I have a sub menu for selecting which pistol your player will be equipped with. The sub menu just shows pictures of pistols and you click on the one you want. So the action on each pistol picture is:
action { uiScript "gearSetItem" ; close ingame_select_gear_pistol; open ingame_select_gear }
Then in ui_main.c in UI_RunMenuScript() I added a new else if near the bottom,
else if (Q_stricmp(name, "gearSetItem") == 0) {
//blud: need to write this

}
The problem I am having is that right there in that else if, how do I know which pistol they clicked on? Is there a way to some how pass along a parameter?
The only thing I can think of is if clicking that pistol also set the value of a cvar like cg_pistol 2, and then in the else if I could check the value of cg_pistol to know which pistol they picked... *but* my problem there is I don't know how to have the itemDef set the value of cg_pistol simply by clicking on it, is this possible?
Seems like being able to somehow pass a parameter would be superior to that though.
Now the only "solution" I have is to write a new else if for every single weapon and item in the game like uiScript "gearSetItemGlock", but I know that's sloppy and ridiculous! rofl.
I've been reading http://www.linux.ucla.edu/~phaethon/q3t ... amenu.html and http://rfactory.org/scripting.html like crazy but I can't find the answers or figure this out.