Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
menus.cpp File Reference
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include "inexor/client/network.hpp"
#include "inexor/engine/rendergl.hpp"
#include "inexor/fpsgame/player.hpp"
#include "inexor/model/rendermodel.hpp"
#include "inexor/physics/physics.hpp"
#include "inexor/shared/command.hpp"
#include "inexor/shared/cube_formatting.hpp"
#include "inexor/shared/cube_hash.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_tools.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/ents.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/shared/tools.hpp"
#include "inexor/texture/texture.hpp"
#include "inexor/ui/legacy/3dgui.hpp"
#include "inexor/ui/legacy/menus.hpp"
#include "inexor/util/legacy_time.hpp"

Classes

struct  menu
 
struct  delayedupdate
 
struct  change
 
struct  applymenu
 
union  delayedupdate.val
 

Macros

#define GUI_TITLE_COLOR   0xFFDD88
 
#define GUI_BUTTON_COLOR   0xFFFFFF
 
#define GUI_TEXT_COLOR   0xDDFFDD
 

Functions

 VARP (menudistance, 16, 40, 256)
 
 VARP (menuautoclose, 32, 120, 4096)
 
vec menuinfrontofplayer ()
 
void popgui ()
 
void removegui (menu *m)
 
void pushgui (menu *m, int pos=-1)
 
void restoregui (int pos)
 
void showgui (const char *name)
 
void hidegui (const char *name)
 
int cleargui (int n)
 
void clearguis (int level=-1)
 
void guionclear (char *action)
 
void guistayopen (uint *contents)
 
void guinoautotab (uint *contents)
 
void guimerge (uint *contents)
 
void guibutton (char *name, char *action, char *icon)
 
void guiimage (char *path, char *action, float *scale, int *overlaid, char *alt)
 
void guicolor (int *color)
 
void guitextbox (char *text, int *width, int *height, int *color)
 
void guitext (char *name, char *icon)
 
void guititle (char *name)
 
void guitab (char *name)
 
void guibar ()
 
void guistrut (float *strut, int *alt)
 
void guispring (int *weight)
 
void guicolumn (int *col)
 
template<class T >
static void updateval (char *var, T val, char *onchange)
 
static int getval (char *var)
 
static float getfval (char *var)
 
static const char * getsval (char *var)
 
void guislider (char *var, int *min, int *max, char *onchange)
 
void guilistslider (char *var, char *list, char *onchange)
 
void guinameslider (char *var, char *names, char *list, char *onchange)
 
void guicheckbox (char *name, char *var, float *on, float *off, char *onchange)
 
void guiradio (char *name, char *var, float *n, char *onchange)
 
void guibitfield (char *name, char *var, int *mask, char *onchange)
 
void guifield (char *var, int *maxlength, char *onchange)
 
void guieditor (char *name, int *maxlength, int *height, int *mode)
 
void guikeyfield (char *var, int *maxlength, char *onchange)
 
void guilist (uint *contents)
 
void guialign (int *align, uint *contents)
 
void newgui (char *name, char *contents, char *header, char *init)
 
void notifywelcome ()
 This function gets executed as we get connected. More...
 
 COMMAND (newgui,"ssss")
 
 COMMAND (guibutton,"sss")
 
 COMMAND (guitext,"ss")
 
 ICOMMAND (cleargui,"i",(int *n), intret(cleargui(*n)))
 
 COMMAND (showgui,"s")
 
 COMMAND (hidegui,"s")
 
 COMMAND (guionclear,"s")
 
 COMMAND (guistayopen,"e")
 
 COMMAND (guinoautotab,"e")
 
 COMMAND (guimerge,"e")
 
 COMMAND (guilist,"e")
 
 COMMAND (guialign,"ie")
 
 COMMAND (guititle,"s")
 
 COMMAND (guibar,"")
 
 COMMAND (guistrut,"fi")
 
 COMMAND (guispring,"i")
 
 COMMAND (guicolumn,"i")
 
 COMMAND (guiimage,"ssfis")
 
 COMMAND (guislider,"sbbs")
 
 COMMAND (guilistslider,"sss")
 
 COMMAND (guinameslider,"ssss")
 
 COMMAND (guiradio,"ssfs")
 
 COMMAND (guibitfield,"ssis")
 
 COMMAND (guicheckbox,"ssffs")
 
 COMMAND (guitab,"s")
 
 COMMAND (guifield,"sis")
 
 COMMAND (guikeyfield,"sis")
 
 COMMAND (guieditor,"siii")
 
 COMMAND (guicolor,"i")
 
 COMMAND (guitextbox,"siii")
 
