gui2/tgamestate_inspector: Don't skip pages with empty contents
Those are sometimes relevant (for example, empty WML variables or containers/arrays). We don't want to conceal the truth here because this is supposed to be a debugging aid.
This commit is contained in:
parent
4deeef797d
commit
019d829b41
2 changed files with 7 additions and 0 deletions
|
@ -112,6 +112,8 @@ Version 1.13.1+dev:
|
|||
messages involving macros.
|
||||
* Added WML menu item and event handler views to the Gamestate Inspector
|
||||
dialog.
|
||||
* The Gamestate Inspector now displays empty WML variables too (including
|
||||
containers/arrays).
|
||||
* Added new possibilities for [effect]:
|
||||
* apply_to=alignment - change a unit's alignment
|
||||
* apply_to=attacks_left - change a unit's attacks per turn
|
||||
|
|
|
@ -191,6 +191,11 @@ public:
|
|||
|
||||
unsigned int get_num_page(const std::string& s)
|
||||
{
|
||||
// We always want to reserve a page for empty contents.
|
||||
if(s.empty()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return (s.length() / max_inspect_win_len) + (s.length() % max_inspect_win_len > 0 ? 1 : 0);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue