Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
MenuMutatorSource Class Reference
Inheritance diagram for MenuMutatorSource:
Collaboration diagram for MenuMutatorSource:

Public Member Functions

virtual void destroy ()
 cleanup on shutdown.
virtual void getEntry ()
 get entry i passing name and icon through returns if it is not null returns DataSource_false if out of bounds otherwise returns an entity or DataSource_true
virtual void getEntryOther ()
virtual void indexOf ()
 return the index of the first match for find.
virtual void reload ()
 reload all entries matching filter returning how many matches were found

Static Public Attributes

static entity false = NULL
static entity true = NEW(Object)

Detailed Description

Definition at line 59 of file dialog_multiplayer_create_mutators.qh.

Member Function Documentation

◆ destroy()

virtual void DataSource::destroy ( )
inlinevirtualinherited

cleanup on shutdown.

optional

Definition at line 17 of file datasource.qh.

17{ }

References destroy(), and entity().

Referenced by destroy().

◆ getEntry()

void MenuMutatorSource::getEntry ( )
virtual

get entry i passing name and icon through returns if it is not null returns DataSource_false if out of bounds otherwise returns an entity or DataSource_true

Reimplemented from DataSource.

Definition at line 11 of file dialog_multiplayer_create_mutators.qc.

12{
14 {
15 if (returns)
16 returns((i == MENU_MUTATOR_HEADER_1 ? _("Weapon & item mutators:") : _("Gameplay mutators:")), "");
17 return NULL;
18 }
20 --i;
22 --i;
23 Lazy l = REGISTRY_GET(MenuMutators, i);
24 entity it = l.m_get();
25 if (returns)
26 returns(it.title, it.describe(it));
27 return it;
28}
entity() spawn
const int MENU_MUTATOR_HEADER_2
const int MENU_MUTATOR_HEADER_1
#define NULL
Definition post.qh:14
#define REGISTRY_GET(id, i)
Definition registry.qh:62

References entity(), getEntry(), MENU_MUTATOR_HEADER_1, MENU_MUTATOR_HEADER_2, name, NULL, and REGISTRY_GET.

Referenced by getEntry().

◆ getEntryOther()

void MenuMutatorSource::getEntryOther ( )
virtual

Definition at line 29 of file dialog_multiplayer_create_mutators.qc.

30{
31 string tree_type;
32 if (i + 1 == REGISTRY_COUNT(MenuMutators) + 2 || i + 1 == MENU_MUTATOR_HEADER_2)
33 tree_type = "tree_elbow";
34 else if (i == MENU_MUTATOR_HEADER_1 + 1 || i == MENU_MUTATOR_HEADER_2 + 1)
35 tree_type = "tree_branch_start";
36 else
37 tree_type = "tree_branch";
38
40 --i;
42 --i;
43 Lazy l = REGISTRY_GET(MenuMutators, i);
44 entity it = l.m_get();
45 // canEnable with input true returns whether the mutator is enabled currently,
46 // input false returns whether the mutator can be enabled (all prerequisite cvars set correctly)
47 if (returns)
48 returns(it.canEnable(it, true), !it.canEnable(it, false), tree_type);
49 return it;
50}
#define REGISTRY_COUNT(id)
Definition registry.qh:18

References disabled, entity(), getEntryOther(), MENU_MUTATOR_HEADER_1, MENU_MUTATOR_HEADER_2, REGISTRY_COUNT, and REGISTRY_GET.

Referenced by getEntryOther().

◆ indexOf()

virtual void DataSource::indexOf ( )
inlinevirtualinherited

return the index of the first match for find.

optional

Definition at line 13 of file datasource.qh.

13{ return -1; }

References entity(), find(), and indexOf().

Referenced by indexOf().

◆ reload()

void MenuMutatorSource::reload ( )
virtual

reload all entries matching filter returning how many matches were found

Reimplemented from DataSource.

Definition at line 52 of file dialog_multiplayer_create_mutators.qc.

53{
54 return REGISTRY_COUNT(MenuMutators) + 2; // two headers
55}

References entity(), REGISTRY_COUNT, and reload().

Referenced by reload().

Member Data Documentation

◆ false

entity DataSource::false = NULL
staticinherited

Definition at line 5 of file datasource.qh.

◆ true

entity DataSource::true = NEW(Object)
staticinherited

Definition at line 4 of file datasource.qh.


The documentation for this class was generated from the following files: