[SOLVED] Icons In menu change by Switches

OK so basically what i am trying to do is add 12 icons in a specific x and y location to my menu, but only if switch so and so is on. I also need it to change the icon if a different switch is on. So if switch 001 is on, icon 1 shows up. Then if switch 002 is on, it changes icon 1 to icon 2, and if switch 003 is on, icon 3 shows up. Then if switch 004 is on, it changes icon 3 to icon 4, and so on for all 12 icons. Icons 1 and 2 are at the same x and y, icons 3 and 4 are at a different x and y, ect. I should note that there not command icons they are icons for collectibles you will get in the game. I have tried editing other plugins but no luck. I have googled, and searched the forums, and still nothing. So here i am looking for a little help or insight on this. It has me all messed up lol.


Also for a better idea think of Final Fantasy 1. In the menu is 4 crystals and after you beat each fiend it changes the gray crystals to a colored one. Se image below.


FF1 Colored crystals


Anyway, any help would be awesome.


Thanks


prepe
It would help if you show us what you've done already.  Or is this a request for someone to write something for you from scratch (in which case you should have posted in Plugin Requests, and will need to give more specific information - what icons, what locations, etc)
I apologize. I thought i explained it pretty good I don't have anything any more. All the scripts i tried to edit i just rolled back to there original or deleted them. I need to show icons in a location in my menu, the location will be put in through the plugin manager so i can change them on the fly in case my menu evolves or changes. So guess what i'm asking is how do i first off add an icons to my menu script via switches at different locations based on the switch that is on. I don't want it made for me. I do understand js a little form working with unity3D but things seem a little different in the js plugins i dunno maybe its just me.


so lets try this maybe, something like this,


var mySwithch = $gameSwitches number defined in the plugin manager;
var mySwithch2 = $gameSwitches number defined in the plugin manager;

if(mySwitch = true)
Show icon number defined in plugin manager at x, y, and maybe z all defined in the plugin manager;
else if (mySwitch2 && mySwitch = true)
Show icon2 number defined plugin manager in the editor at the same x, y, z, as the one above;




i don't know how to make it so the plugin allows me to edit parts of the plugin from the manager for one, and when i try my var switch and my if statements i get nothing no error and it does nothing. Wait once i did get a switch not defined or something but that was a while ago i cant remember. just looking or more direction or incite if i cant figure it out i will post in the plugin request section but i would rather learn more on how to make it my self. I hope that makes more sense.
I guess ill toss it up once before i let it die
Iam not sure if this what you want


every time i activate switch it will appear icon in menu

icons.jpg
@mrcopra


That's exactly it. Could i look at your code or could you explain how you achieved this?
View attachment Icon's window.js
Thanks it works great and the code is for the most part clear. My only question is in your screen shot it shows 2 rows but mine only shows 6 icons on one row the second row does not show up which is fine i can work with that, but in your code i don't see where it wraps the icons to the second row? am i missing something or is it just supposed to be automatic?


Again thank you so much for your help. I was going about this in all the wrong ways.


Also just noticed when i enter the menu and close it with any of the switches activated it opens a message window that displays the name of all of the items that are activated? and I put it in a fresh project and and have not edited anything yet and it still did it.
I was sleepy when I make it but it suppose to make it automatic 


But you can fix it easly


In the last code change h to 2
Its all good i'm just grateful for the help.


So the bottom one is 2. Its the same as it already was. This is what it looks like in script and in game.

Spoiler
Script Bottom


New Bitmap Image2.png


In game



 





New Bitmap Image.png
Because you using yanfly plugin


i will try make it compatible
Oh strange. Even with all the plugins disabled it still causes it to mess it up. I thought if it was disabled it was like its not there. I guess i was wrong and i apologize for that. I miss understood that part.


Also what is it that makes it pull up a message displaying the item names, Like i open my menu and with the switches on the icons are there. Then i close the menu and it instantly pops a message saying the names of the items that all those icons are attached too? I don't see anything that says to pop up a message at all.


This is right after i closed the menu and this was a fresh project just now no plugins but this one

Spoiler
New Bitmap Image2.png





One last thing. How do i make the window transparent? I tried,


this.window.opacity = 0


and that made the window disappear but the icons also disappeared?


Sorry to bug lol. I'm just trying to figure out this plugin stuff.


Thanks again for your help.
Lol, sorry i forgot to remove messages


But it works perfectly with me

Icon.jpg

View attachment Icon's window.js
I'm not sure what happened to my post but you got it anyway.

Spoiler
1-12setup.png


1-12.png


3-14setup.png


3-14.png


19-30setup.png


19-30.png
Fixed it 😉

View attachment Icon's window.js
Yes you did and i now see how. Its perfect. Thank you so much your a huge help.


Oh one last question. What do i add to make it so i only see the icons and not the little window behind it?
I need to learn that.


but i found another problem and fixed it


use this

View attachment Icon's window.js
OK i will figure that out later. But i'm going to mark it as solved sense it does what i need it to do.


-EDIT-


so .... noob question lol. how do i edit the topics name to say solved haha?


-EDIT AGAIN-


I figured it out. to make the window transparent i added


this._myWindow.opacity = 0;


right below 


this.addWindow(this._myWindow);


at the top of the script and it worked perfect. Now to figure out how to close this topic and mark it solved?


thank you again @mrcopra
I tried that one but not under 


this.addWindow(this._myWindow);


so I learned something today 😉  thanx
haha glad i could help too. ><

Original thread: https://forums.rpgmakerweb.com/threads/solved-icons-in-menu-change-by-switches.63631/