Updated to OTCv8 3.1 rev 117

This commit is contained in:
OTCv8 2021-12-13 00:30:25 +00:00
parent 91f2c2da12
commit 8408102687
10 changed files with 16 additions and 12 deletions

View File

@ -100,7 +100,7 @@ InventoryButton < Button
text-align: center text-align: center
font: cipsoftFont font: cipsoftFont
color: white color: white
size: 45 20 size: 45 18
text-offset: 2 2 text-offset: 2 2
SoulCapLabel < GameLabel SoulCapLabel < GameLabel

View File

@ -103,15 +103,18 @@ StaticMainWindow
Button Button
id: autoReconnect id: autoReconnect
!text: tr('Auto reconnect: On')
width: 140 width: 140
anchors.left: parent.left anchors.left: parent.left
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
image-color: green
$!on: $!on:
image-color: red image-color: red
!text: tr('Auto reconnect: Off') !text: tr('Auto reconnect: Off')
$on:
!text: tr('Auto reconnect: On')
image-color: green
Button Button
id: buttonOk id: buttonOk
!text: tr('Ok') !text: tr('Ok')

View File

@ -140,6 +140,7 @@ function terminate()
end end
end end
local n = 0
function setUnsupportedSettings() function setUnsupportedSettings()
local t = {"slot1", "slot2", "slot3"} local t = {"slot1", "slot2", "slot3"}
for i, slot in pairs(t) do for i, slot in pairs(t) do
@ -192,7 +193,7 @@ function show()
preyWindow:show() preyWindow:show()
preyWindow:raise() preyWindow:raise()
preyWindow:focus() preyWindow:focus()
--g_game.preyRequest() -- update preys, it's for tibia 12 g_game.preyRequest() -- update preys, it's for tibia 12
end end
function toggle() function toggle()
@ -205,7 +206,7 @@ end
function onPreyFreeRolls(slot, timeleft) function onPreyFreeRolls(slot, timeleft)
local prey = preyWindow["slot" .. (slot + 1)] local prey = preyWindow["slot" .. (slot + 1)]
local percent = (timeleft / (20 * 60)) * 100 local percent = (timeleft / (20 * 60)) * 100
local desc = timeleftTranslation(timeleft * 60, true) local desc = timeleftTranslation(timeleft * 60)
if not prey then return end if not prey then return end
for i, panel in pairs({prey.active, prey.inactive}) do for i, panel in pairs({prey.active, prey.inactive}) do
local progressBar = panel.reroll.button.time local progressBar = panel.reroll.button.time
@ -213,7 +214,7 @@ function onPreyFreeRolls(slot, timeleft)
progressBar:setPercent(percent) progressBar:setPercent(percent)
progressBar:setText(desc) progressBar:setText(desc)
if timeleft == 0 then if timeleft == 0 then
price:setText("Free") price:setText("0")
end end
end end
end end
@ -421,7 +422,7 @@ function onItemBoxChecked(widget)
widget:setChecked(true) widget:setChecked(true)
end end
function onPreyActive(slot, currentHolderName, currentHolderOutfit, bonusType, bonusValue, bonusGrade, timeLeft, timeUntilFreeReroll) function onPreyActive(slot, currentHolderName, currentHolderOutfit, bonusType, bonusValue, bonusGrade, timeLeft, timeUntilFreeReroll, lockType) -- locktype always 0 for protocols <12
local tracker = preyTracker.contentsPanel["slot"..(slot + 1)] local tracker = preyTracker.contentsPanel["slot"..(slot + 1)]
currentHolderName = capitalFormatStr(currentHolderName) currentHolderName = capitalFormatStr(currentHolderName)
local percent = (timeLeft / (2 * 60 * 60)) * 100 local percent = (timeLeft / (2 * 60 * 60)) * 100
@ -493,8 +494,9 @@ function onPreySelection(slot, bonusType, bonusValue, bonusGrade, names, outfits
prey.inactive:show() prey.inactive:show()
prey.title:setText(tr("Select monster")) prey.title:setText(tr("Select monster"))
local rerollButton = prey.inactive.reroll.button.rerollButton local rerollButton = prey.inactive.reroll.button.rerollButton
rerollButton:setImageSource("/images/game/prey/prey_reroll_blocked") rerollButton.onClick = function()
rerollButton:disable() g_game.preyAction(slot, PREY_ACTION_LISTREROLL, 0)
end
local list = prey.inactive.list local list = prey.inactive.list
list:destroyChildren() list:destroyChildren()
for i, name in ipairs(names) do for i, name in ipairs(names) do

View File

@ -435,7 +435,6 @@ RerollButton < FlatPanel
$pressed: $pressed:
image-clip: 0 46 60 47 image-clip: 0 46 60 47
GoldLabel GoldLabel
id: price id: price
anchors.top: prev.bottom anchors.top: prev.bottom

View File

@ -299,7 +299,7 @@ end
function onLevelChange(localPlayer, value, percent) function onLevelChange(localPlayer, value, percent)
setSkillValue('level', value) setSkillValue('level', value)
local text = tr('You have %s percent to go', 100 - percent) .. '\n' .. local text = tr('You have %s percent to go', 100 - percent) .. '\n' ..
tr('%s of experience left', expToAdvance(localPlayer:getLevel(), localPlayer:getExperience())) tr('%s of experience left', comma_value(expToAdvance(localPlayer:getLevel(), localPlayer:getExperience())))
if localPlayer.expSpeed ~= nil then if localPlayer.expSpeed ~= nil then
local expPerHour = math.floor(localPlayer.expSpeed * 3600) local expPerHour = math.floor(localPlayer.expSpeed * 3600)
@ -308,7 +308,7 @@ function onLevelChange(localPlayer, value, percent)
local hoursLeft = (nextLevelExp - localPlayer:getExperience()) / expPerHour local hoursLeft = (nextLevelExp - localPlayer:getExperience()) / expPerHour
local minutesLeft = math.floor((hoursLeft - math.floor(hoursLeft))*60) local minutesLeft = math.floor((hoursLeft - math.floor(hoursLeft))*60)
hoursLeft = math.floor(hoursLeft) hoursLeft = math.floor(hoursLeft)
text = text .. '\n' .. tr('%d of experience per hour', expPerHour) text = text .. '\n' .. tr('%d of experience per hour', comma_value(expPerHour))
text = text .. '\n' .. tr('Next level in %d hours and %d minutes', hoursLeft, minutesLeft) text = text .. '\n' .. tr('Next level in %d hours and %d minutes', hoursLeft, minutesLeft)
end end
end end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.