Skip to content

Commit be731ca

Browse files
committed
Handle hotkey slots drag-to-clear
Closes #63
1 parent 03d3b60 commit be731ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/ui/hotkey_ui.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,23 @@ bool sub_57E8D0(TigMessageMouseEvent mouse_event)
961961

962962
return false;
963963
}
964+
965+
// CE: Reset the slot when a drag finishes outside of the hotkey bar.
966+
// The original code did nothing, leaving the slot's "dragged" flag set,
967+
// which prevented the slot contents from being drawn and gave the false
968+
// impression that the spell/skill was removed from the hotkey bar.
969+
//
970+
// NOTE: The manual describes a different approach:
971+
//
972+
// "The player can manually clear a slot by dragging it to the right of
973+
// the hot key bank and dropping it into the destruction tab at the
974+
// end."
975+
//
976+
// I assume the "destruction tab" refers to the round metal element to
977+
// the right of the hotkey bar, but it was never implemented.
978+
if (dword_5CB4E4 != -1) {
979+
sub_57F210(dword_5CB4E4);
980+
}
964981
}
965982

966983
if (stru_683950.item_obj.obj != OBJ_HANDLE_NULL) {

0 commit comments

Comments
 (0)