From 9e319781a16d2c9decf8b74221d71de3305ba255 Mon Sep 17 00:00:00 2001 From: flowtron Date: Tue, 1 Jun 2021 17:42:33 +0200 Subject: [PATCH] coop in menu (fix issue #340) --- config/menus.cfg | 8 +++++--- config/menus_multiplayer.cfg | 3 ++- source/src/menus.cpp | 9 +++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/menus.cfg b/config/menus.cfg index 6226ba40..7f3c1d0d 100644 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -27,19 +27,21 @@ const __genmapitems [ ] ] -newmenu [all custom maps] +newmenu all_custom_maps +menutitle "custom maps" menurenderoffset -20 0 menudirlist "packages/maps" cgz [map $arg1] newmenu maps __genmapitems $__defaultmaps menuitem [] -1 -menuitem "Show all custom maps\i\3" [ showmenu [all custom maps] ] +menuitem "Show all custom maps\i\3" [showmenu all_custom_maps] newmenu maps_flags +menutitle "maps with flags" __genmapitems $__ctfmaps menuitem [] -1 -menuitem "Show all custom maps\i\3" [showmenu [all custom maps]] +menuitem "Show all custom maps\i\3" [showmenu all_custom_maps] //// Main > Play demo //// diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index 9d0a6c44..c709313f 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -110,6 +110,7 @@ menuitem [Team Last Swiss Standing] [ mode 17; showmenu maps ] menuitem [Last Swiss Standing] [ mode 9; showmenu maps ] menuitem [One Shot, One Kill] [ mode 10; showmenu maps ] menuitem [Team One Shot, One Kill] [ mode 11; showmenu maps ] +menuitem [Cooperative Editing] [ mode 1; showmenu all_custom_maps ] //// In-Game > kick/ban //// @@ -330,4 +331,4 @@ menuinit [ menuitem "\f2 [ Download the servers map version and join the game ]" [ getmap ] menuitem "\f3 [ Keep the local map version and disconnect from the server ]" [ showmenu ""; disconnect ] menuinitselection 4 -] \ No newline at end of file +] diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 42a132ab..52ddba34 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -886,6 +886,15 @@ void setmenublink(int *truth) } COMMANDN(menucanblink, setmenublink, "i"); +void menutitle(char *title) +{ + if(!lastmenu) return; + gmenu *m = lastmenu; + DELSTRING(m->title); + m->title = newstring(title); +} +COMMAND(menutitle, "s"); + void menuinit(char *initaction) { if(!lastmenu) return;