Allow the JS GUI to subscribe to the window resized event and use it to conditionally update the observer panel (refs D689).
Differential Revision: https://code.wildfiregames.com/D694 Tested By: temple Proofread By: Vladislav This was SVN commit r19846.
This commit is contained in:
parent
5e6b502eab
commit
6f7a5fb773
@ -772,6 +772,12 @@ function onTick()
|
||||
Engine.GuiInterfaceCall("ClearRenamedEntities");
|
||||
}
|
||||
|
||||
function onWindowResized()
|
||||
{
|
||||
// Update followPlayerLabel
|
||||
updateTopPanel();
|
||||
}
|
||||
|
||||
function changeGameSpeed(speed)
|
||||
{
|
||||
if (!g_IsNetworked)
|
||||
|
@ -17,10 +17,15 @@
|
||||
<script directory="gui/session/"/>
|
||||
|
||||
<object name="sn">
|
||||
|
||||
<action on="Tick">
|
||||
onTick();
|
||||
</action>
|
||||
|
||||
<action on="WindowResized">
|
||||
onWindowResized();
|
||||
</action>
|
||||
|
||||
<action on="SimulationUpdate">
|
||||
onSimulationUpdate();
|
||||
</action>
|
||||
|
@ -419,8 +419,16 @@ void CGUIManager::Draw()
|
||||
|
||||
void CGUIManager::UpdateResolution()
|
||||
{
|
||||
for (const SGUIPage& p : m_PageStack)
|
||||
// Save an immutable copy so iterators aren't invalidated by event handlers
|
||||
PageStackType pageStack = m_PageStack;
|
||||
|
||||
for (const SGUIPage& p : pageStack)
|
||||
{
|
||||
m_CurrentGUI = p.gui;
|
||||
p.gui->UpdateResolution();
|
||||
p.gui->SendEventToAll("WindowResized");
|
||||
}
|
||||
m_CurrentGUI.reset();
|
||||
}
|
||||
|
||||
bool CGUIManager::TemplateExists(const std::string& templateName) const
|
||||
|
Loading…
Reference in New Issue
Block a user