Skip to content

Commit

Permalink
Merge pull request #4278 from myk002/myk_default_squads
Browse files Browse the repository at this point in the history
[Gui] include dwarfmode/Default if only other panel is Squads
  • Loading branch information
myk002 authored Feb 17, 2024
2 parents 4dbc8ce + 9324a30 commit 02c4b2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Template for new versions:
- ``Gui::MTB_clean``, ``Gui::MTB_parse``, ``Gui::MTB_set_width``: new functions for manipulating ``markup_text_boxst``
- ``toupper_cp437(char)``, ``tolower_cp437(char)``: new ``MiscUtils`` functions, return a char with case changed, respecting CP437
- ``toUpper``, ``toLower``: ``MiscUtils`` functions renamed to ``toUpper_cp437`` and ``toLower_cp437``, CP437 compliant
- Gui focus strings will now include ``dwarfmode/Default`` if the only other panel open is the Squads panel

## Lua
- Overlay framework now respects ``active`` and ``visible`` widget attributes
Expand Down
11 changes: 6 additions & 5 deletions library/modules/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,16 +722,17 @@ DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
newFocusString += "/Default";
focusStrings.push_back(newFocusString);
}
// squads should be last because it's the only one not exclusive with the others? or something?

if (!focusStrings.size()) {
focusStrings.push_back(baseFocus + "/Default");
}

// squads panel is not exclusive with the others
if (game->main_interface.squads.open) {
newFocusString = baseFocus;
newFocusString += "/Squads";
focusStrings.push_back(newFocusString);
}

if (!newFocusString.size()) {
focusStrings.push_back(baseFocus + "/Default");
}
}

/* TODO: understand how this changes for v50
Expand Down

0 comments on commit 02c4b2a

Please sign in to comment.