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

Public Member Functions

 ATTRIB (MenuItem, parent, entity)
 ATTRIB (MenuItem, tooltip, string)
virtual void destroy ()
virtual void draw ()
virtual void focusEnter ()
virtual void focusLeave ()
virtual void hideNotify ()
virtual void keyDown ()
virtual void keyUp ()
virtual void mouseDrag ()
virtual void mouseMove ()
virtual void mousePress ()
virtual void mouseRelease ()
virtual void relinquishFocus ()
virtual void resizeNotify ()
virtual void showNotify ()
virtual void toString ()

Public Attributes

bool allowFocusSound = false
bool focusable = false
bool focused = false
vector origin = '0 0 0'
float preferredFocusPriority = 0
vector size = '0 0 0'

Detailed Description

Definition at line 8 of file item.qh.

Member Function Documentation

◆ ATTRIB() [1/2]

MenuItem::ATTRIB ( MenuItem ,
parent ,
entity  )

References entity(), and parent.

◆ ATTRIB() [2/2]

MenuItem::ATTRIB ( MenuItem ,
tooltip ,
string  )

◆ destroy()

◆ draw()

void MenuItem::draw ( )
virtual

Reimplemented in BorderImage, Button, CheckBox, Container, Image, InputBox, Label, ListBox, MainWindow, ModalController, Nexposee, Slider, XonoticCampaignList, XonoticColorButton, XonoticColorpicker, XonoticColorpickerString, XonoticCreditsList, XonoticCrosshairPreview, XonoticGameMenuDialog, XonoticGametypeList, XonoticHUDSkinList, XonoticLeaveMatchButton, XonoticMapList, XonoticPicker, XonoticPicmipSlider, XonoticPlayerModelSelector, XonoticPlayList, XonoticProfileTab, XonoticRadioButton, XonoticResolutionSlider, XonoticScreenshotImage, XonoticScreenshotList, XonoticServerList, XonoticSliderCheckBox, XonoticTextLabel, XonoticWeaponsList, and XonoticWelcomeDialog.

Definition at line 25 of file item.qc.

26 {
27 if (!autocvar_menu_showboxes) return;
28 vector rgb = '1 0 1';
30
31 // don't draw containers and border images
32 if (this.instanceOfContainer || this.instanceOfBorderImage)
33 {
34 rgb = '0 0 0';
35 a = 0;
36 }
37
38 #if 0
39 // hack to detect multi drawing
40 float r = random() * 3;
41 if (r >= 2) rgb = '1 0 0';
42 else if (r >= 1) rgb = '0 1 0';
43 else rgb = '0 0 1';
44 #endif
46 {
47 draw_Fill('0 0 0', '0.5 0.5 0', rgb, a);
48 draw_Fill('0.5 0.5 0', '0.5 0.5 0', rgb, a);
49 }
50 else if (autocvar_menu_showboxes > 0)
51 {
52 draw_Fill('0 0 0', '1 1 0', rgb, a);
53 }
54 }
int autocvar_menu_showboxes
Definition item.qc:24
void draw_Fill(vector theOrigin, vector theSize, vector theColor, float theAlpha)
Definition draw.qc:97
float random(void)
float fabs(float f)
vector
Definition self.qh:92

References autocvar_menu_showboxes, draw(), draw_Fill(), fabs(), random(), and vector.

Referenced by draw().

◆ focusEnter()

void MenuItem::focusEnter ( )
virtual

Reimplemented in Nexposee, XonoticCreditsDialog, XonoticServerList, and XonoticWinnerDialog.

Definition at line 94 of file item.qc.

95 {
97 }
bool allowFocusSound
Definition item.qh:26
void m_play_focus_sound()
Definition menu.qc:1097

References allowFocusSound, focusEnter(), and m_play_focus_sound().

Referenced by focusEnter().

◆ focusLeave()

void MenuItem::focusLeave ( )
virtual

Reimplemented in Container, InputContainer, ListBox, XonoticCharmap, XonoticColorpicker, and XonoticInputBox.

