diff --git a/config/admin.cfg b/config/admin.cfg index b4749b3d..ccb9d15c 100644 --- a/config/admin.cfg +++ b/config/admin.cfg @@ -12,4 +12,14 @@ alias cleardemo [ callvote 10 $arg1 ] alias cleardemos [ callvote 10 0 ] alias serverdesc [ callvote 11 $arg1 ] alias shuffleteams [ callvote 12 ] -alias demo [ mode -1; map $arg1 ] + +alias demo [ + alias _demofile $arg1 + if $connected [ + alias mapstartonce [mode -1; map $_demofile] + disconnect + ][ + mode -1; map $_demofile + ] +] + diff --git a/config/menus.cfg b/config/menus.cfg index d9f00e38..40a5af06 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -76,7 +76,14 @@ newmenu "Play demo" // If not in-game (recording/downloading demos isn't needed) menuinit [ echo "To stop demo playback, type: 3/stopdemo" ] menudirlist "demos/" "dmo" "demo $arg1" - +// in-game menu that opens when pressing escape while watching a demo. +newmenu "Watching demo" +menuitem "Stop watching demo" "stopdemo" +menuitem "Restart demo" "demo $_demofile" +menuitem "Watch other demo" [stopdemo; closemenu "Watching demo"; showmenu "Play demo"] +menuitem "" -1 +menuitem " 4Main menu..." [ closemenu "Watching demo"; showmenu main ] +menuitem " 3Quit AssaultCube" "savequit" newmenu about diff --git a/config/resetbinds.cfg b/config/resetbinds.cfg index 7280aa5d..cdefac2f 100644 --- a/config/resetbinds.cfg +++ b/config/resetbinds.cfg @@ -13,7 +13,7 @@ bind TAB [ showscores 1; onrelease [ showscores 0 ] ] bind CLEAR "" bind RETURN "" bind PAUSE "" -bind ESCAPE [ if $connected [ ingamemenu ] [ showmenu main ] ] +bind ESCAPE [ if $connected [ ingamemenu ] [ if (watchingdemo) [ showmenu "Watching demo" ] [ showmenu main ] ] ] bind SPACE "jump" bind EXCLAIM "" bind QUOTEDBL ""