mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Game control precision edits and many other fixes:
* Updated the walking(mouse/keys) control to be a lot more responsive/smooth! * Updated creature diagonal steps to animate faster (due to demand). * Added a warning popup for boost walker option in cipsoft servers. * Added KeyUp event controls in the g_keyboard class. * Fixed an issue with the minimap not reconfiguring. * Fixed a bug with creature lights drawing properly. * Fixed refreshContainer method. * Some layout edits. * Some minor typo fixes. TODO: * Add walk event stack. * Test new walking edits extensively. * Finish pending state feature.
This commit is contained in:
@@ -25,11 +25,13 @@ local defaultOptions = {
|
||||
painterEngine = 0
|
||||
}
|
||||
|
||||
local warningWindow
|
||||
local optionsWindow
|
||||
local optionsButton
|
||||
local optionsTabBar
|
||||
local options = {}
|
||||
local generalPanel
|
||||
local gamePanel
|
||||
local consolePanel
|
||||
local graphicsPanel
|
||||
|
||||
local function setupGraphicsEngines()
|
||||
@@ -62,6 +64,21 @@ local function setupGraphicsEngines()
|
||||
end
|
||||
end
|
||||
|
||||
function displayWarning(widget, warning)
|
||||
if warningWindow and warningWindow:isVisible() then
|
||||
return
|
||||
end
|
||||
if g_game.isOfficialTibia() and widget:isChecked() then
|
||||
local yesCallback = function() warningWindow:destroy() warningWindow=nil end
|
||||
local noCallback = function() widget:setChecked(false) warningWindow:destroy() warningWindow=nil end
|
||||
|
||||
warningWindow = displayGeneralBox('Warning', tr(warning), {
|
||||
{ text='Yes', callback=yesCallback },
|
||||
{ text='No', callback=noCallback },
|
||||
anchor=AnchorHorizontalCenter}, yesCallback, noCallback)
|
||||
end
|
||||
end
|
||||
|
||||
function Options.init()
|
||||
-- load options
|
||||
for k,v in pairs(defaultOptions) do
|
||||
@@ -83,15 +100,21 @@ function Options.init()
|
||||
optionsTabBar = optionsWindow:getChildById('optionsTabBar')
|
||||
optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
|
||||
|
||||
generalPanel = g_ui.loadUI('game.otui')
|
||||
optionsTabBar:addTab(tr('Game'), generalPanel)
|
||||
gamePanel = g_ui.loadUI('game.otui')
|
||||
optionsTabBar:addTab(tr('Game'), gamePanel)
|
||||
|
||||
generalPanel = g_ui.loadUI('console.otui')
|
||||
optionsTabBar:addTab(tr('Console'), generalPanel)
|
||||
consolePanel = g_ui.loadUI('console.otui')
|
||||
optionsTabBar:addTab(tr('Console'), consolePanel)
|
||||
|
||||
graphicsPanel = g_ui.loadUI('graphics.otui')
|
||||
optionsTabBar:addTab(tr('Graphics'), graphicsPanel)
|
||||
|
||||
local optionWalkBooster = gamePanel:getChildById('walkBooster')
|
||||
optionWalkBooster.onCheckChange = function(widget)
|
||||
displayWarning(widget, "This feature could be detectable by official Tibia servers. Would like to continue?")
|
||||
Options.setOption(widget:getId(), widget:isChecked())
|
||||
end
|
||||
|
||||
setupGraphicsEngines()
|
||||
end
|
||||
|
||||
@@ -103,7 +126,8 @@ function Options.terminate()
|
||||
optionsButton:destroy()
|
||||
optionsButton = nil
|
||||
optionsTabBar = nil
|
||||
generalPanel = nil
|
||||
gamePanel = nil
|
||||
consolePanel = nil
|
||||
graphicsPanel = nil
|
||||
Options = nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user