mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
more fixes
* add default key combos to Hotkeys * impement moving countable items holding Ctrl or Shift * fix messagebox incorrent size * implement API in Keyboard to get modifiers key states * minor UI layout fixes * add Ctrl+L logout hotkey
This commit is contained in:
@@ -134,3 +134,19 @@ function Keyboard.unbindKeyPress(keyComboDesc, widget)
|
||||
widget.boundKeyPressCombos[keyComboDesc] = nil
|
||||
end
|
||||
end
|
||||
|
||||
function Keyboard.getModifiers()
|
||||
return g_window.getKeyboardModifiers()
|
||||
end
|
||||
|
||||
function Keyboard.isCtrlPressed()
|
||||
return bit32.band(g_window.getKeyboardModifiers(), KeyboardCtrlModifier) ~= 0
|
||||
end
|
||||
|
||||
function Keyboard.isAltPressed()
|
||||
return bit32.band(g_window.getKeyboardModifiers(), KeyboardAltModifier) ~= 0
|
||||
end
|
||||
|
||||
function Keyboard.isShiftPressed()
|
||||
return bit32.band(g_window.getKeyboardModifiers(), KeyboardShiftModifier) ~= 0
|
||||
end
|
||||
|
@@ -19,7 +19,7 @@ function UIMessageBox.display(title, message, flags)
|
||||
messageLabel:setText(message)
|
||||
messageLabel:resizeToText()
|
||||
|
||||
messagebox:setWidth(math.max(messageLabel:getWidth() + 48, messagebox:getWidth()))
|
||||
messagebox:setWidth(math.max(messageLabel:getWidth() + 48, messagebox:getTextSize().width + 20))
|
||||
messagebox:setHeight(math.max(messageLabel:getHeight() + 64, messagebox:getHeight()))
|
||||
|
||||
-- setup messagebox first button
|
||||
|
Reference in New Issue
Block a user