Swapping and putting back now work in the status_ui inventory, but now I need to refactor so this operation works on any inventory::Model.

This commit is contained in:
Zed A. Shaw 2025-07-02 23:24:06 -04:00
parent 784f753e72
commit 2421a33bb0
3 changed files with 34 additions and 4 deletions

View file

@ -111,10 +111,16 @@ namespace gui {
dbc::check(worked, "Need to fix this, should be able to abort.");
END(CLOSE);
} break;
case INV_SELECT:
if(commit_move($status_ui.$gui, $grab_source, data)) {
END(CLOSE);
}
case INV_SELECT: {
auto drop_id = std::any_cast<guecs::Entity>(data);
if($status_ui.occupied(drop_id)) {
$status_ui.swap(*$grab_source, drop_id);
END(CLOSE);
} else if(commit_move($status_ui.$gui, $grab_source, data)) {
END(CLOSE);
}
} break;
break;
default:
handle_mouse(ev, $status_ui.$gui);