#0 - June 23, 2008, 12:10 a.m.
However, if my mod defines a modified click to a non-modified value (i.e. "BUTTON2"), it breaks quite a few areas of the default UI. I will use the SetItemRef function as an example of why this happens.
SetItemRef checks "IsModifiedClick()" to determine if any modified click applies, and if so jumps directly to "HandleModifiedItemClick". Notice that it catches all modified clicks, no matter if they apply to item links or not. This has problematic implications beyond my issue as well. Imagine that all itemlink-related modified clicks were remapped to "SHIFT-BUTTON[1-5]", and the unrelated SPLITSTACK modifier was set to "ALT". In that case, clicking an itemlink with alt held would do nothing at all, for any context.
I propose a change in how the default UI catches modified clicks to allow for such cases. Throughout most of the default UI, modified clicks are handled as such:if ( IsModifiedClick() ) then
HandleModifiedClick();
else
HandleNonModifiedClick();
endMy suggestion is to have all functions like "HandleModifiedClick" reserve a return value for completely unhandled modifiers. One possible solution could return nil when not handled, true when handled and action was taken, and false for when handled but no action was taken. Using this new method, the earlier function could be rewritten to only intercept clicks it can handle:if ( not IsModifiedClick() or HandleModifiedClick() == nil ) then
HandleNonModifiedClick();
end