Author Topic: Weapon Buy Manager  (Read 605 times)

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)

1. I want to know how to add choices to GuiPopUpMenuCtrl objects. (Drop down box)
Dump the methods of the ctrl, but it's something like Ctrl.addFront();

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?
You would need to loop through all item datablocks and add them to the list.
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?
Same as before, just loop through the datablocks.

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)
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 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: [Select]
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.