|
|
|
@ -124,7 +124,7 @@ namespace gui { |
|
|
|
|
case MOUSE_DRAG_START: |
|
|
|
|
case MOUSE_CLICK: |
|
|
|
|
case MOUSE_DROP: |
|
|
|
|
mouse_action(false); |
|
|
|
|
mouse_action(guecs::NO_MODS); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
if(!$dnd_loot.event(ev, data)) { |
|
|
|
@ -202,11 +202,11 @@ namespace gui { |
|
|
|
|
} break; |
|
|
|
|
case MOUSE_CLICK: |
|
|
|
|
fmt::println("CLICK: {}", $router.left_button); |
|
|
|
|
mouse_action(false); |
|
|
|
|
break; |
|
|
|
|
case MOUSE_MOVE: |
|
|
|
|
mouse_action(true); |
|
|
|
|
mouse_action(guecs::NO_MODS); |
|
|
|
|
break; |
|
|
|
|
case MOUSE_MOVE: { |
|
|
|
|
mouse_action({1 << guecs::ModBit::hover}); |
|
|
|
|
} break; |
|
|
|
|
case AIM_CLICK: |
|
|
|
|
System::pickup($level); |
|
|
|
|
break; |
|
|
|
@ -226,7 +226,7 @@ namespace gui { |
|
|
|
|
break; |
|
|
|
|
case MOUSE_CLICK: { |
|
|
|
|
sf::Vector2f pos = mouse_position(); |
|
|
|
|
$boss_fight_ui->mouse(pos.x, pos.y, false); |
|
|
|
|
$boss_fight_ui->mouse(pos.x, pos.y, guecs::NO_MODS); |
|
|
|
|
|
|
|
|
|
if($boss_fight_ui->boss_dead()) { |
|
|
|
|
event(Event::STAIRS_DOWN); |
|
|
|
@ -242,11 +242,11 @@ namespace gui { |
|
|
|
|
|
|
|
|
|
switch(ev) { |
|
|
|
|
case MOUSE_CLICK: |
|
|
|
|
mouse_action(false); |
|
|
|
|
break; |
|
|
|
|
case MOUSE_MOVE: |
|
|
|
|
mouse_action(true); |
|
|
|
|
mouse_action(guecs::NO_MODS); |
|
|
|
|
break; |
|
|
|
|
case MOUSE_MOVE: { |
|
|
|
|
mouse_action({1 << guecs::ModBit::hover}); |
|
|
|
|
} break; |
|
|
|
|
case ATTACK: |
|
|
|
|
$main_ui.dirty(); |
|
|
|
|
sound::play("Sword_Hit_1"); |
|
|
|
@ -295,16 +295,16 @@ namespace gui { |
|
|
|
|
return $window.mapPixelToCoords($router.position); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FSM::mouse_action(bool hover) { |
|
|
|
|
void FSM::mouse_action(guecs::Modifiers mods) { |
|
|
|
|
sf::Vector2f pos = mouse_position(); |
|
|
|
|
if($debug_ui.active) $debug_ui.mouse(pos.x, pos.y, hover); |
|
|
|
|
$combat_ui.mouse(pos.x, pos.y, hover); |
|
|
|
|
$status_ui.mouse(pos.x, pos.y, hover); |
|
|
|
|
if($debug_ui.active) $debug_ui.mouse(pos.x, pos.y, mods); |
|
|
|
|
$combat_ui.mouse(pos.x, pos.y, mods); |
|
|
|
|
$status_ui.mouse(pos.x, pos.y, mods); |
|
|
|
|
|
|
|
|
|
if($loot_ui.active) { |
|
|
|
|
$loot_ui.mouse(pos.x, pos.y, hover); |
|
|
|
|
$loot_ui.mouse(pos.x, pos.y, mods); |
|
|
|
|
} else { |
|
|
|
|
$main_ui.mouse(pos.x, pos.y, hover); |
|
|
|
|
$main_ui.mouse(pos.x, pos.y, mods); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -444,6 +444,8 @@ namespace gui { |
|
|
|
|
auto [evt, entity, data] = world.recv<eGUI>(); |
|
|
|
|
auto player = world.get_the<Player>(); |
|
|
|
|
|
|
|
|
|
// HERE: this has to go, unify these events and just use them in the state machine directly
|
|
|
|
|
|
|
|
|
|
switch(evt) { |
|
|
|
|
case eGUI::COMBAT: { |
|
|
|
|
auto &damage = std::any_cast<Events::Combat&>(data); |
|
|
|
|