@ -83,10 +83,6 @@ namespace gui {
init ( ) ;
}
void StatusUI : : start_drop ( DinkyECS : : Entity entity ) {
$ selected_entity = entity ;
}
bool StatusUI : : place_slot ( DinkyECS : : Entity gui_id ) {
if ( $ level . world - > has < components : : Sprite > ( $ selected_entity ) ) {
auto & sprite = $ level . world - > get < components : : Sprite > ( $ selected_entity ) ;
@ -103,4 +99,33 @@ namespace gui {
guecs : : DropTarget & StatusUI : : get_drop_target ( DinkyECS : : Entity gui_id ) {
return $ gui . get < guecs : : DropTarget > ( gui_id ) ;
}
void StatusUI : : begin_drop ( DinkyECS : : Entity entity ) {
$ selected_entity = entity ;
}
bool StatusUI : : commit_drop ( DinkyECS : : Entity gui_id ) {
auto & drop = get_drop_target ( gui_id ) ;
return drop . commit ( ) ;
}
bool StatusUI : : has_grab_source ( DinkyECS : : Entity gui_id ) {
return $ gui . has < guecs : : Sprite > ( gui_id ) ;
}
guecs : : GrabSource & StatusUI : : get_grab_source ( DinkyECS : : Entity gui_id ) {
dbc : : check ( has_grab_source ( gui_id ) , " invalid GrabSource requested, entity isn't in the GUI. " ) ;
return static_cast < guecs : : GrabSource & > ( $ gui . get < guecs : : Sprite > ( gui_id ) ) ;
}
std : : optional < DinkyECS : : Entity > StatusUI : : begin_grab ( DinkyECS : : Entity slot_id ) {
( void ) slot_id ;
return std : : nullopt ;
}
void StatusUI : : commit_grab ( DinkyECS : : Entity slot_id ) {
( void ) slot_id ;
}
}