You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gate populating metagame tech dropdown and team icons behind flag.
Every time `MetagameGUI::SetEnabled()` was called, each player's tech selection dropdown would get all its entries added to it again. Since the selection code relied on "-Random-" being the first element of the dropdown, if any other "-Random-" entry were selected (even by the random selecvtion code itself!), the player's `m_NativeTechModule` would get set to `-1`. The same commit that moved the code to `MetagameGUI::SetEnabled()` also did something similar to `ScenarioActivityConfigGUI`, but with one key difference: a boolean flag to determine whether or not that loading had occurred. By adding the same to `MetagameUI`, it can be ensured that the tech list only gets populated once.
Additionally, the code was calling `m_apPlayerTechSelect[player]->GetListPanel()->ScrollToTop()` after *every single tech* was added to the list; it makes much more sense just to do it once after finishing. Since `ScenarioActivityConfigGUI` did something similar, I changed it as well. The performance impact is probably negligible, but it's still less redundant function calls.
Lastly, possibly due to copying code from `ScenarioActivityConfigGUI`, the `MetagameGUI` code was iterating through teams instead of players. This had functionally the same effect, but it's more consistent to use `Players::PlayerOne` and `Players::MaxPlayerCount` than `Activity::Teams::TeamOne` and `Activity::Teams::MaxTeamCount` given that, unlike activities, each row is guaranteed to only be one player.
Copy file name to clipboardExpand all lines: Source/Menus/MetagameGUI.h
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -772,6 +772,8 @@ namespace RTE {
772
772
// The scene currently being played, NOT OWNED
773
773
Scene* m_pPlayingScene;
774
774
775
+
bool m_TechAndFlagListFetched; //!< Whether the tech list was fetched and each team's ComboBox was populated with it, even if no valid tech modules were added. The team flags are also populated at the same time.
0 commit comments