antivirak / japonsko-vn

RenPy visual novel about gaijin trip to japan
0 stars 0 forks source link

Feature/parking bill minigame #73

Closed antivirak closed 1 month ago

antivirak commented 1 month ago

Summary by Sourcery

Refactor the parking machine game to use a property for pointer position, adjust screen positioning logic for different display modes, and update import statements for compatibility.

Enhancements:

Chores:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request implements changes to the parking bill minigame, focusing on refactoring the pointer position handling, adjusting the game's UI for different screen sizes and fullscreen mode, and making minor updates to several screen definitions.

Class diagram for updated pointer position handling

classDiagram
    class ParkingMachine {
        - float mouse_pointer_position
        - float bar_shift
        - float bar_velocity
        + float pointer_position
        + update_input(float value)
        + update_logic(bool pointer_in_hotspot, float time_delta) bool
        + bar_width_scale() float
        + move_mouse()
    }
    ParkingMachine : + pointer_position
    ParkingMachine : + pointer_position(float pos)
    ParkingMachine : + move_mouse()

File-Level Changes

Change Details Files
Refactored pointer position handling in the parking machine minigame
  • Replaced direct assignment with a property setter for pointer_position
  • Updated all instances of set_pointer_pos() to use the new pointer_position property
  • Renamed set_pointer_pos() method to move_mouse()
game/parking_machine_ren.py
Improved UI scaling for different screen sizes and fullscreen mode
  • Added conditional logic to handle fullscreen and windowed modes differently
  • Updated calculations for cursor position, bar position, and other UI elements based on screen size
  • Introduced new variables for screen size calculations
game/parking_machine_ren.py
Updated screen definitions to use proper function syntax
  • Changed screen definitions from 'screen name:' to 'screen name():'
game/dictionary/screen.rpy
game/rightside-menu/screen.rpy
game/stats-overview/screen.rpy
Minor import statement updates
  • Updated import statements in minigame_room_selection.rpy
game/minigame_room_selection.rpy

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).