mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
Add turn and hotkey delay
This commit is contained in:
@@ -38,11 +38,51 @@ Panel
|
||||
id: displayText
|
||||
!text: tr('Display text messages')
|
||||
|
||||
Label
|
||||
id: turnDelayLabel
|
||||
!text: tr('Turn delay: %sms', 30)
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 12
|
||||
@onSetup: |
|
||||
local value = modules.client_options.getOption('turnDelay')
|
||||
self:setText(tr('Turn delay: %dms', value))
|
||||
|
||||
OptionScrollbar
|
||||
id: turnDelay
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 3
|
||||
minimum: 30
|
||||
maximum: 250
|
||||
|
||||
Label
|
||||
id: hotkeyDelayLabel
|
||||
!text: tr('Hotkey delay: %dms', 30)
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 12
|
||||
@onSetup: |
|
||||
local value = modules.client_options.getOption('hotkeyDelay')
|
||||
self:setText(tr('Hotkey delay: %dms', value))
|
||||
|
||||
OptionScrollbar
|
||||
id: hotkeyDelay
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 3
|
||||
minimum: 30
|
||||
maximum: 250
|
||||
|
||||
Button
|
||||
id: changeLocale
|
||||
!text: tr('Change language')
|
||||
@onClick: modules.client_locales.createWindow()
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
margin-top: 5
|
||||
margin-top: 12
|
||||
width: 120
|
||||
|
@@ -26,7 +26,9 @@ local defaultOptions = {
|
||||
displayNames = true,
|
||||
displayHealth = true,
|
||||
displayText = true,
|
||||
dontStretchShrink = false
|
||||
dontStretchShrink = false,
|
||||
turnDelay = 50,
|
||||
hotkeyDelay = 50,
|
||||
}
|
||||
|
||||
local optionsWindow
|
||||
@@ -228,6 +230,10 @@ function setOption(key, value, force)
|
||||
addEvent(function()
|
||||
modules.game_interface.updateStretchShrink()
|
||||
end)
|
||||
elseif key == 'turnDelay' then
|
||||
generalPanel:getChildById('turnDelayLabel'):setText(tr('Turn delay: %sms', value))
|
||||
elseif key == 'hotkeyDelay' then
|
||||
generalPanel:getChildById('hotkeyDelayLabel'):setText(tr('Hotkey delay: %sms', value))
|
||||
end
|
||||
|
||||
-- change value for keybind updates
|
||||
|
Reference in New Issue
Block a user