Wait icon refactor - #503
Conversation
138e744 to
8b31dae
Compare
…and add an independent KeyWaitIcon instance
…ly called once per tick
…logue box is invisible The LCCs don't allow for rendering when the dialogue box is invisible, MOFDH does
8b31dae to
f8dc21a
Compare
| void LoadAnimations() { | ||
| EnsurePushMemberOfType("Animations", LUA_TTABLE); | ||
| { | ||
| EnsurePushMemberOfType("Animations", LUA_TTABLE); |
There was a problem hiding this comment.
you could declare lua getters for SpriteAnimationDef and then just do a EnsureGet for Animations, and do the same for FixedSpriteAnimationDef
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)...
| static std::optional<SpriteAnimation> ResourceLoadBg; | ||
| static std::optional<SpriteAnimation> SaveLoadBg; | ||
| static std::optional<SpriteAnimation> LoadingIcon; | ||
| static std::optional<SpriteAnimation> LoadingText; |
There was a problem hiding this comment.
Why do these need to be optional if it's always being emplaced
There was a problem hiding this comment.
Delayed construction. SpriteAnimations hold a reference wrapper to their definition, so the default constructor is deleted
…ePage, and add an independent KeyWaitIcon instance
(Fixed)SpriteAnimationWaitIconDisplayto use classes insteadDialoguePageaWaitIconinstanceKeyWaitIconinstanceWaitIconDispTypefield inMesModeFormatSW_MESWINTYPEenumA very large part of this PR is mindless API changes dw
The
WaitIconDrawableWithoutTextboxprofile flag is required because the LCCs hardcode the wait icon display inside the text window rendering function, whereas MOFDH does so outside