Skip to content

Commit

Permalink
Remove custom event instancer and convert old inline events to Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Aug 25, 2014
1 parent 27eeb5c commit 7779e36
Show file tree
Hide file tree
Showing 25 changed files with 130 additions and 135 deletions.
2 changes: 1 addition & 1 deletion main/ui/alien_build.rml
Expand Up @@ -96,7 +96,7 @@ div.infobox {
}
</style>
</head>
<body id="alien_build" class="circlemenu alien" onShow="buildDS alienBuildList default; buildDS alienBuildList upgrades">
<body id="alien_build" class="circlemenu alien" onShow='Events.pushevent("buildDS alienBuildList default; buildDS alienBuildList upgrades", event)'>
<div id="foo">
<tabset class="circlemenu">
<tab></tab>
Expand Down
2 changes: 1 addition & 1 deletion main/ui/alien_evo.rml
Expand Up @@ -97,7 +97,7 @@ div.infobox {
}
</style>
</head>
<body id="alien_evo" class="circlemenu alien" onShow="buildDS alienEvolveList default; buildDS alienEvolveList upgrades">
<body id="alien_evo" class="circlemenu alien" onShow='Events.pushevent("buildDS alienEvolveList default; buildDS alienEvolveList upgrades", event)'>
<div id="foo">
<tabset class="circlemenu">
<tab></tab>
Expand Down
6 changes: 3 additions & 3 deletions main/ui/alien_spawn.rml
Expand Up @@ -42,13 +42,13 @@
<body id="alien_spawn" template="window">
<p> Choose your spawn class </p>

<button class="dretch" onClick="hide alien_spawn; exec class level0"> Dretch </button>
<button class="dretch" onClick='Events.pushevent("hide alien_spawn; exec class level0", event)'> Dretch </button>
<!-- FIXME: always spawn as the correct granger version -->
<button class="builder" onClick="hide alien_spawn; exec class builderupg builder"> Granger </button>
<button class="builder" onClick='Events.pushevent("hide alien_spawn; exec class builderupg builder", event)'> Granger </button>

<p> You cannot evolve into a granger from another class</p>

<button class="teamselect" onClick="hide alien_spawn; show ingame_teamselect"> Back to team selection </button>
<button class="teamselect" onClick='Events.pushevent("hide alien_spawn; show ingame_teamselect", event)'> Back to team selection </button>

</body>
</rml>
2 changes: 1 addition & 1 deletion main/ui/callvote_draw.rml
Expand Up @@ -13,7 +13,7 @@
<body id="callvote_draw" template="window" style="width: 35em; margin: 10%;">
<h1> Call a Vote for a Draw </h1>

<form onsubmit='execForm "callvote draw $reason$"; hide'>
<form onsubmit='Events.push("execForm \"callvote draw $reason$\"; hide", event)'>
<row>
<input type="text" cvar="ui_dialogCvar1" class="text" style="width: 25em;" name="reason"/>
<h3> Reason </h3>
Expand Down
4 changes: 2 additions & 2 deletions main/ui/callvote_map.rml
Expand Up @@ -25,11 +25,11 @@
</style>

</head>
<body id="callvote_map" template="window" style="width: 40em; margin: 10%;" onShow='buildDS mapList' >
<body id="callvote_map" template="window" style="width: 40em; margin: 10%;" onShow='Events.pushevent("buildDS mapList", event)' >
<h1> Change map </h1>


