forked from mirrors/0ad
Toggle the visibility of the session GUI instantly, rather than waiting possibly indefinitely for the next simulation turn.
Differential Revision: https://code.wildfiregames.com/D1464 Reviewed By: bb This was SVN commit r21765.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
</object>
|
||||
|
||||
<object hotkey="session.gui.toggle">
|
||||
<action on="Press">g_ShowGUI = !g_ShowGUI;</action>
|
||||
<action on="Press">toggleGUI();</action>
|
||||
</object>
|
||||
|
||||
<object hotkey="session.gui.menu.toggle">
|
||||
|
||||
@@ -933,11 +933,17 @@ function confirmExit()
|
||||
g_ConfirmExit = false;
|
||||
}
|
||||
|
||||
function toggleGUI()
|
||||
{
|
||||
g_ShowGUI = !g_ShowGUI;
|
||||
updateCinemaPath();
|
||||
}
|
||||
|
||||
function updateCinemaPath()
|
||||
{
|
||||
let isPlayingCinemaPath = GetSimState().cinemaPlaying && !g_Disconnected;
|
||||
|
||||
Engine.GetGUIObjectByName("sn").hidden = !g_ShowGUI || isPlayingCinemaPath;
|
||||
Engine.GetGUIObjectByName("session").hidden = !g_ShowGUI || isPlayingCinemaPath;
|
||||
Engine.Renderer_SetSilhouettesEnabled(!isPlayingCinemaPath && Engine.ConfigDB_GetValue("user", "silhouettes") == "true");
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<script directory="gui/common/"/>
|
||||
<script directory="gui/session/"/>
|
||||
|
||||
<object name="sn">
|
||||
<object name="session">
|
||||
|
||||
<action on="Tick">
|
||||
onTick();
|
||||
|
||||
Reference in New Issue
Block a user