Xonotic
weaponslist.qh File Reference
#include "listbox.qh"
+ Include dependency graph for weaponslist.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  XonoticWeaponsList
 

Functions

entity makeXonoticWeaponsList ()
 
void WeaponsList_MoveDown_Click (entity box, entity me)
 
void WeaponsList_MoveUp_Click (entity btn, entity me)
 

Function Documentation

◆ makeXonoticWeaponsList()

entity makeXonoticWeaponsList ( )

Definition at line 7 of file weaponslist.qc.

References entity(), and NEW.

8 {
9  entity me;
10  me = NEW(XonoticWeaponsList);
11  me.configureXonoticWeaponsList(me);
12  return me;
13 }
#define NEW(cname,...)
Definition: oo.qh:105
entity() spawn
+ Here is the call graph for this function:

◆ WeaponsList_MoveDown_Click()

void WeaponsList_MoveDown_Click ( entity  box,
entity  me 
)

Definition at line 37 of file weaponslist.qc.

References cvar_set(), cvar_string(), and swapInPriorityList().

Referenced by XonoticWeaponsList_keyDown().

38 {
39  if(me.selectedItem < me.nItems - 1)
40  {
41  cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, me.selectedItem + 1));
42  me.setSelected(me, me.selectedItem + 1);
43  }
44 }
string swapInPriorityList(string order, float i, float j)
Definition: util.qc:540
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WeaponsList_MoveUp_Click()

void WeaponsList_MoveUp_Click ( entity  btn,
entity  me 
)

Definition at line 29 of file weaponslist.qc.

References cvar_set(), cvar_string(), and swapInPriorityList().

Referenced by XonoticWeaponsList_keyDown().

30 {
31  if(me.selectedItem > 0)
32  {
33  cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem - 1, me.selectedItem));
34  me.setSelected(me, me.selectedItem - 1);
35  }
36 }
string swapInPriorityList(string order, float i, float j)
Definition: util.qc:540
+ Here is the call graph for this function:
+ Here is the caller graph for this function: