2019-09-01 02:18:15 +00:00
|
|
|
/*
|
2020-03-24 06:47:41 +00:00
|
|
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
2019-09-01 02:18:15 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2020-05-02 21:57:25 +00:00
|
|
|
#include "textmenu.h"
|
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* flags for 2d drawing */
|
|
|
|
#define DRAWFLAG_NORMAL 0
|
|
|
|
#define DRAWFLAG_ADDITIVE 1
|
|
|
|
#define DRAWFLAG_MODULATE 2
|
|
|
|
#define DRAWFLAG_2XMODULATE 3
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* undocumented printcall types */
|
2020-03-24 06:47:41 +00:00
|
|
|
#define PRINT_LOW 0
|
2019-01-29 02:40:14 +00:00
|
|
|
#define PRINT_MEDIUM 1
|
2020-03-24 06:47:41 +00:00
|
|
|
#define PRINT_HIGH 2
|
|
|
|
#define PRINT_CHAT 3
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* fonts */
|
2019-01-21 02:00:14 +00:00
|
|
|
var float FONT_16;
|
|
|
|
var float FONT_20;
|
|
|
|
var float FONT_CON;
|
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* clientside cvars */
|
2019-01-21 02:00:14 +00:00
|
|
|
var float autocvar_cl_bob = 0;
|
|
|
|
var float autocvar_v_bob = 0.01;
|
|
|
|
var float autocvar_v_bobcycle = 0.8;
|
|
|
|
var float autocvar_v_bobup = 0.5;
|
2019-09-01 02:18:15 +00:00
|
|
|
var float autocvar_zoom_sensitivity = 1.0f;
|
2019-01-21 02:00:14 +00:00
|
|
|
var int autocvar_cl_smoothstairs = TRUE;
|
2019-09-01 02:18:15 +00:00
|
|
|
var int autocvar_cl_thirdperson = FALSE;
|
|
|
|
var int autocvar_v_bobclassic = TRUE;
|
2019-01-21 02:00:14 +00:00
|
|
|
var int autocvar_v_lefthanded = FALSE;
|
|
|
|
var string autocvar_cl_logofile = "lambda";
|
2019-09-01 02:18:15 +00:00
|
|
|
var vector autocvar_cl_logocolor = [255,0,0];
|
|
|
|
var vector autocvar_con_color = [255,150,0];
|
|
|
|
var vector autocvar_vgui_color = [255,170,0];
|
|
|
|
var vector autocvar_v_gunofs = [0,0,0];
|
2020-03-30 12:47:17 +00:00
|
|
|
var int autocvar_r_viewmodelpass = 0;
|
|
|
|
var float autocvar_r_viewmodelfov = 90.0f;
|
2020-03-30 16:04:45 +00:00
|
|
|
var float autocvar_r_viewmodelscale = 1.0f;
|
2020-04-01 16:43:09 +00:00
|
|
|
var float autocvar_cl_hudaspect = 0.0f;
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* particle descriptors */
|
2020-03-24 06:26:49 +00:00
|
|
|
var float PART_DUSTMOTE;
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2019-09-04 01:56:36 +00:00
|
|
|
/* muzzleflash indices */
|
|
|
|
var int MUZZLE_SMALL;
|
|
|
|
var int MUZZLE_RIFLE;
|
|
|
|
var int MUZZLE_WEIRD;
|
|
|
|
|
2021-03-17 12:24:00 +00:00
|
|
|
var int SHELL_DEFAULT;
|
2021-03-24 06:50:30 +00:00
|
|
|
var int SHELL_SHOTGUN;
|
2021-03-17 12:24:00 +00:00
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* misc globals */
|
2019-01-21 02:00:14 +00:00
|
|
|
vector video_mins;
|
|
|
|
vector video_res;
|
|
|
|
vector mouse_pos;
|
2020-04-26 11:17:19 +00:00
|
|
|
int g_iIntermission;
|
2019-01-21 02:00:14 +00:00
|
|
|
|
2020-03-08 09:59:46 +00:00
|
|
|
int g_iWorldInitialized;
|
2019-12-22 22:28:39 +00:00
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* this actually belongs in builtins.h since its an undocumented global */
|
2019-01-21 02:00:14 +00:00
|
|
|
float clframetime;
|
|
|
|
|
2019-09-01 02:18:15 +00:00
|
|
|
/* prototypes */
|
2020-05-02 21:57:25 +00:00
|
|
|
void Damage_Draw(void);
|
|
|
|
|
2020-05-31 10:54:04 +00:00
|
|
|
string(string modelname, int frame, float frametime) spriteframe = #0;
|
|
|
|
|
2020-05-02 21:57:25 +00:00
|
|
|
void
|
|
|
|
drawstring_r(vector p, string t, vector s, vector c, float a, float f)
|
|
|
|
{
|
|
|
|
p[0] -= stringwidth(t, TRUE, s);
|
|
|
|
drawstring(p, t, s, c, a, f);
|
|
|
|
}
|
|
|
|
|
2021-01-02 20:22:56 +00:00
|
|
|
void GameMessage_Setup(string, int);
|
2020-05-02 21:57:25 +00:00
|
|
|
void Game_Input(void);
|
2019-09-04 01:56:36 +00:00
|
|
|
void View_SetMuzzleflash(int);
|
2021-03-17 13:34:26 +00:00
|
|
|
|
2021-03-29 19:52:53 +00:00
|
|
|
void Event_Callback(float mtime, __inout float btime);
|
|
|
|
void View_AddEvent(void(void) pCallback, float flTime);
|
2019-09-04 01:56:36 +00:00
|
|
|
void View_PlayAnimation(int);
|
2020-05-02 21:57:25 +00:00
|
|
|
void View_PlayAnimation(int);
|
2020-10-17 11:17:34 +00:00
|
|
|
void Vox_Play(string);
|
2021-01-05 14:51:49 +00:00
|
|
|
void Event_ProcessModel(float, int, string);
|
2021-02-16 23:44:40 +00:00
|
|
|
void ClientGame_ModelEvent(float, int, string);
|
2020-08-14 21:18:47 +00:00
|
|
|
|
|
|
|
/* this really should be done in-engine */
|
|
|
|
|
|
|
|
__wrap float(vector pos, string pic, vector size, vector rgb, float alpha, optional float drawflag) drawpic =
|
|
|
|
{
|
|
|
|
return prior([(int)pos[0],(int)pos[1]], pic, size, rgb, alpha, drawflag);
|
|
|
|
};
|
|
|
|
__wrap void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, optional float drawflag) drawsubpic =
|
|
|
|
{
|
|
|
|
return prior([(int)pos[0],(int)pos[1]], sz, pic, srcpos, srcsz, rgb, alpha, drawflag);
|
|
|
|
};
|
2021-03-27 06:49:13 +00:00
|
|
|
|
|
|
|
void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, optional float dfl)
|
|
|
|
{
|
|
|
|
/* top */
|
|
|
|
drawfill(pos, [sz[0], thickness], rgb, al, dfl);
|
|
|
|
/* bottom */
|
|
|
|
drawfill(pos + [0, sz[1] - thickness], [sz[0], thickness], rgb, al, dfl);
|
|
|
|
/* left */
|
|
|
|
drawfill(pos + [0, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
|
|
|
|
/* right */
|
|
|
|
drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
|
|
|
|
}
|