Definition at line 99 of file item.qc.

100 {}

References focusLeave().

Referenced by focusLeave().

◆ hideNotify()

void MenuItem::hideNotify ( )
virtual

Reimplemented in Container, and XonoticCvarList.

Definition at line 59 of file item.qc.

60 {}

References hideNotify().

Referenced by hideNotify().

◆ keyDown()

◆ keyUp()

void MenuItem::keyUp ( )
virtual

Reimplemented in Container, Nexposee, and Slider.

Definition at line 67 of file item.qc.

68 {
69 return 0; // unhandled
70 }

References keyUp().

Referenced by keyUp().

◆ mouseDrag()

void MenuItem::mouseDrag ( )
virtual

Reimplemented in Button, Container, InputBox, InputContainer, ListBox, Nexposee, Slider, XonoticColorpicker, XonoticColorpickerString, XonoticPicker, XonoticPlayList, XonoticScreenshotImage, and XonoticWeaponsList.

Definition at line 82 of file item.qc.

83 {
84 return 0; // unhandled
85 }

References mouseDrag(), and vector.

Referenced by mouseDrag().

◆ mouseMove()

void MenuItem::mouseMove ( )
virtual

Reimplemented in Container, InputBox, InputContainer, ListBox, Nexposee, XonoticPicker, XonoticScreenshotImage, and XonoticServerList.

Definition at line 72 of file item.qc.

73 {
74 return 0; // unhandled
75 }

References mouseMove(), and vector.

Referenced by mouseMove().

◆ mousePress()

void MenuItem::mousePress ( )
virtual

Reimplemented in Button, Container, InputBox, InputContainer, ListBox, Nexposee, Slider, XonoticColorpicker, XonoticColorpickerString, XonoticPicker, and XonoticScreenshotImage.

Definition at line 77 of file item.qc.

78 {
79 return false; // unhandled
80 }

References mousePress(), and vector.

Referenced by mousePress().

◆ mouseRelease()

void MenuItem::mouseRelease ( )
virtual

Reimplemented in Button, Container, InputBox, InputContainer, ListBox, Nexposee, Slider, XonoticColorpicker, XonoticColorpickerString, XonoticCvarList, XonoticPicker, and XonoticWelcomeDialog.

Definition at line 87 of file item.qc.

88 {
89 return 0; // unhandled
90 }

References mouseRelease(), and vector.

Referenced by mouseRelease().

◆ relinquishFocus()

void MenuItem::relinquishFocus ( )
virtual

Definition at line 11 of file item.qc.

12 {
13 entity par = this.parent;
14 if (!par) return;
15 if (par.instanceOfContainer) par.setFocus(par, NULL);
16 }
entity parent
Definition animhost.qc:7
entity() spawn
#define NULL
Definition post.qh:14

References entity(), NULL, parent, and relinquishFocus().

Referenced by relinquishFocus().

◆ resizeNotify()

◆ showNotify()

◆ toString()

void MenuItem::toString ( )
virtual

Reimplemented in CheckBox, Image, Label, Slider, and XonoticWeaponsList.

Definition at line 102 of file item.qc.

103 {
104 return string_null;
105 }
string string_null
Definition nil.qh:9

References string_null, and toString().

Referenced by toString().

Member Data Documentation

◆ allowFocusSound

bool MenuItem::allowFocusSound = false

Definition at line 26 of file item.qh.

Referenced by focusEnter().

◆ focusable

bool MenuItem::focusable = false

Definition at line 25 of file item.qh.

◆ focused

bool MenuItem::focused = false

Definition at line 24 of file item.qh.

◆ origin

vector MenuItem::origin = '0 0 0'

Definition at line 29 of file item.qh.

Referenced by resizeNotify().

◆ preferredFocusPriority

float MenuItem::preferredFocusPriority = 0

Definition at line 28 of file item.qh.

◆ size

vector MenuItem::size = '0 0 0'

Definition at line 30 of file item.qh.

Referenced by resizeNotify().


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