diff --git a/modules/client_options/game.otui b/modules/client_options/game.otui index 2e57de9d..37e3c7d6 100644 --- a/modules/client_options/game.otui +++ b/modules/client_options/game.otui @@ -6,15 +6,25 @@ Panel OptionCheckBox id: autoChaseOverride !text: tr('Allow auto chase override') + + OptionCheckBox + id: smartWalk + !text: tr('Enable smart walking') + !tooltip: tr('Will detect when to use diagonal step based on the\nkeys you are pressing') OptionCheckBox id: walkBooster !text: tr('Enable walk booster') - !tooltip: tr('Also know as dash in tibia community, recommended\nfor playing characters with high speed') + !tooltip: tr('Also known as dash in tibia community, recommended\nfor playing characters with high speed') OptionCheckBox id: enableMusic !text: tr('Enable music') + + OptionCheckBox + id: showPing + !text: tr('Show connection ping') + !tooltip: tr('Display connection speed to the server (milliseconds)') OptionCheckBox id: showLeftPanel diff --git a/modules/client_options/graphics.otui b/modules/client_options/graphics.otui index ec7bdf68..08bae858 100644 --- a/modules/client_options/graphics.otui +++ b/modules/client_options/graphics.otui @@ -35,7 +35,7 @@ Panel !tooltip: tr('Limits FPS to 60') OptionCheckBox - id: showfps + id: showFps !text: tr('Show frame rate') OptionCheckBox diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index 8e26acb6..0657de1c 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -2,7 +2,8 @@ Options = {} local defaultOptions = { vsync = false, - showfps = true, + showFps = true, + showPing = true, fullscreen = false, classicControl = false, walkBooster = false, @@ -131,11 +132,16 @@ function Options.setOption(key, value) if options[key] == value then return end if key == 'vsync' then g_window.setVerticalSync(value) - elseif key == 'showfps' then + elseif key == 'showFps' then addEvent(function() local frameCounter = rootWidget:recursiveGetChildById('frameCounter') if frameCounter then frameCounter:setVisible(value) end end) + elseif key == 'showPing' then + addEvent(function() + local ping = rootWidget:recursiveGetChildById('pingLabel') + if ping then ping:setVisible(value) end + end) elseif key == 'fullscreen' then g_window.setFullscreen(value) elseif key == 'enableMusic' then diff --git a/modules/client_skins/skins/default/styles/labels.otui b/modules/client_skins/skins/default/styles/labels.otui index cea986e9..97d9ef2e 100644 --- a/modules/client_skins/skins/default/styles/labels.otui +++ b/modules/client_skins/skins/default/styles/labels.otui @@ -36,7 +36,7 @@ PingLabel < Label font: verdana-11px-rounded @onSetup: | self.updateEvent = cycleEvent(function() - if g_game.isOnline() then + if g_game.isOnline() and Options.getOption('showPing') then local ping = -1 if g_game.getFeature(GameClientPing) then ping = g_game.getPing() diff --git a/modules/client_topmenu/topmenu.otui b/modules/client_topmenu/topmenu.otui index 2700cad6..ddc11811 100644 --- a/modules/client_topmenu/topmenu.otui +++ b/modules/client_topmenu/topmenu.otui @@ -68,10 +68,10 @@ TopMenuPanel visible: false FrameCounterLabel + id: frameCounter color: white margin-top: 4 margin-left: 5 - id: frameCounter text-auto-resize: true anchors.top: parent.top anchors.left: leftGameButtonsPanel.right diff --git a/modules/corelib/ui/uicreaturebutton.lua b/modules/corelib/ui/uicreaturebutton.lua index 37d31e3e..4d31da47 100644 --- a/modules/corelib/ui/uicreaturebutton.lua +++ b/modules/corelib/ui/uicreaturebutton.lua @@ -89,7 +89,6 @@ function UICreatureButton:updateSkull(skullId) if skullId ~= SkullNone then skullWidget:setWidth(skullWidget:getHeight()) - print(skullId) local imagePath = getSkullImagePath(skullId) skullWidget:setImageSource(imagePath) labelWidget:setMarginLeft(5) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index d4113185..f6b6c07f 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -154,22 +154,27 @@ end function smartWalk() local dir - if g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Left') then - dir = NorthWest - elseif g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Right') then - dir = NorthEast - elseif g_keyboard.isKeyPressed('Down') and g_keyboard.isKeyPressed('Left') then - dir = SouthWest - elseif g_keyboard.isKeyPressed('Down') and g_keyboard.isKeyPressed('Right') then - dir = SouthEast - elseif g_keyboard.isKeyPressed('Up') then - dir = North - elseif g_keyboard.isKeyPressed('Down') then - dir = South - elseif g_keyboard.isKeyPressed('Left') then - dir = West - elseif g_keyboard.isKeyPressed('Right') then - dir = East + if Options.getOption('smartWalk') then + if g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Left') then + dir = NorthWest + elseif g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Right') then + dir = NorthEast + elseif g_keyboard.isKeyPressed('Down') and g_keyboard.isKeyPressed('Left') then + dir = SouthWest + elseif g_keyboard.isKeyPressed('Down') and g_keyboard.isKeyPressed('Right') then + dir = SouthEast + end + end + if not dir then + if g_keyboard.isKeyPressed('Up') then + dir = North + elseif g_keyboard.isKeyPressed('Down') then + dir = South + elseif g_keyboard.isKeyPressed('Left') then + dir = West + elseif g_keyboard.isKeyPressed('Right') then + dir = East + end end if Options.getOption('walkBooster') then