mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-16 09:01:41 +00:00
MENU: Enable drawing in CSQC, Pause Menu
This commit is contained in:
parent
12c092f91a
commit
611b8aafff
14 changed files with 274 additions and 2537 deletions
|
@ -4,15 +4,26 @@
|
|||
|
||||
#pragma includedir "../source/client/"
|
||||
#pragma includedir "../source/shared/"
|
||||
#pragma includedir "../source/menu/"
|
||||
|
||||
#includelist
|
||||
defs/fte.qc
|
||||
defs/menu_defs.qc
|
||||
shared_defs.qc
|
||||
draw.qc
|
||||
|
||||
sui_sys.qc
|
||||
m_menu.qc
|
||||
menu_paus.qc // Pause Menu
|
||||
menu_opts.qc // Options Menu
|
||||
menu_vide.qc // Video Menu
|
||||
menu_audi.qc // Audio Menu
|
||||
menu_ctrl.qc // Control Menu
|
||||
menu_gpad.qc // Gamepad Menu
|
||||
|
||||
sound_enhanced.qc
|
||||
weapon_stats.qc
|
||||
defs/custom.qc
|
||||
draw.qc
|
||||
menu.qc
|
||||
achievements.qc
|
||||
hud.qc
|
||||
chat.qc
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#includelist
|
||||
defs/fte.qc
|
||||
defs/custom.qc
|
||||
defs/menu_defs.qc
|
||||
../client/draw.qc
|
||||
sui_sys.qc
|
||||
m_menu.qc
|
||||
|
|
|
@ -28,22 +28,8 @@
|
|||
|
||||
#pragma warning disable Q302
|
||||
|
||||
vector cursor_pos; /* Current mouse cursor position, updated in csqc_inputevent */
|
||||
float g_width, g_height; /* Globals for screen width and height */
|
||||
|
||||
float walk;
|
||||
|
||||
//Menu stuff
|
||||
float in_menu; //what menu are we in
|
||||
float time_in_menu;
|
||||
|
||||
// Loading screen definitions
|
||||
float in_loadscreen;
|
||||
float loadscreen_timetrigger;
|
||||
string loadscreen_mapname;
|
||||
string loadscreen_maptitle;
|
||||
string loadscreen_tip;
|
||||
|
||||
float weapon;
|
||||
|
||||
float tracercounter;
|
||||
|
@ -53,24 +39,6 @@ float tracercounter;
|
|||
entity cl_viewent;
|
||||
entity cl_viewent2;
|
||||
|
||||
const float MENU_NONE = 0;
|
||||
const float MENU_MAIN = 1;
|
||||
const float MENU_SINGLE = 2;
|
||||
const float MENU_MULTI = 4;
|
||||
const float MENU_SETTINGS = 8;
|
||||
const float MENU_ABOUT = 16;
|
||||
const float MENU_JOIN = 32;
|
||||
const float MENU_PAUSE = 64;
|
||||
const float MENU_IGS = 128;
|
||||
const float MENU_RES = 256;
|
||||
const float MENU_GSETTINGS = 512;
|
||||
const float MENU_CSETTINGS = 1024;
|
||||
const float MENU_CUSTOMS = 2048;
|
||||
const float MENU_ACHIEVEMENTS = 4096;
|
||||
const float MENU_CONSETTINGS = 8192;
|
||||
const float MENU_AUDSETTINGS = 16384;
|
||||
const float MENU_CREATE = 32768;
|
||||
|
||||
float matchmake_enabled;
|
||||
float double_tap_version;
|
||||
|
||||
|
@ -159,10 +127,6 @@ float screenflash_starttime;
|
|||
.float points;
|
||||
.float kills;
|
||||
|
||||
float menu_initialized;
|
||||
|
||||
float customs_interact;
|
||||
|
||||
vector camang; // used for punches
|
||||
|
||||
//world text
|
||||
|
@ -174,30 +138,8 @@ string person;
|
|||
//custom hud
|
||||
string huddir;
|
||||
|
||||
//this just cleans up settings a bit..
|
||||
#define S_ENABLED "Enabled"
|
||||
#define S_DISABLED "Disabled"
|
||||
float wasigs;
|
||||
|
||||
//controls
|
||||
#define MAX_BINDS 14
|
||||
|
||||
float editBind[MAX_BINDS];
|
||||
string buttonBind[MAX_BINDS];
|
||||
string tempBind[MAX_BINDS];
|
||||
|
||||
// resolution
|
||||
float aspectratio;
|
||||
float fullscreenval;
|
||||
float active_swidth;
|
||||
float active_sheight;
|
||||
|
||||
int platform_is_web;
|
||||
|
||||
#define OPTION_EXE_ONLY 0
|
||||
#define OPTION_WEB_ONLY 1
|
||||
#define OPTION_WEB_AND_EXE 2
|
||||
|
||||
// Stopwatch server time counter
|
||||
float stopwatch_sec;
|
||||
int stopwatch_min;
|
||||
|
@ -217,7 +159,6 @@ float GPButtonHeldBeginTime[24]; // Tracks time button down event is called, to
|
|||
float last_input_deviceid; // The Device ID of the input hardware that last called CSQC_InputEvent, to target it directly.
|
||||
|
||||
string build_datetime;
|
||||
#define VERSION_STRING "v1.0"
|
||||
|
||||
vector gun_kick;
|
||||
|
||||
|
@ -244,53 +185,3 @@ string zombie_skins[] =
|
|||
"models/ai/zal(.mdl",
|
||||
"models/ai/zar(.mdl"
|
||||
};
|
||||
|
||||
//
|
||||
// Screen sizes, self-explanatory.
|
||||
//
|
||||
var struct screenres_s
|
||||
{
|
||||
float width;
|
||||
float height;
|
||||
};
|
||||
|
||||
screenres_s screen_resolution_5x4[] =
|
||||
{
|
||||
{1280, 1024}
|
||||
};
|
||||
|
||||
screenres_s screen_resolution_4x3[] =
|
||||
{
|
||||
{640, 480},
|
||||
{800, 600},
|
||||
{1024, 768}
|
||||
};
|
||||
|
||||
screenres_s screen_resolution_16x9[] =
|
||||
{
|
||||
{640, 360},
|
||||
{1280, 720},
|
||||
{1360, 768},
|
||||
{1366, 768},
|
||||
{1536, 864},
|
||||
{1600, 900},
|
||||
{1920, 1080},
|
||||
{2048, 1152},
|
||||
{2560, 1440},
|
||||
{3840, 2160}
|
||||
};
|
||||
|
||||
screenres_s screen_resolution_16x10[] =
|
||||
{
|
||||
{1280, 800},
|
||||
{1440, 900},
|
||||
{1680, 1050},
|
||||
{1920, 1200},
|
||||
{2560, 1600}
|
||||
};
|
||||
|
||||
screenres_s screen_resolution_21x9[] =
|
||||
{
|
||||
{2560, 1080},
|
||||
{3840, 1440}
|
||||
};
|
||||
|
|
|
@ -1676,16 +1676,17 @@ void(float width, float height) HUD_Achievements = {
|
|||
|
||||
string(float index) GetButtonString =
|
||||
{
|
||||
// place holder
|
||||
if (index == 100)
|
||||
return "LMOUSE";
|
||||
else if (index == 101)
|
||||
return "RMOUSE";
|
||||
// // place holder
|
||||
// if (index == 100)
|
||||
// return "LMOUSE";
|
||||
// else if (index == 101)
|
||||
// return "RMOUSE";
|
||||
|
||||
tokenize(findkeysforcommandex(buttonBind[index]));
|
||||
string temps = strtoupper(argv(0));
|
||||
// tokenize(findkeysforcommandex(buttonBind[index]));
|
||||
// string temps = strtoupper(argv(0));
|
||||
|
||||
return temps;
|
||||
// return temps;
|
||||
return "LMOUSE";
|
||||
}
|
||||
|
||||
void(float width, float height) HUD_Waypoint =
|
||||
|
|
|
@ -27,33 +27,23 @@
|
|||
|
||||
void() ToggleMenu =
|
||||
{
|
||||
if(serverkey("constate") != "disconnected")
|
||||
if (serverkey("constate") != "disconnected")
|
||||
{
|
||||
if (player_count == 0)
|
||||
localcmd("cmd pause\n");
|
||||
if(in_menu == MENU_NONE)
|
||||
|
||||
if(current_menu == MENU_NONE)
|
||||
{
|
||||
in_menu = MENU_PAUSE;
|
||||
time_in_menu = 0;
|
||||
local float i;
|
||||
for(i = 0; i < buttons.length; i++)
|
||||
{
|
||||
buttons[i].active = 1;
|
||||
}
|
||||
current_menu = MENU_PAUSE;
|
||||
setcursormode(TRUE, cvar_string("cl_cursor"), __NULL__, cvar("cl_cursor_scale"));
|
||||
}
|
||||
else
|
||||
{
|
||||
in_menu = MENU_NONE;
|
||||
menu_paus_submenu = 0;
|
||||
current_menu = MENU_NONE;
|
||||
setcursormode(FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
in_menu = MENU_MAIN;
|
||||
time_in_menu = 0;
|
||||
setcursormode(TRUE, cvar_string("cl_cursor"), __NULL__, cvar("cl_cursor_scale"));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -84,8 +74,6 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
|
|||
precache_model("models/player.mdl");
|
||||
|
||||
registercommand("togglemenu");
|
||||
registercommand("startwalk");
|
||||
registercommand("stopwalk");
|
||||
registercommand("promptjoin");
|
||||
registercommand("showscores");
|
||||
|
||||
|
@ -105,33 +93,6 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
|
|||
if (platform_is_web) {
|
||||
cvar_set("com_protocolname", "NZP-REBOOT-WEB");
|
||||
}
|
||||
|
||||
//print("CSQC Started\n");
|
||||
if(serverkey("constate") == "disconnected")
|
||||
ToggleMenu();
|
||||
//bgpos = 0;
|
||||
|
||||
// default button binds
|
||||
|
||||
buttonBind[0] = "+forward";
|
||||
buttonBind[1] = "+back";
|
||||
buttonBind[2] = "+moveleft";
|
||||
buttonBind[3] = "+moveright";
|
||||
buttonBind[4] = "impulse 10";
|
||||
buttonBind[5] = "impulse 23";
|
||||
buttonBind[6] = "impulse 30";
|
||||
buttonBind[7] = "+button4";
|
||||
buttonBind[8] = "+button4";
|
||||
buttonBind[9] = "+button7";
|
||||
buttonBind[10] = "+button5";
|
||||
buttonBind[11] = "+button6";
|
||||
buttonBind[12] = "+button3";
|
||||
buttonBind[13] = "impulse 33";
|
||||
|
||||
// default/current width and height
|
||||
active_swidth = cvar("vid_width");
|
||||
active_sheight = cvar("vid_height");
|
||||
fullscreenval = cvar("vid_fullscreen");
|
||||
|
||||
// cvars for custom settings
|
||||
autocvar(cl_cinematic, 0);
|
||||
|
@ -173,9 +134,6 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
|
|||
localcmd("bind 1 +button4; bind 2 +button4\n");
|
||||
}
|
||||
|
||||
// retrieve custom maps
|
||||
Customs_Get();
|
||||
|
||||
//
|
||||
// get the build date
|
||||
//
|
||||
|
@ -203,12 +161,6 @@ noref void() CSQC_WorldLoaded =
|
|||
huddir = "gfx/hud/";
|
||||
};
|
||||
|
||||
// This is from COW lol!
|
||||
#define ADS_THOMPSON '-3 +5.80 +4.52'
|
||||
|
||||
/*vector adsOffset;
|
||||
float adsAmount;
|
||||
float adsDir;*/
|
||||
vector weapon_bob_factor;
|
||||
float weapon_bob_factor_z_coef;
|
||||
vector dampening_factor;
|
||||
|
@ -592,7 +544,8 @@ noref void(float width, float height, float menushown) CSQC_UpdateView =
|
|||
setviewprop(VF_DRAWCROSSHAIR, 0);
|
||||
|
||||
float sensitivity_factor;
|
||||
if (in_menu == MENU_PAUSE)
|
||||
|
||||
if (current_menu != MENU_NONE)
|
||||
sensitivity_factor = 0;
|
||||
else
|
||||
sensitivity_factor = (1 + SCALE_CONSTANT * getstatf(STAT_VIEWZOOM)) / (1 + SCALE_CONSTANT);
|
||||
|
@ -658,23 +611,22 @@ noref void(float width, float height, float menushown) CSQC_UpdateView =
|
|||
//does what you think it does
|
||||
renderscene();
|
||||
|
||||
if(in_menu)
|
||||
if (current_menu != MENU_NONE)
|
||||
{
|
||||
// sorta-nasty hack: flashes should still draw if we're
|
||||
// drawing the menu.
|
||||
if (screenflash_duration > time)
|
||||
HUD_Screenflash();
|
||||
|
||||
Draw_Menu();
|
||||
setlocaluserinfo(0, "in_menu", "1");
|
||||
|
||||
if (gamepad_enabled)
|
||||
buttons[20].gray_out = true;
|
||||
else
|
||||
buttons[20].gray_out = false;
|
||||
sui_begin(g_width, g_height);
|
||||
root_menu([g_width, g_height]);
|
||||
sui_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
setcursormode(FALSE);
|
||||
HUD_Draw(g_width, g_height);
|
||||
Chat_Draw();
|
||||
setlocaluserinfo(0, "in_menu", "0");
|
||||
|
@ -695,15 +647,6 @@ noref float(string cmd) CSQC_ConsoleCommand =
|
|||
return TRUE;
|
||||
case "map":
|
||||
return FALSE;
|
||||
case "startwalk":
|
||||
walk = TRUE;
|
||||
return FALSE;
|
||||
case "stopwalk":
|
||||
walk = FALSE;
|
||||
return FALSE;
|
||||
case "promptjoin":
|
||||
menu_join();
|
||||
return TRUE;
|
||||
case "showscores":
|
||||
if (score_show)
|
||||
score_show = FALSE;
|
||||
|
@ -741,28 +684,15 @@ void(float scanx, float setval) Input_Movecheck =
|
|||
K_BACKDOWN = setval;
|
||||
}
|
||||
|
||||
void(float button, string key) setToBind =
|
||||
{
|
||||
local string fullbind, unbind, oldkey;
|
||||
local string btn;
|
||||
editBind[button] = FALSE;
|
||||
|
||||
btn = buttonBind[button];
|
||||
|
||||
tokenize(findkeysforcommandex(btn));
|
||||
oldkey = argv(0);
|
||||
|
||||
unbind = strcat("bind ", oldkey, " null\n");
|
||||
fullbind = strcat("bind ", key, " \"", btn, "\"\n");
|
||||
|
||||
localcmd(unbind);
|
||||
localcmd(fullbind);
|
||||
}
|
||||
|
||||
noref float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent =
|
||||
{
|
||||
last_input_deviceid = devid;
|
||||
|
||||
if (current_menu != MENU_NONE)
|
||||
{
|
||||
return sui_input_event(evtype, scanx, chary, devid);
|
||||
}
|
||||
|
||||
if (evtype == IE_KEYDOWN) {
|
||||
switch (scanx) {
|
||||
case K_GP_A:
|
||||
|
@ -831,85 +761,6 @@ noref float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent
|
|||
switch(evtype)
|
||||
{
|
||||
case IE_KEYDOWN:
|
||||
if(in_menu != MENU_NONE)
|
||||
{
|
||||
if(scanx == K_MOUSE1) {
|
||||
Menu_Click(0);
|
||||
|
||||
if (in_menu == MENU_CUSTOMS)
|
||||
Menu_Click_Custom();
|
||||
return TRUE;
|
||||
} else if (scanx == K_MOUSE2) {
|
||||
Menu_Click(1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (in_menu == MENU_CSETTINGS) {
|
||||
for (int i = 0; i < MAX_BINDS; i += 1) {
|
||||
if (editBind[i] == TRUE)
|
||||
setToBind(i, keynumtostring(scanx));
|
||||
}
|
||||
}
|
||||
|
||||
if (in_menu == MENU_MULTI) {
|
||||
// GO AWAY!
|
||||
if (scanx == K_ENTER || scanx == K_ESCAPE) {
|
||||
editing_player_name = editing_server_id = editing_password = editing_hostname = false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (editing_player_name == true) {
|
||||
// Update the temp string.
|
||||
temp_player_name = GetUserInput(temp_player_name, scanx, chary, 18);
|
||||
|
||||
// Always append.
|
||||
cvar_set("name", temp_player_name);
|
||||
|
||||
// No, I don't want to read binds. Thanks.
|
||||
return TRUE;
|
||||
}
|
||||
} else if (in_menu == MENU_CREATE || in_menu == MENU_JOIN) {
|
||||
// GO AWAY!
|
||||
if (scanx == K_ENTER || scanx == K_ESCAPE) {
|
||||
editing_player_name = editing_server_id = editing_password = false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Server IP
|
||||
if (editing_server_id == true) {
|
||||
// Update the temp string.
|
||||
temp_server_name = GetUserInput(temp_server_name, scanx, chary, 18);
|
||||
|
||||
// No, I don't want to read binds. Thanks.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Password
|
||||
if (editing_password == true) {
|
||||
// Update the temp string.
|
||||
temp_password = GetUserInput(temp_password, scanx, chary, 18);
|
||||
|
||||
// Always append.
|
||||
cvar_set("password", temp_password);
|
||||
|
||||
// No, I don't want to read binds. Thanks.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Hostname
|
||||
if (editing_hostname == true) {
|
||||
// Update the temp string.
|
||||
temp_hostname = GetUserInput(temp_hostname, scanx, chary, 18);
|
||||
|
||||
// Always append.
|
||||
cvar_set("hostname", temp_hostname);
|
||||
|
||||
// No, I don't want to read binds. Thanks.
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Input_Movecheck(scanx, 1);
|
||||
return FALSE;
|
||||
case IE_KEYUP:
|
||||
|
@ -918,10 +769,6 @@ noref float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent
|
|||
case IE_MOUSEDELTA:
|
||||
return FALSE;
|
||||
case IE_MOUSEABS:
|
||||
//if(devid != 0 && devid != 1)
|
||||
// return FALSE;
|
||||
cursor_pos_x = scanx;
|
||||
cursor_pos_y = chary;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,26 +35,45 @@ enum {
|
|||
MENU_CONTROL,
|
||||
MENU_GAMEPAD,
|
||||
MENU_CREDITS,
|
||||
MENU_HELP
|
||||
MENU_PAUSE
|
||||
};
|
||||
|
||||
#define MENU_SND_NAVIGATE 0
|
||||
#define MENU_SND_ENTER 1
|
||||
void(float type) Menu_PlaySound;
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
void() Menu_Main;
|
||||
void() Menu_Maps;
|
||||
void() Menu_Credits;
|
||||
|
||||
#else
|
||||
|
||||
void() Menu_Pause;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
void() Menu_Options;
|
||||
void() Menu_Video;
|
||||
void() Menu_Audio;
|
||||
void() Menu_Control;
|
||||
void() Menu_Gamepad;
|
||||
void() Menu_Credits;
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
string(string prev_id) Menu_Main_GetNextButton;
|
||||
string(string next_id) Menu_Main_GetPreviousButton;
|
||||
string(string prev_id) Menu_Maps_GetNextButton;
|
||||
string(string next_id) Menu_Maps_GetPreviousButton;
|
||||
|
||||
#else
|
||||
|
||||
string(string prev_id) Menu_Pause_GetNextButton;
|
||||
string(string next_id) Menu_Pause_GetPreviousButton;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
string(string prev_id) Menu_Options_GetNextButton;
|
||||
string(string next_id) Menu_Options_GetPreviousButton;
|
||||
string(string prev_id) Menu_Video_GetNextButton;
|
|
@ -22,7 +22,6 @@ void() input_tester =
|
|||
{
|
||||
printme = strcat(printme, chr2str(char));
|
||||
}
|
||||
if (printme != "") printf("INPUT: %s\n", printme);
|
||||
};
|
||||
|
||||
void(string id, vector pos, vector size, float maxlen, __inout string text, __inout float cursor) text_input_control =
|
||||
|
@ -107,6 +106,29 @@ void(float order, string id, string text, float index) Menu_SocialBadge =
|
|||
sui_action_element(position, [28, 28], id, sui_noop);
|
||||
};
|
||||
|
||||
//
|
||||
// Menu_DrawYesNoPanel()
|
||||
// Draws a ribbon over the screen typically used
|
||||
// for Yes/No message boxes.
|
||||
//
|
||||
void(string line_1, string line_2) Menu_DrawYesNoPanel =
|
||||
{
|
||||
sui_set_align([SUI_ALIGN_START, SUI_ALIGN_START]);
|
||||
sui_fill([0, 0], sui_current_frame_size(), [0.01, 0, 0], 0.5, 0);
|
||||
|
||||
// Black Fill
|
||||
sui_fill([0, 160], [sui_current_frame_size()[0], 160], [0, 0, 0], 1, 0);
|
||||
|
||||
// Yellow borders
|
||||
sui_fill([0, 160], [sui_current_frame_size()[0], 3], [1, 1, 0], 0.9, 0);
|
||||
sui_fill([0, sui_current_frame_size()[1] - 160], [sui_current_frame_size()[0], 3], [1, 1, 0], 0.9, 0);
|
||||
|
||||
sui_set_align([SUI_ALIGN_CENTER, SUI_ALIGN_START]);
|
||||
sui_text([0, 170], MENU_TEXT_MEDIUM, line_1, [1, 1, 1], 1, 0);
|
||||
sui_text([0, 190], MENU_TEXT_MEDIUM, line_2, [1, 1, 1], 1, 0);
|
||||
sui_set_align([SUI_ALIGN_START, SUI_ALIGN_START]);
|
||||
};
|
||||
|
||||
//
|
||||
// Menu_DrawMapPanel()
|
||||
// Draws a translucent box on the right
|
||||
|
@ -355,13 +377,21 @@ void() Menu_DrawBuildDate =
|
|||
// background for readibility, and some
|
||||
// style lines.
|
||||
//
|
||||
string() Menu_PickBackground;
|
||||
void() Menu_DrawBackground =
|
||||
{
|
||||
sui_set_align([SUI_ALIGN_START, SUI_ALIGN_START]);
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
sui_pic([0, 0], sui_current_frame_size(), menu_background, [1, 1, 1], 1, 1);
|
||||
sui_fill([0, 0], sui_current_frame_size(), [0, 0, 0], 0.7, 0);
|
||||
|
||||
#else
|
||||
|
||||
sui_fill([0, 0], sui_current_frame_size(), [0, 0, 0], 0.8, 0);
|
||||
|
||||
#endif // MENU
|
||||
|
||||
// Top Bars
|
||||
sui_fill([0, 0], [sui_current_frame_size()[0], 55], [0, 0, 0], 0.9, 0);
|
||||
sui_fill([0, 52], [sui_current_frame_size()[0], 3], [0.2, 0.2, 0.2], 1, 0);
|
||||
|
@ -530,29 +560,6 @@ void() settings_menu =
|
|||
sui_pop_frame();
|
||||
};
|
||||
|
||||
void() help_menu =
|
||||
{
|
||||
vector pos = [0, 0];
|
||||
vector size = [360, 280];
|
||||
|
||||
sui_push_frame(pos, size);
|
||||
|
||||
sui_fill([0, 0], size, MENU_BG, 0.75, 0);
|
||||
sui_border_box([0, 0], size, 2, MENU_BORDER, 0.3, 0);
|
||||
|
||||
sui_set_align([SUI_ALIGN_CENTER, SUI_ALIGN_START]);
|
||||
sui_text([0, 4], MENU_TEXT_MEDIUM, "Help", MENU_TEXT_1, 1, 0);
|
||||
|
||||
float xpos = 0;
|
||||
float ypos = 32;
|
||||
sui_text([xpos, ypos], MENU_TEXT_SMALL, "Bunch of Help and About", MENU_TEXT_1, 1, 0);
|
||||
|
||||
sui_set_align([SUI_ALIGN_END, SUI_ALIGN_END]);
|
||||
my_button("hlp_back", [-8, -8], [80, 20], "Back") ? current_menu = MENU_MAIN : 0;
|
||||
|
||||
sui_pop_frame();
|
||||
};
|
||||
|
||||
void(float type) Menu_PlaySound =
|
||||
{
|
||||
string sound = "";
|
||||
|
@ -570,16 +577,26 @@ void(vector size) root_menu =
|
|||
sui_fill([0, 0], size, '0 0 0', 0.5, 0);
|
||||
switch (current_menu)
|
||||
{
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
case MENU_MAIN: Menu_Main(); break;
|
||||
case MENU_SOLO: menu_map_mode = MAP_SOLOSTOCK; Menu_Maps(); break;
|
||||
case MENU_SOLOUSER: menu_map_mode = MAP_SOLOUSER; Menu_Maps(); break;
|
||||
case MENU_CREDITS: Menu_Credits(); break;
|
||||
|
||||
#else
|
||||
|
||||
case MENU_PAUSE: Menu_Pause(); break;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
case MENU_OPTIONS: Menu_Options(); break;
|
||||
case MENU_VIDEO: Menu_Video(); break;
|
||||
case MENU_AUDIO: Menu_Audio(); break;
|
||||
case MENU_CONTROL: Menu_Control(); break;
|
||||
case MENU_GAMEPAD: Menu_Gamepad(); break;
|
||||
case MENU_CREDITS: Menu_Credits(); break;
|
||||
case MENU_HELP: help_menu();
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ void() Menu_Main =
|
|||
Menu_SocialBadge(1, "soc_youtube", "youtube.com/@nzpteam", 2);
|
||||
Menu_SocialBadge(2, "soc_mastadon", "FIXME", 3);
|
||||
Menu_SocialBadge(3, "soc_patreon", "patreon.com/cypressimplex", 4);
|
||||
Menu_SocialBadge(4, "soc_matrix", "matrix.nzp.gay", 1);
|
||||
Menu_SocialBadge(4, "soc_discord", "discord.nzp.gay", 1);
|
||||
|
||||
sui_pop_frame();
|
||||
};
|
|
@ -53,7 +53,15 @@ void() Menu_Options =
|
|||
Menu_DrawDivider(5);
|
||||
Menu_Button(5.25, "om_console", "OPEN CONSOLE", "Access the Developer Console.") ? localcmd("toggleconsole\n") : 0;
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
Menu_Button(-1, "om_back", "BACK", "Return to Main Menu.") ? current_menu = MENU_MAIN : 0;
|
||||
|
||||
#else
|
||||
|
||||
Menu_Button(-1, "om_back", "BACK", "Return to Pause Menu.") ? current_menu = MENU_PAUSE : 0;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
sui_pop_frame();
|
||||
};
|
125
source/menu/menu_paus.qc
Normal file
125
source/menu/menu_paus.qc
Normal file
|
@ -0,0 +1,125 @@
|
|||
void() ToggleMenu;
|
||||
float player_count;
|
||||
|
||||
string menu_paus_buttons[4];
|
||||
int menu_paus_submenu;
|
||||
|
||||
string(string prev_id) Menu_Pause_GetNextButton =
|
||||
{
|
||||
if (prev_id == "")
|
||||
return menu_paus_buttons[0];
|
||||
|
||||
string ret = menu_paus_buttons[0];
|
||||
|
||||
for(float i = 0; i < menu_paus_buttons.length; i++) {
|
||||
if (menu_paus_buttons[i] == prev_id) {
|
||||
if (i + 1 >= menu_paus_buttons.length)
|
||||
break;
|
||||
|
||||
ret = menu_paus_buttons[i + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (player_count != 0 && ret == "pm_reloa")
|
||||
ret = "pm_opts";
|
||||
|
||||
if (ret == "")
|
||||
ret = "pm_yes";
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
string(string next_id) Menu_Pause_GetPreviousButton =
|
||||
{
|
||||
if (next_id == "")
|
||||
return menu_paus_buttons[menu_paus_buttons.length - 1];
|
||||
|
||||
string ret = menu_paus_buttons[menu_paus_buttons.length - 1];
|
||||
|
||||
for(float i = menu_paus_buttons.length - 1; i > 0; i--) {
|
||||
if (menu_paus_buttons[i] == next_id) {
|
||||
if (i - 1 < 0)
|
||||
break;
|
||||
|
||||
ret = menu_paus_buttons[i - 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (player_count != 0 && ret == "pm_reloa")
|
||||
ret = "pm_resum";
|
||||
|
||||
if (ret == "")
|
||||
ret = "pm_no";
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
void(int idx) Menu_Pause_EnterSubMenu =
|
||||
{
|
||||
Menu_PlaySound(MENU_SND_ENTER);
|
||||
menu_paus_submenu = idx;
|
||||
};
|
||||
|
||||
void() Menu_Pause_Yes =
|
||||
{
|
||||
if (menu_paus_submenu == 1)
|
||||
localcmd("restart\n");
|
||||
else if (menu_paus_submenu == 2)
|
||||
localcmd("disconnect\n");
|
||||
|
||||
Menu_Pause_EnterSubMenu(0);
|
||||
};
|
||||
|
||||
void() Menu_Pause_No =
|
||||
{
|
||||
Menu_Pause_EnterSubMenu(0);
|
||||
};
|
||||
|
||||
void() Menu_Pause =
|
||||
{
|
||||
Menu_DrawBackground();
|
||||
Menu_DrawTitle("PAUSED");
|
||||
|
||||
if (menu_paus_submenu == 0)
|
||||
{
|
||||
Menu_Button(1, "pm_resum", "RESUME CARNAGE", "Return to Game.") ? ToggleMenu() : 0;
|
||||
|
||||
if (player_count == 0)
|
||||
Menu_Button(2, "pm_reloa", "RESTART LEVEL", "Tough luck? Give things another go.") ? Menu_Pause_EnterSubMenu(1) : 0;
|
||||
else
|
||||
Menu_GreyButton(2, "RESTART LEVEL");
|
||||
|
||||
Menu_Button(3, "pm_opts", "OPTIONS", "Tweak Game related Options.") ? current_menu = MENU_OPTIONS : 0;
|
||||
Menu_Button(4, "pm_quit", "END GAME", "Return to Main Menu.") ? Menu_Pause_EnterSubMenu(2) : 0;
|
||||
|
||||
menu_paus_buttons[0] = "pm_resum";
|
||||
menu_paus_buttons[1] = "pm_reloa";
|
||||
menu_paus_buttons[2] = "pm_opts";
|
||||
menu_paus_buttons[3] = "pm_quit";
|
||||
}
|
||||
else
|
||||
{
|
||||
Menu_GreyButton(1, "RESUME CARNAGE");
|
||||
Menu_GreyButton(2, "RESTART LEVEL");
|
||||
Menu_GreyButton(3, "OPTIONS");
|
||||
Menu_GreyButton(4, "END GAME");
|
||||
|
||||
// Draw the UI
|
||||
if (menu_paus_submenu == 1)
|
||||
Menu_DrawYesNoPanel("Are you sure you want to restart?", "You will lose any progress that you have made.");
|
||||
else if (menu_paus_submenu == 2)
|
||||
Menu_DrawYesNoPanel("Are you sure you want to quit?", "You will lose any progress that you have made.");
|
||||
|
||||
Menu_Button(8, "pm_yes", "GET ME OUTTA HERE!", "") ? Menu_Pause_Yes() : 0;
|
||||
Menu_Button(9, "pm_no", "I WILL PERSEVERE", "") ? Menu_Pause_No() : 0;
|
||||
|
||||
menu_paus_buttons[0] = "pm_yes";
|
||||
menu_paus_buttons[1] = "pm_no";
|
||||
menu_paus_buttons[2] = "";
|
||||
menu_paus_buttons[3] = "";
|
||||
}
|
||||
|
||||
sui_pop_frame();
|
||||
};
|
|
@ -152,7 +152,7 @@ void(vector pos, vector size) sui_push_frame =
|
|||
_frame_index += 1;
|
||||
if (_frame_index >= MAX_FRAMES)
|
||||
{
|
||||
printf("^3sui warning: amount of frames = %.0f exceeds MAX_FRAMES = %.0f, consider increasing MAX_FRAMES\n", _frame_index, MAX_FRAMES);
|
||||
//printf("^3sui warning: amount of frames = %.0f exceeds MAX_FRAMES = %.0f, consider increasing MAX_FRAMES\n", _frame_index, MAX_FRAMES);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ void() _action_element_count_sanity =
|
|||
if (_action_elements_index > MAX_ACTION_ELEMENTS)
|
||||
{
|
||||
// let the user know if they're hitting the bounds
|
||||
printf("^3sui warning: amount of action elements = %.0f exceeds MAX_ACTION_ELEMENTS = %.0f, consider increasing MAX_ACTION_ELEMENTS\n", _action_elements_index, MAX_ACTION_ELEMENTS);
|
||||
//printf("^3sui warning: amount of action elements = %.0f exceeds MAX_ACTION_ELEMENTS = %.0f, consider increasing MAX_ACTION_ELEMENTS\n", _action_elements_index, MAX_ACTION_ELEMENTS);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -353,7 +353,7 @@ float(float num) mouse_action_sanity =
|
|||
{
|
||||
if (num >= MAX_MOUSE_ACTIONS)
|
||||
{
|
||||
printf("^3sui warning: you have exceeded the amount of overlapping action elements with %.0f, MAX_MOUSE_ACTIONS = %.0f\n", num, MAX_MOUSE_ACTIONS);
|
||||
//printf("^3sui warning: you have exceeded the amount of overlapping action elements with %.0f, MAX_MOUSE_ACTIONS = %.0f\n", num, MAX_MOUSE_ACTIONS);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -394,6 +394,9 @@ void() _sui_menukey_downarrow =
|
|||
string current_hovered_option = _hover_actions[0];
|
||||
|
||||
switch(current_menu) {
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
case MENU_MAIN:
|
||||
_hover_actions[0] = Menu_Main_GetNextButton(current_hovered_option);
|
||||
break;
|
||||
|
@ -401,6 +404,15 @@ void() _sui_menukey_downarrow =
|
|||
case MENU_SOLOUSER:
|
||||
_hover_actions[0] = Menu_Maps_GetNextButton(current_hovered_option);
|
||||
break;
|
||||
|
||||
#else
|
||||
|
||||
case MENU_PAUSE:
|
||||
_hover_actions[0] = Menu_Pause_GetNextButton(current_hovered_option);
|
||||
break;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
case MENU_OPTIONS:
|
||||
_hover_actions[0] = Menu_Options_GetNextButton(current_hovered_option);
|
||||
break;
|
||||
|
@ -428,6 +440,9 @@ void() _sui_menukey_uparrow =
|
|||
string current_hovered_option = _hover_actions[0];
|
||||
|
||||
switch(current_menu) {
|
||||
|
||||
#ifdef MENU
|
||||
|
||||
case MENU_MAIN:
|
||||
_hover_actions[0] = Menu_Main_GetPreviousButton(current_hovered_option);
|
||||
break;
|
||||
|
@ -435,6 +450,15 @@ void() _sui_menukey_uparrow =
|
|||
case MENU_SOLOUSER:
|
||||
_hover_actions[0] = Menu_Maps_GetPreviousButton(current_hovered_option);
|
||||
break;
|
||||
|
||||
#else
|
||||
|
||||
case MENU_PAUSE:
|
||||
_hover_actions[0] = Menu_Pause_GetPreviousButton(current_hovered_option);
|
||||
break;
|
||||
|
||||
#endif // MENU
|
||||
|
||||
case MENU_OPTIONS:
|
||||
_hover_actions[0] = Menu_Options_GetPreviousButton(current_hovered_option);
|
||||
break;
|
||||
|
@ -607,9 +631,9 @@ float(float char, float scan) _sui_add_input =
|
|||
// TODO check if input was listened, return FALSE if not
|
||||
if (_input_length >= MAX_INPUTS)
|
||||
{
|
||||
printf("^3sui warning: exceeded amount of per frame inputs count MAX_INPUTS = %.0f\n"
|
||||
"^3 - make sure sui_input_event isn't being called without sui_draw being called in update loop\n"
|
||||
"^3 - consider increasing MAX_INPUTS\n", MAX_INPUTS);
|
||||
// printf("^3sui warning: exceeded amount of per frame inputs count MAX_INPUTS = %.0f\n"
|
||||
// "^3 - make sure sui_input_event isn't being called without sui_draw being called in update loop\n"
|
||||
// "^3 - consider increasing MAX_INPUTS\n", MAX_INPUTS);
|
||||
return TRUE;
|
||||
}
|
||||
_input_buffer[_input_length].char = char;
|
||||
|
|
|
@ -23,6 +23,8 @@ echo "Compiling FTE CSQC.."
|
|||
./$FTEQCC -srcfile ../progs/csqc.src | grep -E -i "warning |error |defined |not |unknown |branches"
|
||||
echo "Compiling FTE SSQC.."
|
||||
./$FTEQCC -O3 -DFTE -srcfile ../progs/ssqc.src | grep -E -i "warning |error |defined |not |unknown |branches"
|
||||
echo "Compiling FTE MenuQC.."
|
||||
./$FTEQCC -O3 -DFTE -srcfile ../progs/menu.src | grep -E -i "warning |error |defined |not |unknown |branches"
|
||||
echo "Compiling Standard/Id SSQC.."
|
||||
./$FTEQCC -O3 -srcfile ../progs/ssqc.src | grep -E -i "warning |error |defined |not |unknown |branches"
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ echo Compiling FTE CSQC..
|
|||
fteqcc-cli-win.exe -srcfile ../progs/csqc.src
|
||||
echo Compiling FTE SSQC..
|
||||
fteqcc-cli-win.exe -O3 -DFTE -srcfile ../progs/ssqc.src
|
||||
echo Compiling FTE MenuQC..
|
||||
fteqcc-cli-win.exe -O3 -DFTE -srcfile ../progs/menu.src
|
||||
echo Compiling Standard/Id SSQC..
|
||||
fteqcc-cli-win.exe -O3 -srcfile ../progs/ssqc.src
|
||||
|
||||
|
|
Loading…
Reference in a new issue