Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test topic and exception for register_img_same #8393

Merged
merged 3 commits into from
Jan 16, 2022

Conversation

ThePotatoGuy
Copy link
Member

@ThePotatoGuy ThePotatoGuy commented Dec 12, 2021

Copied from @multimokia:

Figured the issue out. It's an issue with init order. We should never use register_img_same on the same init level as register_img for the original, because it will always fail provided the tag does not exist yet.

Key Changes

  • Adds a new exception in MASImageTagDecoDefinition.register_img_same when it could not find a deco definition from the source BG (we'll just assume that this is only being called at init time).
  • Adds a testing topic DECO TAG TEST API REG SAME for checking the register_img_same function.

Testing

  • in dev/dev_deco.rpy, uncomment the section under register_img_same init exception - verify that the game raises the new exception on load
  • run the DECO TAG TEST API REG SAME dev topic - verify that the blue deco remains in the same place for each background.

@ThePotatoGuy ThePotatoGuy added awaiting testing code needs to be tested awaiting code review someone needs to check for syntax/logic/indentation errors labels Dec 12, 2021
@ThePotatoGuy ThePotatoGuy added this to the 0.12.6 milestone Dec 12, 2021
@ThePotatoGuy ThePotatoGuy modified the milestones: 0.12.6, 0.12.7 Dec 21, 2021
Copy link
Member

@multimokia multimokia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured the issue out. It's an issue with init order. We should never use register_img_same on the same init level as register_img for the original, because it will always fail provided the tag does not exist yet.

As such:
It might be worth just raising an error or logging in place of silently handling the issue as to actually provide some feedback to the user. Requesting some changes to add logging or an ex throw for it if config.developer

@ThePotatoGuy ThePotatoGuy changed the title Add test topic for register_img_same Add test topic and exception for register_img_same Jan 2, 2022
@ThePotatoGuy
Copy link
Member Author

@multimokia I added an exception

@multimokia multimokia self-requested a review January 2, 2022 16:16
@multimokia multimokia removed awaiting testing code needs to be tested awaiting code review someone needs to check for syntax/logic/indentation errors labels Jan 16, 2022
@multimokia multimokia merged commit 173ebe3 into Monika-After-Story:content Jan 16, 2022
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.

3 participants