I think this is the best I can do for a hover vs. click shader effect. Just do it in a shader based on a uniform setting.

This commit is contained in:
Zed A. Shaw 2025-04-15 01:01:44 -04:00
parent 84a5f06dac
commit 7186c2ecb0
16 changed files with 54 additions and 38 deletions

View file

@ -235,18 +235,24 @@ namespace gui {
if(mouse->button == sf::Mouse::Button::Left) {
sf::Vector2f pos = $window.mapPixelToCoords(mouse->position);
if(in_state(State::NEXT_LEVEL)) {
$boss_fight_ui->mouse(pos.x, pos.y);
$boss_fight_ui->mouse(pos.x, pos.y, false);
if($boss_fight_ui->boss_dead()) {
event(Event::STAIRS_DOWN);
}
} else {
$debug_ui.mouse(pos.x, pos.y);
$combat_ui.mouse(pos.x, pos.y);
$status_ui.mouse(pos.x, pos.y);
$main_ui.mouse(pos.x, pos.y);
$debug_ui.mouse(pos.x, pos.y, false);
$combat_ui.mouse(pos.x, pos.y, false);
$status_ui.mouse(pos.x, pos.y, false);
$main_ui.mouse(pos.x, pos.y, false);
}
}
} else if(const auto* mouse = ev->getIf<sf::Event::MouseMoved>()) {
sf::Vector2f pos = $window.mapPixelToCoords(mouse->position);
$debug_ui.mouse(pos.x, pos.y, true);
$combat_ui.mouse(pos.x, pos.y, true);
$status_ui.mouse(pos.x, pos.y, true);
$main_ui.mouse(pos.x, pos.y, true);
}
if(const auto* key = ev->getIf<sf::Event::KeyPressed>()) {