<form onsubmit='execForm "$action$ $map$"; hide'>
<form onsubmit='Events.pushevent("execForm \"$action$ $map$\"; hide", event)'>
<row>
<select cvar="ui_dialogCvar2" name="action">
<option value="callvote nextmap">Vote: change nextmap</option>
Expand Down
4 changes: 2 additions & 2 deletions main/ui/error.rml
Expand Up @@ -3,11 +3,11 @@
<link type="text/rcss" href="/ui/shared/basics.rcss" />
<link type="text/template" href="/ui/shared/window.rml" />
</head>
<body id="error" onhide="exec set com_errorMessage" template="window" style="width: 32em; margin: 10%;">
<body id="error" onhide='Events.pushevent("exec set com_errorMessage", event)' template="window" style="width: 32em; margin: 10%;">
<h1>Error!</h1>
<p class="inline">
<inlinecvar cvar="ui_errorMessage"/>
</p>
<button onClick="hide error">Ok</button>
<button onClick='Events.pushevent("hide error", event)'>Ok</button>
</body>
</rml>
2 changes: 1 addition & 1 deletion main/ui/human_build.rml
Expand Up @@ -96,7 +96,7 @@ div.infobox {
}
</style>
</head>
<body id="human_build" class="circlemenu human" onShow="buildDS humanBuildList default; buildDS humanBuildList upgrades">
<body id="human_build" class="circlemenu human" onShow='Events.pushevent("buildDS humanBuildList default; buildDS humanBuildList upgrades", event)'>
<div id="foo">
<tabset class="circlemenu">
<tab></tab>
Expand Down
2 changes: 1 addition & 1 deletion main/ui/human_buy.rml
Expand Up @@ -98,7 +98,7 @@ div.infobox {

</style>
</head>
<body id="human_buy" class="circlemenu human" onShow="buildDS armouryBuyList weapons; buildDS armouryBuyList upgrades">
<body id="human_buy" class="circlemenu human" onShow='Events.pushevent("buildDS armouryBuyList weapons; buildDS armouryBuyList upgrades", event)'>
<div id="foo">
<tabset class="circlemenu">
<tab>Weapons</tab>
Expand Down
6 changes: 3 additions & 3 deletions main/ui/human_spawn.rml
Expand Up @@ -42,12 +42,12 @@
<body id="human_spawn" template="window">
<p> Choose your spawn class </p>

<button class="rifle" onClick="hide human_spawn; exec class rifle"> Rifle </button>
<button class="ckit" onClick="hide human_spawn; exec class ckit"> Construction Kit </button>
<button class="rifle" onClick='Events.pushevent("hide human_spawn; exec class rifle", event)'> Rifle </button>
<button class="ckit" onClick='Events.pushevent("hide human_spawn; exec class ckit", event)'> Construction Kit </button>

<p> All weapons can be traded at the armoury. </p>

<button class="teamselect" onClick="hide human_spawn; show ingame_teamselect"> Back to team selection </button>
<button class="teamselect" onClick='Events.pushevent("hide human_spawn; show ingame_teamselect", event)'> Back to team selection </button>

</body>
</rml>
2 changes: 1 addition & 1 deletion main/ui/ingame_beaconmenu.rml
Expand Up @@ -52,7 +52,7 @@
}
</style>
</head>
<body id="ingame_beaconmenu" class="circlemenu" onShow="buildDS beaconList default">
<body id="ingame_beaconmenu" class="circlemenu" onShow='Events.pushevent("buildDS beaconList default", event)'>
<div id="foo">
<tabset class="circlemenu">
<tab>Beacons</tab>
Expand Down
2 changes: 1 addition & 1 deletion main/ui/ingame_chat.rml
Expand Up @@ -18,6 +18,6 @@
</style>
</head>
<body id="ingame_chat">
<chatType/> <chatfield onFocus="setChatCommand" />
<chatType/> <chatfield onFocus='Events.pushevent("setChatCommand", event)' />
</body>
</rml>
8 changes: 4 additions & 4 deletions main/ui/ingame_teamselect.rml
Expand Up @@ -52,7 +52,7 @@

<body id="ingame_teamselect" template="window">

<button class="wide" onClick="hide ingame_teamselect; exec team auto" style="z-index: 10;">
<button class="wide" onClick='Events.pushevent("hide ingame_teamselect; exec team auto", event)' style="z-index: 10;">
<!-- High z-index, so we are placed 'ontop' of the drag-handle at the top of the window -->
Auto-select a team
</button>
Expand All @@ -66,12 +66,12 @@
than make up for it in upgrades.
</p>

<button class="alien" onClick="hide ingame_teamselect; exec team alien"> Join Aliens </button>
<button class="human" onClick="hide ingame_teamselect; exec team human"> Join Humans </button>
<button class="alien" onClick='Events.pushevent("hide ingame_teamselect; exec team alien", event)'> Join Aliens </button>
<button class="human" onClick='Events.pushevent("hide ingame_teamselect; exec team human", event)'> Join Humans </button>

<p> Alternatively you can watch the game without playing.</p>

<button class="wide" onClick="hide ingame_teamselect; exec team spec"> Spectate </button>
<button class="wide" onClick='Events.pushevent("hide ingame_teamselect; exec team spec", event)'> Spectate </button>

</body>
</rml>
74 changes: 37 additions & 37 deletions main/ui/menu_ingame.rml
Expand Up @@ -17,64 +17,64 @@

<sidesection id="sidebar_ingame">
<h1> Match menu </h1>
<blocklink class="rightfloat" onClick="exec disconnect"> Leave match</blocklink>
<blocklink class="leftalign" onClick="hide ingame">Resume action</blocklink>
<blocklink class="rightfloat" onClick='Events.pushevent("exec disconnect", event)'> Leave match</blocklink>
<blocklink class="leftalign" onClick='Events.pushevent("hide ingame", event)'>Resume action</blocklink>

<h2> Teams </h2>
<indent>
<blocklink onClick="exec team alien; hide ingame_menu"> Join aliens</blocklink>
<blocklink onClick="exec team human; hide ingame_menu"> Join humans</blocklink>
<blocklink onClick="exec team spec; hide ingame_menu"> Spectate </blocklink>
<blocklink onClick='Events.pushevent("exec team alien; hide ingame_menu", event)'> Join aliens</blocklink>
<blocklink onClick='Events.pushevent("exec team human; hide ingame_menu", event)'> Join humans</blocklink>
<blocklink onClick='Events.pushevent("exec team spec; hide ingame_menu", event)'> Spectate </blocklink>
</indent>

<h2> Democracy </h2>
<indent>
<blocklink class="fake">
Global vote: <ilink onClick="exec vote yes">yes</ilink> or
<ilink onClick="exec vote no">no</ilink>
Global vote: <ilink onClick='Events.pushevent("exec vote yes", event)'>yes</ilink> or
<ilink onClick='Events.pushevent("exec vote no", event)'>no</ilink>
</blocklink>
<blocklink class="fake">
Team vote: <ilink onClick="exec teamvote yes">yes</ilink> or
<ilink onClick="exec teamvote no">no</ilink>
Team vote: <ilink onClick='Events.pushevent("exec teamvote yes", event)'>yes</ilink> or
<ilink onClick='Events.pushevent("exec teamvote no", event)'>no</ilink>
</blocklink>
<blocklink onClick="exec callvote kickbots"> Kick bots </blocklink>
<!-- <blocklink onClick="show callvote_map"> Change map </blocklink> -->
<blocklink onClick="exec callvote extend"> Extend timelimit </blocklink>
<blocklink onClick="show callvote_draw"> Call a draw </blocklink>
<blocklink onClick="exec callteamvote admitdefeat"> Admit defeat </blocklink>
<blocklink onClick='Events.pushevent("exec callvote kickbots", event)'> Kick bots </blocklink>
<!-- <blocklink onClick='Events.pushevent("show callvote_map", event)'> Change map </blocklink> -->
<blocklink onClick='Events.pushevent("exec callvote extend", event)'> Extend timelimit </blocklink>
<blocklink onClick='Events.pushevent("show callvote_draw", event)'> Call a draw </blocklink>
<blocklink onClick='Events.pushevent("exec callteamvote admitdefeat", event)'> Admit defeat </blocklink>
</indent>

</sidesection>

<if cvar="sv_running" condition="==" value="1">
<sidesection id="sidebar_host">
<h1> Host menu </h1>
<blocklink class="rightfloat" onClick="exec disconnect"> Stop server </blocklink>
<blocklink class="leftalign" onClick="exec pause">Pause server</blocklink>
<blocklink class="rightfloat" onClick='Events.pushevent("exec disconnect", event)'> Stop server </blocklink>
<blocklink class="leftalign" onClick='Events.pushevent("exec pause", event)'>Pause server</blocklink>

<h2>Configuration</h2>
<indent>
<blocklink onClick="show server_general"> Server setup </blocklink>
<blocklink onClick="show server_bots"> Bots </blocklink>
<blocklink onClick='Events.pushevent("show server_general", event)'> Server setup </blocklink>
<blocklink onClick='Events.pushevent("show server_bots", event)'> Bots </blocklink>
</indent>

