mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-04-30 03:09:20 +02:00
Version 0.991 BETA
This commit is contained in:
parent
bc977c268e
commit
c5c600e83e
@ -26,11 +26,6 @@ Panel
|
|||||||
!text: tr('Enable smart walking')
|
!text: tr('Enable smart walking')
|
||||||
!tooltip: tr('Will detect when to use diagonal step based on the\nkeys you are pressing')
|
!tooltip: tr('Will detect when to use diagonal step based on the\nkeys you are pressing')
|
||||||
|
|
||||||
OptionCheckBox
|
|
||||||
id: ignoreServerDirection
|
|
||||||
!text: tr('Ignore server direction')
|
|
||||||
!tooltip: tr('Doesn\'t change direction when walk is canceled')
|
|
||||||
|
|
||||||
OptionCheckBox
|
OptionCheckBox
|
||||||
id: realDirection
|
id: realDirection
|
||||||
!text: tr('Show real direction')
|
!text: tr('Show real direction')
|
||||||
|
@ -295,8 +295,8 @@ function setOption(key, value, force)
|
|||||||
if modules.game_console and modules.game_console.consoleToggleChat:isChecked() ~= value then
|
if modules.game_console and modules.game_console.consoleToggleChat:isChecked() ~= value then
|
||||||
modules.game_console.consoleToggleChat:setChecked(value)
|
modules.game_console.consoleToggleChat:setChecked(value)
|
||||||
end
|
end
|
||||||
elseif key == 'ignoreServerDirection' then
|
--elseif key == 'ignoreServerDirection' then
|
||||||
g_game.ignoreServerDirection(value)
|
-- g_game.ignoreServerDirection(value)
|
||||||
elseif key == 'realDirection' then
|
elseif key == 'realDirection' then
|
||||||
g_game.showRealDirection(value)
|
g_game.showRealDirection(value)
|
||||||
elseif key == 'hotkeyDelay' then
|
elseif key == 'hotkeyDelay' then
|
||||||
|
@ -55,10 +55,6 @@ function HTTP.downloadImage(url, callback)
|
|||||||
return operation
|
return operation
|
||||||
end
|
end
|
||||||
|
|
||||||
function HTTP.progress(operationId)
|
|
||||||
return g_http.getProgress(operationId)
|
|
||||||
end
|
|
||||||
|
|
||||||
function HTTP.cancel(operationId)
|
function HTTP.cancel(operationId)
|
||||||
return g_http.cancel(operationId)
|
return g_http.cancel(operationId)
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,6 @@ function g_tooltip.init()
|
|||||||
toolTipLabel:setBackgroundColor('#111111cc')
|
toolTipLabel:setBackgroundColor('#111111cc')
|
||||||
toolTipLabel:setTextAlign(AlignCenter)
|
toolTipLabel:setTextAlign(AlignCenter)
|
||||||
toolTipLabel:hide()
|
toolTipLabel:hide()
|
||||||
toolTipLabel.onMouseMove = function() moveToolTip() end
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -89,10 +88,18 @@ function g_tooltip.display(text)
|
|||||||
toolTipLabel:enable()
|
toolTipLabel:enable()
|
||||||
g_effects.fadeIn(toolTipLabel, 100)
|
g_effects.fadeIn(toolTipLabel, 100)
|
||||||
moveToolTip(true)
|
moveToolTip(true)
|
||||||
|
|
||||||
|
connect(rootWidget, {
|
||||||
|
onMouseMove = moveToolTip,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_tooltip.hide()
|
function g_tooltip.hide()
|
||||||
g_effects.fadeOut(toolTipLabel, 100)
|
g_effects.fadeOut(toolTipLabel, 100)
|
||||||
|
|
||||||
|
disconnect(rootWidget, {
|
||||||
|
onMouseMove = moveToolTip,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -1277,15 +1277,15 @@ function loadCommunicationSettings()
|
|||||||
|
|
||||||
local ignoreNode = g_settings.getNode('IgnorePlayers')
|
local ignoreNode = g_settings.getNode('IgnorePlayers')
|
||||||
if ignoreNode then
|
if ignoreNode then
|
||||||
for i = 1, #ignoreNode do
|
for _, player in pairs(ignoreNode) do
|
||||||
table.insert(communicationSettings.ignoredPlayers, ignoreNode[i])
|
table.insert(communicationSettings.ignoredPlayers, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local whitelistNode = g_settings.getNode('WhitelistedPlayers')
|
local whitelistNode = g_settings.getNode('WhitelistedPlayers')
|
||||||
if whitelistNode then
|
if whitelistNode then
|
||||||
for i = 1, #whitelistNode do
|
for _, player in pairs(whitelistNode) do
|
||||||
table.insert(communicationSettings.whitelistedPlayers, whitelistNode[i])
|
table.insert(communicationSettings.whitelistedPlayers, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -373,8 +373,23 @@ function addKeyCombo(keyCombo, keySettings, focus)
|
|||||||
|
|
||||||
updateHotkeyLabel(hotkeyLabel)
|
updateHotkeyLabel(hotkeyLabel)
|
||||||
|
|
||||||
boundCombosCallback[keyCombo] = function() scheduleEvent(function() doKeyCombo(keyCombo) end, g_settings.getNumber('hotkeyDelay')) end
|
|
||||||
|
if keyCombo:lower():find("ctrl") then
|
||||||
|
if boundCombosCallback[keyCombo] then
|
||||||
|
g_keyboard.unbindKeyPress(keyCombo, boundCombosCallback[keyCombo])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
boundCombosCallback[keyCombo] = function() prepareKeyCombo(keyCombo) end
|
||||||
g_keyboard.bindKeyPress(keyCombo, boundCombosCallback[keyCombo])
|
g_keyboard.bindKeyPress(keyCombo, boundCombosCallback[keyCombo])
|
||||||
|
|
||||||
|
if not keyCombo:lower():find("ctrl") then
|
||||||
|
local keyComboCtrl = "Ctrl+" .. keyCombo
|
||||||
|
if not boundCombosCallback[keyComboCtrl] then
|
||||||
|
boundCombosCallback[keyComboCtrl] = function() prepareKeyCombo(keyComboCtrl) end
|
||||||
|
g_keyboard.bindKeyPress(keyComboCtrl, boundCombosCallback[keyComboCtrl])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if focus then
|
if focus then
|
||||||
@ -385,6 +400,24 @@ function addKeyCombo(keyCombo, keySettings, focus)
|
|||||||
configValueChanged = true
|
configValueChanged = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function prepareKeyCombo(keyCombo)
|
||||||
|
local hotKey = hotkeyList[keyCombo]
|
||||||
|
if keyCombo:lower():find("ctrl") and not hotKey or (hotKey.itemId == nil and (not hotKey.value or #hotKey.value == 0)) then
|
||||||
|
keyCombo = keyCombo:gsub("Ctrl%+", "")
|
||||||
|
keyCombo = keyCombo:gsub("ctrl%+", "")
|
||||||
|
hotKey = hotkeyList[keyCombo]
|
||||||
|
end
|
||||||
|
if not hotKey then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if hotKey.itemId == nil then -- say
|
||||||
|
scheduleEvent(function() doKeyCombo(keyCombo) end, g_settings.getNumber('hotkeyDelay'))
|
||||||
|
else
|
||||||
|
doKeyCombo(keyCombo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function doKeyCombo(keyCombo)
|
function doKeyCombo(keyCombo)
|
||||||
if not g_game.isOnline() then return end
|
if not g_game.isOnline() then return end
|
||||||
if modules.game_console and modules.game_console.isChatEnabled() then
|
if modules.game_console and modules.game_console.isChatEnabled() then
|
||||||
|
@ -10,6 +10,7 @@ walkLock = 0
|
|||||||
lastWalk = 0
|
lastWalk = 0
|
||||||
lastTurn = 0
|
lastTurn = 0
|
||||||
lastTurnDirection = 0
|
lastTurnDirection = 0
|
||||||
|
lastStop = 0
|
||||||
turnKeys = {}
|
turnKeys = {}
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
@ -263,11 +264,15 @@ function walk(dir)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if player:isAutoWalking() or player:isServerWalking() then
|
if player:isAutoWalking() or player:isServerWalking() then
|
||||||
|
if lastStop + 100 < g_clock.millis() then
|
||||||
|
lastStop = g_clock.millis()
|
||||||
if player:isAutoWalking() then
|
if player:isAutoWalking() then
|
||||||
player:stopAutoWalk()
|
player:stopAutoWalk()
|
||||||
end
|
end
|
||||||
g_game.stop()
|
g_game.stop()
|
||||||
end
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if player:isWalkLocked() then
|
if player:isWalkLocked() then
|
||||||
nextWalkDir = nil
|
nextWalkDir = nil
|
||||||
|
BIN
otclient_dx.exe
BIN
otclient_dx.exe
Binary file not shown.
BIN
otclient_gl.exe
BIN
otclient_gl.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,11 +10,10 @@ HTTP.post(url, data, callback)
|
|||||||
HTTP.postJSON(url, data, callback) -- data should be a table {} and website should return json
|
HTTP.postJSON(url, data, callback) -- data should be a table {} and website should return json
|
||||||
HTTP.download(url, file, downloadCallback, progressCallback) -- progressCallback can be null
|
HTTP.download(url, file, downloadCallback, progressCallback) -- progressCallback can be null
|
||||||
HTTP.downloadImage(url, downloadImageCallback)
|
HTTP.downloadImage(url, downloadImageCallback)
|
||||||
HTTP.progress(operationId) -- return -1 on error or number from 0 to 100
|
|
||||||
HTTP.cancel(operationId)
|
HTTP.cancel(operationId)
|
||||||
```
|
```
|
||||||
|
|
||||||
Each function, except `cancel` and `progress` return operationId, you can use it to cancel or get progress of http request.
|
Each function, except `cancel` return operationId, you can use it to cancel http request.
|
||||||
Those functions came from `modules/corelib/http.lua` and they use more advanced g_http API.
|
Those functions came from `modules/corelib/http.lua` and they use more advanced g_http API.
|
||||||
Files from download are available in virtual "/downloads" directory. Downloading of images is using cache based on url (so if you change image it won't refresh until restart or change url).
|
Files from download are available in virtual "/downloads" directory. Downloading of images is using cache based on url (so if you change image it won't refresh until restart or change url).
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user