void guiplayerpreview (int *model, int *team, int *weap, char *action, float *scale, int *overlaid)
 
 COMMAND (guiplayerpreview,"iiisfi")
 
void guimodelpreview (char *model, char *animspec, char *action, float *scale, int *overlaid)
 
 COMMAND (guimodelpreview,"sssfi")
 
void guiprefabpreview (char *prefab, int *color, char *action, float *scale, int *overlaid)
 
 COMMAND (guiprefabpreview,"sisfi")
 
 VARP (applydialog, 0, 1, 1)
 
void addchange (const char *desc, int type)
 
void clearchanges (int type)
 
void menuprocess ()
 
 VAR (mainmenu, 1, 1, 0)
 
void clearmainmenu ()
 
void g3d_mainmenu ()
 
bool initwarning (const char *desc, int level, int type)
 print initialisation (bug hints) warning in game console More...
 

Variables

static vec menupos
 
static int menustart = 0
 
static int menutab = 1
 
static g3d_guicgui = nullptr
 
static hashnameset< menuguis
 
static vector< menu * > guistack
 
static vector< delayedupdateupdatelater
 
static bool shouldclearmenu = true
 
static bool clearlater = false
 
static vector< changeneedsapply
 
applymenu applymenu
 
static bool processingmenu = false
 

Class Documentation

union delayedupdate.val
Class Members
float f
int i
char * s

Macro Definition Documentation

#define GUI_BUTTON_COLOR   0xFFFFFF
#define GUI_TEXT_COLOR   0xDDFFDD

Referenced by applymenu::gui(), and guitext().

#define GUI_TITLE_COLOR   0xFFDD88

Function Documentation

void addchange ( const char *  desc,
int  type 
)
void clearchanges ( int  type)
int cleargui ( int  n)
void clearguis ( int  level = -1)
void clearmainmenu ( )

References cleargui(), isconnected(), and mainmenu.

Referenced by emptymap(), and load_world().

COMMAND ( newgui  ,
"ssss"   
)
COMMAND ( guibutton  ,
"sss"   
)
COMMAND ( guitext  ,
"ss"   
)
COMMAND ( showgui  ,
"s"   
)
COMMAND ( hidegui  ,
"s"   
)
COMMAND ( guionclear  ,
"s"   
)
COMMAND ( guistayopen  ,
"e"   
)
COMMAND ( guinoautotab  ,
"e"   
)
COMMAND ( guimerge  ,
"e"   
)
COMMAND ( guilist  ,
"e"   
)
COMMAND ( guialign  ,
"ie"   
)
COMMAND ( guititle  ,
"s"   
)
COMMAND ( guibar  ,
""   
)
COMMAND ( guistrut  ,
"fi"   
)
COMMAND ( guispring  ,
"i"   
)
COMMAND ( guicolumn  ,
"i"   
)
COMMAND ( guiimage  ,
"ssfis"   
)
COMMAND ( guislider  ,
"sbbs"   
)
COMMAND ( guilistslider  ,
"sss"   
)
COMMAND ( guinameslider  ,
"ssss"   
)
COMMAND ( guiradio  ,
"ssfs"   
)
COMMAND ( guibitfield  ,
"ssis"   
)
COMMAND ( guicheckbox  ,
"ssffs"   
)
COMMAND ( guitab  ,
"s"   
)
COMMAND ( guifield  ,
"sis"   
)
COMMAND ( guikeyfield  ,
"sis"   
)
COMMAND ( guieditor  ,
"siii"   
)
COMMAND ( guicolor  ,
"i"   
)
COMMAND ( guitextbox  ,
"siii"   
)
COMMAND ( guiplayerpreview  ,
"iiisfi"   
)
COMMAND ( guimodelpreview  ,
"sssfi"   
)
COMMAND ( guiprefabpreview  ,
"sisfi"   
)
void g3d_mainmenu ( )
static float getfval ( char *  var)
static
static const char* getsval ( char *  var)
static
static int getval ( char *  var)
static
void guialign ( int *  align,
uint contents 
)
void guibar ( )

