Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: refactor walking for better responsivenes #1028

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions modules/client_options/data_options.lua
Original file line number Diff line number Diff line change
@@ -150,27 +150,28 @@ return {
g_app.setDrawTexts(value)
end
},
walkFirstStepDelay = {
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)
end
},
walkTurnDelay = {
value = 100,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('walkTurnDelay'):setText(string.format(
'Walk delay after turn: %sms',
value))
g_game.setWalkTurnDelay(value)
end
},
turnDelay = {
walkTeleportDelay = {
value = 50,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
panels.generalPanel:recursiveGetChildById('walkTeleportDelay'):setText(string.format(
'Walk delay after teleport: %sms',
value))
end
},
walkStairsDelay = {
value = 50,
action = function(value, options, controller, panels, extraWidgets)
panels.generalPanel:recursiveGetChildById('walkStairsDelay'):setText(string.format(
'Walk delay after floor change: %sms',
value))
end
},
hotkeyDelay = {
@@ -418,7 +419,7 @@ return {
end
end
},
showExpiryInInvetory = {
showExpiryInInvetory = {
value = true,
event = nil,
action = function(value, options, controller, panels, extraWidgets)
@@ -431,7 +432,7 @@ return {
end, 100)
end
},
showExpiryInContainers = {
showExpiryInContainers = {
value = true,
event = nil,
action = function(value, options, controller, panels, extraWidgets)
@@ -463,10 +464,10 @@ return {
end, 100)
end
},
autoSwitchPreset = false,
listKeybindsPanel = {
autoSwitchPreset = false,
listKeybindsPanel = {
action = function(value, options, controller, panels, extraWidgets)
listKeybindsComboBox(value)
end
},
}
}
1 change: 1 addition & 0 deletions modules/client_options/options.otui
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ OptionScaleScroll < Label
id: valueBar
step: 1
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
margin-right: 3
width: 174
@onValueChange: |
28 changes: 14 additions & 14 deletions modules/client_options/styles/controls/general.otui
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
5 changes: 3 additions & 2 deletions modules/game_features/features.lua
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@ controller:registerEvents(g_game, {
-- g_game.enableFeature(GameNegativeOffset)
-- g_game.enableFeature(GameWingsAurasEffectsShader)
-- g_game.enableFeature(GameAllowCustomBotScripts)


g_game.enableFeature(GameAllowPreWalk)
g_game.enableFeature(GameFormatCreatureName)

if version >= 750 then
@@ -226,7 +227,7 @@ controller:registerEvents(g_game, {
end

if version >= 1314 then
g_game.disableFeature(GameTournamentPackets)
g_game.disableFeature(GameTournamentPackets)
g_game.enableFeature(GameDynamicForgeVariables)
end

Loading

Unchanged files with check annotations Beta

return false;
if(pid == 0) {
char* cargs[args.size()+2];

Check warning on line 74 in src/framework/platform/unixplatform.cpp

GitHub Actions / ubuntu-22.04-linux-debug

ISO C++ forbids variable length array ‘cargs’ [-Wvla]

Check warning on line 74 in src/framework/platform/unixplatform.cpp

GitHub Actions / ubuntu-24.04-linux-debug

ISO C++ forbids variable length array ‘cargs’ [-Wvla]
cargs[0] = (char*)process.c_str();
for(uint i=1;i<=args.size();++i)
cargs[i] = (char*)args[i-1].c_str();
if(!where.empty())
ss << "\n\t[C++]: " << where;
void* buffer[maxDepth + level + 1];

Check warning on line 234 in src/framework/platform/unixplatform.cpp

GitHub Actions / ubuntu-22.04-linux-debug

ISO C++ forbids variable length array ‘buffer’ [-Wvla]

Check warning on line 234 in src/framework/platform/unixplatform.cpp

GitHub Actions / ubuntu-24.04-linux-debug

ISO C++ forbids variable length array ‘buffer’ [-Wvla]
int numLevels = backtrace(buffer, maxDepth + level + 1);
char **tracebackBuffer = backtrace_symbols(buffer, numLevels);
if(tracebackBuffer) {