Animator won't crash anymore when there's an error, and instead displays an error message.

This commit is contained in:
Zed A. Shaw 2026-02-07 13:05:24 -05:00
parent 46f34828e4
commit 0d481a5ab7
6 changed files with 76 additions and 18 deletions

View file

@ -26,6 +26,7 @@ namespace animator {
struct UI {
guecs::UI $ui;
guecs::UI $overlay;
bool $initialized_this_sucks_ass = false;
void button(const std::string& name, std::function<void(guecs::Modifiers mods)> cb);
void init(const std::string& sprite_name, const std::string& background, int width, int height);
@ -33,6 +34,8 @@ namespace animator {
bool mouse(float x, float y, guecs::Modifiers mods);
void update_status(animate2::Animate2& anim);
std::shared_ptr<sf::Sprite> get_sprite();
void show_error(const std::string& message);
void clear_error();
};
struct FSM : public DeadSimpleFSM<State, Event> {
@ -50,7 +53,7 @@ namespace animator {
sf::Clock $timer;
std::string $cur_form = "idle";
int $cur_form_i = 0;
bool $mute = false;
bool $mute = true;
void init(const std::string &sprite_name, const std::string& background, const std::string &anim_name);
void event(Event ev, std::any data={});