This commit is contained in:
OTCv8
2020-07-15 18:25:22 +02:00
parent f17ac1ec71
commit f6f88a9cb3
16 changed files with 51 additions and 34 deletions

View File

@@ -15,7 +15,7 @@ local serverSelector
local clientVersionSelector
local serverHostTextEdit
local rememberPasswordBox
local protos = {"740", "760", "772", "792", "800", "810", "854", "860", "870", "961", "1000", "1077", "1090", "1096", "1098", "1099", "1100", "1200"}
local protos = {"740", "760", "772", "792", "800", "810", "854", "860", "870", "961", "1000", "1077", "1090", "1096", "1098", "1099", "1100", "1200", "1220"}
local checkedByUpdater = {}
@@ -149,8 +149,8 @@ local function onTibia12HTTPResult(session, playdata)
for _, world in pairs(playdata["worlds"]) do
worlds[world.id] = {
name = world.name,
port = world.externalportunprotected or world.externalportprotected,
address = world.externaladdressunprotected or world.externaladdressprotected
port = world.externalportunprotected or world.externalportprotected or world.externaladdress,
address = world.externaladdressunprotected or world.externaladdressprotected or world.externalport
}
end
@@ -414,8 +414,10 @@ function EnterGame.doLogin()
G.host = server_params[1] .. ":" .. server_params[2] .. ":" .. server_params[3]
G.clientVersion = tonumber(server_params[4])
elseif #server_params >= 3 then
G.host = server_params[1] .. ":" .. server_params[2]
G.clientVersion = tonumber(server_params[3])
if tonumber(server_params[3]) == server_params[3] then
G.host = server_params[1] .. ":" .. server_params[2]
G.clientVersion = tonumber(server_params[3])
end
end
return EnterGame.doLoginHttp()
end

View File

@@ -38,7 +38,7 @@ local function setup()
local targetPos = target:getPosition()
if targetPos.x == 0xFFFF then return end
lastPos = pos
CaveBot.addAction("usewith", itemId .. "," .. pos.x .. "," .. pos.y .. "," .. pos.z, true)
CaveBot.addAction("usewith", itemId .. "," .. targetPos.x .. "," .. targetPos.y .. "," .. targetPos.z, true)
end)
end

View File

@@ -111,11 +111,13 @@ end
function setProtection(value)
protection = value
if protection then
emptyImbue.cost:setText(selectedImbue["cost"] + selectedImbue["protectionCost"])
emptyImbue.successRate:setText("100%")
emptyImbue.successRate:setColor("green")
protectionBtn:setImageClip(torect("66 0 66 66"))
else
if selectedImbue then
emptyImbue.cost:setText(selectedImbue["cost"])
emptyImbue.successRate:setText(selectedImbue["successRate"] .. "%")
if selectedImbue["successRate"] > 50 then
emptyImbue.successRate:setColor("white")
@@ -219,7 +221,13 @@ function selectSlot(widget, slotId, activeSlot)
emptyImbue.imbue.onClick = function()
imbuingWindow:hide()
clearConfirmWindow = displayGeneralBox(tr('Confirm Imbuing Attempt'), tr('You are about to imbue your item with "' .. selectedImbue["name"] .. '".\nYour chance to succeed is ' .. selectedImbue["successRate"] .. '. It will consume the required astral sources and '.. selectedImbue["cost"]..' gold coins.\nDo you wish to proceed?'), {
local cost = selectedImbue["cost"]
local successRate = selectedImbue["successRate"]
if protection then
cost = cost + selectedImbue["protectionCost"]
successRate = "100"
end
clearConfirmWindow = displayGeneralBox(tr('Confirm Imbuing Attempt'), 'You are about to imbue your item with "' .. selectedImbue["name"] .. '".\nYour chance to succeed is ' .. successRate .. '%. It will consume the required astral sources and '.. cost ..' gold coins.\nDo you wish to proceed?', {
{ text=tr('Yes'), callback=yesCallback },
{ text=tr('No'), callback=noCallback },
anchor=AnchorHorizontalCenter}, yesCallback, noCallback)

View File

@@ -106,7 +106,7 @@ function setupSelector(widget, id, outfit, list)
widget.label:setText(list[pos][2])
updateOutfit()
end
return w
return widget
end
function create(currentOutfit, outfitList, mountList, wingList, auraList, shaderList)
@@ -219,10 +219,12 @@ end
function accept()
local outfit = outfitWindow.type.creature:getOutfit()
for i, child in pairs(outfitWindow.extensions:getChildren()) do
if child:getId() == "shader" then
outfit[child:getId()] = child.creature:getOutfit().shader
else
outfit[child:getId()] = child.creature:getOutfit().type
if child.creature:getCreature() then
if child:getId() == "shader" then
outfit[child:getId()] = child.creature:getOutfit().shader
else
outfit[child:getId()] = child.creature:getOutfit().type
end
end
end
g_game.changeOutfit(outfit)

View File

@@ -157,13 +157,6 @@ MainWindow
fit-children: true
spacing: 3
HorizontalSeparator
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: next.top
margin-bottom: 5
margin-top: 5
Button
id: outfitOkButton
!text: tr('Ok')

View File

@@ -2,7 +2,7 @@ function init()
-- add manually your shaders from /data/shaders
g_shaders.createOutfitShader("default", "/shaders/outfit_default_vertex", "/shaders/outfit_default_fragment")
--[[ g_shaders.createOutfitShader("stars", "/shaders/outfit_stars_vertex", "/shaders/outfit_stars_fragment")
g_shaders.createOutfitShader("stars", "/shaders/outfit_stars_vertex", "/shaders/outfit_stars_fragment")
g_shaders.addTexture("stars", "/shaders/stars.png")
g_shaders.createOutfitShader("gold", "/shaders/outfit_gold_vertex", "/shaders/outfit_gold_fragment")
@@ -13,7 +13,7 @@ function init()
g_shaders.createOutfitShader("line", "/shaders/outfit_line_vertex", "/shaders/outfit_line_fragment")
g_shaders.createOutfitShader("outline", "/shaders/outfit_outline_vertex", "/shaders/outfit_outline_fragment") ]]--
g_shaders.createOutfitShader("outline", "/shaders/outfit_outline_vertex", "/shaders/outfit_outline_fragment")
end
function terminate()

View File

@@ -366,7 +366,7 @@ function processAd(data)
if data['image'] and data['image']:sub(1, 4):lower() == "http" then
HTTP.downloadImage(data['image'], function(path, err)
if err then g_logger.warning("HTTP error: " .. err) return end
if err then g_logger.warning("HTTP error: " .. err .. " - " .. data['image']) return end
shop.adPanel:setHeight(shop.infoPanel:getHeight())
shop.adPanel.ad:setText("")
shop.adPanel.ad:setImageSource(path)
@@ -407,7 +407,7 @@ function addCategory(data)
category = g_ui.createWidget('ShopCategoryImage', shop.categories)
if data["image"] and data["image"]:sub(1, 4):lower() == "http" then
HTTP.downloadImage(data['image'], function(path, err)
if err then g_logger.warning("HTTP error: " .. err) return end
if err then g_logger.warning("HTTP error: " .. err .. " - " .. data["image"]) return end
category.image:setImageSource(path)
end)
else
@@ -456,7 +456,7 @@ function addOffer(category, data)
offer = g_ui.createWidget('ShopOfferImage', shop.offers)
if data["image"] and data["image"]:sub(1, 4):lower() == "http" then
HTTP.downloadImage(data['image'], function(path, err)
if err then g_logger.warning("HTTP error: " .. err) return end
if err then g_logger.warning("HTTP error: " .. err .. " - " .. data['image']) return end
if not offer.image then return end
offer.image:setImageSource(path)
end)