--- /dev/null
+// generated file; do not modify
+#include "announcer.qc"
+#include "bgmscript.qc"
+#include "csqcmodel_hooks.qc"
+#include "main.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "player_skeleton.qc"
+#include "scoreboard.qc"
+#include "shownames.qc"
+#include "teamradar.qc"
+#include "view.qc"
+#include "wall.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "cl_cmd.qc"
#include "all.qh"
#include <common/command/all.qc>
-
-#include "cl_cmd.qc"
--- /dev/null
+// generated file; do not modify
+#include "hud.qc"
+#include "hud_config.qc"
+++ /dev/null
-#include "all.qh"
-#include "hud.qc"
-#include "hud_config.qc"
--- /dev/null
+// generated file; do not modify
+#include "ammo.qc"
+#include "centerprint.qc"
+#include "chat.qc"
+#include "engineinfo.qc"
+#include "healtharmor.qc"
+#include "infomessages.qc"
+#include "minigame.qc"
+#include "modicons.qc"
+#include "notify.qc"
+#include "physics.qc"
+#include "powerups.qc"
+#include "pressedkeys.qc"
+#include "quickmenu.qc"
+#include "racetimer.qc"
+#include "radar.qc"
+#include "score.qc"
+#include "timer.qc"
+#include "vote.qc"
+#include "weapons.qc"
#include "quickmenu.qh"
// QuickMenu (#23)
-#include <client/quickmenu.qc>
+#include <common/ent_cs.qh>
+#include <client/hud/all.qh>
+#include <client/mapvoting.qh>
+
+// QUICKMENU_MAXLINES must be <= 10
+const int QUICKMENU_MAXLINES = 10;
+// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
+string QuickMenu_Page_Command[QUICKMENU_MAXLINES];
+string QuickMenu_Page_Description[QUICKMENU_MAXLINES];
+int QuickMenu_Page_Command_Type[QUICKMENU_MAXLINES];
+int QuickMenu_Page_Entries;
+int QuickMenu_Page;
+int QuickMenu_Page_ActivatedEntry = -1;
+bool QuickMenu_Page_ActivatedEntry_Close;
+float QuickMenu_Page_ActivatedEntry_Time;
+bool QuickMenu_IsLastPage;
+// all the entries are loaded into QuickMenu_Buffer
+// each entry (submenu or command) is composed of 2 entries
+const int QUICKMENU_MAXENTRIES = 256;
+const int QUICKMENU_BUFFER_MAXENTRIES = 2 * QUICKMENU_MAXENTRIES;
+int QuickMenu_Buffer = -1;
+int QuickMenu_Buffer_Size;
+int QuickMenu_Buffer_Index;
+string QuickMenu_CurrentSubMenu;
+float QuickMenu_TimeOut;
+
+// QuickMenu_Buffer are labeled with these tags
+#define QM_TAG_TITLE "T"
+#define QM_TAG_SUBMENU "S"
+#define QM_TAG_COMMAND "C"
+#define QM_TAG_PLCOMMAND "P"
+
+#define QuickMenu_Buffer_Set(tag, string) bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat(tag, string))
+#define QuickMenu_Buffer_Get() bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index)
+
+// if s1 is not empty s will be displayed as command otherwise as submenu
+void QuickMenu_Page_LoadEntry(int i, string s, string s1)
+{
+ TC(int, i);
+ //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
+ if (QuickMenu_Page_Description[i])
+ strunzone(QuickMenu_Page_Description[i]);
+ QuickMenu_Page_Description[i] = strzone(s);
+ if (QuickMenu_Page_Command[i])
+ strunzone(QuickMenu_Page_Command[i]);
+ QuickMenu_Page_Command[i] = strzone(s1);
+}
+
+void QuickMenu_Page_ClearEntry(int i)
+{
+ TC(int, i);
+ if (QuickMenu_Page_Description[i])
+ strunzone(QuickMenu_Page_Description[i]);
+ QuickMenu_Page_Description[i] = string_null;
+ if (QuickMenu_Page_Command[i])
+ strunzone(QuickMenu_Page_Command[i]);
+ QuickMenu_Page_Command[i] = string_null;
+}
+
+float QuickMenu_Page_Load(string target_submenu, float new_page);
+void QuickMenu_Default(string submenu);
+bool QuickMenu_Open(string mode, string submenu)
+{
+ int fh = -1;
+ string s;
+
+ if(mode == "")
+ {
+ if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
+ mode = "default";
+ else
+ mode = "file";
+ }
+
+ if(mode == "file")
+ {
+ if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
+ LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
+ else
+ {
+ fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
+ if(fh < 0)
+ LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
+ }
+ if(fh < 0)
+ mode = "default";
+ }
+
+ if(mode == "default")
+ {
+ QuickMenu_Buffer = buf_create();
+ if(QuickMenu_Buffer < 0)
+ return false;
+
+ QuickMenu_Default(submenu);
+ }
+ else if(mode == "file")
+ {
+ QuickMenu_Buffer = buf_create();
+ if(QuickMenu_Buffer < 0)
+ {
+ fclose(fh);
+ return false;
+ }
+
+ QuickMenu_Buffer_Size = 0;
+ while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES)
+ {
+ // first skip invalid entries, so we don't check them anymore
+ float argc;
+ argc = tokenize_console(s);
+ if(argc == 0 || argv(0) == "")
+ continue;
+ if(argc == 1)
+ QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+ else if(argc == 2)
+ {
+ if(argv(1) == "")
+ continue;
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
+ ++QuickMenu_Buffer_Size;
+ QuickMenu_Buffer_Set(QM_TAG_COMMAND, argv(1));
+ }
+ else if(argc == 3)
+ {
+ // check for special keywords
+ float teamplayers = 0, without_me = 0;
+ switch(argv(2))
+ {
+ case "ALLPLAYERS_BUT_ME": without_me = 1; // fall through
+ case "ALLPLAYERS": teamplayers = 0; break;
+ case "OWNTEAMPLAYERS_BUT_ME": without_me = 1; // fall through
+ case "OWNTEAMPLAYERS": teamplayers = 1; break;
+ case "ENEMYTEAMPLAYERS": teamplayers = 2; break;
+ default: continue;
+ }
+
+ if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES)
+ {
+ QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+ ++QuickMenu_Buffer_Size;
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); // put PLCOMMAND arguments in the title string
+ ++QuickMenu_Buffer_Size;
+ QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, argv(1));
+ ++QuickMenu_Buffer_Size;
+ QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
+ }
+ }
+ ++QuickMenu_Buffer_Size;
+ }
+ fclose(fh);
+ }
+ else
+ {
+ LOG_WARNINGF("Unrecognized mode %s\n", mode);
+ return false;
+ }
+
+ if (QuickMenu_Buffer_Size <= 0)
+ {
+ buf_del(QuickMenu_Buffer);
+ QuickMenu_Buffer = -1;
+ return false;
+ }
+
+ if(mode == "file")
+ QuickMenu_Page_Load(submenu, 0);
+ else
+ QuickMenu_Page_Load("", 0);
+
+ hud_panel_quickmenu = 1;
+ if(autocvar_hud_cursormode)
+ setcursormode(1);
+ hudShiftState = 0;
+
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+ return true;
+}
+
+void QuickMenu_Buffer_Close()
+{
+ if (QuickMenu_Buffer >= 0)
+ {
+ buf_del(QuickMenu_Buffer);
+ QuickMenu_Buffer = -1;
+ QuickMenu_Buffer_Size = 0;
+ }
+}
+
+void QuickMenu_Close()
+{
+ if (QuickMenu_CurrentSubMenu)
+ strunzone(QuickMenu_CurrentSubMenu);
+ QuickMenu_CurrentSubMenu = string_null;
+ int i;
+ for (i = 0; i < QUICKMENU_MAXLINES; ++i)
+ QuickMenu_Page_ClearEntry(i);
+ QuickMenu_Page_Entries = 0;
+ hud_panel_quickmenu = 0;
+ mouseClicked = 0;
+ prevMouseClicked = 0;
+ QuickMenu_Buffer_Close();
+
+ if(autocvar_hud_cursormode)
+ if(!mv_active)
+ setcursormode(0);
+}
+
+// It assumes submenu open tag is already detected
+void QuickMenu_skip_submenu(string submenu)
+{
+ string s, z_submenu;
+ z_submenu = strzone(submenu);
+ for(++QuickMenu_Buffer_Index ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+ {
+ s = QuickMenu_Buffer_Get();
+ if(substring(s, 0, 1) != QM_TAG_SUBMENU)
+ continue;
+ if(substring(s, 1, -1) == z_submenu) // submenu end
+ break;
+ QuickMenu_skip_submenu(substring(s, 1, -1));
+ }
+ strunzone(z_submenu);
+}
+
+bool QuickMenu_IsOpened()
+{
+ return (QuickMenu_Page_Entries > 0);
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me);
+bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
+{
+ TC(int, teamplayers); TC(bool, without_me);
+ int i;
+ for(i = 0; i < QUICKMENU_MAXLINES; ++i)
+ QuickMenu_Page_ClearEntry(i);
+ QuickMenu_Buffer_Close();
+
+ QuickMenu_Buffer = buf_create();
+ if(QuickMenu_Buffer < 0)
+ return false;
+
+ HUD_Quickmenu_PlayerListEntries(cmd, teamplayers, without_me);
+
+ if(QuickMenu_Buffer_Size <= 0)
+ {
+ buf_del(QuickMenu_Buffer);
+ QuickMenu_Buffer = -1;
+ return false;
+ }
+ return true;
+}
+
+// new_page 0 means page 0, new_page != 0 means next page
+int QuickMenu_Buffer_Index_Prev;
+bool QuickMenu_Page_Load(string target_submenu, bool new_page)
+{
+ TC(bool, new_page);
+ string s = string_null, cmd = string_null, z_submenu;
+
+ if (new_page == 0)
+ QuickMenu_Page = 0;
+ else
+ ++QuickMenu_Page;
+
+ z_submenu = strzone(target_submenu);
+ if (QuickMenu_CurrentSubMenu)
+ strunzone(QuickMenu_CurrentSubMenu);
+ QuickMenu_CurrentSubMenu = strzone(z_submenu);
+
+ QuickMenu_IsLastPage = true;
+ QuickMenu_Page_Entries = 0;
+
+ QuickMenu_Buffer_Index = 0;
+ if (z_submenu != "")
+ {
+ // skip everything until the submenu open tag is found
+ for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+ {
+ s = QuickMenu_Buffer_Get();
+ if(substring(s, 0, 1) == QM_TAG_SUBMENU && substring(s, 1, -1) == z_submenu)
+ {
+ // printf("^3 beginning of %s\n", z_submenu);
+ ++QuickMenu_Buffer_Index;
+ break; // target_submenu found!
+ }
+ // printf("^1 skipping %s\n", s);
+ }
+ if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
+ LOG_WARNINGF("Couldn't find submenu \"%s\"\n", z_submenu);
+ }
+
+ // only the last page can contain up to QUICKMENU_MAXLINES entries
+ // the other ones contain only (QUICKMENU_MAXLINES - 2) entries
+ // so that the panel can show an empty row and "Continue..."
+ float first_entry = QuickMenu_Page * (QUICKMENU_MAXLINES - 2);
+ int entry_num = 0; // counts entries in target_submenu
+ for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+ {
+ s = QuickMenu_Buffer_Get();
+
+ if(z_submenu != "" && substring(s, 1, -1) == z_submenu)
+ {
+ // printf("^3 end of %s\n", z_submenu);
+ break;
+ }
+
+ if(entry_num >= first_entry)
+ {
+ ++QuickMenu_Page_Entries;
+ if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES - 2)
+ QuickMenu_Buffer_Index_Prev = QuickMenu_Buffer_Index;
+ else if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES)
+ {
+ QuickMenu_Page_ClearEntry(QUICKMENU_MAXLINES - 1);
+ QuickMenu_Buffer_Index = QuickMenu_Buffer_Index_Prev;
+ QuickMenu_IsLastPage = false;
+ break;
+ }
+ }
+
+ // NOTE: entries are loaded starting from 1, not from 0
+ if(substring(s, 0, 1) == QM_TAG_SUBMENU)
+ {
+ if(entry_num >= first_entry)
+ QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), "");
+ QuickMenu_skip_submenu(substring(s, 1, -1));
+ }
+ else if(entry_num >= first_entry && substring(s, 0, 1) == QM_TAG_TITLE)
+ {
+ ++QuickMenu_Buffer_Index;
+ cmd = QuickMenu_Buffer_Get();
+ string command_code = substring(cmd, 0, 1);
+ if(command_code == QM_TAG_COMMAND)
+ cmd = substring(cmd, 1, -1);
+ else if(command_code == QM_TAG_PLCOMMAND)
+ {
+ // throw away the current quickmenu buffer and load a new one
+ cmd = substring(cmd, 1, -1);
+ strunzone(z_submenu);
+ if(HUD_Quickmenu_PlayerListEntries_Create(cmd, stof(substring(s, 1, 1)), stof(substring(s, 2, 1))))
+ return QuickMenu_Page_Load("", 0);
+ QuickMenu_Close();
+ return false;
+ }
+
+ tokenize_console(cmd);
+ QuickMenu_Page_Command_Type[QuickMenu_Page_Entries] = (argv(1) && argv(0) == "toggle");
+
+ QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), cmd);
+ }
+
+ ++entry_num;
+ }
+ strunzone(z_submenu);
+ if (QuickMenu_Page_Entries == 0)
+ {
+ QuickMenu_Close();
+ return false;
+ }
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+ return true;
+}
+
+bool QuickMenu_ActionForNumber(int num)
+{
+ TC(int, num);
+ if (!QuickMenu_IsLastPage)
+ {
+ if (num < 0 || num >= QUICKMENU_MAXLINES)
+ return false;
+ if (num == QUICKMENU_MAXLINES - 1)
+ return false;
+ if (num == 0)
+ {
+ QuickMenu_Page_Load(QuickMenu_CurrentSubMenu, +1);
+ return false;
+ }
+ } else if (num <= 0 || num > QuickMenu_Page_Entries)
+ return false;
+
+ if (QuickMenu_Page_Command[num] != "")
+ {
+ localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n"));
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
+ return true;
+ }
+ if (QuickMenu_Page_Description[num] != "")
+ QuickMenu_Page_Load(QuickMenu_Page_Description[num], 0);
+ return false;
+}
+
+void QuickMenu_Page_ActiveEntry(int entry_num)
+{
+ TC(int, entry_num);
+ QuickMenu_Page_ActivatedEntry = entry_num;
+ QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
+ if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
+ {
+ bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
+ // toggle commands don't close the quickmenu
+ if(QuickMenu_Page_Command_Type[QuickMenu_Page_ActivatedEntry] == 1)
+ QuickMenu_Page_ActivatedEntry_Close = false;
+ else
+ QuickMenu_Page_ActivatedEntry_Close = (f && !(hudShiftState & S_CTRL));
+ }
+ else
+ QuickMenu_Page_ActivatedEntry_Close = (!(hudShiftState & S_CTRL));
+}
+
+bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
+{
+ TC(int, bInputType);
+ // we only care for keyboard events
+ if(bInputType == 2)
+ return false;
+
+ if(!QuickMenu_IsOpened() || autocvar__hud_configure || mv_active)
+ return false;
+
+ if(bInputType == 3)
+ {
+ mousepos.x = nPrimary;
+ mousepos.y = nSecondary;
+ return true;
+ }
+
+ // allow console bind to work
+ string con_keys;
+ float keys;
+ con_keys = findkeysforcommand("toggleconsole", 0);
+ keys = tokenize(con_keys); // findkeysforcommand returns data for this
+
+ bool hit_con_bind = false;
+ int i;
+ for (i = 0; i < keys; ++i)
+ {
+ if(nPrimary == stof(argv(i)))
+ hit_con_bind = true;
+ }
+
+ if(bInputType == 0) {
+ if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+ }
+ else if(bInputType == 1) {
+ if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+ if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+ if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+ }
+
+ if(nPrimary == K_ESCAPE)
+ {
+ if (bInputType == 1)
+ return true;
+ QuickMenu_Close();
+ }
+ else if(nPrimary >= '0' && nPrimary <= '9')
+ {
+ if (bInputType == 1)
+ return true;
+ QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary)));
+ }
+ if(nPrimary == K_MOUSE1)
+ {
+ if(bInputType == 0) // key pressed
+ mouseClicked |= S_MOUSE1;
+ else if(bInputType == 1) // key released
+ mouseClicked -= (mouseClicked & S_MOUSE1);
+ }
+ else if(nPrimary == K_MOUSE2)
+ {
+ if(bInputType == 0) // key pressed
+ mouseClicked |= S_MOUSE2;
+ else if(bInputType == 1) // key released
+ mouseClicked -= (mouseClicked & S_MOUSE2);
+ }
+ else if(hit_con_bind)
+ return false;
+
+ return true;
+}
+
+void QuickMenu_Mouse()
+{
+ if(mv_active) return;
+
+ if(!mouseClicked)
+ if(prevMouseClicked & S_MOUSE2)
+ {
+ QuickMenu_Close();
+ return;
+ }
+
+ if(!autocvar_hud_cursormode)
+ {
+ mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
+
+ mousepos.x = bound(0, mousepos.x, vid_conwidth);
+ mousepos.y = bound(0, mousepos.y, vid_conheight);
+ }
+
+ HUD_Panel_UpdateCvars();
+
+ if(panel_bg_padding)
+ {
+ panel_pos += '1 1 0' * panel_bg_padding;
+ panel_size -= '2 2 0' * panel_bg_padding;
+ }
+
+ float first_entry_pos, entries_height;
+ vector fontsize;
+ fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
+ first_entry_pos = panel_pos.y + ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
+ entries_height = panel_size.y - ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y);
+
+ if (mousepos.x >= panel_pos.x && mousepos.y >= first_entry_pos && mousepos.x <= panel_pos.x + panel_size.x && mousepos.y <= first_entry_pos + entries_height)
+ {
+ float entry_num;
+ entry_num = floor((mousepos.y - first_entry_pos) / fontsize.y);
+ if (QuickMenu_IsLastPage || entry_num != QUICKMENU_MAXLINES - 2)
+ {
+ panel_pos.y = first_entry_pos + entry_num * fontsize.y;
+ vector color;
+ if(mouseClicked & S_MOUSE1)
+ color = '0.5 1 0.5';
+ else if(hudShiftState & S_CTRL)
+ color = '1 1 0.3';
+ else
+ color = '1 1 1';
+ drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, color, .2, DRAWFLAG_NORMAL);
+
+ if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
+ QuickMenu_Page_ActiveEntry((entry_num < QUICKMENU_MAXLINES - 1) ? entry_num + 1 : 0);
+ }
+ }
+
+ draw_cursor_normal(mousepos, '1 1 1', 0.8);
+
+ prevMouseClicked = mouseClicked;
+}
+
+void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector fontsize)
+{
+ string entry;
+ float offset;
+ float desc_width = panel_size.x;
+ if(option)
+ {
+ string pic = strcat(hud_skin_path, "/", option);
+ if(precache_pic(pic) == "")
+ pic = strcat("gfx/hud/default/", option);
+ vector option_size = '1 1 0' * fontsize.y * 0.8;
+ desc_width -= option_size.x;
+ drawpic(pos + eX * desc_width + eY * (fontsize.y - option_size.y) / 2, pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
+ desc_width -= fontsize.x / 4;
+ }
+ entry = textShortenToWidth(desc, desc_width, fontsize, stringwidth_colors);
+ if (autocvar_hud_panel_quickmenu_align > 0)
+ {
+ float real_desc_width = stringwidth_colors(entry, fontsize);
+ offset = (desc_width - real_desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
+
+ if(option)
+ {
+ // when there's enough room align description regardless the checkbox
+ float extra_offset = (panel_size.x - desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
+ if(offset + real_desc_width + extra_offset < desc_width)
+ offset += extra_offset;
+ else
+ offset = max(0, desc_width - real_desc_width);
+ }
+ drawcolorcodedstring(pos + eX * offset, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+ }
+ else
+ drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+}
+
+void HUD_QuickMenu()
+{
+ if(!autocvar__hud_configure)
+ {
+ if (hud_configure_prev && hud_configure_prev != -1)
+ QuickMenu_Close();
+
+ if(!hud_draw_maximized) return;
+ if(mv_active) return;
+ //if(!autocvar_hud_panel_quickmenu) return;
+ if(!hud_panel_quickmenu) return;
+
+ if(QuickMenu_TimeOut)
+ if(time > QuickMenu_TimeOut)
+ {
+ QuickMenu_Close();
+ return;
+ }
+ }
+ else
+ {
+ if(!QuickMenu_IsOpened())
+ {
+ QuickMenu_Page_Entries = 1;
+ QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
+ ++QuickMenu_Page_Entries;
+ QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
+ ++QuickMenu_Page_Entries;
+ // although real command doesn't matter here, it must not be empty
+ // otherwise the entry is displayed like a submenu
+ for (; QuickMenu_Page_Entries < QUICKMENU_MAXLINES - 1; ++QuickMenu_Page_Entries)
+ QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Command%d"), QuickMenu_Page_Entries), "-");
+ ++QuickMenu_Page_Entries;
+ QuickMenu_Page_ClearEntry(QuickMenu_Page_Entries);
+ QuickMenu_IsLastPage = false;
+ }
+ }
+
+ HUD_Panel_UpdateCvars();
+
+ HUD_Panel_DrawBg(1);
+
+ if(panel_bg_padding)
+ {
+ panel_pos += '1 1 0' * panel_bg_padding;
+ panel_size -= '2 2 0' * panel_bg_padding;
+ }
+
+ int i;
+ vector fontsize;
+ string color;
+ fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
+
+ if (!QuickMenu_IsLastPage)
+ {
+ color = "^5";
+ HUD_Quickmenu_DrawEntry(panel_pos + eY * (panel_size.y - fontsize.y), sprintf("%d: %s%s", 0, color, _("Continue...")), string_null, fontsize);
+ }
+ else
+ panel_pos.y += ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
+
+ for (i = 1; i <= QuickMenu_Page_Entries; ++i) {
+ if (QuickMenu_Page_Description[i] == "")
+ break;
+ string option = string_null;
+ if (QuickMenu_Page_Command[i] == "")
+ color = "^4";
+ else
+ {
+ color = "^3";
+ if(QuickMenu_Page_Command_Type[i] == 1) // toggle command
+ {
+ int end = strstrofs(QuickMenu_Page_Command[i], ";", 0);
+ if(end < 0)
+ tokenize_console(QuickMenu_Page_Command[i]);
+ else
+ tokenize_console(substring(QuickMenu_Page_Command[i], 0, end));
+
+ //if(argv(1) && argv(0) == "toggle") // already checked
+ {
+ // "enable feature xxx" "toggle xxx" (or "toggle xxx 1 0")
+ // "disable feature xxx" "toggle xxx 0 1"
+ float ON_value = 1, OFF_value = 0;
+ if(argv(2))
+ ON_value = stof(argv(2));
+
+ if(argv(3))
+ OFF_value = stof(argv(3));
+ else
+ OFF_value = !ON_value;
+
+ float value = cvar(argv(1));
+ if(value == ON_value)
+ option = "checkbox_checked";
+ else if(value == OFF_value)
+ option = "checkbox_empty";
+ else
+ option = "checkbox_undefined";
+ }
+ }
+ }
+ HUD_Quickmenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Page_Description[i]), option, fontsize);
+
+ if(QuickMenu_Page_ActivatedEntry_Time && time < QuickMenu_Page_ActivatedEntry_Time
+ && QuickMenu_Page_ActivatedEntry == i)
+ drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
+
+ panel_pos.y += fontsize.y;
+ }
+
+ if(QuickMenu_Page_ActivatedEntry >= 0 && time >= QuickMenu_Page_ActivatedEntry_Time)
+ {
+ if(!QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
+ {
+ bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
+ if(f && QuickMenu_Page_ActivatedEntry_Close)
+ QuickMenu_Close();
+ }
+ else if(QuickMenu_Page_ActivatedEntry_Close)
+ QuickMenu_Close();
+ QuickMenu_Page_ActivatedEntry = -1;
+ QuickMenu_Page_ActivatedEntry_Time = 0;
+ }
+}
+
+
+#define QUICKMENU_SMENU(submenu,eng_submenu) { \
+ if(target_submenu == eng_submenu && target_submenu_found) \
+ return; /* target_submenu entries are now loaded, exit */ \
+ if(QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) \
+ QuickMenu_Buffer_Set(QM_TAG_SUBMENU, submenu); \
+ ++QuickMenu_Buffer_Size; \
+ if(target_submenu == eng_submenu && !target_submenu_found) { \
+ QuickMenu_Buffer_Size = 0; /* enable load of next entries */ \
+ target_submenu_found = true; \
+ } \
+}
+
+#define QUICKMENU_ENTRY(title,command) { \
+ if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
+ { \
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
+ ++QuickMenu_Buffer_Size; \
+ QuickMenu_Buffer_Set(QM_TAG_COMMAND, command); \
+ } \
+ ++QuickMenu_Buffer_Size; \
+}
+
+#define QUICKMENU_SMENU_PL(submenu,eng_submenu,command,teamplayers,without_me) { \
+ if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES) {\
+ QUICKMENU_SMENU(submenu,eng_submenu) \
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); \
+ ++QuickMenu_Buffer_Size; \
+ QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, command); \
+ ++QuickMenu_Buffer_Size; \
+ QUICKMENU_SMENU(submenu,eng_submenu) \
+ } \
+}
+
+
+
+// useful to Translate a string inside the Command
+#define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
+ if(prvm_language == "en") \
+ QUICKMENU_ENTRY(title, sprintf(command, text)) \
+ else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
+ QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
+ else \
+ QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
+{
+ TC(int, teamplayers); TC(bool, without_me);
+ entity pl;
+ if(teamplayers && !team_count)
+ return;
+
+ for(pl = players.sort_next; pl; pl = pl.sort_next)
+ {
+ if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
+ continue;
+ if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
+ continue;
+ if(without_me && pl.sv_entnum == player_localnum)
+ continue;
+ QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum)))
+ }
+
+ return;
+}
+
+
+// Specifying target_submenu, this function only loads entries inside target_submenu
+// NOTE: alternatively we could have loaded the whole default quickmenu and
+// then called QuickMenu_Page_Load(target_submenu, 0);
+// but this sytem is more reliable since we can always refer to target_submenu
+// with the English title even if a translation is active
+void QuickMenu_Default(string target_submenu)
+{
+ bool target_submenu_found = false;
+ if(target_submenu != "")
+ QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
+
+ QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^hi / good luck")), "say %s", "hi / good luck and have fun", CTX(_("QMCMD^hi / good luck and have fun")))
+ QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+
+ if(teamplay)
+ {
+ QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^quad soon")), "say_team %s", "quad soon", CTX(_("QMCMD^quad soon")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^free item, icon")), "say_team %s; g_waypointsprite_team_here_p", "free item %x^7 (l:%y^7)", CTX(_("QMCMD^free item %x^7 (l:%y^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^took item, icon")), "say_team %s; g_waypointsprite_team_here", "took item (l:%l^7)", CTX(_("QMCMD^took item (l:%l^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^negative")), "say_team %s", "negative", CTX(_("QMCMD^negative")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^positive")), "say_team %s", "positive", CTX(_("QMCMD^positive")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^need help, icon")), "say_team %s; g_waypointsprite_team_helpme; cmd voice needhelp", "need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^enemy seen, icon")), "say_team %s; g_waypointsprite_team_danger_p; cmd voice incoming", "enemy seen (l:%y^7)", CTX(_("QMCMD^enemy seen (l:%y^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^flag seen, icon")), "say_team %s; g_waypointsprite_team_here_p; cmd voice seenflag", "flag seen (l:%y^7)", CTX(_("QMCMD^flag seen (l:%y^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^defending, icon")), "say_team %s; g_waypointsprite_team_here", "defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^roaming, icon")), "say_team %s; g_waypointsprite_team_here", "roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^attacking, icon")), "say_team %s; g_waypointsprite_team_here", "attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^killed flag, icon")), "say_team %s; g_waypointsprite_team_here_p", "killed flagcarrier (l:%y^7)", CTX(_("QMCMD^killed flagcarrier (l:%y^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^dropped flag, icon")), "say_team %s; g_waypointsprite_team_here_d", "dropped flag (l:%d^7)", CTX(_("QMCMD^dropped flag (l:%d^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop gun, icon")), "say_team %s; g_waypointsprite_team_here; wait; dropweapon", "dropped gun %w^7 (l:%l^7)", CTX(_("QMCMD^dropped gun %w^7 (l:%l^7)")))
+ QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop flag/key, icon")), "say_team %s; g_waypointsprite_team_here; wait; use", "dropped flag/key %w^7 (l:%l^7)", CTX(_("QMCMD^dropped flag/key %w^7 (l:%l^7)")))
+ QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+ }
+
+ QUICKMENU_SMENU_PL(CTX(_("QMCMD^Send private message to")), "Send private message to", "commandmode tell \"%s^7\"", 0, 1)
+
+ QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+ QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person view")), "toggle chase_active")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Player models like mine")), "toggle cl_forceplayermodels")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Names above players")), "toggle hud_shownames")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Crosshair per weapon")), "toggle crosshair_per_weapon")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^FPS")), "toggle hud_panel_engineinfo")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Net graph")), "toggle shownetgraph")
+ QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+
+ QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Hit sound")), "toggle cl_hitsound")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Chat sound")), "toggle con_chatsound")
+ QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+
+ if(spectatee_status > 0)
+ {
+ QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^1st person")), "chase_active 0; -use")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person around player")), "chase_active 1; +use")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person behind")), "chase_active 1; -use")
+ QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+ }
+
+ if(spectatee_status == -1)
+ {
+ QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Increase speed")), "weapnext")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Decrease speed")), "weapprev")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision off")), "+use")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision on")), "-use")
+ QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+ }
+
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Fullscreen")), "toggle vid_fullscreen; vid_restart")
+ if(prvm_language != "en")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Translate chat messages")), "toggle hud_panel_quickmenu_translatecommands")
+ QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+
+ QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Restart the map")), "vcall restart")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^End match")), "vcall endmatch")
+ if(STAT(TIMELIMIT) > 0)
+ {
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
+ }
+ if(teamplay)
+ QUICKMENU_ENTRY(CTX(_("QMCMD^Shuffle teams")), "vcall shuffleteams")
+ QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+
+ if(target_submenu != "" && !target_submenu_found)
+ {
+ LOG_WARNINGF("Couldn't find submenu \"%s\"\n", target_submenu);
+ if(prvm_language != "en")
+ LOG_WARNINGF("^3Warning: submenu must be in English\n", target_submenu);
+ QuickMenu_Buffer_Size = 0;
+ }
+}
+#undef QUICKMENU_SMENU
+#undef QUICKMENU_ENTRY
+#undef QUICKMENU_ENTRY_TC
#pragma once
#include "../panel.qh"
+
+bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
+bool QuickMenu_IsOpened();
+void QuickMenu_Mouse();
#include "hud/all.qh"
#include "mapvoting.qh"
#include "mutators/events.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
#include "scoreboard.qh"
#include "shownames.qh"
#include <common/t_items.qh>
--- /dev/null
+// generated file; do not modify
-#include "../lib/_all.inc"
+#include <lib/_all.inc>
#include "_all.qh"
-#include "../common/effects/qc/all.qc"
+#include "_mod.inc"
+#include "commands/_mod.inc"
+#include "hud/_mod.inc"
+#include "mutators/_mod.inc"
+#include "weapons/_mod.inc"
-#include "announcer.qc"
-#include "bgmscript.qc"
-#include "csqcmodel_hooks.qc"
-#include "hud/all.qc"
-#include "main.qc"
-#include "mapvoting.qc"
-#include "miscfunctions.qc"
-#include "player_skeleton.qc"
-#include "scoreboard.qc"
-#include "shownames.qc"
-#include "teamradar.qc"
-#include "view.qc"
-#include "wall.qc"
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
-#include "commands/all.qc"
+#include <lib/csqcmodel/cl_model.qc>
+#include <lib/csqcmodel/cl_player.qc>
+#include <lib/csqcmodel/interpolate.qc>
-#include "weapons/projectile.qc" // TODO
-
-#include "../common/_all.inc"
-
-#include "../lib/csqcmodel/cl_model.qc"
-#include "../lib/csqcmodel/cl_player.qc"
-#include "../lib/csqcmodel/interpolate.qc"
-
-#include "../lib/warpzone/anglestransform.qc"
-#include "../lib/warpzone/client.qc"
-#include "../lib/warpzone/common.qc"
-#include "../lib/warpzone/server.qc"
-#include "../lib/warpzone/util_server.qc"
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/client.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
#if BUILD_MOD
#include "../../mod/client/progs.inc"
+++ /dev/null
-#include "quickmenu.qh"
-
-#include <common/ent_cs.qh>
-#include "hud/all.qh"
-#include "mapvoting.qh"
-
-// QUICKMENU_MAXLINES must be <= 10
-const int QUICKMENU_MAXLINES = 10;
-// visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
-string QuickMenu_Page_Command[QUICKMENU_MAXLINES];
-string QuickMenu_Page_Description[QUICKMENU_MAXLINES];
-int QuickMenu_Page_Command_Type[QUICKMENU_MAXLINES];
-int QuickMenu_Page_Entries;
-int QuickMenu_Page;
-int QuickMenu_Page_ActivatedEntry = -1;
-bool QuickMenu_Page_ActivatedEntry_Close;
-float QuickMenu_Page_ActivatedEntry_Time;
-bool QuickMenu_IsLastPage;
-// all the entries are loaded into QuickMenu_Buffer
-// each entry (submenu or command) is composed of 2 entries
-const int QUICKMENU_MAXENTRIES = 256;
-const int QUICKMENU_BUFFER_MAXENTRIES = 2 * QUICKMENU_MAXENTRIES;
-int QuickMenu_Buffer = -1;
-int QuickMenu_Buffer_Size;
-int QuickMenu_Buffer_Index;
-string QuickMenu_CurrentSubMenu;
-float QuickMenu_TimeOut;
-
-// QuickMenu_Buffer are labeled with these tags
-#define QM_TAG_TITLE "T"
-#define QM_TAG_SUBMENU "S"
-#define QM_TAG_COMMAND "C"
-#define QM_TAG_PLCOMMAND "P"
-
-#define QuickMenu_Buffer_Set(tag, string) bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat(tag, string))
-#define QuickMenu_Buffer_Get() bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index)
-
-// if s1 is not empty s will be displayed as command otherwise as submenu
-void QuickMenu_Page_LoadEntry(int i, string s, string s1)
-{
- TC(int, i);
- //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
- if (QuickMenu_Page_Description[i])
- strunzone(QuickMenu_Page_Description[i]);
- QuickMenu_Page_Description[i] = strzone(s);
- if (QuickMenu_Page_Command[i])
- strunzone(QuickMenu_Page_Command[i]);
- QuickMenu_Page_Command[i] = strzone(s1);
-}
-
-void QuickMenu_Page_ClearEntry(int i)
-{
- TC(int, i);
- if (QuickMenu_Page_Description[i])
- strunzone(QuickMenu_Page_Description[i]);
- QuickMenu_Page_Description[i] = string_null;
- if (QuickMenu_Page_Command[i])
- strunzone(QuickMenu_Page_Command[i]);
- QuickMenu_Page_Command[i] = string_null;
-}
-
-float QuickMenu_Page_Load(string target_submenu, float new_page);
-void QuickMenu_Default(string submenu);
-bool QuickMenu_Open(string mode, string submenu)
-{
- int fh = -1;
- string s;
-
- if(mode == "")
- {
- if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
- mode = "default";
- else
- mode = "file";
- }
-
- if(mode == "file")
- {
- if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
- LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
- else
- {
- fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
- if(fh < 0)
- LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
- }
- if(fh < 0)
- mode = "default";
- }
-
- if(mode == "default")
- {
- QuickMenu_Buffer = buf_create();
- if(QuickMenu_Buffer < 0)
- return false;
-
- QuickMenu_Default(submenu);
- }
- else if(mode == "file")
- {
- QuickMenu_Buffer = buf_create();
- if(QuickMenu_Buffer < 0)
- {
- fclose(fh);
- return false;
- }
-
- QuickMenu_Buffer_Size = 0;
- while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES)
- {
- // first skip invalid entries, so we don't check them anymore
- float argc;
- argc = tokenize_console(s);
- if(argc == 0 || argv(0) == "")
- continue;
- if(argc == 1)
- QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
- else if(argc == 2)
- {
- if(argv(1) == "")
- continue;
- QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
- ++QuickMenu_Buffer_Size;
- QuickMenu_Buffer_Set(QM_TAG_COMMAND, argv(1));
- }
- else if(argc == 3)
- {
- // check for special keywords
- float teamplayers = 0, without_me = 0;
- switch(argv(2))
- {
- case "ALLPLAYERS_BUT_ME": without_me = 1; // fall through
- case "ALLPLAYERS": teamplayers = 0; break;
- case "OWNTEAMPLAYERS_BUT_ME": without_me = 1; // fall through
- case "OWNTEAMPLAYERS": teamplayers = 1; break;
- case "ENEMYTEAMPLAYERS": teamplayers = 2; break;
- default: continue;
- }
-
- if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES)
- {
- QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
- ++QuickMenu_Buffer_Size;
- QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); // put PLCOMMAND arguments in the title string
- ++QuickMenu_Buffer_Size;
- QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, argv(1));
- ++QuickMenu_Buffer_Size;
- QuickMenu_Buffer_Set(QM_TAG_SUBMENU, argv(0));
- }
- }
- ++QuickMenu_Buffer_Size;
- }
- fclose(fh);
- }
- else
- {
- LOG_WARNINGF("Unrecognized mode %s\n", mode);
- return false;
- }
-
- if (QuickMenu_Buffer_Size <= 0)
- {
- buf_del(QuickMenu_Buffer);
- QuickMenu_Buffer = -1;
- return false;
- }
-
- if(mode == "file")
- QuickMenu_Page_Load(submenu, 0);
- else
- QuickMenu_Page_Load("", 0);
-
- hud_panel_quickmenu = 1;
- if(autocvar_hud_cursormode)
- setcursormode(1);
- hudShiftState = 0;
-
- QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
- return true;
-}
-
-void QuickMenu_Buffer_Close()
-{
- if (QuickMenu_Buffer >= 0)
- {
- buf_del(QuickMenu_Buffer);
- QuickMenu_Buffer = -1;
- QuickMenu_Buffer_Size = 0;
- }
-}
-
-void QuickMenu_Close()
-{
- if (QuickMenu_CurrentSubMenu)
- strunzone(QuickMenu_CurrentSubMenu);
- QuickMenu_CurrentSubMenu = string_null;
- int i;
- for (i = 0; i < QUICKMENU_MAXLINES; ++i)
- QuickMenu_Page_ClearEntry(i);
- QuickMenu_Page_Entries = 0;
- hud_panel_quickmenu = 0;
- mouseClicked = 0;
- prevMouseClicked = 0;
- QuickMenu_Buffer_Close();
-
- if(autocvar_hud_cursormode)
- if(!mv_active)
- setcursormode(0);
-}
-
-// It assumes submenu open tag is already detected
-void QuickMenu_skip_submenu(string submenu)
-{
- string s, z_submenu;
- z_submenu = strzone(submenu);
- for(++QuickMenu_Buffer_Index ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
- {
- s = QuickMenu_Buffer_Get();
- if(substring(s, 0, 1) != QM_TAG_SUBMENU)
- continue;
- if(substring(s, 1, -1) == z_submenu) // submenu end
- break;
- QuickMenu_skip_submenu(substring(s, 1, -1));
- }
- strunzone(z_submenu);
-}
-
-bool QuickMenu_IsOpened()
-{
- return (QuickMenu_Page_Entries > 0);
-}
-
-void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me);
-bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
-{
- TC(int, teamplayers); TC(bool, without_me);
- int i;
- for(i = 0; i < QUICKMENU_MAXLINES; ++i)
- QuickMenu_Page_ClearEntry(i);
- QuickMenu_Buffer_Close();
-
- QuickMenu_Buffer = buf_create();
- if(QuickMenu_Buffer < 0)
- return false;
-
- HUD_Quickmenu_PlayerListEntries(cmd, teamplayers, without_me);
-
- if(QuickMenu_Buffer_Size <= 0)
- {
- buf_del(QuickMenu_Buffer);
- QuickMenu_Buffer = -1;
- return false;
- }
- return true;
-}
-
-// new_page 0 means page 0, new_page != 0 means next page
-int QuickMenu_Buffer_Index_Prev;
-bool QuickMenu_Page_Load(string target_submenu, bool new_page)
-{
- TC(bool, new_page);
- string s = string_null, cmd = string_null, z_submenu;
-
- if (new_page == 0)
- QuickMenu_Page = 0;
- else
- ++QuickMenu_Page;
-
- z_submenu = strzone(target_submenu);
- if (QuickMenu_CurrentSubMenu)
- strunzone(QuickMenu_CurrentSubMenu);
- QuickMenu_CurrentSubMenu = strzone(z_submenu);
-
- QuickMenu_IsLastPage = true;
- QuickMenu_Page_Entries = 0;
-
- QuickMenu_Buffer_Index = 0;
- if (z_submenu != "")
- {
- // skip everything until the submenu open tag is found
- for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
- {
- s = QuickMenu_Buffer_Get();
- if(substring(s, 0, 1) == QM_TAG_SUBMENU && substring(s, 1, -1) == z_submenu)
- {
- // printf("^3 beginning of %s\n", z_submenu);
- ++QuickMenu_Buffer_Index;
- break; // target_submenu found!
- }
- // printf("^1 skipping %s\n", s);
- }
- if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
- LOG_WARNINGF("Couldn't find submenu \"%s\"\n", z_submenu);
- }
-
- // only the last page can contain up to QUICKMENU_MAXLINES entries
- // the other ones contain only (QUICKMENU_MAXLINES - 2) entries
- // so that the panel can show an empty row and "Continue..."
- float first_entry = QuickMenu_Page * (QUICKMENU_MAXLINES - 2);
- int entry_num = 0; // counts entries in target_submenu
- for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
- {
- s = QuickMenu_Buffer_Get();
-
- if(z_submenu != "" && substring(s, 1, -1) == z_submenu)
- {
- // printf("^3 end of %s\n", z_submenu);
- break;
- }
-
- if(entry_num >= first_entry)
- {
- ++QuickMenu_Page_Entries;
- if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES - 2)
- QuickMenu_Buffer_Index_Prev = QuickMenu_Buffer_Index;
- else if(QuickMenu_Page_Entries == QUICKMENU_MAXLINES)
- {
- QuickMenu_Page_ClearEntry(QUICKMENU_MAXLINES - 1);
- QuickMenu_Buffer_Index = QuickMenu_Buffer_Index_Prev;
- QuickMenu_IsLastPage = false;
- break;
- }
- }
-
- // NOTE: entries are loaded starting from 1, not from 0
- if(substring(s, 0, 1) == QM_TAG_SUBMENU)
- {
- if(entry_num >= first_entry)
- QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), "");
- QuickMenu_skip_submenu(substring(s, 1, -1));
- }
- else if(entry_num >= first_entry && substring(s, 0, 1) == QM_TAG_TITLE)
- {
- ++QuickMenu_Buffer_Index;
- cmd = QuickMenu_Buffer_Get();
- string command_code = substring(cmd, 0, 1);
- if(command_code == QM_TAG_COMMAND)
- cmd = substring(cmd, 1, -1);
- else if(command_code == QM_TAG_PLCOMMAND)
- {
- // throw away the current quickmenu buffer and load a new one
- cmd = substring(cmd, 1, -1);
- strunzone(z_submenu);
- if(HUD_Quickmenu_PlayerListEntries_Create(cmd, stof(substring(s, 1, 1)), stof(substring(s, 2, 1))))
- return QuickMenu_Page_Load("", 0);
- QuickMenu_Close();
- return false;
- }
-
- tokenize_console(cmd);
- QuickMenu_Page_Command_Type[QuickMenu_Page_Entries] = (argv(1) && argv(0) == "toggle");
-
- QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, substring(s, 1, -1), cmd);
- }
-
- ++entry_num;
- }
- strunzone(z_submenu);
- if (QuickMenu_Page_Entries == 0)
- {
- QuickMenu_Close();
- return false;
- }
- QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
- return true;
-}
-
-bool QuickMenu_ActionForNumber(int num)
-{
- TC(int, num);
- if (!QuickMenu_IsLastPage)
- {
- if (num < 0 || num >= QUICKMENU_MAXLINES)
- return false;
- if (num == QUICKMENU_MAXLINES - 1)
- return false;
- if (num == 0)
- {
- QuickMenu_Page_Load(QuickMenu_CurrentSubMenu, +1);
- return false;
- }
- } else if (num <= 0 || num > QuickMenu_Page_Entries)
- return false;
-
- if (QuickMenu_Page_Command[num] != "")
- {
- localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n"));
- QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
- return true;
- }
- if (QuickMenu_Page_Description[num] != "")
- QuickMenu_Page_Load(QuickMenu_Page_Description[num], 0);
- return false;
-}
-
-void QuickMenu_Page_ActiveEntry(int entry_num)
-{
- TC(int, entry_num);
- QuickMenu_Page_ActivatedEntry = entry_num;
- QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
- if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
- {
- bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
- // toggle commands don't close the quickmenu
- if(QuickMenu_Page_Command_Type[QuickMenu_Page_ActivatedEntry] == 1)
- QuickMenu_Page_ActivatedEntry_Close = false;
- else
- QuickMenu_Page_ActivatedEntry_Close = (f && !(hudShiftState & S_CTRL));
- }
- else
- QuickMenu_Page_ActivatedEntry_Close = (!(hudShiftState & S_CTRL));
-}
-
-bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
-{
- TC(int, bInputType);
- // we only care for keyboard events
- if(bInputType == 2)
- return false;
-
- if(!QuickMenu_IsOpened() || autocvar__hud_configure || mv_active)
- return false;
-
- if(bInputType == 3)
- {
- mousepos.x = nPrimary;
- mousepos.y = nSecondary;
- return true;
- }
-
- // allow console bind to work
- string con_keys;
- float keys;
- con_keys = findkeysforcommand("toggleconsole", 0);
- keys = tokenize(con_keys); // findkeysforcommand returns data for this
-
- bool hit_con_bind = false;
- int i;
- for (i = 0; i < keys; ++i)
- {
- if(nPrimary == stof(argv(i)))
- hit_con_bind = true;
- }
-
- if(bInputType == 0) {
- if(nPrimary == K_ALT) hudShiftState |= S_ALT;
- if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
- if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
- }
- else if(bInputType == 1) {
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- }
-
- if(nPrimary == K_ESCAPE)
- {
- if (bInputType == 1)
- return true;
- QuickMenu_Close();
- }
- else if(nPrimary >= '0' && nPrimary <= '9')
- {
- if (bInputType == 1)
- return true;
- QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary)));
- }
- if(nPrimary == K_MOUSE1)
- {
- if(bInputType == 0) // key pressed
- mouseClicked |= S_MOUSE1;
- else if(bInputType == 1) // key released
- mouseClicked -= (mouseClicked & S_MOUSE1);
- }
- else if(nPrimary == K_MOUSE2)
- {
- if(bInputType == 0) // key pressed
- mouseClicked |= S_MOUSE2;
- else if(bInputType == 1) // key released
- mouseClicked -= (mouseClicked & S_MOUSE2);
- }
- else if(hit_con_bind)
- return false;
-
- return true;
-}
-
-void QuickMenu_Mouse()
-{
- if(mv_active) return;
-
- if(!mouseClicked)
- if(prevMouseClicked & S_MOUSE2)
- {
- QuickMenu_Close();
- return;
- }
-
- if(!autocvar_hud_cursormode)
- {
- mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
- mousepos.x = bound(0, mousepos.x, vid_conwidth);
- mousepos.y = bound(0, mousepos.y, vid_conheight);
- }
-
- HUD_Panel_UpdateCvars();
-
- if(panel_bg_padding)
- {
- panel_pos += '1 1 0' * panel_bg_padding;
- panel_size -= '2 2 0' * panel_bg_padding;
- }
-
- float first_entry_pos, entries_height;
- vector fontsize;
- fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
- first_entry_pos = panel_pos.y + ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
- entries_height = panel_size.y - ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y);
-
- if (mousepos.x >= panel_pos.x && mousepos.y >= first_entry_pos && mousepos.x <= panel_pos.x + panel_size.x && mousepos.y <= first_entry_pos + entries_height)
- {
- float entry_num;
- entry_num = floor((mousepos.y - first_entry_pos) / fontsize.y);
- if (QuickMenu_IsLastPage || entry_num != QUICKMENU_MAXLINES - 2)
- {
- panel_pos.y = first_entry_pos + entry_num * fontsize.y;
- vector color;
- if(mouseClicked & S_MOUSE1)
- color = '0.5 1 0.5';
- else if(hudShiftState & S_CTRL)
- color = '1 1 0.3';
- else
- color = '1 1 1';
- drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, color, .2, DRAWFLAG_NORMAL);
-
- if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
- QuickMenu_Page_ActiveEntry((entry_num < QUICKMENU_MAXLINES - 1) ? entry_num + 1 : 0);
- }
- }
-
- draw_cursor_normal(mousepos, '1 1 1', 0.8);
-
- prevMouseClicked = mouseClicked;
-}
-
-void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector fontsize)
-{
- string entry;
- float offset;
- float desc_width = panel_size.x;
- if(option)
- {
- string pic = strcat(hud_skin_path, "/", option);
- if(precache_pic(pic) == "")
- pic = strcat("gfx/hud/default/", option);
- vector option_size = '1 1 0' * fontsize.y * 0.8;
- desc_width -= option_size.x;
- drawpic(pos + eX * desc_width + eY * (fontsize.y - option_size.y) / 2, pic, option_size, '1 1 1', panel_fg_alpha, DRAWFLAG_ADDITIVE);
- desc_width -= fontsize.x / 4;
- }
- entry = textShortenToWidth(desc, desc_width, fontsize, stringwidth_colors);
- if (autocvar_hud_panel_quickmenu_align > 0)
- {
- float real_desc_width = stringwidth_colors(entry, fontsize);
- offset = (desc_width - real_desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
-
- if(option)
- {
- // when there's enough room align description regardless the checkbox
- float extra_offset = (panel_size.x - desc_width) * min(autocvar_hud_panel_quickmenu_align, 1);
- if(offset + real_desc_width + extra_offset < desc_width)
- offset += extra_offset;
- else
- offset = max(0, desc_width - real_desc_width);
- }
- drawcolorcodedstring(pos + eX * offset, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
- }
- else
- drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
-}
-
-void HUD_QuickMenu()
-{
- if(!autocvar__hud_configure)
- {
- if (hud_configure_prev && hud_configure_prev != -1)
- QuickMenu_Close();
-
- if(!hud_draw_maximized) return;
- if(mv_active) return;
- //if(!autocvar_hud_panel_quickmenu) return;
- if(!hud_panel_quickmenu) return;
-
- if(QuickMenu_TimeOut)
- if(time > QuickMenu_TimeOut)
- {
- QuickMenu_Close();
- return;
- }
- }
- else
- {
- if(!QuickMenu_IsOpened())
- {
- QuickMenu_Page_Entries = 1;
- QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
- ++QuickMenu_Page_Entries;
- QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Submenu%d"), QuickMenu_Page_Entries), "");
- ++QuickMenu_Page_Entries;
- // although real command doesn't matter here, it must not be empty
- // otherwise the entry is displayed like a submenu
- for (; QuickMenu_Page_Entries < QUICKMENU_MAXLINES - 1; ++QuickMenu_Page_Entries)
- QuickMenu_Page_LoadEntry(QuickMenu_Page_Entries, sprintf(_("Command%d"), QuickMenu_Page_Entries), "-");
- ++QuickMenu_Page_Entries;
- QuickMenu_Page_ClearEntry(QuickMenu_Page_Entries);
- QuickMenu_IsLastPage = false;
- }
- }
-
- HUD_Panel_UpdateCvars();
-
- HUD_Panel_DrawBg(1);
-
- if(panel_bg_padding)
- {
- panel_pos += '1 1 0' * panel_bg_padding;
- panel_size -= '2 2 0' * panel_bg_padding;
- }
-
- int i;
- vector fontsize;
- string color;
- fontsize = '1 1 0' * (panel_size.y / QUICKMENU_MAXLINES);
-
- if (!QuickMenu_IsLastPage)
- {
- color = "^5";
- HUD_Quickmenu_DrawEntry(panel_pos + eY * (panel_size.y - fontsize.y), sprintf("%d: %s%s", 0, color, _("Continue...")), string_null, fontsize);
- }
- else
- panel_pos.y += ((QUICKMENU_MAXLINES - QuickMenu_Page_Entries) * fontsize.y) / 2;
-
- for (i = 1; i <= QuickMenu_Page_Entries; ++i) {
- if (QuickMenu_Page_Description[i] == "")
- break;
- string option = string_null;
- if (QuickMenu_Page_Command[i] == "")
- color = "^4";
- else
- {
- color = "^3";
- if(QuickMenu_Page_Command_Type[i] == 1) // toggle command
- {
- int end = strstrofs(QuickMenu_Page_Command[i], ";", 0);
- if(end < 0)
- tokenize_console(QuickMenu_Page_Command[i]);
- else
- tokenize_console(substring(QuickMenu_Page_Command[i], 0, end));
-
- //if(argv(1) && argv(0) == "toggle") // already checked
- {
- // "enable feature xxx" "toggle xxx" (or "toggle xxx 1 0")
- // "disable feature xxx" "toggle xxx 0 1"
- float ON_value = 1, OFF_value = 0;
- if(argv(2))
- ON_value = stof(argv(2));
-
- if(argv(3))
- OFF_value = stof(argv(3));
- else
- OFF_value = !ON_value;
-
- float value = cvar(argv(1));
- if(value == ON_value)
- option = "checkbox_checked";
- else if(value == OFF_value)
- option = "checkbox_empty";
- else
- option = "checkbox_undefined";
- }
- }
- }
- HUD_Quickmenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Page_Description[i]), option, fontsize);
-
- if(QuickMenu_Page_ActivatedEntry_Time && time < QuickMenu_Page_ActivatedEntry_Time
- && QuickMenu_Page_ActivatedEntry == i)
- drawfill(panel_pos, eX * panel_size.x + eY * fontsize.y, '0.5 1 0.5', .2, DRAWFLAG_NORMAL);
-
- panel_pos.y += fontsize.y;
- }
-
- if(QuickMenu_Page_ActivatedEntry >= 0 && time >= QuickMenu_Page_ActivatedEntry_Time)
- {
- if(!QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
- {
- bool f = QuickMenu_ActionForNumber(QuickMenu_Page_ActivatedEntry);
- if(f && QuickMenu_Page_ActivatedEntry_Close)
- QuickMenu_Close();
- }
- else if(QuickMenu_Page_ActivatedEntry_Close)
- QuickMenu_Close();
- QuickMenu_Page_ActivatedEntry = -1;
- QuickMenu_Page_ActivatedEntry_Time = 0;
- }
-}
-
-
-#define QUICKMENU_SMENU(submenu,eng_submenu) { \
- if(target_submenu == eng_submenu && target_submenu_found) \
- return; /* target_submenu entries are now loaded, exit */ \
- if(QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) \
- QuickMenu_Buffer_Set(QM_TAG_SUBMENU, submenu); \
- ++QuickMenu_Buffer_Size; \
- if(target_submenu == eng_submenu && !target_submenu_found) { \
- QuickMenu_Buffer_Size = 0; /* enable load of next entries */ \
- target_submenu_found = true; \
- } \
-}
-
-#define QUICKMENU_ENTRY(title,command) { \
- if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
- { \
- QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
- ++QuickMenu_Buffer_Size; \
- QuickMenu_Buffer_Set(QM_TAG_COMMAND, command); \
- } \
- ++QuickMenu_Buffer_Size; \
-}
-
-#define QUICKMENU_SMENU_PL(submenu,eng_submenu,command,teamplayers,without_me) { \
- if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES) {\
- QUICKMENU_SMENU(submenu,eng_submenu) \
- QuickMenu_Buffer_Set(QM_TAG_TITLE, strcat(ftos(teamplayers), ftos(without_me))); \
- ++QuickMenu_Buffer_Size; \
- QuickMenu_Buffer_Set(QM_TAG_PLCOMMAND, command); \
- ++QuickMenu_Buffer_Size; \
- QUICKMENU_SMENU(submenu,eng_submenu) \
- } \
-}
-
-
-
-// useful to Translate a string inside the Command
-#define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
- if(prvm_language == "en") \
- QUICKMENU_ENTRY(title, sprintf(command, text)) \
- else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
- QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
- else \
- QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
-}
-
-void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
-{
- TC(int, teamplayers); TC(bool, without_me);
- entity pl;
- if(teamplayers && !team_count)
- return;
-
- for(pl = players.sort_next; pl; pl = pl.sort_next)
- {
- if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
- continue;
- if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
- continue;
- if(without_me && pl.sv_entnum == player_localnum)
- continue;
- QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum)))
- }
-
- return;
-}
-
-
-// Specifying target_submenu, this function only loads entries inside target_submenu
-// NOTE: alternatively we could have loaded the whole default quickmenu and
-// then called QuickMenu_Page_Load(target_submenu, 0);
-// but this sytem is more reliable since we can always refer to target_submenu
-// with the English title even if a translation is active
-void QuickMenu_Default(string target_submenu)
-{
- bool target_submenu_found = false;
- if(target_submenu != "")
- QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
-
- QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^hi / good luck")), "say %s", "hi / good luck and have fun", CTX(_("QMCMD^hi / good luck and have fun")))
- QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
-
- if(teamplay)
- {
- QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^quad soon")), "say_team %s", "quad soon", CTX(_("QMCMD^quad soon")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^free item, icon")), "say_team %s; g_waypointsprite_team_here_p", "free item %x^7 (l:%y^7)", CTX(_("QMCMD^free item %x^7 (l:%y^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^took item, icon")), "say_team %s; g_waypointsprite_team_here", "took item (l:%l^7)", CTX(_("QMCMD^took item (l:%l^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^negative")), "say_team %s", "negative", CTX(_("QMCMD^negative")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^positive")), "say_team %s", "positive", CTX(_("QMCMD^positive")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^need help, icon")), "say_team %s; g_waypointsprite_team_helpme; cmd voice needhelp", "need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^enemy seen, icon")), "say_team %s; g_waypointsprite_team_danger_p; cmd voice incoming", "enemy seen (l:%y^7)", CTX(_("QMCMD^enemy seen (l:%y^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^flag seen, icon")), "say_team %s; g_waypointsprite_team_here_p; cmd voice seenflag", "flag seen (l:%y^7)", CTX(_("QMCMD^flag seen (l:%y^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^defending, icon")), "say_team %s; g_waypointsprite_team_here", "defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^roaming, icon")), "say_team %s; g_waypointsprite_team_here", "roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^attacking, icon")), "say_team %s; g_waypointsprite_team_here", "attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^killed flag, icon")), "say_team %s; g_waypointsprite_team_here_p", "killed flagcarrier (l:%y^7)", CTX(_("QMCMD^killed flagcarrier (l:%y^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^dropped flag, icon")), "say_team %s; g_waypointsprite_team_here_d", "dropped flag (l:%d^7)", CTX(_("QMCMD^dropped flag (l:%d^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop gun, icon")), "say_team %s; g_waypointsprite_team_here; wait; dropweapon", "dropped gun %w^7 (l:%l^7)", CTX(_("QMCMD^dropped gun %w^7 (l:%l^7)")))
- QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop flag/key, icon")), "say_team %s; g_waypointsprite_team_here; wait; use", "dropped flag/key %w^7 (l:%l^7)", CTX(_("QMCMD^dropped flag/key %w^7 (l:%l^7)")))
- QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
- }
-
- QUICKMENU_SMENU_PL(CTX(_("QMCMD^Send private message to")), "Send private message to", "commandmode tell \"%s^7\"", 0, 1)
-
- QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
- QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
- QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person view")), "toggle chase_active")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Player models like mine")), "toggle cl_forceplayermodels")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Names above players")), "toggle hud_shownames")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Crosshair per weapon")), "toggle crosshair_per_weapon")
- QUICKMENU_ENTRY(CTX(_("QMCMD^FPS")), "toggle hud_panel_engineinfo")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Net graph")), "toggle shownetgraph")
- QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
-
- QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Hit sound")), "toggle cl_hitsound")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Chat sound")), "toggle con_chatsound")
- QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
-
- if(spectatee_status > 0)
- {
- QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
- QUICKMENU_ENTRY(CTX(_("QMCMD^1st person")), "chase_active 0; -use")
- QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person around player")), "chase_active 1; +use")
- QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person behind")), "chase_active 1; -use")
- QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
- }
-
- if(spectatee_status == -1)
- {
- QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Increase speed")), "weapnext")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Decrease speed")), "weapprev")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision off")), "+use")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision on")), "-use")
- QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
- }
-
- QUICKMENU_ENTRY(CTX(_("QMCMD^Fullscreen")), "toggle vid_fullscreen; vid_restart")
- if(prvm_language != "en")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Translate chat messages")), "toggle hud_panel_quickmenu_translatecommands")
- QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
-
- QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Restart the map")), "vcall restart")
- QUICKMENU_ENTRY(CTX(_("QMCMD^End match")), "vcall endmatch")
- if(STAT(TIMELIMIT) > 0)
- {
- QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
- QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
- }
- if(teamplay)
- QUICKMENU_ENTRY(CTX(_("QMCMD^Shuffle teams")), "vcall shuffleteams")
- QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
-
- if(target_submenu != "" && !target_submenu_found)
- {
- LOG_WARNINGF("Couldn't find submenu \"%s\"\n", target_submenu);
- if(prvm_language != "en")
- LOG_WARNINGF("^3Warning: submenu must be in English\n", target_submenu);
- QuickMenu_Buffer_Size = 0;
- }
-}
-#undef QUICKMENU_SMENU
-#undef QUICKMENU_ENTRY
-#undef QUICKMENU_ENTRY_TC
+++ /dev/null
-#pragma once
-
-bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
-bool QuickMenu_IsOpened();
-void QuickMenu_Mouse();
#include "scoreboard.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
#include "hud/all.qh"
#include <common/ent_cs.qh>
#include "mapvoting.qh"
#include "scoreboard.qh"
#include "shownames.qh"
-#include "quickmenu.qh"
+#include "hud/panel/quickmenu.qh"
#include "mutators/events.qh"
--- /dev/null
+// generated file; do not modify
+#include "projectile.qc"
#include "t_items.qc"
#endif
-#include "items/all.qc"
+#include "items/_mod.inc"
#include "weapons/all.qc"
#include "monsters/all.qc"
#include "turrets/all.qc"
#include "vehicles/all.qc"
-#include "mutators/all.qc"
- #include "gamemodes/all.qc"
+#include "mutators/_mod.inc"
+ #include "gamemodes/_mod.inc"
--- /dev/null
+// generated file; do not modify
+#include "anim.qc"
+#include "animdecide.qc"
+#include "campaign_file.qc"
+#include "campaign_setup.qc"
+#include "ent_cs.qc"
+#include "mapinfo.qc"
+#include "net_notice.qc"
+#include "playerstats.qc"
+#include "state.qc"
+#include "t_items.qc"
+#include "util.qc"
+#include "viewloc.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "generic.qc"
+#include "markup.qc"
+#include "rpn.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "effectinfo.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "casings.qc"
+#include "damageeffects.qc"
+#include "gibs.qc"
+#include "globalsound.qc"
+#include "lightningarc.qc"
+#include "modeleffects.qc"
+#ifdef SVQC
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner);
+#endif
+
#ifdef IMPLEMENTATION
#include <common/util.qh>
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
--- /dev/null
+// generated file; do not modify
+#include "nexball.qc"
+#include "weapon.qc"
--- /dev/null
+// generated file; do not modify
+#include "cl_controlpoint.qc"
+#include "cl_generator.qc"
+#include "onslaught.qc"
+#include "sv_controlpoint.qc"
+#include "sv_generator.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+++ /dev/null
-/** If you register a new item, make sure to add it to this list */
-#include "item/ammo.qc"
-#include "item/armor.qc"
-#include "item/health.qc"
-#include "item/jetpack.qc"
-#include "item/pickup.qc"
-#include "item/powerup.qc"
#define ITEMS_ALL_C
#include "all.qh"
-#include "all.inc"
+#include "item/_mod.inc"
void Dump_Items()
{
REGISTRY(Items, BITS(5))
#define Items_from(i) _Items_from(i, NULL)
REGISTER_REGISTRY(Items)
-/** If you register a new item, make sure to add it to all.inc */
#define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
REGISTRY_SORT(Items)
const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
#define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
-/** If you register a new item, make sure to add it to all.inc */
CLASS(GameItem, Object)
ATTRIB(GameItem, m_id, int, 0)
ATTRIB(GameItem, m_name, string, string_null)
--- /dev/null
+// generated file; do not modify
+#include "ammo.qc"
+#include "armor.qc"
+#include "health.qc"
+#include "jetpack.qc"
+#include "pickup.qc"
+#include "powerup.qc"
--- /dev/null
+// generated file; do not modify
+#include "cl_minigames.qc"
+#include "cl_minigames_hud.qc"
+#include "minigames.qc"
+#include "sv_minigames.qc"
--- /dev/null
+// generated file; do not modify
+#include "bd.qc"
+#include "c4.qc"
+#include "nmm.qc"
+#include "pong.qc"
+#include "pp.qc"
+#include "ps.qc"
+#include "snake.qc"
+#include "ttt.qc"
--- /dev/null
+// generated file; do not modify
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "spawn.qc"
+#include "sv_monsters.qc"
+++ /dev/null
-#ifndef MENUQC
-#include "../animdecide.qh"
-#include "../anim.qh"
-vector animfixfps(entity e, vector a, vector b);
-#endif
-
-#include "monster/mage.qc"
-#include "monster/shambler.qc"
-#include "monster/spider.qc"
-#include "monster/wyvern.qc"
-#include "monster/zombie.qc"
#include "all.qh"
#define IMPLEMENTATION
-#include "all.inc"
+#include "monster/_mod.inc"
#undef IMPLEMENTATION
#ifdef SVQC
REGISTRY_CHECK(Monsters)
const int MON_FIRST = 1;
#define MON_LAST (Monsters_COUNT - 1)
-/** If you register a new monster, make sure to add it to all.inc */
#define REGISTER_MONSTER(id, inst) REGISTER(Monsters, MON, id, monsterid, inst)
REGISTER_MONSTER(Null, NEW(Monster));
-#include "all.inc"
+#include "monster/_mod.inc"
#endif
#include <lib/warpzone/server.qh>
#endif
+#ifndef MENUQC
+#include "../animdecide.qh"
+#include "../anim.qh"
+vector animfixfps(entity e, vector a, vector b);
+#endif
+
// special spawn flags
const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
const int MONSTER_TYPE_FLY = 32;
.vector anim_walk;
.vector anim_spawn;
-/** If you register a new monster, make sure to add it to all.inc */
CLASS(Monster, Object)
ATTRIB(Monster, monsterid, int, 0)
/** attributes */
--- /dev/null
+// generated file; do not modify
+#include "mage.qc"
+#include "shambler.qc"
+#include "spider.qc"
+#include "wyvern.qc"
+#include "zombie.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "itemstime.qc"
--- /dev/null
+// generated file; do not modify
+#include "bloodloss.qc"
--- /dev/null
+// generated file; do not modify
+#include "breakablehook.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "buffs.qc"
--- /dev/null
+// generated file; do not modify
+#include "bugrigs.qc"
--- /dev/null
+// generated file; do not modify
+#include "campcheck.qc"
--- /dev/null
+// generated file; do not modify
+#include "cloaked.qc"
--- /dev/null
+// generated file; do not modify
+#include "damagetext.qc"
--- /dev/null
+// generated file; do not modify
+#include "dodging.qc"
--- /dev/null
+// generated file; do not modify
+#include "doublejump.qc"
--- /dev/null
+// generated file; do not modify
+#include "hook.qc"
--- /dev/null
+// generated file; do not modify
+#include "instagib.qc"
+#include "items.qc"
--- /dev/null
+// generated file; do not modify
+#include "invincibleproj.qc"
--- /dev/null
+// generated file; do not modify
+#include "melee_only.qc"
--- /dev/null
+// generated file; do not modify
+#include "midair.qc"
--- /dev/null
+// generated file; do not modify
+#include "multijump.qc"
--- /dev/null
+// generated file; do not modify
+#include "nades.qc"
+#include "net.qc"
--- /dev/null
+// generated file; do not modify
+#include "new_toys.qc"
--- /dev/null
+// generated file; do not modify
+#include "nix.qc"
--- /dev/null
+// generated file; do not modify
+#include "hmg.qc"
+#include "overkill.qc"
+#include "rpc.qc"
--- /dev/null
+// generated file; do not modify
+#include "physical_items.qc"
--- /dev/null
+// generated file; do not modify
+#include "pinata.qc"
--- /dev/null
+// generated file; do not modify
+#include "random_gravity.qc"
--- /dev/null
+// generated file; do not modify
+#include "rocketflying.qc"
--- /dev/null
+// generated file; do not modify
+#include "rocketminsta.qc"
--- /dev/null
+// generated file; do not modify
+#include "running_guns.qc"
--- /dev/null
+// generated file; do not modify
+#include "sandbox.qc"
--- /dev/null
+// generated file; do not modify
+#include "spawn_near_teammate.qc"
--- /dev/null
+// generated file; do not modify
+#include "superspec.qc"
--- /dev/null
+// generated file; do not modify
+#include "touchexplode.qc"
--- /dev/null
+// generated file; do not modify
+#include "vampire.qc"
--- /dev/null
+// generated file; do not modify
+#include "vampirehook.qc"
--- /dev/null
+// generated file; do not modify
+#include "waypointsprites.qc"
--- /dev/null
+// generated file; do not modify
+#include "weaponarena_random.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "movelib.qc"
+#include "player.qc"
--- /dev/null
+// generated file; do not modify
+#include "follow.qc"
+#include "movetypes.qc"
+#include "push.qc"
+#include "step.qc"
+#include "toss.qc"
+#include "walk.qc"
#define ITEMS_STAT(s) ((s).items)
+.float teleport_time;
+
#ifdef CSQC
string autocvar_cl_jumpspeedcap_min;
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "include.qc"
+#include "platforms.qc"
+#include "subs.qc"
+#include "teleporters.qc"
+#include "triggers.qc"
--- /dev/null
+// generated file; do not modify
+#include "bobbing.qc"
+#include "breakable.qc"
+#include "button.qc"
+#include "conveyor.qc"
+#include "door.qc"
+#include "door_rotating.qc"
+#include "door_secret.qc"
+#include "fourier.qc"
+#include "include.qc"
+#include "ladder.qc"
+#include "pendulum.qc"
+#include "plat.qc"
+#include "pointparticles.qc"
+#include "rainsnow.qc"
+#include "rotating.qc"
+#include "stardust.qc"
+#include "train.qc"
+#include "vectormamamam.qc"
--- /dev/null
+// generated file; do not modify
+#include "corner.qc"
+#include "follow.qc"
+#include "include.qc"
+#include "laser.qc"
+#include "teleport_dest.qc"
--- /dev/null
+// generated file; do not modify
+#include "changelevel.qc"
+#include "include.qc"
+#include "location.qc"
+#include "music.qc"
+#include "spawn.qc"
+#include "speaker.qc"
+#include "voicescript.qc"
--- /dev/null
+// generated file; do not modify
+#include "counter.qc"
+#include "delay.qc"
+#include "disablerelay.qc"
+#include "flipflop.qc"
+#include "gamestart.qc"
+#include "gravity.qc"
+#include "heal.qc"
+#include "hurt.qc"
+#include "impulse.qc"
+#include "include.qc"
+#include "jumppads.qc"
+#include "keylock.qc"
+#include "magicear.qc"
+#include "monoflop.qc"
+#include "multi.qc"
+#include "multivibrator.qc"
+#include "relay.qc"
+#include "relay_activators.qc"
+#include "relay_if.qc"
+#include "relay_teamcheck.qc"
+#include "secret.qc"
+#include "swamp.qc"
+#include "teleport.qc"
+#include "viewloc.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "checkpoint.qc"
+#include "cl_turrets.qc"
+#include "config.qc"
+#include "sv_turrets.qc"
+#include "targettrigger.qc"
+#include "util.qc"
+++ /dev/null
-#include "turret/ewheel.qc"
-#include "turret/flac.qc"
-#include "turret/fusionreactor.qc"
-#include "turret/hellion.qc"
-#include "turret/hk.qc"
-#include "turret/machinegun.qc"
-#include "turret/mlrs.qc"
-#include "turret/phaser.qc"
-#include "turret/plasma.qc"
-#include "turret/plasma_dual.qc"
-#include "turret/tesla.qc"
-#include "turret/walker.qc"
#endif
#define IMPLEMENTATION
-#include "all.inc"
+#include "turret/_mod.inc"
#undef IMPLEMENTATION
#ifdef CSQC
REGISTER_TURRET(Null, NEW(Turret));
-#include "all.inc"
+#include "turret/_mod.inc"
#endif
--- /dev/null
+// generated file; do not modify
+#include "ewheel.qc"
+#include "ewheel_weapon.qc"
+#include "flac.qc"
+#include "flac_weapon.qc"
+#include "fusionreactor.qc"
+#include "hellion.qc"
+#include "hellion_weapon.qc"
+#include "hk.qc"
+#include "hk_weapon.qc"
+#include "machinegun.qc"
+#include "machinegun_weapon.qc"
+#include "mlrs.qc"
+#include "mlrs_weapon.qc"
+#include "phaser.qc"
+#include "phaser_weapon.qc"
+#include "plasma.qc"
+#include "plasma_dual.qc"
+#include "plasma_weapon.qc"
+#include "tesla.qc"
+#include "tesla_weapon.qc"
+#include "walker.qc"
+#include "walker_weapon.qc"
//#define EWHEEL_FANCYPATH
-#include "ewheel_weapon.qc"
+#include "ewheel_weapon.qh"
CLASS(EWheel, Turret)
/* spawnflags */ ATTRIB(EWheel, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE | TUR_FLAG_ROAM);
#ifdef IMPLEMENTATION
-#include "ewheel_weapon.qc"
-
#ifdef SVQC
float autocvar_g_turrets_unit_ewheel_speed_fast;
-#ifndef TURRET_EWHEEL_WEAPON_H
-#define TURRET_EWHEEL_WEAPON_H
-
-CLASS(EWheelAttack, PortoLaunch)
-/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(EWheelAttack, impulse, int, 5);
-/* refname */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
-/* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
-ENDCLASS(EWheelAttack)
-REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
-
-#endif
+#include "ewheel_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(EWheelAttack, PortoLaunch)
+/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(EWheelAttack, impulse, int, 5);
+/* refname */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel");
+/* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel"));
+ENDCLASS(EWheelAttack)
+REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
#ifndef TURRET_FLAC_H
#define TURRET_FLAC_H
-#include "flac_weapon.qc"
+#include "flac_weapon.qh"
CLASS(Flac, Turret)
/* spawnflags */ ATTRIB(Flac, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_MISSILE);
#ifdef IMPLEMENTATION
-#include "flac_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_flac) { if (!turret_initialize(TUR_FLAC)) remove(self); }
-#ifndef TURRET_FLAC_WEAPON_H
-#define TURRET_FLAC_WEAPON_H
-
-CLASS(FlacAttack, PortoLaunch)
-/* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(FlacAttack, impulse, int, 5);
-/* refname */ ATTRIB(FlacAttack, netname, string, "turret_flac");
-/* wepname */ ATTRIB(FlacAttack, m_name, string, _("FLAC"));
-ENDCLASS(FlacAttack)
-REGISTER_WEAPON(FLAC, NEW(FlacAttack));
-
-#endif
+#include "flac_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(FlacAttack, PortoLaunch)
+/* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(FlacAttack, impulse, int, 5);
+/* refname */ ATTRIB(FlacAttack, netname, string, "turret_flac");
+/* wepname */ ATTRIB(FlacAttack, m_name, string, _("FLAC"));
+ENDCLASS(FlacAttack)
+REGISTER_WEAPON(FLAC, NEW(FlacAttack));
#ifndef TURRET_HELLION_H
#define TURRET_HELLION_H
-#include "hellion_weapon.qc"
+#include "hellion_weapon.qh"
CLASS(Hellion, Turret)
/* spawnflags */ ATTRIB(Hellion, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE);
#ifdef IMPLEMENTATION
-#include "hellion_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_hellion) { if (!turret_initialize(TUR_HELLION)) remove(self); }
-#ifndef TURRET_HELLION_WEAPON_H
-#define TURRET_HELLION_WEAPON_H
-
-CLASS(HellionAttack, PortoLaunch)
-/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(HellionAttack, impulse, int, 9);
-/* refname */ ATTRIB(HellionAttack, netname, string, "turret_hellion");
-/* wepname */ ATTRIB(HellionAttack, m_name, string, _("Hellion"));
-ENDCLASS(HellionAttack)
-REGISTER_WEAPON(HELLION, NEW(HellionAttack));
-
-#endif
+#include "hellion_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(HellionAttack, PortoLaunch)
+/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(HellionAttack, impulse, int, 9);
+/* refname */ ATTRIB(HellionAttack, netname, string, "turret_hellion");
+/* wepname */ ATTRIB(HellionAttack, m_name, string, _("Hellion"));
+ENDCLASS(HellionAttack)
+REGISTER_WEAPON(HELLION, NEW(HellionAttack));
//#define TURRET_DEBUG_HK
-#include "hk_weapon.qc"
+#include "hk_weapon.qh"
CLASS(HunterKiller, Turret)
/* spawnflags */ ATTRIB(HunterKiller, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER | TUR_FLAG_RECIEVETARGETS);
#ifdef IMPLEMENTATION
-#include "hk_weapon.qc"
-
#ifdef SVQC
#ifdef TURRET_DEBUG_HK
-#ifndef TURRET_HK_WEAPON_H
-#define TURRET_HK_WEAPON_H
-
-CLASS(HunterKillerAttack, PortoLaunch)
-/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(HunterKillerAttack, impulse, int, 9);
-/* refname */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk");
-/* wepname */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer"));
-ENDCLASS(HunterKillerAttack)
-REGISTER_WEAPON(HK, NEW(HunterKillerAttack));
-
-#endif
+#include "hk_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(HunterKillerAttack, PortoLaunch)
+/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(HunterKillerAttack, impulse, int, 9);
+/* refname */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk");
+/* wepname */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer"));
+ENDCLASS(HunterKillerAttack)
+REGISTER_WEAPON(HK, NEW(HunterKillerAttack));
#ifndef TURRET_MACHINEGUN_H
#define TURRET_MACHINEGUN_H
-#include "machinegun_weapon.qc"
+#include "machinegun_weapon.qh"
CLASS(MachineGunTurret, Turret)
/* spawnflags */ ATTRIB(MachineGunTurret, spawnflags, int, TUR_FLAG_PLAYER);
#ifdef IMPLEMENTATION
-#include "machinegun_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_machinegun) { if (!turret_initialize(TUR_MACHINEGUN)) remove(self); }
-#ifndef TURRET_MACHINEGUN_WEAPON_H
-#define TURRET_MACHINEGUN_WEAPON_H
-
-CLASS(MachineGunTurretAttack, PortoLaunch)
-/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
-/* refname */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
-/* wepname */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun"));
-ENDCLASS(MachineGunTurretAttack)
-REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
-
-#endif
+#include "machinegun_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(MachineGunTurretAttack, PortoLaunch)
+/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(MachineGunTurretAttack, impulse, int, 9);
+/* refname */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun");
+/* wepname */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun"));
+ENDCLASS(MachineGunTurretAttack)
+REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
#ifndef TURRET_MLRS_H
#define TURRET_MLRS_H
-#include "mlrs_weapon.qc"
+#include "mlrs_weapon.qh"
CLASS(MLRSTurret, Turret)
/* spawnflags */ ATTRIB(MLRSTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
#ifdef IMPLEMENTATION
-#include "mlrs_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_mlrs) { if (!turret_initialize(TUR_MLRS)) remove(self); }
-#ifndef TURRET_MLRS_WEAPON_H
-#define TURRET_MLRS_WEAPON_H
-
-CLASS(MLRSTurretAttack, PortoLaunch)
-/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
-/* refname */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
-/* wepname */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS"));
-ENDCLASS(MLRSTurretAttack)
-REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
-
-#endif
+#include "mlrs_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(MLRSTurretAttack, PortoLaunch)
+/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(MLRSTurretAttack, impulse, int, 9);
+/* refname */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs");
+/* wepname */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS"));
+ENDCLASS(MLRSTurretAttack)
+REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
#ifndef TURRET_PHASER_H
#define TURRET_PHASER_H
-#include "phaser_weapon.qc"
+#include "phaser_weapon.qh"
CLASS(PhaserTurret, Turret)
/* spawnflags */ ATTRIB(PhaserTurret, spawnflags, int, TUR_FLAG_SNIPER | TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER);
#ifdef IMPLEMENTATION
-#include "phaser_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_phaser) { if (!turret_initialize(TUR_PHASER)) remove(self); }
+.int fireflag;
+
METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
{
SELFPARAM();
-#ifndef TURRET_PHASER_WEAPON_H
-#define TURRET_PHASER_WEAPON_H
-
-CLASS(PhaserTurretAttack, PortoLaunch)
-/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(PhaserTurretAttack, impulse, int, 9);
-/* refname */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser");
-/* wepname */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser"));
-ENDCLASS(PhaserTurretAttack)
-REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
-
-#endif
+#include "phaser_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(PhaserTurretAttack, PortoLaunch)
+/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(PhaserTurretAttack, impulse, int, 9);
+/* refname */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser");
+/* wepname */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser"));
+ENDCLASS(PhaserTurretAttack)
+REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
#ifndef TURRET_PLASMA_H
#define TURRET_PLASMA_H
-#include "plasma_weapon.qc"
+#include "plasma_weapon.qh"
CLASS(PlasmaTurret, Turret)
/* spawnflags */ ATTRIB(PlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
#ifdef IMPLEMENTATION
-#include "plasma_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_plasma) { if (!turret_initialize(TUR_PLASMA)) remove(self); }
#ifndef TURRET_PLASMA_DUAL_H
#define TURRET_PLASMA_DUAL_H
+#include "plasma_weapon.qh"
+
CLASS(PlasmaDualAttack, PlasmaAttack)
/* refname */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual");
/* wepname */ ATTRIB(PlasmaDualAttack, m_name, string, _("Dual plasma"));
-#ifndef TURRET_PLASMA_WEAPON_H
-#define TURRET_PLASMA_WEAPON_H
-
-CLASS(PlasmaAttack, PortoLaunch)
-/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5);
-/* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
-/* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
-ENDCLASS(PlasmaAttack)
-REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
-
-#endif
+#include "plasma_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(PlasmaAttack, PortoLaunch)
+/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5);
+/* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma");
+/* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma"));
+ENDCLASS(PlasmaAttack)
+REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
#ifndef TURRET_TESLA_H
#define TURRET_TESLA_H
-#include "tesla_weapon.qc"
+#include "tesla_weapon.qh"
CLASS(TeslaCoil, Turret)
/* spawnflags */ ATTRIB(TeslaCoil, spawnflags, int, TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE);
#ifdef IMPLEMENTATION
-#include "tesla_weapon.qc"
-
#ifdef SVQC
spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(self); }
-#ifndef TURRET_TESLA_WEAPON_H
-#define TURRET_TESLA_WEAPON_H
-
-CLASS(TeslaCoilTurretAttack, PortoLaunch)
-/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9);
-/* refname */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla");
-/* wepname */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil"));
-ENDCLASS(TeslaCoilTurretAttack)
-REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
-
-#endif
+#include "tesla_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(TeslaCoilTurretAttack, PortoLaunch)
+/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9);
+/* refname */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla");
+/* wepname */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil"));
+ENDCLASS(TeslaCoilTurretAttack)
+REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
//#define WALKER_FANCYPATHING
-#include "walker_weapon.qc"
+#include "walker_weapon.qh"
CLASS(WalkerTurret, Turret)
/* spawnflags */ ATTRIB(WalkerTurret, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE);
#ifdef IMPLEMENTATION
-#include "walker_weapon.qc"
-
#ifdef SVQC
float autocvar_g_turrets_unit_walker_melee_damage;
-#ifndef TURRET_WALKER_WEAPON_H
-#define TURRET_WALKER_WEAPON_H
-
-CLASS(WalkerTurretAttack, PortoLaunch)
-/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
-/* refname */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
-/* wepname */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker"));
-ENDCLASS(WalkerTurretAttack)
-REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
-
-#endif
+#include "walker_weapon.qh"
#ifdef IMPLEMENTATION
--- /dev/null
+#pragma once
+
+CLASS(WalkerTurretAttack, PortoLaunch)
+/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(WalkerTurretAttack, impulse, int, 5);
+/* refname */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker");
+/* wepname */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker"));
+ENDCLASS(WalkerTurretAttack)
+REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "cl_vehicles.qc"
+#include "sv_vehicles.qc"
+++ /dev/null
-#include "vehicle/spiderbot.qc"
-#include "vehicle/raptor.qc"
-#include "vehicle/racer.qc"
-#ifndef VEHICLES_NO_UNSTABLE
- #include "vehicle/bumblebee.qc"
-#endif
#endif
#define IMPLEMENTATION
-#include "all.inc"
+#include "vehicle/_mod.inc"
#undef IMPLEMENTATION
#endif
const int VEH_FIRST = 1;
#define VEH_LAST (Vehicles_COUNT - 1)
-/** If you register a new vehicle, make sure to add it to all.inc */
#define REGISTER_VEHICLE(id, inst) REGISTER(Vehicles, VEH, id, vehicleid, inst)
#if defined(SVQC)
REGISTER_VEHICLE(Null, NEW(Vehicle));
-#include "all.inc"
+#include "vehicle/_mod.inc"
#endif
--- /dev/null
+// generated file; do not modify
+#include "bumblebee.qc"
+#include "bumblebee_weapons.qc"
+#include "racer.qc"
+#include "racer_weapon.qc"
+#include "raptor.qc"
+#include "raptor_weapons.qc"
+#include "spiderbot.qc"
+#include "spiderbot_weapons.qc"
#define VEHICLE_BUMBLEBEE
#include "bumblebee.qh"
-#include "bumblebee_weapons.qc"
+#include "bumblebee_weapons.qh"
CLASS(Bumblebee, Vehicle)
/* spawnflags */ ATTRIB(Bumblebee, spawnflags, int, VHF_DMGSHAKE);
const float BRG_START = 4;
const float BRG_END = 8;
-#include "bumblebee_weapons.qc"
-
#ifdef SVQC
float autocvar_g_vehicle_bumblebee_respawntime = 60;
void CSQC_BUMBLE_GUN_HUD();
#endif
+#ifdef SVQC
+float raptor_altitude(float amax);
+#endif
+
#endif
-#ifndef VEHICLE_BUMBLEBEE_WEAPONS_H
-#define VEHICLE_BUMBLEBEE_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-#endif
+#include "bumblebee_weapons.qh"
#ifdef IMPLEMENTATION
#ifdef SVQC
-float autocvar_g_vehicle_bumblebee_cannon_cost = 2;
-float autocvar_g_vehicle_bumblebee_cannon_damage = 60;
-float autocvar_g_vehicle_bumblebee_cannon_radius = 225;
-float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2;
-float autocvar_g_vehicle_bumblebee_cannon_speed = 20000;
-float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02;
-float autocvar_g_vehicle_bumblebee_cannon_force = -35;
-
-bool bumble_raygun_send(entity this, entity to, int sf);
-
void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner)
{
vector v = gettaginfo(_gun, gettagindex(_gun, _tagname));
--- /dev/null
+#pragma once
+
+#include <common/weapons/all.qh>
+
+float autocvar_g_vehicle_bumblebee_cannon_cost = 2;
+float autocvar_g_vehicle_bumblebee_cannon_damage = 60;
+float autocvar_g_vehicle_bumblebee_cannon_radius = 225;
+float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2;
+float autocvar_g_vehicle_bumblebee_cannon_speed = 20000;
+float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02;
+float autocvar_g_vehicle_bumblebee_cannon_force = -35;
+
+#ifdef SVQC
+void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner);
+bool bumble_raygun_send(entity this, entity to, int sf);
+#endif
#ifndef VEHICLE_RACER
#define VEHICLE_RACER
-#include "racer_weapon.qc"
+#include "racer_weapon.qh"
CLASS(Racer, Vehicle)
/* spawnflags */ ATTRIB(Racer, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
#ifdef IMPLEMENTATION
-#include "racer_weapon.qc"
-
#ifdef SVQC
#include <common/triggers/trigger/impulse.qh>
-#ifndef VEHICLE_RACER_WEAPON_H
-#define VEHICLE_RACER_WEAPON_H
-
-#include <common/weapons/all.qh>
-
-CLASS(RacerAttack, PortoLaunch)
-/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(RacerAttack, impulse, int, 3);
-/* refname */ ATTRIB(RacerAttack, netname, string, "racercannon");
-/* wepname */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon"));
-ENDCLASS(RacerAttack)
-REGISTER_WEAPON(RACER, NEW(RacerAttack));
-
-// TODO: move into implementation
-#ifdef SVQC
-void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
-#endif
-
-#endif
+#include "racer_weapon.qh"
#ifdef IMPLEMENTATION
#ifdef SVQC
-float autocvar_g_vehicle_racer_cannon_cost = 2;
-float autocvar_g_vehicle_racer_cannon_damage = 15;
-float autocvar_g_vehicle_racer_cannon_radius = 100;
-float autocvar_g_vehicle_racer_cannon_refire = 0.05;
-float autocvar_g_vehicle_racer_cannon_speed = 15000;
-float autocvar_g_vehicle_racer_cannon_spread = 0.0125;
-float autocvar_g_vehicle_racer_cannon_force = 50;
-
-float autocvar_g_vehicle_racer_rocket_accel = 1600;
-float autocvar_g_vehicle_racer_rocket_damage = 100;
-float autocvar_g_vehicle_racer_rocket_radius = 125;
-float autocvar_g_vehicle_racer_rocket_force = 350;
-float autocvar_g_vehicle_racer_rocket_speed = 900;
-float autocvar_g_vehicle_racer_rocket_turnrate = 0.2;
-float autocvar_g_vehicle_racer_rocket_refire = 3;
-
-float autocvar_g_vehicle_racer_rocket_climbspeed = 1600;
-float autocvar_g_vehicle_racer_rocket_locked_maxangle = 1.8;
-
void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
--- /dev/null
+#pragma once
+
+#include <common/weapons/all.qh>
+
+CLASS(RacerAttack, PortoLaunch)
+/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(RacerAttack, impulse, int, 3);
+/* refname */ ATTRIB(RacerAttack, netname, string, "racercannon");
+/* wepname */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon"));
+ENDCLASS(RacerAttack)
+REGISTER_WEAPON(RACER, NEW(RacerAttack));
+
+// TODO: move into implementation
+#ifdef SVQC
+void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
+#endif
+
+float autocvar_g_vehicle_racer_cannon_cost = 2;
+float autocvar_g_vehicle_racer_cannon_damage = 15;
+float autocvar_g_vehicle_racer_cannon_radius = 100;
+float autocvar_g_vehicle_racer_cannon_refire = 0.05;
+float autocvar_g_vehicle_racer_cannon_speed = 15000;
+float autocvar_g_vehicle_racer_cannon_spread = 0.0125;
+float autocvar_g_vehicle_racer_cannon_force = 50;
+
+float autocvar_g_vehicle_racer_rocket_accel = 1600;
+float autocvar_g_vehicle_racer_rocket_damage = 100;
+float autocvar_g_vehicle_racer_rocket_radius = 125;
+float autocvar_g_vehicle_racer_rocket_force = 350;
+float autocvar_g_vehicle_racer_rocket_speed = 900;
+float autocvar_g_vehicle_racer_rocket_turnrate = 0.2;
+float autocvar_g_vehicle_racer_rocket_refire = 3;
+
+float autocvar_g_vehicle_racer_rocket_climbspeed = 1600;
+float autocvar_g_vehicle_racer_rocket_locked_maxangle = 1.8;
#define VEHICLE_RAPTOR
#include "raptor.qh"
-#include "raptor_weapons.qc"
+#include "raptor_weapons.qh"
CLASS(Raptor, Vehicle)
/* spawnflags */ ATTRIB(Raptor, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
#ifdef IMPLEMENTATION
-#include "raptor_weapons.qc"
-
#ifdef SVQC
bool autocvar_g_vehicle_raptor = true;
-#ifndef VEHICLE_RAPTOR_WEAPONS_H
-#define VEHICLE_RAPTOR_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-CLASS(RaptorCannon, PortoLaunch)
-/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(RaptorCannon, impulse, int, 3);
-/* refname */ ATTRIB(RaptorCannon, netname, string, "raptorcannon");
-/* wepname */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon"));
-ENDCLASS(RaptorCannon)
-REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
-
-CLASS(RaptorBomb, PortoLaunch)
-/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(RaptorBomb, impulse, int, 3);
-/* refname */ ATTRIB(RaptorBomb, netname, string, "raptorbomb");
-/* wepname */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb"));
-ENDCLASS(RaptorBomb)
-REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
-
-CLASS(RaptorFlare, PortoLaunch)
-/* flags */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
-/* impulse */ ATTRIB(RaptorFlare, impulse, int, 3);
-/* refname */ ATTRIB(RaptorFlare, netname, string, "raptorflare");
-/* wepname */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare"));
-ENDCLASS(RaptorFlare)
-REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
-
-#endif
+#include "raptor_weapons.qh"
#ifdef IMPLEMENTATION
#ifdef SVQC
-float autocvar_g_vehicle_raptor_cannon_cost = 1;
-float autocvar_g_vehicle_raptor_cannon_damage = 10;
-float autocvar_g_vehicle_raptor_cannon_radius = 60;
-float autocvar_g_vehicle_raptor_cannon_refire = 0.03;
-float autocvar_g_vehicle_raptor_cannon_speed = 24000;
-float autocvar_g_vehicle_raptor_cannon_spread = 0.01;
-float autocvar_g_vehicle_raptor_cannon_force = 25;
-
-float autocvar_g_vehicle_raptor_bomblets = 8;
-float autocvar_g_vehicle_raptor_bomblet_alt = 750;
-float autocvar_g_vehicle_raptor_bomblet_time = 0.5;
-float autocvar_g_vehicle_raptor_bomblet_damage = 55;
-float autocvar_g_vehicle_raptor_bomblet_spread = 0.4;
-float autocvar_g_vehicle_raptor_bomblet_edgedamage = 25;
-float autocvar_g_vehicle_raptor_bomblet_radius = 350;
-float autocvar_g_vehicle_raptor_bomblet_force = 150;
-float autocvar_g_vehicle_raptor_bomblet_explode_delay = 0.4;
-
METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
return isPlayer || veh.vehicle_energy >= autocvar_g_vehicle_raptor_cannon_cost;
}
-float autocvar_g_vehicle_raptor_bombs_refire = 5;
void raptor_bombdrop();
METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
}
}
-float autocvar_g_vehicle_raptor_flare_refire = 5;
-float autocvar_g_vehicle_raptor_flare_lifetime = 10;
-float autocvar_g_vehicle_raptor_flare_chase = 0.9;
-float autocvar_g_vehicle_raptor_flare_range = 2000;
-
void raptor_flare_think();
void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
void raptor_flare_touch();
--- /dev/null
+#pragma once
+
+#include <common/weapons/all.qh>
+
+CLASS(RaptorCannon, PortoLaunch)
+/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(RaptorCannon, impulse, int, 3);
+/* refname */ ATTRIB(RaptorCannon, netname, string, "raptorcannon");
+/* wepname */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon"));
+ENDCLASS(RaptorCannon)
+REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon));
+
+CLASS(RaptorBomb, PortoLaunch)
+/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(RaptorBomb, impulse, int, 3);
+/* refname */ ATTRIB(RaptorBomb, netname, string, "raptorbomb");
+/* wepname */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb"));
+ENDCLASS(RaptorBomb)
+REGISTER_WEAPON(RAPTOR_BOMB, NEW(RaptorBomb));
+
+CLASS(RaptorFlare, PortoLaunch)
+/* flags */ ATTRIB(RaptorFlare, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
+/* impulse */ ATTRIB(RaptorFlare, impulse, int, 3);
+/* refname */ ATTRIB(RaptorFlare, netname, string, "raptorflare");
+/* wepname */ ATTRIB(RaptorFlare, m_name, string, _("Raptor flare"));
+ENDCLASS(RaptorFlare)
+REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare));
+
+
+float autocvar_g_vehicle_raptor_cannon_cost = 1;
+float autocvar_g_vehicle_raptor_cannon_damage = 10;
+float autocvar_g_vehicle_raptor_cannon_radius = 60;
+float autocvar_g_vehicle_raptor_cannon_refire = 0.03;
+float autocvar_g_vehicle_raptor_cannon_speed = 24000;
+float autocvar_g_vehicle_raptor_cannon_spread = 0.01;
+float autocvar_g_vehicle_raptor_cannon_force = 25;
+
+float autocvar_g_vehicle_raptor_bomblets = 8;
+float autocvar_g_vehicle_raptor_bomblet_alt = 750;
+float autocvar_g_vehicle_raptor_bomblet_time = 0.5;
+float autocvar_g_vehicle_raptor_bomblet_damage = 55;
+float autocvar_g_vehicle_raptor_bomblet_spread = 0.4;
+float autocvar_g_vehicle_raptor_bomblet_edgedamage = 25;
+float autocvar_g_vehicle_raptor_bomblet_radius = 350;
+float autocvar_g_vehicle_raptor_bomblet_force = 150;
+float autocvar_g_vehicle_raptor_bomblet_explode_delay = 0.4;
+
+float autocvar_g_vehicle_raptor_bombs_refire = 5;
+
+float autocvar_g_vehicle_raptor_flare_refire = 5;
+float autocvar_g_vehicle_raptor_flare_lifetime = 10;
+float autocvar_g_vehicle_raptor_flare_chase = 0.9;
+float autocvar_g_vehicle_raptor_flare_range = 2000;
#ifndef VEHICLE_SPIDERBOT
#define VEHICLE_SPIDERBOT
-#include "spiderbot_weapons.qc"
+#include "spiderbot_weapons.qh"
CLASS(Spiderbot, Vehicle)
/* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
const int SBRM_ARTILLERY = 3;
const int SBRM_LAST = 3;
-#include "spiderbot_weapons.qc"
-
#ifdef SVQC
bool autocvar_g_vehicle_spiderbot = true;
-#ifndef VEHICLE_SPIDERBOT_WEAPONS_H
-#define VEHICLE_SPIDERBOT_WEAPONS_H
-
-#include <common/weapons/all.qh>
-
-#endif
+#include "spiderbot_weapons.qh"
#ifdef IMPLEMENTATION
#ifdef SVQC
-// 400 (x2) DPS
-float autocvar_g_vehicle_spiderbot_minigun_damage = 24;
-float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06;
-float autocvar_g_vehicle_spiderbot_minigun_spread = 0.015;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_cost = 1;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_max = 100;
-int autocvar_g_vehicle_spiderbot_minigun_ammo_regen = 40;
-float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause = 1;
-float autocvar_g_vehicle_spiderbot_minigun_force = 9;
-float autocvar_g_vehicle_spiderbot_minigun_solidpenetration = 32;
-
-float autocvar_g_vehicle_spiderbot_rocket_damage = 50;
-float autocvar_g_vehicle_spiderbot_rocket_force = 150;
-float autocvar_g_vehicle_spiderbot_rocket_radius = 250;
-float autocvar_g_vehicle_spiderbot_rocket_speed = 3500;
-float autocvar_g_vehicle_spiderbot_rocket_spread = 0.05;
-float autocvar_g_vehicle_spiderbot_rocket_refire = 0.1;
-// volley
-float autocvar_g_vehicle_spiderbot_rocket_refire2 = 0.025;
-float autocvar_g_vehicle_spiderbot_rocket_reload = 4;
-float autocvar_g_vehicle_spiderbot_rocket_health = 100;
-float autocvar_g_vehicle_spiderbot_rocket_noise = 0.2;
-float autocvar_g_vehicle_spiderbot_rocket_turnrate = 0.25;
-float autocvar_g_vehicle_spiderbot_rocket_lifetime = 20;
-
void spiderbot_rocket_artillery()
{SELFPARAM();
self.nextthink = time;
--- /dev/null
+#pragma once
+
+#include <common/weapons/all.qh>
+
+#ifdef SVQC
+void spiderbot_rocket_do();
+#endif
+
+// 400 (x2) DPS
+float autocvar_g_vehicle_spiderbot_minigun_damage = 24;
+float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06;
+float autocvar_g_vehicle_spiderbot_minigun_spread = 0.015;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_cost = 1;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_max = 100;
+int autocvar_g_vehicle_spiderbot_minigun_ammo_regen = 40;
+float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause = 1;
+float autocvar_g_vehicle_spiderbot_minigun_force = 9;
+float autocvar_g_vehicle_spiderbot_minigun_solidpenetration = 32;
+
+float autocvar_g_vehicle_spiderbot_rocket_damage = 50;
+float autocvar_g_vehicle_spiderbot_rocket_force = 150;
+float autocvar_g_vehicle_spiderbot_rocket_radius = 250;
+float autocvar_g_vehicle_spiderbot_rocket_speed = 3500;
+float autocvar_g_vehicle_spiderbot_rocket_spread = 0.05;
+float autocvar_g_vehicle_spiderbot_rocket_refire = 0.1;
+// volley
+float autocvar_g_vehicle_spiderbot_rocket_refire2 = 0.025;
+float autocvar_g_vehicle_spiderbot_rocket_reload = 4;
+float autocvar_g_vehicle_spiderbot_rocket_health = 100;
+float autocvar_g_vehicle_spiderbot_rocket_noise = 0.2;
+float autocvar_g_vehicle_spiderbot_rocket_turnrate = 0.25;
+float autocvar_g_vehicle_spiderbot_rocket_lifetime = 20;
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "calculations.qc"
+#include "config.qc"
#include <common/items/item/pickup.qh>
#include <common/stats.qh>
+#ifdef SVQC
+#include <common/effects/qc/all.qh>
+#endif
+
const int MAX_WEAPONSLOTS = 2;
.entity weaponentities[MAX_WEAPONSLOTS];
--- /dev/null
+// generated file; do not modify
+#include "arc.qc"
+#include "blaster.qc"
+#include "crylink.qc"
+#include "devastator.qc"
+#include "electro.qc"
+#include "fireball.qc"
+#include "hagar.qc"
+#include "hlac.qc"
+#include "hook.qc"
+#include "machinegun.qc"
+#include "minelayer.qc"
+#include "mortar.qc"
+#include "porto.qc"
+#include "rifle.qc"
+#include "seeker.qc"
+#include "shockwave.qc"
+#include "shotgun.qc"
+#include "tuba.qc"
+#include "vaporizer.qc"
+#include "vortex.qc"
--- /dev/null
+// generated file; do not modify
+#include "angle.qc"
+#include "p2mathlib.qc"
+#include "random.qc"
+#include "sortlist.qc"
+#include "test.qc"
+#include "urllib.qc"
--- /dev/null
+// generated file; do not modify
+#include "cl_model.qc"
+#include "cl_player.qc"
+#include "interpolate.qc"
+#include "sv_model.qc"
#ifdef MENUQC
#define NULL (0, null_entity)
+ #define world NULL
#else
#define NULL (0, world)
#endif
--- /dev/null
+// generated file; do not modify
+#include "anglestransform.qc"
+#include "client.qc"
+#include "common.qc"
+#include "mathlib.qc"
+#include "server.qc"
+#include "util_server.qc"
--- /dev/null
+// generated file; do not modify
+#include "draw.qc"
+#include "item.qc"
+#include "menu.qc"
--- /dev/null
+// generated file; do not modify
+#include "animation.qc"
+#include "animhost.qc"
+#include "easing.qc"
+#include "keyframe.qc"
-#include "anim/animation.qc"
-#include "anim/animhost.qc"
-#include "anim/easing.qc"
-#include "anim/keyframe.qc"
-#include "item.qc"
-#include "item/borderimage.qc"
-#include "item/button.qc"
-#include "item/checkbox.qc"
-#include "item/container.qc"
-#include "item/dialog.qc"
-#include "item/image.qc"
-#include "item/inputbox.qc"
-#include "item/inputcontainer.qc"
-#include "item/label.qc"
-#include "item/listbox.qc"
-#include "item/modalcontroller.qc"
-#include "item/nexposee.qc"
-#include "item/radiobutton.qc"
-#include "item/slider.qc"
-#include "item/tab.qc"
-#include "item/textslider.qc"
-
-#include "xonotic/bigbutton.qc"
-#include "xonotic/bigcommandbutton.qc"
-#include "xonotic/button.qc"
-#include "xonotic/campaign.qc"
-#include "xonotic/charmap.qc"
-#include "xonotic/checkbox.qc"
-#include "xonotic/checkbox_slider_invalid.qc"
-#include "xonotic/checkbox_string.qc"
-#include "xonotic/colorbutton.qc"
-#include "xonotic/colorpicker.qc"
-#include "xonotic/colorpicker_string.qc"
-#include "xonotic/commandbutton.qc"
-#include "xonotic/credits.qc"
-#include "xonotic/crosshairpicker.qc"
-#include "xonotic/crosshairpreview.qc"
-#include "xonotic/cvarlist.qc"
-#include "xonotic/datasource.qc"
-#include "xonotic/demolist.qc"
-#include "xonotic/dialog.qc"
-#include "xonotic/dialog_credits.qc"
-#include "xonotic/dialog_firstrun.qc"
-#include "xonotic/dialog_hudpanel_ammo.qc"
-#include "xonotic/dialog_hudpanel_centerprint.qc"
-#include "xonotic/dialog_hudpanel_chat.qc"
-#include "xonotic/dialog_hudpanel_engineinfo.qc"
-#include "xonotic/dialog_hudpanel_healtharmor.qc"
-#include "xonotic/dialog_hudpanel_infomessages.qc"
-#include "xonotic/dialog_hudpanel_itemstime.qc"
-#include "xonotic/dialog_hudpanel_modicons.qc"
-#include "xonotic/dialog_hudpanel_notification.qc"
-#include "xonotic/dialog_hudpanel_physics.qc"
-#include "xonotic/dialog_hudpanel_powerups.qc"
-#include "xonotic/dialog_hudpanel_pressedkeys.qc"
-#include "xonotic/dialog_hudpanel_quickmenu.qc"
-#include "xonotic/dialog_hudpanel_racetimer.qc"
-#include "xonotic/dialog_hudpanel_radar.qc"
-#include "xonotic/dialog_hudpanel_score.qc"
-#include "xonotic/dialog_hudpanel_timer.qc"
-#include "xonotic/dialog_hudpanel_vote.qc"
-#include "xonotic/dialog_hudpanel_weapons.qc"
-#include "xonotic/dialog_hudsetup_exit.qc"
-#include "xonotic/dialog_monstertools.qc"
-#include "xonotic/dialog_multiplayer.qc"
-#include "xonotic/dialog_multiplayer_create.qc"
-#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
-#include "xonotic/dialog_multiplayer_create_mutators.qc"
-#include "xonotic/dialog_multiplayer_join.qc"
-#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
-#include "xonotic/dialog_multiplayer_media.qc"
-#include "xonotic/dialog_multiplayer_media_demo.qc"
-#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
-#include "xonotic/dialog_multiplayer_profile.qc"
-#include "xonotic/dialog_quit.qc"
-#include "xonotic/dialog_sandboxtools.qc"
-#include "xonotic/dialog_settings.qc"
-#include "xonotic/dialog_settings_audio.qc"
-#include "xonotic/dialog_settings_effects.qc"
-#include "xonotic/dialog_settings_game.qc"
-#include "xonotic/dialog_settings_game_crosshair.qc"
-#include "xonotic/dialog_settings_game_hudconfirm.qc"
-#include "xonotic/dialog_settings_game_hud.qc"
-#include "xonotic/dialog_settings_game_messages.qc"
-#include "xonotic/dialog_settings_game_model.qc"
-#include "xonotic/dialog_settings_game_view.qc"
-#include "xonotic/dialog_settings_game_weapons.qc"
-#include "xonotic/dialog_settings_input.qc"
-#include "xonotic/dialog_settings_input_userbind.qc"
-#include "xonotic/dialog_settings_misc.qc"
-#include "xonotic/dialog_settings_misc_cvars.qc"
-#include "xonotic/dialog_settings_misc_reset.qc"
-#include "xonotic/dialog_settings_user.qc"
-#include "xonotic/dialog_settings_user_languagewarning.qc"
-#include "xonotic/dialog_settings_video.qc"
-#include "xonotic/dialog_singleplayer.qc"
-#include "xonotic/dialog_singleplayer_winner.qc"
-#include "xonotic/dialog_teamselect.qc"
-#include "xonotic/gametypelist.qc"
-#include "xonotic/hudskinlist.qc"
-#include "xonotic/image.qc"
-#include "xonotic/inputbox.qc"
-#include "xonotic/keybinder.qc"
-#include "xonotic/languagelist.qc"
-#include "xonotic/listbox.qc"
-#include "xonotic/mainwindow.qc"
-#include "xonotic/maplist.qc"
-#include "xonotic/nexposee.qc"
-#include "xonotic/picker.qc"
-#include "xonotic/playerlist.qc"
-#include "xonotic/playermodel.qc"
-#include "xonotic/playlist.qc"
-#include "xonotic/radiobutton.qc"
-#include "xonotic/rootdialog.qc"
-#include "xonotic/screenshotimage.qc"
-#include "xonotic/screenshotlist.qc"
-#include "xonotic/serverlist.qc"
-#include "xonotic/skinlist.qc"
-#include "xonotic/slider.qc"
-#include "xonotic/slider_decibels.qc"
-#include "xonotic/slider_particles.qc"
-#include "xonotic/slider_picmip.qc"
-#include "xonotic/slider_resolution.qc"
-#include "xonotic/slider_sbfadetime.qc"
-#include "xonotic/soundlist.qc"
-#include "xonotic/statslist.qc"
-#include "xonotic/tabcontroller.qc"
-#include "xonotic/tab.qc"
-#include "xonotic/textlabel.qc"
-#include "xonotic/textslider.qc"
-#include "xonotic/weaponarenacheckbox.qc"
-#include "xonotic/weaponslist.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "menu_cmd.qc"
--- /dev/null
+#include <common/command/all.qc>
return 0; // unhandled
}
+ void m_play_focus_sound();
+
METHOD(Item, focusEnter, void(Item this))
{
if (this.allowFocusSound) m_play_focus_sound();
--- /dev/null
+// generated file; do not modify
+#include "borderimage.qc"
+#include "button.qc"
+#include "checkbox.qc"
+#include "container.qc"
+#include "dialog.qc"
+#include "image.qc"
+#include "inputbox.qc"
+#include "inputcontainer.qc"
+#include "label.qc"
+#include "listbox.qc"
+#include "modalcontroller.qc"
+#include "nexposee.qc"
+#include "radiobutton.qc"
+#include "slider.qc"
+#include "tab.qc"
+#include "textslider.qc"
--- /dev/null
+// generated file; do not modify
-#include "../lib/_all.inc"
-
-#define world NULL
-
-#include "classes.inc"
-
-#include "draw.qc"
-#include "menu.qc"
-
-#include <common/command/all.qc>
-#include "command/menu_cmd.qc"
-
-#include "xonotic/util.qc"
+#include <lib/_all.inc>
+
+#include "_mod.inc"
+#include "anim/_mod.inc"
+#include "command/_mod.inc"
+#include "item/_mod.inc"
+#include "mutators/_mod.inc"
+#include "xonotic/_mod.inc"
#include <common/_all.inc>
--- /dev/null
+// generated file; do not modify
+#include "bigbutton.qc"
+#include "bigcommandbutton.qc"
+#include "button.qc"
+#include "campaign.qc"
+#include "charmap.qc"
+#include "checkbox.qc"
+#include "checkbox_slider_invalid.qc"
+#include "checkbox_string.qc"
+#include "colorbutton.qc"
+#include "colorpicker.qc"
+#include "colorpicker_string.qc"
+#include "commandbutton.qc"
+#include "credits.qc"
+#include "crosshairpicker.qc"
+#include "crosshairpreview.qc"
+#include "cvarlist.qc"
+#include "datasource.qc"
+#include "demolist.qc"
+#include "dialog.qc"
+#include "dialog_credits.qc"
+#include "dialog_firstrun.qc"
+#include "dialog_hudpanel_ammo.qc"
+#include "dialog_hudpanel_centerprint.qc"
+#include "dialog_hudpanel_chat.qc"
+#include "dialog_hudpanel_engineinfo.qc"
+#include "dialog_hudpanel_healtharmor.qc"
+#include "dialog_hudpanel_infomessages.qc"
+#include "dialog_hudpanel_itemstime.qc"
+#include "dialog_hudpanel_modicons.qc"
+#include "dialog_hudpanel_notification.qc"
+#include "dialog_hudpanel_physics.qc"
+#include "dialog_hudpanel_powerups.qc"
+#include "dialog_hudpanel_pressedkeys.qc"
+#include "dialog_hudpanel_quickmenu.qc"
+#include "dialog_hudpanel_racetimer.qc"
+#include "dialog_hudpanel_radar.qc"
+#include "dialog_hudpanel_score.qc"
+#include "dialog_hudpanel_timer.qc"
+#include "dialog_hudpanel_vote.qc"
+#include "dialog_hudpanel_weapons.qc"
+#include "dialog_hudsetup_exit.qc"
+#include "dialog_monstertools.qc"
+#include "dialog_multiplayer.qc"
+#include "dialog_multiplayer_create.qc"
+#include "dialog_multiplayer_create_mapinfo.qc"
+#include "dialog_multiplayer_create_mutators.qc"
+#include "dialog_multiplayer_join.qc"
+#include "dialog_multiplayer_join_serverinfo.qc"
+#include "dialog_multiplayer_media.qc"
+#include "dialog_multiplayer_media_demo.qc"
+#include "dialog_multiplayer_media_demo_startconfirm.qc"
+#include "dialog_multiplayer_media_demo_timeconfirm.qc"
+#include "dialog_multiplayer_media_musicplayer.qc"
+#include "dialog_multiplayer_media_screenshot.qc"
+#include "dialog_multiplayer_media_screenshot_viewer.qc"
+#include "dialog_multiplayer_profile.qc"
+#include "dialog_quit.qc"
+#include "dialog_sandboxtools.qc"
+#include "dialog_settings.qc"
+#include "dialog_settings_audio.qc"
+#include "dialog_settings_effects.qc"
+#include "dialog_settings_game.qc"
+#include "dialog_settings_game_crosshair.qc"
+#include "dialog_settings_game_hud.qc"
+#include "dialog_settings_game_hudconfirm.qc"
+#include "dialog_settings_game_messages.qc"
+#include "dialog_settings_game_model.qc"
+#include "dialog_settings_game_view.qc"
+#include "dialog_settings_game_weapons.qc"
+#include "dialog_settings_input.qc"
+#include "dialog_settings_input_userbind.qc"
+#include "dialog_settings_misc.qc"
+#include "dialog_settings_misc_cvars.qc"
+#include "dialog_settings_misc_reset.qc"
+#include "dialog_settings_user.qc"
+#include "dialog_settings_user_languagewarning.qc"
+#include "dialog_settings_video.qc"
+#include "dialog_singleplayer.qc"
+#include "dialog_singleplayer_winner.qc"
+#include "dialog_teamselect.qc"
+#include "gametypelist.qc"
+#include "hudskinlist.qc"
+#include "image.qc"
+#include "inputbox.qc"
+#include "keybinder.qc"
+#include "languagelist.qc"
+#include "listbox.qc"
+#include "mainwindow.qc"
+#include "maplist.qc"
+#include "nexposee.qc"
+#include "picker.qc"
+#include "playerlist.qc"
+#include "playermodel.qc"
+#include "playlist.qc"
+#include "radiobutton.qc"
+#include "rootdialog.qc"
+#include "screenshotimage.qc"
+#include "screenshotlist.qc"
+#include "serverlist.qc"
+#include "skinlist.qc"
+#include "slider.qc"
+#include "slider_decibels.qc"
+#include "slider_particles.qc"
+#include "slider_picmip.qc"
+#include "slider_resolution.qc"
+#include "slider_sbfadetime.qc"
+#include "soundlist.qc"
+#include "statslist.qc"
+#include "tab.qc"
+#include "tabcontroller.qc"
+#include "textlabel.qc"
+#include "textslider.qc"
+#include "util.qc"
+#include "weaponarenacheckbox.qc"
+#include "weaponslist.qc"
--- /dev/null
+// generated file; do not modify
+#include "anticheat.qc"
+#include "antilag.qc"
+#include "campaign.qc"
+#include "cheats.qc"
+#include "cl_client.qc"
+#include "cl_impulse.qc"
+#include "cl_player.qc"
+#include "g_damage.qc"
+#include "g_hook.qc"
+#include "g_lights.qc"
+#include "g_models.qc"
+#include "g_subs.qc"
+#include "g_world.qc"
+#include "ipban.qc"
+#include "item_key.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "playerdemo.qc"
+#include "portals.qc"
+#include "race.qc"
+#include "round_handler.qc"
+#include "scores.qc"
+#include "scores_rules.qc"
+#include "spawnpoints.qc"
+#include "steerlib.qc"
+#include "sv_main.qc"
+#include "teamplay.qc"
+#include "tests.qc"
+#include "t_halflife.qc"
+#include "t_quake.qc"
+#include "t_quake3.qc"
+++ /dev/null
-#include "aim.qc"
-#include "bot.qc"
-#include "navigation.qc"
-#include "scripting.qc"
-#include "waypoints.qc"
-
-#include "havocbot/_all.inc"
--- /dev/null
+// generated file; do not modify
+#include "aim.qc"
+#include "bot.qc"
+#include "navigation.qc"
+#include "scripting.qc"
+#include "waypoints.qc"
+++ /dev/null
-#include "havocbot.qc"
-#include "roles.qc"
--- /dev/null
+// generated file; do not modify
+#include "havocbot.qc"
+#include "roles.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
+#include "banning.qc"
+#include "cmd.qc"
+#include "common.qc"
+#include "getreplies.qc"
+#include "radarmap.qc"
+#include "sv_cmd.qc"
+#include "vote.qc"
#include "all.qh"
#include <common/command/all.qc>
-
-#include "sv_cmd.qc"
-
-#include "banning.qc"
-#include "cmd.qc"
-#include "common.qc"
-#include "getreplies.qc"
-#include "radarmap.qc"
-#include "vote.qc"
--- /dev/null
+// generated file; do not modify
+#include "all.qc"
--- /dev/null
+// generated file; do not modify
+#include "gamemode_assault.qc"
+#include "gamemode_ca.qc"
+#include "gamemode_ctf.qc"
+#include "gamemode_cts.qc"
+#include "gamemode_deathmatch.qc"
+#include "gamemode_domination.qc"
+#include "gamemode_freezetag.qc"
+#include "gamemode_invasion.qc"
+#include "gamemode_keepaway.qc"
+#include "gamemode_keyhunt.qc"
+#include "gamemode_lms.qc"
+#include "gamemode_race.qc"
+#include "gamemode_tdm.qc"
--- /dev/null
+// generated file; do not modify
+#include "costs.qc"
+#include "debug.qc"
+#include "expandnode.qc"
+#include "main.qc"
+#include "movenode.qc"
+#include "path_waypoint.qc"
+#include "utility.qc"
-#include "../lib/_all.inc"
-#include "_all.qh"
-
-#include "../common/effects/qc/all.qc"
-
-#include "anticheat.qc"
-#include "antilag.qc"
-#include "campaign.qc"
-#include "cheats.qc"
-#include "cl_client.qc"
-#include "cl_impulse.qc"
-#include "cl_player.qc"
-#include "g_damage.qc"
-#include "g_hook.qc"
-// #include "g_lights.qc" // TODO: was never used
-#include "g_models.qc"
-#include "g_subs.qc"
-#include "g_world.qc"
-#include "ipban.qc"
-#include "item_key.qc"
-#include "mapvoting.qc"
-#include "miscfunctions.qc"
-#include "playerdemo.qc"
-#include "portals.qc"
-#include "race.qc"
-#include "round_handler.qc"
-#include "scores.qc"
-#include "scores_rules.qc"
-#include "spawnpoints.qc"
-#include "steerlib.qc"
-#include "sv_main.qc"
-#include "teamplay.qc"
-#include "t_halflife.qc"
-#include "t_quake3.qc"
-#include "t_quake.qc"
-
-#include "tests.qc"
-
-#include "bot/_all.inc"
+#ifndef DEBUGPATHING
+ #define DEBUGPATHING 0
+#endif
-#include "command/all.qc"
+#include <lib/_all.inc>
+#include "_all.qh"
+#include "_mod.inc"
+#include "bot/_mod.inc"
+#include "bot/havocbot/_mod.inc"
+#include "command/_mod.inc"
+#include "mutators/_mod.inc"
#include "pathlib/_all.inc"
+#include "weapons/_mod.inc"
-#include "weapons/accuracy.qc"
-#include "weapons/common.qc"
-#include "weapons/csqcprojectile.qc" // TODO
-#include "weapons/hitplot.qc"
-#include "weapons/selection.qc"
-#include "weapons/spawning.qc"
-#include "weapons/throwing.qc"
-#include "weapons/tracing.qc"
-#include "weapons/weaponstats.qc"
-#include "weapons/weaponsystem.qc"
-
-#include "../common/_all.inc"
-#include "mutators/all.qc"
+#include <common/_all.inc>
+#include <common/effects/qc/all.qc>
-#include "../lib/csqcmodel/sv_model.qc"
+#include <lib/csqcmodel/sv_model.qc>
-#include "../lib/warpzone/anglestransform.qc"
-#include "../lib/warpzone/common.qc"
-#include "../lib/warpzone/server.qc"
-#include "../lib/warpzone/util_server.qc"
+#include <lib/warpzone/anglestransform.qc>
+#include <lib/warpzone/common.qc>
+#include <lib/warpzone/server.qc>
+#include <lib/warpzone/util_server.qc>
#if BUILD_MOD
#include "../../mod/server/progs.inc"
--- /dev/null
+// generated file; do not modify
+#include "accuracy.qc"
+#include "common.qc"
+#include "csqcprojectile.qc"
+#include "hitplot.qc"
+#include "selection.qc"
+#include "spawning.qc"
+#include "throwing.qc"
+#include "tracing.qc"
+#include "weaponstats.qc"
+#include "weaponsystem.qc"
--- /dev/null
+#!/bin/bash
+set -eu
+cd "$(dirname "$0")"
+cd ..
+
+MOD=_mod.inc
+
+function genmod() {
+ echo '// generated file; do not modify' > ${MOD}
+ for f in $(ls | sort -k 1,1 -t .); do
+ if [[ "$f" == *.qc ]]; then echo "#include \"$f\"" >> ${MOD}; fi
+ done
+ # echo >> ${MOD}
+ for f in *; do if [ -d "$f" ]; then
+ (cd -- "$f" && genmod)
+ # echo "#include \"$f/MOD\"" >> ${MOD}
+ fi; done
+}
+
+(cd lib; genmod)
+(cd common; genmod)
+(cd client; genmod)
+(cd server; genmod)
+(cd menu; genmod)