Blockland Forums > Modification Help
Weapon Buy Manager
Pages: (1/1)
HellsHero:
Alright, pretty new to most things about GUIs, so I need your guys' help!
1. I want to know how to add choices to GuiPopUpMenuCtrl objects. (Drop down box)
2. How would I add weapons and items (Weapon_, Item_) to the GuiScrollCtrl labeled 'Selectable Weapons' so you could click them and then edit their values and then once you click the Apply Item button that the entry in the 'Selectable Weapons' would be removed and then added to the 'Grouped Weapons' GuiScrollCtrl?
3. Also, to add onto the previous question, how could I add the items to the list by UI name and not the .zip file? (For example Tier+Tactical has packages, so multiple weapons in one .zip) Would I have to make the GUI accessible from in-game and not from the Start Mission GUI?
4. Another quick question so I won't run into any errors, this GUI is accessible from the Start Mission GUI, and I'm wanting to include the item icon of the weapon/item selected for editing, would I be able to include it without errors? (The server.cs isn't executed, but I still use content from the .zip)
lilboarder32:
--- Quote from: HellsHero on June 21, 2010, 09:45:19 PM ---1. I want to know how to add choices to GuiPopUpMenuCtrl objects. (Drop down box)
--- End quote ---
Dump the methods of the ctrl, but it's something like Ctrl.addFront();
--- Quote from: HellsHero on June 21, 2010, 09:45:19 PM ---2. How would I add weapons and items (Weapon_, Item_) to the GuiScrollCtrl labeled 'Selectable Weapons' so you could click them and then edit their values and then once you click the Apply Item button that the entry in the 'Selectable Weapons' would be removed and then added to the 'Grouped Weapons' GuiScrollCtrl?
--- End quote ---
You would need to loop through all item datablocks and add them to the list.
--- Quote from: HellsHero on June 21, 2010, 09:45:19 PM ---3. Also, to add onto the previous question, how could I add the items to the list by UI name and not the .zip file? (For example Tier+Tactical has packages, so multiple weapons in one .zip) Would I have to make the GUI accessible from in-game and not from the Start Mission GUI?
--- End quote ---
Same as before, just loop through the datablocks.
--- Quote from: HellsHero on June 21, 2010, 09:45:19 PM ---4. Another quick question so I won't run into any errors, this GUI is accessible from the Start Mission GUI, and I'm wanting to include the item icon of the weapon/item selected for editing, would I be able to include it without errors? (The server.cs isn't executed, but I still use content from the .zip)
--- End quote ---
I'm not sure how you would access it from the Start Mission GUI since it hasn't loaded datablocks. For the previous two answers, maybe you could loop through the .cs files looking for defined datablocks? (Which is completely discouraged, but I can't think of any other way)
ZSNO:
ZSNO only wants to answer #1
I would suggest using a GUIMenuBar
If you do use it here are the things for adding stuff to it
--- Code: ---addMenu( menuName , menuID )
menuName The text (name) of the new menu entry.
menuID The ID of the new menu entry.
addMenuItem( menuID | menuName , menuItemName , menuItemID , [ accelerator ] , [ checkGroup ] )
menuID The ID of the menu.
menuName The text (name) of the menu.
menuItemID The ID of the menu item.
menuItemName The text (name) of the menu item.
accelerator A boolean value. If set to true, the sub-menu entry is checked, otherwise it is unchecked.
checkGroup The check group this item should belong to, if any.
--- End code ---
Pages: (1/1)