]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add waypoint editor quickmenu entry in the default quickmenu if waypoint editor is...
authorterencehill <piuntn@gmail.com>
Sat, 7 May 2022 14:14:07 +0000 (16:14 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 7 May 2022 14:14:07 +0000 (16:14 +0200)
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/server/client.qc

index 695a58fb04bc3ffbaecddeb8741a48139c41c59d..a6ea8e20aadcb49dfdf7a1c9db2a238606e41525 100644 (file)
@@ -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)
index 88691ae39e4fe58091207030744a63eef5643c22..3e3eb08cf17ac7e61ee27464ef605341669b7bae 100644 (file)
@@ -46,6 +46,7 @@
 #include <server/antilag.qh>
 #include <server/bot/api.qh>
 #include <server/bot/default/cvars.qh>
+#include <server/bot/default/waypoints.qh>
 #include <server/campaign.qh>
 #include <server/chat.qh>
 #include <server/cheats.qh>
@@ -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));
        }