mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
Use new coding style in game modules
Lots of refactoring and changes Remove docs folder
This commit is contained in:
@@ -1,29 +1,8 @@
|
||||
HotkeysManager = {}
|
||||
|
||||
local hotkeysManagerLoaded = false
|
||||
local hotkeysWindow
|
||||
local hotkeysButton
|
||||
local currentHotkeysList
|
||||
local hotkeyLabelSelectedOnList
|
||||
local currentItemPreview
|
||||
local itemWidget
|
||||
local addHotkey
|
||||
local removeHotkey
|
||||
local hotkeyText
|
||||
local hotKeyTextLabel
|
||||
local sendAutomatically
|
||||
local selectObjectButton
|
||||
local clearObjectButton
|
||||
local useOnSelf
|
||||
local useOnTarget
|
||||
local useWith
|
||||
local hotkeyList = {}
|
||||
|
||||
HOTKEY_MANAGER_USEONSELF = 1
|
||||
HOTKEY_MANAGER_USEONTARGET = 2
|
||||
HOTKEY_MANAGER_USEWITH = 3
|
||||
|
||||
local hotkeyColors = {
|
||||
HotkeyColors = {
|
||||
text = '#888888',
|
||||
textAutoSend = '#FFFFFF',
|
||||
itemUse = '#8888FF',
|
||||
@@ -32,14 +11,33 @@ local hotkeyColors = {
|
||||
itemUseWith = '#CC0000',
|
||||
}
|
||||
|
||||
hotkeysManagerLoaded = false
|
||||
hotkeysWindow = nil
|
||||
hotkeysButton = nil
|
||||
currentHotkeysList = nil
|
||||
hotkeyLabelSelectedOnList = nil
|
||||
currentItemPreview = nil
|
||||
itemWidget = nil
|
||||
addHotkey = nil
|
||||
removeHotkey = nil
|
||||
hotkeyText = nil
|
||||
hotKeyTextLabel = nil
|
||||
sendAutomatically = nil
|
||||
selectObjectButton = nil
|
||||
clearObjectButton = nil
|
||||
useOnSelf = nil
|
||||
useOnTarget = nil
|
||||
useWith = nil
|
||||
hotkeyList = {}
|
||||
|
||||
-- public functions
|
||||
function HotkeysManager.init()
|
||||
function init()
|
||||
hotkeysWindow = g_ui.displayUI('hotkeys_manager.otui')
|
||||
local hotkeyListPanel = hotkeysWindow:getChildById('currentHotkeys')
|
||||
|
||||
hotkeysWindow:setVisible(false)
|
||||
hotkeysButton = TopMenu.addLeftGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', '/game_hotkeys/icon.png', HotkeysManager.toggle)
|
||||
g_keyboard.bindKeyDown('Ctrl+K', HotkeysManager.toggle)
|
||||
hotkeysButton = TopMenu.addLeftGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', '/game_hotkeys/icon.png', toggle)
|
||||
g_keyboard.bindKeyDown('Ctrl+K', toggle)
|
||||
g_keyboard.bindKeyPress('Down', function() hotkeyListPanel:focusNextChild(KeyboardFocusReason) end, hotkeysWindow)
|
||||
g_keyboard.bindKeyPress('Up', function() hotkeyListPanel:focusPreviousChild(KeyboardFocusReason) end, hotkeysWindow)
|
||||
|
||||
@@ -61,21 +59,39 @@ function HotkeysManager.init()
|
||||
itemWidget:setVisible(false)
|
||||
itemWidget:setFocusable(false)
|
||||
|
||||
connect(g_game, { onGameEnd = HotkeysManager.hide })
|
||||
connect(currentHotkeysList, { onChildFocusChange = function (self, focusedChild) HotkeysManager.checkSelectedHotkey(focusedChild) end } )
|
||||
connect(g_game, { onGameEnd = hide })
|
||||
connect(currentHotkeysList, { onChildFocusChange = function (self, focusedChild) checkSelectedHotkey(focusedChild) end } )
|
||||
|
||||
hotkeysManagerLoaded = true
|
||||
|
||||
HotkeysManager.load()
|
||||
load()
|
||||
end
|
||||
|
||||
function HotkeysManager.load()
|
||||
function terminate()
|
||||
hotkeysManagerLoaded = false
|
||||
|
||||
disconnect(g_game, { onGameEnd = hide })
|
||||
g_keyboard.unbindKeyDown('Ctrl+K')
|
||||
|
||||
save()
|
||||
|
||||
for keyCombo,v in pairs(hotkeyList) do
|
||||
g_keyboard.unbindKeyPress(keyCombo)
|
||||
end
|
||||
hotkeyList = {}
|
||||
|
||||
itemWidget:destroy()
|
||||
hotkeysWindow:destroy()
|
||||
hotkeysButton:destroy()
|
||||
end
|
||||
|
||||
function load()
|
||||
local hotkeySettings = g_settings.getNode('HotkeysManager')
|
||||
|
||||
local hasCombos = false
|
||||
if hotkeySettings ~= nil then
|
||||
for i, v in pairs(hotkeySettings) do
|
||||
HotkeysManager.addKeyCombo(nil, v.keyCombo, v)
|
||||
addKeyCombo(nil, v.keyCombo, v)
|
||||
hasCombos = true
|
||||
end
|
||||
end
|
||||
@@ -83,12 +99,12 @@ function HotkeysManager.load()
|
||||
-- add default F keys combos
|
||||
if not hasCombos then
|
||||
for i=1,12 do
|
||||
HotkeysManager.addKeyCombo(nil, 'F' .. i)
|
||||
addKeyCombo(nil, 'F' .. i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.save()
|
||||
function save()
|
||||
local hotkeySettings = {}
|
||||
for i=1, currentHotkeysList:getChildCount() do
|
||||
local child = currentHotkeysList:getChildByIndex(i)
|
||||
@@ -102,49 +118,15 @@ function HotkeysManager.save()
|
||||
g_settings.setNode('HotkeysManager', hotkeySettings)
|
||||
end
|
||||
|
||||
function HotkeysManager.terminate()
|
||||
hotkeysManagerLoaded = false
|
||||
|
||||
disconnect(g_game, { onGameEnd = HotkeysManager.hide })
|
||||
g_keyboard.unbindKeyDown('Ctrl+K')
|
||||
|
||||
HotkeysManager.save()
|
||||
|
||||
currentHotkeysList = nil
|
||||
hotkeyLabelSelectedOnList = nil
|
||||
currentItemPreview = nil
|
||||
|
||||
hotkeyList = {}
|
||||
addHotkey = nil
|
||||
removeHotkey = nil
|
||||
hotkeyText = nil
|
||||
hotKeyTextLabel = nil
|
||||
sendAutomatically = nil
|
||||
selectObjectButton = nil
|
||||
clearObjectButton = nil
|
||||
useOnSelf = nil
|
||||
useOnTarget = nil
|
||||
useWith = nil
|
||||
|
||||
itemWidget:destroy()
|
||||
itemWidget = nil
|
||||
hotkeysWindow:destroy()
|
||||
hotkeysWindow = nil
|
||||
hotkeysButton:destroy()
|
||||
hotkeysButton = nil
|
||||
|
||||
HotkeysManager = nil
|
||||
end
|
||||
|
||||
function HotkeysManager.toggle()
|
||||
function toggle()
|
||||
if hotkeysWindow:isVisible() then
|
||||
HotkeysManager.hide()
|
||||
hide()
|
||||
else
|
||||
HotkeysManager.show()
|
||||
show()
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.show()
|
||||
function show()
|
||||
if g_game.isOnline() then
|
||||
hotkeysWindow:grabKeyboard()
|
||||
hotkeysWindow:show()
|
||||
@@ -152,16 +134,16 @@ function HotkeysManager.show()
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.hide()
|
||||
function hide()
|
||||
hotkeysWindow:ungrabKeyboard()
|
||||
hotkeysWindow:hide()
|
||||
end
|
||||
|
||||
-- private functions
|
||||
function HotkeysManager.onChooseItemMouseRelease(self, mousePosition, mouseButton)
|
||||
function onChooseItemMouseRelease(self, mousePosition, mouseButton)
|
||||
local item = nil
|
||||
if mouseButton == MouseLeftButton then
|
||||
local clickedWidget = GameInterface.getRootPanel():recursiveGetChildByPos(mousePosition, false)
|
||||
local clickedWidget = modules.game_interface.getRootPanel():recursiveGetChildByPos(mousePosition, false)
|
||||
if clickedWidget then
|
||||
if clickedWidget:getClassName() == 'UIMap' then
|
||||
local tile = clickedWidget:getTile(mousePosition)
|
||||
@@ -180,8 +162,8 @@ function HotkeysManager.onChooseItemMouseRelease(self, mousePosition, mouseButto
|
||||
if item then
|
||||
currentItemPreview:setItemId(item:getId())
|
||||
hotkeyLabelSelectedOnList.itemId = item:getId()
|
||||
HotkeysManager.changeUseType(HOTKEY_MANAGER_USEONSELF)
|
||||
HotkeysManager.checkSelectedHotkey(hotkeyLabelSelectedOnList)
|
||||
changeUseType(HOTKEY_MANAGER_USEONSELF)
|
||||
checkSelectedHotkey(hotkeyLabelSelectedOnList)
|
||||
HotkeysManager:show()
|
||||
end
|
||||
|
||||
@@ -190,12 +172,12 @@ function HotkeysManager.onChooseItemMouseRelease(self, mousePosition, mouseButto
|
||||
self:destroy()
|
||||
end
|
||||
|
||||
function HotkeysManager.startChooseItem()
|
||||
function startChooseItem()
|
||||
local mouseGrabberWidget = g_ui.createWidget('UIWidget')
|
||||
mouseGrabberWidget:setVisible(false)
|
||||
mouseGrabberWidget:setFocusable(false)
|
||||
|
||||
connect(mouseGrabberWidget, { onMouseRelease = HotkeysManager.onChooseItemMouseRelease })
|
||||
connect(mouseGrabberWidget, { onMouseRelease = onChooseItemMouseRelease })
|
||||
|
||||
mouseGrabberWidget:grabMouse()
|
||||
g_mouse.setTargetCursor()
|
||||
@@ -203,17 +185,17 @@ function HotkeysManager.startChooseItem()
|
||||
HotkeysManager:hide()
|
||||
end
|
||||
|
||||
function HotkeysManager.clearObject()
|
||||
function clearObject()
|
||||
hotkeyLabelSelectedOnList.itemId = nil
|
||||
currentItemPreview:clearItem()
|
||||
HotkeysManager.changeUseType(HOTKEY_MANAGER_USEONSELF)
|
||||
HotkeysManager.sendAutomatically(false)
|
||||
changeUseType(HOTKEY_MANAGER_USEONSELF)
|
||||
setSendAutomatically(false)
|
||||
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': ')
|
||||
|
||||
HotkeysManager.checkSelectedHotkey(hotkeyLabelSelectedOnList)
|
||||
checkSelectedHotkey(hotkeyLabelSelectedOnList)
|
||||
end
|
||||
|
||||
function HotkeysManager.addHotkey()
|
||||
function addHotkey()
|
||||
local widget
|
||||
|
||||
messageBox = g_ui.createWidget('MainWindow', rootWidget)
|
||||
@@ -260,26 +242,26 @@ function HotkeysManager.addHotkey()
|
||||
widget:setMarginRight(10)
|
||||
widget.onClick = function (self)
|
||||
messageBox = nil
|
||||
HotkeysManager.addKeyCombo(self:getParent(), self:getParent():getChildById('comboPreview').keyCombo)
|
||||
addKeyCombo(self:getParent(), self:getParent():getChildById('comboPreview').keyCombo)
|
||||
end
|
||||
|
||||
connect(messageBox, { onKeyDown = HotkeysManager.hotkeyCapture }, true)
|
||||
connect(messageBox, { onKeyDown = hotkeyCapture }, true)
|
||||
end
|
||||
|
||||
function HotkeysManager.addKeyCombo(messageBox, keyCombo, keySettings)
|
||||
function addKeyCombo(messageBox, keyCombo, keySettings)
|
||||
local label = nil
|
||||
if currentHotkeysList:getChildById(keyCombo) == nil then
|
||||
local label = g_ui.createWidget('HotkeyListLabel', currentHotkeysList)
|
||||
label:setId(keyCombo)
|
||||
label:setColor(hotkeyColors.text)
|
||||
label:setColor(HotkeyColors.text)
|
||||
label:setText(keyCombo..': ')
|
||||
if keySettings then
|
||||
hotkeyLabelSelectedOnList = label
|
||||
label.keyCombo = keyCombo
|
||||
HotkeysManager.sendAutomatically(keySettings.autoSend)
|
||||
setSendAutomatically(keySettings.autoSend)
|
||||
label.itemId = keySettings.itemId
|
||||
currentItemPreview:setItemId(keySettings.itemId)
|
||||
HotkeysManager.changeUseType(tonumber(keySettings.useType))
|
||||
changeUseType(tonumber(keySettings.useType))
|
||||
label.value = keySettings.value
|
||||
else
|
||||
label.keyCombo = keyCombo
|
||||
@@ -289,10 +271,10 @@ function HotkeysManager.addKeyCombo(messageBox, keyCombo, keySettings)
|
||||
label.value = ''
|
||||
end
|
||||
|
||||
HotkeysManager.checkSelectedHotkey(label)
|
||||
checkSelectedHotkey(label)
|
||||
|
||||
hotkeyList[keyCombo] = label
|
||||
g_keyboard.bindKeyPress(keyCombo, function () HotkeysManager.call(keyCombo) end, nil, 350)
|
||||
g_keyboard.bindKeyPress(keyCombo, function () call(keyCombo) end, nil, 350)
|
||||
end
|
||||
|
||||
if messageBox then
|
||||
@@ -301,14 +283,14 @@ function HotkeysManager.addKeyCombo(messageBox, keyCombo, keySettings)
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.call(keyCombo)
|
||||
function call(keyCombo)
|
||||
if g_game.isOnline() then
|
||||
local hotKey = hotkeyList[keyCombo]
|
||||
if hotKey ~= nil and hotKey.itemId == nil and hotKey.value ~= '' then
|
||||
if hotKey.autoSend then
|
||||
g_game.talk(hotKey.value)
|
||||
else
|
||||
Console.setTextEditText(hotKey.value)
|
||||
modules.game_console.setTextEditText(hotKey.value)
|
||||
end
|
||||
elseif hotKey.itemId ~= nil then
|
||||
if hotKey.useType == HOTKEY_MANAGER_USEONSELF then
|
||||
@@ -320,13 +302,13 @@ function HotkeysManager.call(keyCombo)
|
||||
end
|
||||
elseif hotKey.useType == HOTKEY_MANAGER_USEWITH then
|
||||
itemWidget:setItemId(hotKey.itemId)
|
||||
GameInterface.startUseWith(itemWidget:getItem())
|
||||
modules.game_interface.startUseWith(itemWidget:getItem())
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.checkSelectedHotkey(focused)
|
||||
function checkSelectedHotkey(focused)
|
||||
if not focused then return end
|
||||
if hotkeysManagerLoaded then
|
||||
hotkeyLabelSelectedOnList = focused
|
||||
@@ -362,7 +344,7 @@ function HotkeysManager.checkSelectedHotkey(focused)
|
||||
|
||||
currentItemPreview:setItemId(hotkeyLabelSelectedOnList.itemId)
|
||||
end
|
||||
HotkeysManager.changeUseType(hotkeyLabelSelectedOnList.useType)
|
||||
changeUseType(hotkeyLabelSelectedOnList.useType)
|
||||
else
|
||||
hotkeyText:clearText()
|
||||
removeHotkey:disable()
|
||||
@@ -383,7 +365,7 @@ function HotkeysManager.checkSelectedHotkey(focused)
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.changeUseType(useType, checked)
|
||||
function changeUseType(useType, checked)
|
||||
if checked == nil or checked then
|
||||
hotkeyLabelSelectedOnList.useType = useType
|
||||
if hotkeyLabelSelectedOnList.itemId ~= nil and currentItemPreview:getItem():isMultiUse() then
|
||||
@@ -393,19 +375,19 @@ function HotkeysManager.changeUseType(useType, checked)
|
||||
|
||||
if useType == HOTKEY_MANAGER_USEONSELF then
|
||||
hotkeyLabelSelectedOnList:setText(tr('%s: (use object on yourself)', hotkeyLabelSelectedOnList.keyCombo))
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseSelf)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.itemUseSelf)
|
||||
useOnSelf:setChecked(true)
|
||||
useOnTarget:setChecked(false)
|
||||
useWith:setChecked(false)
|
||||
elseif useType == HOTKEY_MANAGER_USEONTARGET then
|
||||
hotkeyLabelSelectedOnList:setText(tr('%s: (use object on target)', hotkeyLabelSelectedOnList.keyCombo))
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseTarget)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.itemUseTarget)
|
||||
useOnSelf:setChecked(false)
|
||||
useOnTarget:setChecked(true)
|
||||
useWith:setChecked(false)
|
||||
elseif useType == HOTKEY_MANAGER_USEWITH then
|
||||
hotkeyLabelSelectedOnList:setText(tr('%s: (use object with crosshair)', hotkeyLabelSelectedOnList.keyCombo))
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUseWith)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.itemUseWith)
|
||||
|
||||
useOnSelf:setChecked(false)
|
||||
useOnTarget:setChecked(false)
|
||||
@@ -417,7 +399,7 @@ function HotkeysManager.changeUseType(useType, checked)
|
||||
useWith:disable()
|
||||
|
||||
hotkeyLabelSelectedOnList:setText(tr('%s: (use object)', hotkeyLabelSelectedOnList.keyCombo))
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.itemUse)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.itemUse)
|
||||
|
||||
useOnSelf:setChecked(false)
|
||||
useOnTarget:setChecked(false)
|
||||
@@ -434,7 +416,7 @@ function HotkeysManager.changeUseType(useType, checked)
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.removeHotkey()
|
||||
function removeHotkey()
|
||||
if hotkeyLabelSelectedOnList ~= nil then
|
||||
hotkeyList[hotkeyLabelSelectedOnList.keyCombo] = nil
|
||||
g_keyboard.unbindKeyPress(hotkeyLabelSelectedOnList.keyCombo)
|
||||
@@ -442,7 +424,7 @@ function HotkeysManager.removeHotkey()
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.onHotkeyTextChange(id, value)
|
||||
function onHotkeyTextChange(id, value)
|
||||
if hotkeyLabelSelectedOnList ~= nil and hotkeyLabelSelectedOnList.keyCombo ~= nil then
|
||||
hotkeyLabelSelectedOnList:setText(hotkeyLabelSelectedOnList.keyCombo .. ': ' .. value)
|
||||
hotkeyLabelSelectedOnList.value = value
|
||||
@@ -456,16 +438,16 @@ function HotkeysManager.onHotkeyTextChange(id, value)
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.sendAutomatically(value)
|
||||
function setSendAutomatically(value)
|
||||
hotkeyLabelSelectedOnList.autoSend = value
|
||||
if value then
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.autoSend)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.autoSend)
|
||||
else
|
||||
hotkeyLabelSelectedOnList:setColor(hotkeyColors.text)
|
||||
hotkeyLabelSelectedOnList:setColor(HotkeyColors.text)
|
||||
end
|
||||
end
|
||||
|
||||
function HotkeysManager.hotkeyCapture(widget, keyCode, keyboardModifiers)
|
||||
function hotkeyCapture(widget, keyCode, keyboardModifiers)
|
||||
local keyCombo = determineKeyComboDesc(keyCode, keyboardModifiers)
|
||||
local comboPreview = rootWidget:getChildById('assignWindow'):getChildById('comboPreview')
|
||||
comboPreview:setText(tr('Current hotkey to add: %s', keyCombo))
|
||||
|
@@ -3,13 +3,7 @@ Module
|
||||
description: Manage client hotkeys
|
||||
author: andrefaramir, BeniS
|
||||
website: www.otclient.info
|
||||
|
||||
dependencies:
|
||||
- game_interface
|
||||
|
||||
@onLoad: |
|
||||
dofile 'hotkeys_manager'
|
||||
HotkeysManager.init()
|
||||
|
||||
@onUnload: |
|
||||
HotkeysManager.terminate()
|
||||
sandboxed: true
|
||||
scripts: [ hotkeys_manager.lua ]
|
||||
@onLoad: init()
|
||||
@onUnload: terminate()
|
||||
|
@@ -13,8 +13,8 @@ MainWindow
|
||||
!text: tr('Hotkeys')
|
||||
size: 340 460
|
||||
|
||||
@onEnter: HotkeysManager.hide()
|
||||
@onEscape: HotkeysManager.hide()
|
||||
@onEnter: hide()
|
||||
@onEscape: hide()
|
||||
|
||||
Label
|
||||
id: currentHotkeysLabel
|
||||
@@ -33,7 +33,7 @@ MainWindow
|
||||
|
||||
TextList
|
||||
id: currentHotkeys
|
||||
vertical-scrollbar: currentHotkeysScrollBar
|
||||
vertical-scrollbar: currentHotkeysScrollBar
|
||||
anchors.left: parent.left
|
||||
anchors.right: prev.left
|
||||
anchors.top: prev.top
|
||||
@@ -56,7 +56,7 @@ MainWindow
|
||||
anchors.left: parent.left
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 2
|
||||
@onClick: HotkeysManager.addHotkey()
|
||||
@onClick: addHotkey()
|
||||
|
||||
Button
|
||||
id: removeHotkey
|
||||
@@ -66,7 +66,7 @@ MainWindow
|
||||
anchors.left: prev.right
|
||||
anchors.top: prev.top
|
||||
margin-left: 10
|
||||
@onClick: HotkeysManager.removeHotkey()
|
||||
@onClick: removeHotkey()
|
||||
|
||||
Label
|
||||
id: hotKeyTextLabel
|
||||
@@ -84,7 +84,7 @@ MainWindow
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-bottom: 2
|
||||
@onTextChange: HotkeysManager.onHotkeyTextChange(self:getId(), self:getText())
|
||||
@onTextChange: onHotkeyTextChange(self:getId(), self:getText())
|
||||
|
||||
CheckBox
|
||||
id: sendAutomatically
|
||||
@@ -94,7 +94,7 @@ MainWindow
|
||||
anchors.top: prev.bottom
|
||||
enabled:false
|
||||
margin-top: 10
|
||||
@onCheckChange: HotkeysManager.sendAutomatically(self:isChecked())
|
||||
@onCheckChange: setSendAutomatically(self:isChecked())
|
||||
|
||||
Item
|
||||
id: itemPreview
|
||||
@@ -111,7 +111,7 @@ MainWindow
|
||||
anchors.left: prev.right
|
||||
anchors.top: prev.top
|
||||
margin-left: 10
|
||||
@onClick: HotkeysManager.startChooseItem()
|
||||
@onClick: startChooseItem()
|
||||
|
||||
Button
|
||||
id: clearObjectButton
|
||||
@@ -122,7 +122,7 @@ MainWindow
|
||||
anchors.right: prev.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 2
|
||||
@onClick: HotkeysManager.clearObject()
|
||||
@onClick: clearObject()
|
||||
|
||||
ButtonBox
|
||||
id: useOnSelf
|
||||
@@ -134,7 +134,7 @@ MainWindow
|
||||
anchors.top: selectObjectButton.top
|
||||
checked: false
|
||||
margin-left: 10
|
||||
@onCheckChange: HotkeysManager.changeUseType(HOTKEY_MANAGER_USEONSELF, self:isChecked())
|
||||
@onCheckChange: changeUseType(HOTKEY_MANAGER_USEONSELF, self:isChecked())
|
||||
|
||||
ButtonBox
|
||||
id: useOnTarget
|
||||
@@ -146,7 +146,7 @@ MainWindow
|
||||
anchors.top: prev.bottom
|
||||
checked: false
|
||||
margin-top: 2
|
||||
@onCheckChange: HotkeysManager.changeUseType(HOTKEY_MANAGER_USEONTARGET, self:isChecked())
|
||||
@onCheckChange: changeUseType(HOTKEY_MANAGER_USEONTARGET, self:isChecked())
|
||||
|
||||
ButtonBox
|
||||
id: useWith
|
||||
@@ -158,11 +158,11 @@ MainWindow
|
||||
anchors.top: prev.bottom
|
||||
checked: false
|
||||
margin-top: 2
|
||||
@onCheckChange: HotkeysManager.changeUseType(HOTKEY_MANAGER_USEWITH, self:isChecked())
|
||||
@onCheckChange: changeUseType(HOTKEY_MANAGER_USEWITH, self:isChecked())
|
||||
|
||||
Button
|
||||
!text: tr('Close')
|
||||
width: 64
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
@onClick: HotkeysManager.hide()
|
||||
@onClick: hide()
|
||||
|
Reference in New Issue
Block a user