Animations are refactored to let me spawn in an 'attack animation' but I think the data model is wrong. Rather than spawning in an animation every time I can probably just make one, reposition it, then tell it to play. I'll have to try it.
This commit is contained in:
parent
8384b11993
commit
ad3e580495
15 changed files with 109 additions and 56 deletions
|
|
@ -412,6 +412,7 @@ namespace gui {
|
|||
draw_gui();
|
||||
}
|
||||
|
||||
System::clear_attack();
|
||||
$window.display();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace gui {
|
|||
$ritual_ui = textures::get_sprite("ritual_crafting_area");
|
||||
$ritual_ui.sprite->setPosition($gui.get_position());
|
||||
$ritual_ui.sprite->setTextureRect($ritual_closed_rect);
|
||||
$ritual_anim = animation::load("ritual_blanket");
|
||||
$ritual_anim = animation::load("ritual_crafting_area");
|
||||
|
||||
auto open_close_toggle = $gui.entity("ritual_ui");
|
||||
$gui.set<Clickable>(open_close_toggle, {
|
||||
|
|
@ -84,7 +84,6 @@ namespace gui {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void UI::CLOSED(Event ev) {
|
||||
if(ev == Event::TOGGLE) {
|
||||
$ritual_anim.play();
|
||||
|
|
@ -95,7 +94,7 @@ namespace gui {
|
|||
|
||||
void UI::OPENING(Event ev) {
|
||||
if(ev == Event::TICK) {
|
||||
if(!animation::apply($ritual_anim, $ritual_ui)) {
|
||||
if(!animation::apply($ritual_anim, *$ritual_ui.sprite)) {
|
||||
state(State::OPENED);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue