|
|
|
@ -60,10 +60,7 @@ namespace guecs { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Sound::play(bool hover) { |
|
|
|
|
if(hover) { |
|
|
|
|
// BUG: need to sort out how to make hover a one shot thing
|
|
|
|
|
// sound::play(on_hover);
|
|
|
|
|
} else { |
|
|
|
|
if(!hover) { |
|
|
|
|
sound::play(on_click); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -235,17 +232,14 @@ namespace guecs { |
|
|
|
|
if((x >= cell.x && x <= cell.x + cell.w) && |
|
|
|
|
(y >= cell.y && y <= cell.y + cell.h)) |
|
|
|
|
{ |
|
|
|
|
if($world.has<Effect>(ent)) { |
|
|
|
|
auto& effect = $world.get<Effect>(ent); |
|
|
|
|
do_if<Effect>(ent, [hover](auto& effect) { |
|
|
|
|
effect.$shader->setUniform("hover", hover); |
|
|
|
|
effect.run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if($world.has<Sound>(ent)) { |
|
|
|
|
auto& sound = $world.get<Sound>(ent); |
|
|
|
|
sound.play(hover); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
do_if<Sound>(ent, [hover](auto& sound) { |
|
|
|
|
sound.play(hover); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(hover) return; // kinda gross
|
|
|
|
|
|
|
|
|
|