⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui_shared.h

📁 quakeIII源码这个不用我多说吧
💻 H
📖 第 1 页 / 共 2 页
字号:
  float textalignx;              // ( optional ) text alignment x coord
  float textaligny;              // ( optional ) text alignment x coord
  float textscale;               // scale percentage from 72pts
  int textStyle;                 // ( optional ) style, normal and shadowed are it for now
  const char *text;              // display text
  void *parent;                  // menu owner
  qhandle_t asset;               // handle to asset
  const char *mouseEnterText;    // mouse enter script
  const char *mouseExitText;     // mouse exit script
  const char *mouseEnter;        // mouse enter script
  const char *mouseExit;         // mouse exit script 
  const char *action;            // select script
  const char *onFocus;           // select script
  const char *leaveFocus;        // select script
  const char *cvar;              // associated cvar 
  const char *cvarTest;          // associated cvar for enable actions
	const char *enableCvar;			   // enable, disable, show, or hide based on value, this can contain a list
	int cvarFlags;								 //	what type of action to take on cvarenables
  sfxHandle_t focusSound;
	int numColors;								 // number of color ranges
	colorRangeDef_t colorRanges[MAX_COLOR_RANGES];
	float special;								 // used for feeder id's etc.. diff per type
  int cursorPos;                 // cursor position in characters
	void *typeData;								 // type specific data ptr's	
} itemDef_t;

typedef struct {
  Window window;
  const char  *font;								// font
  qboolean fullScreen;							// covers entire screen 
  int itemCount;										// number of items;
  int fontIndex;										// 
  int cursorItem;										// which item as the cursor
	int fadeCycle;										//
	float fadeClamp;									//
	float fadeAmount;									//
  const char *onOpen;								// run when the menu is first opened
  const char *onClose;							// run when the menu is closed
  const char *onESC;								// run when the menu is closed
	const char *soundName;						// background loop sound for menu

  vec4_t focusColor;								// focus color for items
  vec4_t disableColor;							// focus color for items
  itemDef_t *items[MAX_MENUITEMS];	// items this menu contains   
} menuDef_t;

typedef struct {
  const char *fontStr;
  const char *cursorStr;
  const char *gradientStr;
  fontInfo_t textFont;
  fontInfo_t smallFont;
  fontInfo_t bigFont;
  qhandle_t cursor;
  qhandle_t gradientBar;
  qhandle_t scrollBarArrowUp;
  qhandle_t scrollBarArrowDown;
  qhandle_t scrollBarArrowLeft;
  qhandle_t scrollBarArrowRight;
  qhandle_t scrollBar;
  qhandle_t scrollBarThumb;
  qhandle_t buttonMiddle;
  qhandle_t buttonInside;
  qhandle_t solidBox;
  qhandle_t sliderBar;
  qhandle_t sliderThumb;
  sfxHandle_t menuEnterSound;
  sfxHandle_t menuExitSound;
  sfxHandle_t menuBuzzSound;
  sfxHandle_t itemFocusSound;
  float fadeClamp;
  int fadeCycle;
  float fadeAmount;
  float shadowX;
  float shadowY;
  vec4_t shadowColor;
  float shadowFadeClamp;
  qboolean fontRegistered;

  // player settings
	qhandle_t fxBasePic;
  qhandle_t fxPic[7];
	qhandle_t	crosshairShader[NUM_CROSSHAIRS];

} cachedAssets_t;

typedef struct {
  const char *name;
  void (*handler) (itemDef_t *item, char** args);
} commandDef_t;

typedef struct {
  qhandle_t (*registerShaderNoMip) (const char *p);
  void (*setColor) (const vec4_t v);
  void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset);
  void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
  void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style );
  int (*textWidth) (const char *text, float scale, int limit);
  int (*textHeight) (const char *text, float scale, int limit);
  qhandle_t (*registerModel) (const char *p);
  void (*modelBounds) (qhandle_t model, vec3_t min, vec3_t max);
  void (*fillRect) ( float x, float y, float w, float h, const vec4_t color);
  void (*drawRect) ( float x, float y, float w, float h, float size, const vec4_t color);
  void (*drawSides) (float x, float y, float w, float h, float size);
  void (*drawTopBottom) (float x, float y, float w, float h, float size);
  void (*clearScene) ();
  void (*addRefEntityToScene) (const refEntity_t *re );
  void (*renderScene) ( const refdef_t *fd );
  void (*registerFont) (const char *pFontname, int pointSize, fontInfo_t *font);
  void (*ownerDrawItem) (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle);
	float (*getValue) (int ownerDraw);
	qboolean (*ownerDrawVisible) (int flags);
  void (*runScript)(char **p);
  void (*getTeamColor)(vec4_t *color);
  void (*getCVarString)(const char *cvar, char *buffer, int bufsize);
  float (*getCVarValue)(const char *cvar);
  void (*setCVar)(const char *cvar, const char *value);
  void (*drawTextWithCursor)(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style);
  void (*setOverstrikeMode)(qboolean b);
  qboolean (*getOverstrikeMode)();
  void (*startLocalSound)( sfxHandle_t sfx, int channelNum );
  qboolean (*ownerDrawHandleKey)(int ownerDraw, int flags, float *special, int key);
  int (*feederCount)(float feederID);
  const char *(*feederItemText)(float feederID, int index, int column, qhandle_t *handle);
  qhandle_t (*feederItemImage)(float feederID, int index);
  void (*feederSelection)(float feederID, int index);
	void (*keynumToStringBuf)( int keynum, char *buf, int buflen );
	void (*getBindingBuf)( int keynum, char *buf, int buflen );
	void (*setBinding)( int keynum, const char *binding );
	void (*executeText)(int exec_when, const char *text );	
	void (*Error)(int level, const char *error, ...);
	void (*Print)(const char *msg, ...);
	void (*Pause)(qboolean b);
	int (*ownerDrawWidth)(int ownerDraw, float scale);
	sfxHandle_t (*registerSound)(const char *name, qboolean compressed);
	void (*startBackgroundTrack)( const char *intro, const char *loop);
	void (*stopBackgroundTrack)();
	int (*playCinematic)(const char *name, float x, float y, float w, float h);
	void (*stopCinematic)(int handle);
	void (*drawCinematic)(int handle, float x, float y, float w, float h);
	void (*runCinematicFrame)(int handle);

  float			yscale;
  float			xscale;
  float			bias;
  int				realTime;
  int				frameTime;
	int				cursorx;
	int				cursory;
	qboolean	debug;

  cachedAssets_t Assets;

	glconfig_t glconfig;
	qhandle_t	whiteShader;
  qhandle_t gradientImage;
  qhandle_t cursor;
	float FPS;

} displayContextDef_t;

const char *String_Alloc(const char *p);
void String_Init();
void String_Report();
void Init_Display(displayContextDef_t *dc);
void Display_ExpandMacros(char * buff);
void Menu_Init(menuDef_t *menu);
void Item_Init(itemDef_t *item);
void Menu_PostParse(menuDef_t *menu);
menuDef_t *Menu_GetFocused();
void Menu_HandleKey(menuDef_t *menu, int key, qboolean down);
void Menu_HandleMouseMove(menuDef_t *menu, float x, float y);
void Menu_ScrollFeeder(menuDef_t *menu, int feeder, qboolean down);
qboolean Float_Parse(char **p, float *f);
qboolean Color_Parse(char **p, vec4_t *c);
qboolean Int_Parse(char **p, int *i);
qboolean Rect_Parse(char **p, rectDef_t *r);
qboolean String_Parse(char **p, const char **out);
qboolean Script_Parse(char **p, const char **out);
qboolean PC_Float_Parse(int handle, float *f);
qboolean PC_Color_Parse(int handle, vec4_t *c);
qboolean PC_Int_Parse(int handle, int *i);
qboolean PC_Rect_Parse(int handle, rectDef_t *r);
qboolean PC_String_Parse(int handle, const char **out);
qboolean PC_Script_Parse(int handle, const char **out);
int Menu_Count();
void Menu_New(int handle);
void Menu_PaintAll();
menuDef_t *Menus_ActivateByName(const char *p);
void Menu_Reset();
qboolean Menus_AnyFullScreenVisible();
void  Menus_Activate(menuDef_t *menu);

displayContextDef_t *Display_GetContext();
void *Display_CaptureItem(int x, int y);
qboolean Display_MouseMove(void *p, int x, int y);
int Display_CursorType(int x, int y);
qboolean Display_KeyBindPending();
void Menus_OpenByName(const char *p);
menuDef_t *Menus_FindByName(const char *p);
void Menus_ShowByName(const char *p);
void Menus_CloseByName(const char *p);
void Display_HandleKey(int key, qboolean down, int x, int y);
void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
void Menus_CloseAll();
void Menu_Paint(menuDef_t *menu, qboolean forcePaint);
void Menu_SetFeederSelection(menuDef_t *menu, int feeder, int index, const char *name);
void Display_CacheAll();

void *UI_Alloc( int size );
void UI_InitMemory( void );
qboolean UI_OutOfMemory();

void Controls_GetConfig( void );
void Controls_SetConfig(qboolean restart);
void Controls_SetDefaults( void );

int			trap_PC_AddGlobalDefine( char *define );
int			trap_PC_LoadSource( const char *filename );
int			trap_PC_FreeSource( int handle );
int			trap_PC_ReadToken( int handle, pc_token_t *pc_token );
int			trap_PC_SourceFileAndLine( int handle, char *filename, int *line );

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -