Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the UI text rendering and scene layout logic, focusing on more accurate dimension calculations, improved font management, and better handling of dynamic content in the
TitleScene. The changes ensure that UI elements such as the title text and menu are positioned and sized correctly, even when fonts or console state change at runtime.UI Text Rendering and Font Management:
Textclass to separate font and text management, introducingsetFontName()andgetFontName()methods, and ensuring that changes to text or font immediately update the raw lines and dimensions. Also added arefreshDimensions()helper for best-effort dimension recalculation. [1] [2] [3]setPosition()inTextto recalculate dimensions before updating position, ensuring layout remains accurate if the text content or font changes.Scene and Menu Layout Improvements:
uiHeightproperty toTitleScenefor dynamic UI sizing based on title text and menu items.Rectfor menu dimensions and refining calculation of menu margins. [1] [2]Title Text Positioning and Debugging:
setTitleText()inTitleSceneto refresh text dimensions after updating the text, ensuring correct centering and layout. Added detailed debug logging for easier troubleshooting.Screen Dimension Fixes:
Gameclass to usetput linesinstead oftput cols, fixing a bug where the screen height could be set incorrectly.resolveScreenWidth()inTitleSceneto remove an unnecessary call toget_screen_width(), relying on internal state and settings for consistency.