Skip to content

Wait icon refactor - #503

Open
PringlesGang wants to merge 9 commits into
masterfrom
wait-icon-refactor
Open

Wait icon refactor#503
PringlesGang wants to merge 9 commits into
masterfrom
wait-icon-refactor

Conversation

@PringlesGang

@PringlesGang PringlesGang commented Jul 28, 2026

Copy link
Copy Markdown
Member
  • Refactors (Fixed)SpriteAnimation
  • Refactors WaitIconDisplay to use classes instead
  • Gives each DialoguePage a WaitIcon instance
  • Adds a global KeyWaitIcon instance
  • Touches up wait icon display conditions
  • Touches up auto/skip/wait icon profile parameters
  • Make use of WaitIconDispType field in MesModeFormat
  • Add SW_MESWINTYPE enum

A very large part of this PR is mindless API changes dw

The WaitIconDrawableWithoutTextbox profile flag is required because the LCCs hardcode the wait icon display inside the text window rendering function, whereas MOFDH does so outside

@PringlesGang PringlesGang self-assigned this Jul 28, 2026
Base automatically changed from chlcc/seira-alarm to master July 28, 2026 21:42
@PringlesGang
PringlesGang marked this pull request as ready for review July 29, 2026 00:03
void LoadAnimations() {
EnsurePushMemberOfType("Animations", LUA_TTABLE);
{
EnsurePushMemberOfType("Animations", LUA_TTABLE);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you could declare lua getters for SpriteAnimationDef and then just do a EnsureGet for Animations, and do the same for FixedSpriteAnimationDef

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You mean just forego the whole (FixedSprite)Animations hashmaps and directly fetch the animation definitions in the profile initialization? Because right now TryGet<SpriteAnimationDef>() is implemented as getting from that map

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, I mean just use the APIs we have that allow for you to do a tryget if the definition for tryget to the values for the map are defined

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah but the problem is that TryGet<SpriteAnimationDef>() is currently implemented as fetching from the Animations map as per HasEntityType<T>, so I couldn't override it a second time to fetch the original map

Now, I don't see a particular need to go through this map anyway, because we're now pretty much just storing them twice (both in the map and in the inline profile variables)...

Comment on lines +18 to +21
static std::optional<SpriteAnimation> ResourceLoadBg;
static std::optional<SpriteAnimation> SaveLoadBg;
static std::optional<SpriteAnimation> LoadingIcon;
static std::optional<SpriteAnimation> LoadingText;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do these need to be optional if it's always being emplaced

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Delayed construction. SpriteAnimations hold a reference wrapper to their definition, so the default constructor is deleted

Comment thread src/hud/waiticondisplay.h Outdated
Comment thread src/profile/dialogue.cpp
Comment thread src/hud/chlcc/dialoguebox.cpp Outdated
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