Skip to content

Commit 02c4b2a

Browse files
authored
Merge pull request #4278 from myk002/myk_default_squads
[Gui] include dwarfmode/Default if only other panel is Squads
2 parents 4dbc8ce + 9324a30 commit 02c4b2a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Template for new versions:
7777
- ``Gui::MTB_clean``, ``Gui::MTB_parse``, ``Gui::MTB_set_width``: new functions for manipulating ``markup_text_boxst``
7878
- ``toupper_cp437(char)``, ``tolower_cp437(char)``: new ``MiscUtils`` functions, return a char with case changed, respecting CP437
7979
- ``toUpper``, ``toLower``: ``MiscUtils`` functions renamed to ``toUpper_cp437`` and ``toLower_cp437``, CP437 compliant
80+
- Gui focus strings will now include ``dwarfmode/Default`` if the only other panel open is the Squads panel
8081

8182
## Lua
8283
- Overlay framework now respects ``active`` and ``visible`` widget attributes

library/modules/Gui.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,16 +722,17 @@ DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
722722
newFocusString += "/Default";
723723
focusStrings.push_back(newFocusString);
724724
}
725-
// squads should be last because it's the only one not exclusive with the others? or something?
725+
726+
if (!focusStrings.size()) {
727+
focusStrings.push_back(baseFocus + "/Default");
728+
}
729+
730+
// squads panel is not exclusive with the others
726731
if (game->main_interface.squads.open) {
727732
newFocusString = baseFocus;
728733
newFocusString += "/Squads";
729734
focusStrings.push_back(newFocusString);
730735
}
731-
732-
if (!newFocusString.size()) {
733-
focusStrings.push_back(baseFocus + "/Default");
734-
}
735736
}
736737

737738
/* TODO: understand how this changes for v50

0 commit comments

Comments
 (0)