Skip to content

Refactor constants and dimension handling for improved flexibility#51

Merged
amasiye merged 3 commits into
mainfrom
develop
Mar 21, 2026
Merged

Refactor constants and dimension handling for improved flexibility#51
amasiye merged 3 commits into
mainfrom
develop

Conversation

@amasiye

@amasiye amasiye commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and refactorings related to screen and viewport sizing, UI activation behavior, and code cleanliness. The main focus is on making screen dimension handling more robust and flexible, improving UI element lifecycle management, and cleaning up debugging output and type annotations.

Screen and viewport sizing improvements:

  • Added logical viewport accessors (getLogicalWidth, getLogicalHeight, getLogicalSize) to Console, and new global functions (get_terminal_width, get_logical_width, get_terminal_height, get_logical_height) for more precise and flexible screen dimension handling. [1] [2] [3]
  • Refactored Game class to use nullable screen width/height, added computed properties for screenWidth and screenHeight with fallback to terminal size, and updated constructor signature accordingly.
  • Updated constants in Constants.php to use define with guards instead of bare const for better compatibility and flexibility.

UI and rendering behavior:

  • Changed UIElement::activate and deactivate to immediately render or erase the element, ensuring UI state is visually consistent with logical state. [1] [2]
  • Updated GUITexture::render to only render when active, preventing unnecessary drawing.

Code cleanliness and debugging:

  • Removed various Debug::log statements from production code for cleaner logs, except for a useful screen width log in TitleScene. [1] [2] [3] [4]
  • Improved type annotations for class properties, e.g., making consoleCursor nullable in Game.

Other improvements:

  • Added exception annotation to resolveScreenWidth for clarity.

Let me know if you have questions about any of these changes!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@amasiye amasiye merged commit 3fa45b2 into main Mar 21, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant