Closed cursor442 closed 7 months ago
Creating a new game after adding enough to the log to add a new page leaves the extra tab up, which then crashes the game when clicked.
Tab for new page is now drawn but main tab bar disappears when it is added. Extra tab still persists after new game.
Main tab bar still works even though it is invisible. Extra tab is gone after new game but Page 1 tab is only one character wide.
Main tab bar no longer hidden. Would be better to not redraw it every time the log tab bar is used but that can be dealt with in the future.
Custom text button also disappears when switching between tabs. What's strange is that the text width bounds for the Page 1 tab are set to 0 when making a new game (but of course not when making the original game) but all tabs after it are calculated correctly.
Switching to the nation screen before making the new game results in a crash when switching back to the log screen.
Crash is resolved. Log class should report that there is a new page upon the start of a new game. The next page number variable was uninitialized otherwise.
The log screen bar wasn't being deleted when there was only one page, just when there were multiple pages. The tab width was of course fine when the tab bar wasn't deleted. Try only fully deleting the tab bar when exiting the application and just delete tabs after tab 1 when calling destroyLogScreen to create a new game or load a game.
Deleting all tabs aside from the first seems to work ok. No random crashes in the couple tests either, may have resolved some uninitialized graphics pointer issue in the process. Just fix custom text button disappearing the close the issue.
Just force the hide screen for now. Can undo later when updating log screen to the class-based structure.
The function to add a new tab to the log screen tab bar does not trigger a redraw on its own. It must wait for the next drawing call from another source.