diff --git a/gui/fsm.cpp b/gui/fsm.cpp index 3f020f6..d87bb50 100644 --- a/gui/fsm.cpp +++ b/gui/fsm.cpp @@ -147,7 +147,9 @@ namespace gui { auto gui_id = std::any_cast(data); if($grab_source) { - if($status_ui.commit_drop(gui_id)) { + auto& drop = $status_ui.get_drop_target(gui_id); + + if(drop.commit()) { $loot_ui.commit_grab(*$grab_source); $grab_source = std::nullopt; } @@ -192,7 +194,9 @@ namespace gui { auto gui_id = std::any_cast(data); if($grab_source) { - if($loot_ui.commit_drop(gui_id)) { + auto& drop = $loot_ui.get_drop_target(gui_id); + + if(drop.commit()) { $status_ui.commit_grab(*$grab_source); $grab_source = std::nullopt; } diff --git a/gui/loot_ui.cpp b/gui/loot_ui.cpp index f9c49f2..30ffabf 100644 --- a/gui/loot_ui.cpp +++ b/gui/loot_ui.cpp @@ -125,14 +125,4 @@ namespace gui { dbc::log("begin the loot drop"); $selected_entity = world_entity; } - - bool LootUI::commit_drop(DinkyECS::Entity gui_id) { - if($gui.has(gui_id)) { - auto& drop = get_drop_target(gui_id); - return drop.commit(); - } else { - // NOTE: I think I need to cancel the drop or something? - return false; - } - } } diff --git a/gui/loot_ui.hpp b/gui/loot_ui.hpp index 3a22f5a..2e9cbfb 100644 --- a/gui/loot_ui.hpp +++ b/gui/loot_ui.hpp @@ -30,7 +30,6 @@ namespace gui { guecs::DropTarget& get_drop_target(DinkyECS::Entity gui_id); void begin_drop(DinkyECS::Entity world_entity); - bool commit_drop(DinkyECS::Entity gui_id); bool place_slot(DinkyECS::Entity id); }; } diff --git a/gui/status_ui.cpp b/gui/status_ui.cpp index c528e3d..c7530eb 100644 --- a/gui/status_ui.cpp +++ b/gui/status_ui.cpp @@ -104,12 +104,6 @@ namespace gui { $selected_entity = world_entity; } - bool StatusUI::commit_drop(DinkyECS::Entity gui_id) { - // BUG: just roll this into DropTarget - auto& drop = get_drop_target(gui_id); - return drop.commit(); - } - guecs::GrabSource& StatusUI::get_grab_source(DinkyECS::Entity gui_id) { dbc::check($gui.has(gui_id), "invalid GrabSource requested, entity isn't in the GUI."); diff --git a/gui/status_ui.hpp b/gui/status_ui.hpp index 1b77959..eded60a 100644 --- a/gui/status_ui.hpp +++ b/gui/status_ui.hpp @@ -32,7 +32,6 @@ namespace gui { guecs::DropTarget& get_drop_target(DinkyECS::Entity gui_id); void begin_drop(DinkyECS::Entity world_entity); - bool commit_drop(DinkyECS::Entity gui_id); bool place_slot(DinkyECS::Entity gui_id); }; }