Skip to content

Commit

Permalink
Better walking
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Jan 13, 2025
1 parent 0a5ad4a commit d054ee1
Show file tree
Hide file tree
Showing 13 changed files with 279 additions and 210 deletions.
35 changes: 18 additions & 17 deletions modules/client_options/data_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,27 +150,28 @@ return {
g_app.setDrawTexts(value)
end
},
walkFirstStepDelay = {
walkTurnDelay = {
value = 250,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('walkFirstStepDelay'):setText(string.format(
'Walk Delay after first step: %sms', value))
g_game.setWalkFirstStepDelay(value)
panels.generalPanel:recursiveGetChildById('walkTurnDelay'):setText(string.format(
'Walk delay after turn: %sms',
value))
end
},
walkTurnDelay = {
value = 100,
walkTeleportDelay = {
value = 250,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('walkTurnDelay'):setText(string.format(
'Walk delay after turn: %sms',
panels.generalPanel:recursiveGetChildById('walkTeleportDelay'):setText(string.format(
'Walk delay after teleport: %sms',
value))
g_game.setWalkTurnDelay(value)
end
},
turnDelay = {
value = 50,
walkStairsDelay = {
value = 250,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
panels.generalPanel:recursiveGetChildById('walkStairsDelay'):setText(string.format(
'Walk delay after floor change: %sms',
value))
end
},
hotkeyDelay = {
Expand Down Expand Up @@ -418,7 +419,7 @@ return {
end
end
},
showExpiryInInvetory = {
showExpiryInInvetory = {
value = true,
event = nil,
action = function(value, options, controller, panels, extraWidgets)
Expand All @@ -431,7 +432,7 @@ return {
end, 100)
end
},
showExpiryInContainers = {
showExpiryInContainers = {
value = true,
event = nil,
action = function(value, options, controller, panels, extraWidgets)
Expand Down Expand Up @@ -463,10 +464,10 @@ return {
end, 100)
end
},
autoSwitchPreset = false,
listKeybindsPanel = {
autoSwitchPreset = false,
listKeybindsPanel = {
action = function(value, options, controller, panels, extraWidgets)
listKeybindsComboBox(value)
end
},
}
}
28 changes: 14 additions & 14 deletions modules/client_options/styles/controls/general.otui
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ UIWidget
height: 22

OptionScaleScroll
id: walkFirstStepDelay
!text: tr('Walk Delay after first step: 50ms')
id: walkTurnDelay
!text: tr('Walk delay after turn: 50ms')
anchors.fill: parent
&minimumScrollValue: 50
&minimumScrollValue: 10
&maximumScrollValue: 500
&scrollSize: 21
@onSetup: |
local value = modules.client_options.getOption('walkFirstStepDelay')
self:setText(tr('Walk Delay after first step: %dms', value))
local value = modules.client_options.getOption('walkTurnDelay')
self:setText(tr('Walk delay after turn: %dms', value))

SmallReversedQtPanel
anchors.left: parent.left
Expand All @@ -132,14 +132,14 @@ UIWidget
height: 22

OptionScaleScroll
id: walkTurnDelay
!text: tr('Walk delay after turn: 50ms')
id: walkTeleportDelay
!text: tr('Walk delay after teleport: 200ms')
anchors.fill: parent
&minimumScrollValue: 50
&maximumScrollValue: 500
&scrollSize: 21
@onSetup: |
local value = modules.client_options.getOption('walkTurnDelay')
local value = modules.client_options.getOption('walkTeleportDelay')
self:setText(tr('Walk delay after turn: %dms', value))

SmallReversedQtPanel
Expand All @@ -150,15 +150,15 @@ UIWidget
height: 22

OptionScaleScroll
id: turnDelay
!text: tr('Turn delay: 30ms')
id: walkStairsDelay
!text: tr('Walk delay after floor change: 200ms')
anchors.fill: parent
&minimumScrollValue: 30
&maximumScrollValue: 250
&minimumScrollValue: 50
&maximumScrollValue: 500
&scrollSize: 21
@onSetup: |
local value = modules.client_options.getOption('turnDelay')
self:setText(tr('Turn delay: %dms', value))
local value = modules.client_options.getOption('walkStairsDelay')
self:setText(tr('Walk delay after turn: %dms', value))

QtButton
id: hotkeysButton
Expand Down
Loading

0 comments on commit d054ee1

Please sign in to comment.