<h2>Map</h2>
<indent>
<!-- <blocklink onClick="show callvote_map">Change map</blocklink> -->
<blocklink onClick="exec layoutLoad default">Reset match</blocklink>
<!-- <blocklink onClick='Events.pushevent("show callvote_map", event)'>Change map</blocklink> -->
<blocklink onClick='Events.pushevent("exec layoutLoad default", event)'>Reset match</blocklink>
</indent>

<h2> Bots </h2>
<indent>
<blocklink onClick="exec bot add Lavishment aliens"> Add an alien bot </blocklink>
<blocklink onClick="exec bot add Pulsifer humans"> Add a human bot </blocklink>
<blocklink onClick="exec bot del all"> Remove all bots </blocklink>
<blocklink onClick='Events.pushevent("exec bot add Lavishment aliens", event)'> Add an alien bot </blocklink>
<blocklink onClick='Events.pushevent("exec bot add Pulsifer humans", event)'> Add a human bot </blocklink>
<blocklink onClick='Events.pushevent("exec bot del all", event)'> Remove all bots </blocklink>
</indent>

<!--
<h2> Players </h2>
<indent>
<blocklink onClick="show server_discipline">Disclipline: kick/ban/mute/nobuild</blocklink>
<blocklink onClick='Events.pushevent("show server_discipline", event)'>Disclipline: kick/ban/mute/nobuild</blocklink>
</indent>
-->
</sidesection>
Expand All @@ -87,31 +87,31 @@

<h2> Play</h2>
<indent>
<blocklink onClick="show serverbrowser"> Server listings</blocklink>
<blocklink onClick="show createserver"> Start local/LAN game</blocklink>
<!-- <blocklink onClick="show demos"> Recorded demos </blocklink> -->
<blocklink onClick='Events.pushevent("show serverbrowser", event)'> Server listings</blocklink>
<blocklink onClick='Events.pushevent("show createserver", event)'> Start local/LAN game</blocklink>
<!-- <blocklink onClick='Events.pushevent("show demos", event)'> Recorded demos </blocklink> -->
</indent>

<h2> Options </h2>
<indent>
<blocklink onClick="show options_player"> Player </blocklink>
<blocklink onClick="show options_graphics"> Graphics </blocklink>
<blocklink onClick="show options_keys"> Key bindings </blocklink>
<blocklink onClick="show options_mouse"> Mouse and aim </blocklink>
<blocklink onClick="show options_sound"> Sound </blocklink>
<blocklink onClick="show options_ui"> User interface and HUD </blocklink>
<!-- <blocklink onClick="show options_fov"> Fields of view </blocklink> -->
<blocklink onClick='Events.pushevent("show options_player", event)'> Player </blocklink>
<blocklink onClick='Events.pushevent("show options_graphics", event)'> Graphics </blocklink>
<blocklink onClick='Events.pushevent("show options_keys", event)'> Key bindings </blocklink>
<blocklink onClick='Events.pushevent("show options_mouse", event)'> Mouse and aim </blocklink>
<blocklink onClick='Events.pushevent("show options_sound", event)'> Sound </blocklink>
<blocklink onClick='Events.pushevent("show options_ui", event)'> User interface and HUD </blocklink>
<!-- <blocklink onClick='Events.pushevent("show options_fov", event)'> Fields of view </blocklink> -->
</indent>

<h2> Lore </h2>
<indent>
<blocklink onClick="show help_gameplay"> Gameplay guide </blocklink>
<blocklink onClick="show help_textentry"> Colour codes and symbols </blocklink>
<blocklink onClick='Events.pushevent("show help_gameplay", event)'> Gameplay guide </blocklink>
<blocklink onClick='Events.pushevent("show help_textentry", event)'> Colour codes and symbols </blocklink>
</indent>

<br />

<blocklink class="rightfloat" onClick="exec quit"> Quit game</blocklink>
<blocklink class="rightfloat" onClick='Events.pushevent("exec quit", event)'> Quit game</blocklink>
<blocklink class="leftalign fake" style="color: #666666;"> Alpha 0.30 </blocklink>
</sidesection>

Expand Down

0 comments on commit 7779e36

Please sign in to comment.