]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/quickmenu_file_example' into 'master'
authorMario <zacjardine@y7mail.com>
Sun, 8 Nov 2015 08:28:35 +0000 (08:28 +0000)
committerMario <zacjardine@y7mail.com>
Sun, 8 Nov 2015 08:28:35 +0000 (08:28 +0000)
Quickmenu file example

See merge request !249

qcsrc/client/commands/cl_cmd.qc
quickmenu_example.txt [new file with mode: 0644]

index 1c83438e534b5f9cde60a93d2c40aa61502114be..63e0c56126f7394c8ffd8eacbab9a9d194a229c6 100644 (file)
@@ -267,6 +267,13 @@ void LocalCommand_hud(int request, int argc)
 
                                case "quickmenu":
                                {
+                                       if (argv(2) == "help")
+                                       {
+                                               LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
+                                               LOG_INFO("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+                                               LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.\n");
+                                               return;
+                                       }
                                        if (QuickMenu_IsOpened())
                                                QuickMenu_Close();
                                        else
@@ -336,10 +343,7 @@ void LocalCommand_hud(int request, int argc)
                        LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
                        LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
                        LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       LOG_INFO("  quickmenu [[default | file | \"\"] submenu]\n");
-                       LOG_INFO("    Called without options (or with " ") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
-                       LOG_INFO("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
-                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       LOG_INFO("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
                        return;
                }
        }
diff --git a/quickmenu_example.txt b/quickmenu_example.txt
new file mode 100644 (file)
index 0000000..6f97e28
--- /dev/null
@@ -0,0 +1,36 @@
+// This quickmenu example file can be loaded by setting
+// hud_panel_quickmenu_file quickmenu_example.txt
+// and executing "quickmenu file"
+// For more options see "quickmenu help"
+
+"Chat"
+       "nice one" "say :-) / nice one"
+       "good game" "say good game"
+       "hi / good luck" "say hi / good luck and have fun"
+"Chat"
+
+"Settings"
+       // nested submenu
+       "Sound settings"
+               "Hit sound" "toggle cl_hitsound"
+               "Chat sound" "toggle cl_chatsound"
+       "Sound settings"
+
+       // A toggle command displays a checkbox showing the current cvar's state
+       "enable 3rd person view" "toggle chase_active"
+       // it's possible to invert the meaning of the checkbox by inverting the
+       // parameters of toggle from the implicit 1 0 to 0 1
+       "disable 3rd person view" "toggle chase_active 0 1"
+"Settings"
+
+"screenshot" "wait; screenshot"
+
+// Commands that accept a player's name as parameter (%s), followed by one of
+// these special keywords:
+//   ALLPLAYERS_BUT_ME
+//   ALLPLAYERS
+//   OWNTEAMPLAYERS_BUT_ME
+//   OWNTEAMPLAYERS
+//   ENEMYTEAMPLAYERS
+// lets you pick a player's name from a list:
+"private chat with:" "commandmode tell \"%s\"" ALLPLAYERS_BUT_ME