From: terencehill Date: Sat, 7 May 2022 14:14:07 +0000 (+0200) Subject: Add waypoint editor quickmenu entry in the default quickmenu if waypoint editor is... X-Git-Tag: xonotic-v0.8.6~360^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ba8ae4694fcaae610fc923f0f13a3b9238a53999;p=xonotic%2Fxonotic-data.pk3dir.git Add waypoint editor quickmenu entry in the default quickmenu if waypoint editor is enabled --- diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index 695a58fb0..a6ea8e20a 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -875,7 +875,10 @@ void QuickMenu_Default(string target_submenu) if (autocvar__hud_panel_quickmenu_file_from_server != "") { // TODO make it translatable - QUICKMENU_ENTRY("Server's custom quickmenu", "quickmenu; wait; quickmenu \"\" \"\" $_hud_panel_quickmenu_file_from_server") + string entry_name = "Server's custom quickmenu"; + if (autocvar__hud_panel_quickmenu_file_from_server == "wpeditor.txt") + entry_name = "Waypoint editor quickmenu"; + QUICKMENU_ENTRY(entry_name, "quickmenu; wait; quickmenu \"\" \"\" $_hud_panel_quickmenu_file_from_server") } if(spectatee_status != 0) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 88691ae39..3e3eb08cf 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -1147,7 +1148,9 @@ void ClientConnect(entity this) stuffcmd(this, "cl_cmd settemp chase_active 1\n"); // quickmenu file must be put in a subfolder with an unique name // to reduce chances of overriding custom client quickmenus - if (autocvar_sv_quickmenu_file != "" && strstrofs(autocvar_sv_quickmenu_file, "/", 0) && fexists(autocvar_sv_quickmenu_file)) + if (waypointeditor_enabled) + stuffcmd(this, sprintf("cl_cmd settemp _hud_panel_quickmenu_file_from_server %s\n", "wpeditor.txt")); + else if (autocvar_sv_quickmenu_file != "" && strstrofs(autocvar_sv_quickmenu_file, "/", 0) && fexists(autocvar_sv_quickmenu_file)) stuffcmd(this, sprintf("cl_cmd settemp _hud_panel_quickmenu_file_from_server %s\n", autocvar_sv_quickmenu_file)); }