References g3d_gui::separator().

void guibitfield ( char *  name,
char *  var,
int *  mask,
char *  onchange 
)
void guibutton ( char *  name,
char *  action,
char *  icon 
)
void guicheckbox ( char *  name,
char *  var,
float *  on,
float *  off,
char *  onchange 
)
void guicolor ( int *  color)

References defformatstring, and g3d_gui::text().

void guicolumn ( int *  col)

References g3d_gui::column().

void guieditor ( char *  name,
int *  maxlength,
int *  height,
int *  mode 
)
void guifield ( char *  var,
int *  maxlength,
char *  onchange 
)
void guiimage ( char *  path,
char *  action,
float *  scale,
int *  overlaid,
char *  alt 
)
void guikeyfield ( char *  var,
int *  maxlength,
char *  onchange 
)
void guilist ( uint contents)
void guilistslider ( char *  var,
char *  list,
char *  onchange 
)
void guimerge ( uint contents)

References execute(), and g3d_gui::mergehits().

void guimodelpreview ( char *  model,
char *  animspec,
char *  action,
float *  scale,
int *  overlaid 
)
void guinameslider ( char *  var,
char *  names,
char *  list,
char *  onchange 
)
void guinoautotab ( uint contents)
void guionclear ( char *  action)
void guiplayerpreview ( int *  model,
int *  team,
int *  weap,
char *  action,
float *  scale,
int *  overlaid 
)
void guiprefabpreview ( char *  prefab,
int *  color,
char *  action,
float *  scale,
int *  overlaid 
)
void guiradio ( char *  name,
char *  var,
float *  n,
char *  onchange 
)
void guislider ( char *  var,
int *  min,
int *  max,
char *  onchange 
)
void guispring ( int *  weight)
void guistayopen ( uint contents)

References execute(), and shouldclearmenu.

void guistrut ( float *  strut,
int *  alt 
)
void guitab ( char *  name)

References GUI_TITLE_COLOR, and g3d_gui::tab().

void guitext ( char *  name,
char *  icon 
)
void guitextbox ( char *  text,
int *  width,
int *  height,
int *  color 
)

References g3d_gui::textbox().

void guititle ( char *  name)
void hidegui ( const char *  name)
ICOMMAND ( cleargui  ,
"i"  ,
(int *n)  ,
intret(cleargui(*n))   
)
bool initwarning ( const char *  desc,
int  level,
int  type 
)

print initialisation (bug hints) warning in game console

See Also
addchange

References addchange(), and initing.

Referenced by inexor::rendering::screen::ScreenManager::screenres().

vec menuinfrontofplayer ( )
void menuprocess ( )
void newgui ( char *  name,
char *  contents,
char *  header,
char *  init 
)
void notifywelcome ( )

This function gets executed as we get connected.

Referenced by game::parsemessages().

void popgui ( )

References menu::clear(), and vector< T, MINSIZE >::pop().

Referenced by cleargui(), and restoregui().

void pushgui ( menu m,
int  pos = -1 
)
void removegui ( menu m)
void restoregui ( int  pos)
void showgui ( const char *  name)
template<class T >
static void updateval ( char *  var,
val,
char *  onchange 
)
static
VAR ( mainmenu  ,
,
,
 
)
VARP ( menudistance  ,
16  ,
40  ,
256   
)
VARP ( menuautoclose  ,
32  ,
120  ,
4096   
)
VARP ( applydialog  ,
,
,
 
)

Variable Documentation

g3d_gui* cgui = nullptr
static
bool clearlater = false
static
hashnameset<menu> guis
static
vector<menu *> guistack
static
vec menupos
static
int menustart = 0
static
int menutab = 1
static
vector<change> needsapply
static
bool processingmenu = false
static
bool shouldclearmenu = true
static
vector<delayedupdate> updatelater
static