ui_local.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. #ifndef __UI_LOCAL_H__
  2. #define __UI_LOCAL_H__
  3. #include <string.h>
  4. #include <limits.h>
  5. #include "../game/q_shared.h"
  6. #include "../renderer/tr_types.h"
  7. #include "../qcommon/qcommon.h"
  8. #include "ui_public.h"
  9. #include "ui_shared.h"
  10. #define MAX_PLAYERMODELS 32
  11. #define MAX_DEFERRED_SCRIPT 1024
  12. //
  13. // ui_qmenu.c
  14. //
  15. #define MAX_EDIT_LINE 256
  16. typedef struct {
  17. int cursor;
  18. int scroll;
  19. int widthInChars;
  20. char buffer[MAX_EDIT_LINE];
  21. int maxchars;
  22. int style;
  23. int textEnum; // Label
  24. int textcolor; // Normal color
  25. int textcolor2; // Highlight color
  26. } uifield_t;
  27. extern void Menu_Cache( void );
  28. //
  29. // ui_field.c
  30. //
  31. extern void Field_Clear( uifield_t *edit );
  32. extern void Field_CharEvent( uifield_t *edit, int ch );
  33. extern void Field_Draw( uifield_t *edit, int x, int y, int width, int size,int color,int color2, qboolean showCursor );
  34. //
  35. // ui_menu.c
  36. //
  37. extern void UI_MainMenu(void);
  38. extern void UI_InGameMenu(const char*holoFlag);
  39. extern void AssetCache(void);
  40. extern void UI_DataPadMenu(void);
  41. //
  42. // ui_connect.c
  43. //
  44. extern void UI_DrawConnect( const char *servername, const char * updateInfoString );
  45. extern void UI_UpdateConnectionString( char *string );
  46. extern void UI_UpdateConnectionMessageString( char *string );
  47. //
  48. // ui_atoms.c
  49. //
  50. #define UI_FADEOUT 0
  51. #define UI_FADEIN 1
  52. typedef struct {
  53. int frametime;
  54. int realtime;
  55. int cursorx;
  56. int cursory;
  57. glconfig_t glconfig;
  58. qboolean debugMode;
  59. qhandle_t whiteShader;
  60. qhandle_t menuBackShader;
  61. qhandle_t cursor;
  62. float scalex;
  63. float scaley;
  64. //float bias;
  65. qboolean firstdraw;
  66. } uiStatic_t;
  67. extern void UI_FillRect( float x, float y, float width, float height, const float *color );
  68. extern void UI_DrawString( int x, int y, const char* str, int style, vec4_t color );
  69. extern void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader );
  70. extern void UI_UpdateScreen( void );
  71. extern int UI_RegisterFont(const char *fontName);
  72. extern void UI_SetColor( const float *rgba );
  73. extern char *UI_Cvar_VariableString( const char *var_name );
  74. extern uiStatic_t uis;
  75. extern uiimport_t ui;
  76. #define MAX_MOVIES 256
  77. #define MAX_MODS 64
  78. typedef struct {
  79. const char *modName;
  80. const char *modDescr;
  81. } modInfo_t;
  82. typedef struct {
  83. char Name[64];
  84. int SkinHeadCount;
  85. // qhandle_t SkinHeadIcons[MAX_PLAYERMODELS];
  86. char SkinHeadNames[MAX_PLAYERMODELS][16];
  87. int SkinTorsoCount;
  88. // qhandle_t SkinTorsoIcons[MAX_PLAYERMODELS];
  89. char SkinTorsoNames[MAX_PLAYERMODELS][16];
  90. int SkinLegCount;
  91. // qhandle_t SkinLegIcons[MAX_PLAYERMODELS];
  92. char SkinLegNames[MAX_PLAYERMODELS][16];
  93. char ColorShader[MAX_PLAYERMODELS][64];
  94. int ColorCount;
  95. char ColorActionText[MAX_PLAYERMODELS][128];
  96. } playerSpeciesInfo_t;
  97. typedef struct {
  98. displayContextDef_t uiDC;
  99. int effectsColor;
  100. int currentCrosshair;
  101. modInfo_t modList[MAX_MODS];
  102. int modIndex;
  103. int modCount;
  104. int playerSpeciesCount;
  105. playerSpeciesInfo_t playerSpecies[MAX_PLAYERMODELS];
  106. int playerSpeciesIndex;
  107. char deferredScript [ MAX_DEFERRED_SCRIPT ];
  108. itemDef_t* deferredScriptItem;
  109. itemDef_t* runScriptItem;
  110. qboolean inGameLoad;
  111. // Used by Force Power allocation screen
  112. short forcePowerUpdated; // Enum of which power had the point allocated
  113. // Used by Weapon allocation screen
  114. short selectedWeapon1; // 1st weapon chosen
  115. // char selectedWeapon1ItemName[64]; // Item name of weapon chosen
  116. // int selectedWeapon1AmmoIndex; // Holds index to ammo
  117. short selectedWeapon2; // 2nd weapon chosen
  118. // char selectedWeapon2ItemName[64]; // Item name of weapon chosen
  119. // int selectedWeapon2AmmoIndex; // Holds index to ammo
  120. short selectedThrowWeapon; // throwable weapon chosen
  121. // char selectedThrowWeaponItemName[64]; // Item name of weapon chosen
  122. // int selectedThrowWeaponAmmoIndex; // Holds index to ammo
  123. itemDef_t *weapon1ItemButton;
  124. qhandle_t litWeapon1Icon;
  125. qhandle_t unlitWeapon1Icon;
  126. itemDef_t *weapon2ItemButton;
  127. qhandle_t litWeapon2Icon;
  128. qhandle_t unlitWeapon2Icon;
  129. itemDef_t *weaponThrowButton;
  130. qhandle_t litThrowableIcon;
  131. qhandle_t unlitThrowableIcon;
  132. short movesTitleIndex;
  133. char *movesBaseAnim;
  134. int moveAnimTime;
  135. // int languageCount;
  136. int languageCountIndex;
  137. } uiInfo_t;
  138. extern uiInfo_t uiInfo;
  139. //
  140. // ui_main.c
  141. //
  142. void _UI_Init( qboolean inGameLoad );
  143. void _UI_DrawRect( float x, float y, float width, float height, float size, const float *color );
  144. void _UI_MouseEvent( int dx, int dy );
  145. void _UI_KeyEvent( int key, qboolean down );
  146. void UI_Report(void);
  147. extern char GoToMenu[];
  148. //
  149. // ui_syscalls.c
  150. //
  151. int trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits, const char *psAudioFile /* = NULL */);
  152. int trap_CIN_StopCinematic(int handle);
  153. void trap_Cvar_Set( const char *var_name, const char *value );
  154. float trap_Cvar_VariableValue( const char *var_name );
  155. void trap_GetGlconfig( glconfig_t *glconfig );
  156. void trap_Key_ClearStates( void );
  157. int trap_Key_GetCatcher( void );
  158. qboolean trap_Key_GetOverstrikeMode( void );
  159. void trap_Key_SetBinding( int keynum, const char *binding );
  160. void trap_Key_SetCatcher( int catcher );
  161. void trap_Key_SetOverstrikeMode( qboolean state );
  162. void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
  163. void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs );
  164. void trap_R_SetColor( const float *rgba );
  165. void trap_R_ClearScene( void );
  166. void trap_R_AddRefEntityToScene( const refEntity_t *re );
  167. void trap_R_RenderScene( const refdef_t *fd );
  168. void trap_S_StopSounds( void );
  169. sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed );
  170. void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum );
  171. #ifdef _IMMERSION
  172. ffHandle_t trap_FF_Register( const char *name, int channel = FF_CHANNEL_MENU );
  173. void trap_FF_Start( ffHandle_t ff );
  174. #endif // _IMMERSION
  175. #ifndef _XBOX
  176. int PASSFLOAT( float x );
  177. #endif
  178. void _UI_Refresh( int realtime );
  179. //from xboxcommon.h (from MP)
  180. //
  181. // Xbox Error Popup Constants
  182. //
  183. // The error popup system needs a context when it returns a value to know
  184. // what to do. One of these is saved off when we create the popup, and then it's
  185. // queried when we get a response so we know what we're doing.
  186. enum xbErrorPopupType
  187. {
  188. XB_POPUP_NONE,
  189. XB_POPUP_DELETE_CONFIRM,
  190. XB_POPUP_DISKFULL, // Only at startup
  191. XB_POPUP_DISKFULL_DURING_SAVE, // When trying to save a new game
  192. XB_POPUP_SAVE_COMPLETE,
  193. XB_POPUP_OVERWRITE_CONFIRM,
  194. XB_POPUP_LOAD_FAILED,
  195. XB_POPUP_LOAD_CHECKPOINT_FAILED,
  196. XB_POPUP_QUIT_CONFIRM,
  197. XB_POPUP_SAVING,
  198. XB_POPUP_LOAD_CONFIRM,
  199. XB_POPUP_TOO_MANY_SAVES,
  200. XB_POPUP_LOAD_CONFIRM_CHECKPOINT,
  201. XB_POPUP_CONFIRM_INVITE,
  202. XB_POPUP_CORRUPT_SETTINGS,
  203. XB_POPUP_DISKFULL_BOTH,
  204. XB_POPUP_YOU_ARE_DEAD,
  205. XB_POPUP_TESTING_SAVE,
  206. XB_POPUP_CORRUPT_SCREENSHOT,
  207. XB_POPUP_CONFIRM_NEW_1,
  208. XB_POPUP_CONFIRM_NEW_2,
  209. XB_POPUP_CONFIRM_NEW_3,
  210. };
  211. void UI_xboxErrorPopup(xbErrorPopupType popup);
  212. void UI_xboxPopupResponse(void);
  213. void UI_CheckForInvite( void );
  214. #endif