mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Remove g_GUI usage in simulation2/*
This is the last remaining inclusion of a gui file in simulation2/.
This commit is contained in:
+10
-12
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -387,21 +387,19 @@ InReaction CGUIManager::HandleEvent(const SDL_Event_* ev)
|
||||
return IN_PASS;
|
||||
}
|
||||
|
||||
void CGUIManager::SendEventToAll(const CStr& eventName) const
|
||||
|
||||
void CGUIManager::SendEventToAll(const CStr& eventName,
|
||||
std::optional<JS::HandleValueArray> paramData) const
|
||||
{
|
||||
const auto pageStack = GetCopyOfFrozenStack();
|
||||
|
||||
for (const SGUIPage& p : pageStack)
|
||||
p.gui->SendEventToAll(eventName);
|
||||
|
||||
}
|
||||
|
||||
void CGUIManager::SendEventToAll(const CStr& eventName, JS::HandleValueArray paramData) const
|
||||
{
|
||||
const auto pageStack = GetCopyOfFrozenStack();
|
||||
|
||||
for (const SGUIPage& p : pageStack)
|
||||
p.gui->SendEventToAll(eventName, paramData);
|
||||
{
|
||||
if (paramData.has_value())
|
||||
p.gui->SendEventToAll(eventName, paramData.value());
|
||||
else
|
||||
p.gui->SendEventToAll(eventName);
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<bool> CGUIManager::TickObjects()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
/**
|
||||
* See CGUI::SendEventToAll; applies to the currently active page.
|
||||
*/
|
||||
void SendEventToAll(const CStr& eventName) const;
|
||||
void SendEventToAll(const CStr& eventName, JS::HandleValueArray paramData) const;
|
||||
void SendEventToAll(const CStr& eventName,
|
||||
std::optional<JS::HandleValueArray> paramData = std::nullopt) const;
|
||||
|
||||
/**
|
||||
* See CGUI::TickObjects; applies to @em all loaded pages.
|
||||
|
||||
Reference in New Issue
Block a user