Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
checkbox_slider_invalid.qc File Reference
#include "checkbox_slider_invalid.qh"
#include "slider.qh"
Include dependency graph for checkbox_slider_invalid.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticSliderCheckBox (float theOffValue, float isInverted, entity theControlledSlider, string theText)
void XonoticSliderCheckBox_configureXonoticSliderCheckBox (entity me, float theOffValue, float isInverted, entity theControlledSlider, string theText)
void XonoticSliderCheckBox_draw (entity me)
void XonoticSliderCheckBox_setChecked (entity me, bool val)

Function Documentation

◆ makeXonoticSliderCheckBox()

entity makeXonoticSliderCheckBox ( float theOffValue,
float isInverted,
entity theControlledSlider,
string theText )

Definition at line 5 of file checkbox_slider_invalid.qc.

6{
8 me.configureXonoticSliderCheckBox(me, theOffValue, isInverted, theControlledSlider, theText);
9 return me;
10}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticEffectsSettingsTab_fill(), and XonoticMutatorsDialog_fill().

◆ XonoticSliderCheckBox_configureXonoticSliderCheckBox()

void XonoticSliderCheckBox_configureXonoticSliderCheckBox ( entity me,
float theOffValue,
float isInverted,
entity theControlledSlider,
string theText )

Definition at line 11 of file checkbox_slider_invalid.qc.

12{
13 me.offValue = theOffValue;
14 me.inverted = isInverted;
15 me.checked = (theControlledSlider.value == theOffValue);
16 if(theControlledSlider.value == median(theControlledSlider.valueMin, theControlledSlider.value, theControlledSlider.valueMax))
17 me.savedValue = theControlledSlider.value;
18 else
19 me.savedValue = theControlledSlider.valueMin;
20 me.controlledSlider = theControlledSlider;
21 me.configureCheckBox(me, theText, me.fontSize, me.image);
22 me.controlledCvar = theControlledSlider.controlledCvar; // in case we want to display the cvar in the tooltip
23 me.tooltip = theControlledSlider.tooltip;
24}
ERASEABLE float median(float a, float b, float c)
Definition math.qh:213

References entity(), and median().

◆ XonoticSliderCheckBox_draw()

void XonoticSliderCheckBox_draw ( entity me)

Definition at line 25 of file checkbox_slider_invalid.qc.

26{
27 me.checked = ((me.controlledSlider.value == me.offValue) != me.inverted);
28 if(me.controlledSlider.value == median(me.controlledSlider.valueMin, me.controlledSlider.value, me.controlledSlider.valueMax))
29 me.savedValue = me.controlledSlider.value;
31}
#define SUPER(cname)
Definition oo.qh:231

References entity(), median(), and SUPER.

◆ XonoticSliderCheckBox_setChecked()

void XonoticSliderCheckBox_setChecked ( entity me,
bool val )

Definition at line 32 of file checkbox_slider_invalid.qc.

33{
34 if(me.checked == val)
35 return;
36 me.checked = val;
37 if(val == me.inverted)
38 me.controlledSlider.setValue(me.controlledSlider, median(me.controlledSlider.valueMin, me.savedValue, me.controlledSlider.valueMax), autocvar_menu_animations > 0);
39 else
40 me.controlledSlider.setValue(me.controlledSlider, me.offValue, autocvar_menu_animations > 0);
41}
float autocvar_menu_animations
Definition animation.qh:3

References autocvar_menu_animations, entity(), and median().