Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
This commit is contained in:

committed by
Peter Nelson

parent
a12f426d69
commit
b86182ab84
@@ -646,9 +646,9 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
|
||||
void OnTimeout() override
|
||||
{
|
||||
for (uint i = WID_ETT_START; i < this->nested_array_size; i++) {
|
||||
if (i == WID_ETT_BUTTONS_START) i = WID_ETT_BUTTONS_END; // skip the buttons
|
||||
this->RaiseWidgetWhenLowered(i);
|
||||
for (const auto &pair : this->widget_lookup) {
|
||||
if (pair.first < WID_ETT_START || (pair.first >= WID_ETT_BUTTONS_START && pair.first < WID_ETT_BUTTONS_END)) continue; // skip the buttons
|
||||
this->RaiseWidgetWhenLowered(pair.first);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user