Minor changes to manifest format
This commit is contained in:
@@ -412,7 +412,7 @@ function TreeViewClass:DrawTree(build, viewPort, inputEvents)
|
||||
end
|
||||
end
|
||||
|
||||
if hoverNode then
|
||||
if hoverNode and (hoverNode.type ~= "socket" or not IsKeyDown("SHIFT")) then
|
||||
self:AddNodeTooltip(hoverNode, build)
|
||||
local scrX, scrY = treeToScreen(hoverNode.x, hoverNode.y)
|
||||
local size = m_floor(hoverNode.size * scale)
|
||||
@@ -517,31 +517,31 @@ function TreeViewClass:AddNodeTooltip(node, build)
|
||||
end
|
||||
local none = true
|
||||
local header = false
|
||||
for _, data in ipairs(build.displayStats) do
|
||||
if data.mod then
|
||||
local diff = (nodeOutput[data.mod] or 0) - (calcBase[data.mod] or 0)
|
||||
for _, stat in ipairs(build.displayStats) do
|
||||
if stat.mod then
|
||||
local diff = (nodeOutput[stat.mod] or 0) - (calcBase[stat.mod] or 0)
|
||||
if diff > 0.001 or diff < -0.001 then
|
||||
none = false
|
||||
if not header then
|
||||
main:AddTooltipLine(14, string.format("^7%s this node will give you:", node.alloc and "Unallocating" or "Allocating"))
|
||||
header = true
|
||||
end
|
||||
main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
main:AddTooltipLine(14, string.format("%s%+"..stat.fmt.." %s", diff > 0 and data.colorCodes.POSITIVE or data.colorCodes.NEGATIVE, diff * (stat.pc and 100 or 1), stat.label))
|
||||
end
|
||||
end
|
||||
end
|
||||
if count > 1 then
|
||||
header = false
|
||||
for _, data in ipairs(build.displayStats) do
|
||||
if data.mod then
|
||||
local diff = (pathOutput[data.mod] or 0) - (calcBase[data.mod] or 0)
|
||||
for _, stat in ipairs(build.displayStats) do
|
||||
if stat.mod then
|
||||
local diff = (pathOutput[stat.mod] or 0) - (calcBase[stat.mod] or 0)
|
||||
if diff > 0.001 or diff < -0.001 then
|
||||
none = false
|
||||
if not header then
|
||||
main:AddTooltipLine(14, string.format("^7%s this node and all nodes %s will give you:", node.alloc and "Unallocating" or "Allocating", node.alloc and "depending on it" or "leading to it"))
|
||||
header = true
|
||||
end
|
||||
main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
main:AddTooltipLine(14, string.format("%s%+"..stat.fmt.." %s", diff > 0 and data.colorCodes.POSITIVE or data.colorCodes.NEGATIVE, diff * (stat.pc and 100 or 1), stat.label))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -149,7 +149,7 @@ function launch:OnSubFinished(ret)
|
||||
if not ret then
|
||||
self:ShowPrompt(1, 0, 0, self.updateMsg .. "\n\nEnter/Escape to dismiss")
|
||||
elseif self.updateChecking then
|
||||
if ret == "none" then
|
||||
if ret == "none" then
|
||||
self:ShowPrompt(0, 0, 0, "No update available.", function(key) return true end)
|
||||
else
|
||||
self:ShowPrompt(0.2, 0.8, 0.2, "An update has been downloaded.\n\nClick 'Apply Update' at the top right when you are ready.", function(key) return true end)
|
||||
|
||||
@@ -10,12 +10,14 @@ local basicFiles = { "Launch.lua", "Update.lua" }
|
||||
local xml = require("xml")
|
||||
local curl = require("lcurl")
|
||||
|
||||
local localSource
|
||||
local localBranch, localSource
|
||||
local localManXML = xml.LoadXMLFile("manifest.xml")
|
||||
if localManXML and localManXML[1].elem == "PoBVersion" then
|
||||
for _, node in ipairs(localManXML[1]) do
|
||||
if type(node) == "table" then
|
||||
if node.elem == "Source" then
|
||||
if node.elem == "Version" then
|
||||
localBranch = node.attrib.branch
|
||||
elseif node.elem == "Source" then
|
||||
if node.attrib.part == "program" then
|
||||
localSource = node.attrib.url
|
||||
end
|
||||
@@ -23,10 +25,11 @@ if localManXML and localManXML[1].elem == "PoBVersion" then
|
||||
end
|
||||
end
|
||||
end
|
||||
if not localSource then
|
||||
if not localBranch or not localSource then
|
||||
Exit("Install failed. (Missing or invalid manifest)")
|
||||
return
|
||||
end
|
||||
localSource = localSource:gsub("{branch}", localBranch)
|
||||
for _, name in pairs(basicFiles) do
|
||||
local outFile = io.open(name, "wb")
|
||||
local easy = curl.easy()
|
||||
|
||||
@@ -24,12 +24,14 @@ data.colorCodes = {
|
||||
COLD = "^x366492",
|
||||
LIGHTNING = "^xFFD700",
|
||||
CHAOS = "^xD02090",
|
||||
POSITIVE = "^x33FF77",
|
||||
NEGATIVE = "^xDD0022",
|
||||
}
|
||||
|
||||
data.jewelRadius = {
|
||||
{ rad = 800, col = "^xFFBB33", label = "Small" },
|
||||
{ rad = 1200, col = "^x33FF66", label = "Medium" },
|
||||
{ rad = 1500, col = "^x3333FF", label = "Large" }
|
||||
{ rad = 800, col = "^xBB6600", label = "Small" },
|
||||
{ rad = 1200, col = "^x66FFCC", label = "Medium" },
|
||||
{ rad = 1500, col = "^x2222CC", label = "Large" }
|
||||
}
|
||||
|
||||
data.evasionTable = { 36, 42, 49, 56, 64, 72, 80, 89, 98, 108,
|
||||
|
||||
@@ -311,7 +311,7 @@ function items:AddItemTooltip(item)
|
||||
end
|
||||
header = true
|
||||
end
|
||||
main:AddTooltipLine(14, string.format("%s%+"..statData.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (statData.pc and 100 or 1), statData.label))
|
||||
main:AddTooltipLine(14, string.format("%s%+"..statData.fmt.." %s", diff > 0 and data.colorCodes.POSITIVE or data.colorCodes.NEGATIVE, diff * (statData.pc and 100 or 1), statData.label))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
10
Update.lua
10
Update.lua
@@ -50,7 +50,7 @@ if mode == "CHECK" then
|
||||
|
||||
-- Load and process local manifest
|
||||
local localVer
|
||||
local localPlatform
|
||||
local localPlatform, localBranch
|
||||
local localFiles = { }
|
||||
local localManXML = xml.LoadXMLFile("manifest.xml")
|
||||
local localSource
|
||||
@@ -60,6 +60,7 @@ if mode == "CHECK" then
|
||||
if node.elem == "Version" then
|
||||
localVer = node.attrib.number
|
||||
localPlatform = node.attrib.platform
|
||||
localBranch = node.attrib.branch
|
||||
elseif node.elem == "Source" then
|
||||
if node.attrib.part == "program" then
|
||||
localSource = node.attrib.url
|
||||
@@ -74,6 +75,7 @@ if mode == "CHECK" then
|
||||
ConPrintf("Update check failed: invalid local manifest")
|
||||
return
|
||||
end
|
||||
localSource = localSource:gsub("{branch}", localBranch)
|
||||
|
||||
-- Download and process remote manifest
|
||||
local remoteVer
|
||||
@@ -151,6 +153,7 @@ if mode == "CHECK" then
|
||||
for _, data in ipairs(updateFiles) do
|
||||
local partSources = remoteSources[data.part]
|
||||
local source = partSources[localPlatform] or partSources["any"]
|
||||
source = source:gsub("{branch}", localBranch)
|
||||
local fileName = "Update/"..data.name:gsub("[\\/]","{slash}")
|
||||
data.updateFileName = fileName
|
||||
local zipName = source:match("/([^/]+%.zip)$")
|
||||
@@ -177,9 +180,6 @@ if mode == "CHECK" then
|
||||
ConPrintf("Couldn't extract '%s' from '%s' (zip open failed)", data.name, zipName)
|
||||
failedFile = true
|
||||
end
|
||||
elseif source == "" then
|
||||
ConPrintf("File '%s' has no source", data.name)
|
||||
failedFile = true
|
||||
else
|
||||
ConPrintf("Downloading %s...", data.name)
|
||||
if downloadFile(curl, source..data.name, fileName) then
|
||||
@@ -198,7 +198,7 @@ if mode == "CHECK" then
|
||||
|
||||
-- Create new manifest
|
||||
localManXML = { elem = "PoBVersion" }
|
||||
table.insert(localManXML, { elem = "Version", attrib = { number = remoteVer, platform = localPlatform } })
|
||||
table.insert(localManXML, { elem = "Version", attrib = { number = remoteVer, platform = localPlatform, branch = localBranch } })
|
||||
for part, platforms in pairs(remoteSources) do
|
||||
for platform, url in pairs(platforms) do
|
||||
table.insert(localManXML, { elem = "Source", attrib = { part = part, platform = platform ~= "any" and platform, url = url } })
|
||||
|
||||
18
manifest.xml
18
manifest.xml
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PoBVersion>
|
||||
<Version number="0.1.0"/>
|
||||
<Source part="program" url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/dev/"/>
|
||||
<Source url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/dev/runtime-win32.zip" part="runtime" platform="win32"/>
|
||||
<File sha1="e95fac891f87e79401f3158bf4baf4545c32dbc0" name="Launch.lua" part="program"/>
|
||||
<File sha1="e33daa13951d2002db2d273fe139301c8bee5efb" name="Update.lua" part="program"/>
|
||||
<Version number="0.1.1"/>
|
||||
<Source part="program" url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/{branch}/"/>
|
||||
<Source url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/{branch}/runtime-win32.zip" part="runtime" platform="win32"/>
|
||||
<File sha1="4a805f9ced3587237123c082d057a9c50f711023" name="Launch.lua" part="program"/>
|
||||
<File sha1="ad57260ba55bc2dd7cf0138608197423d38bdbc9" name="Update.lua" part="program"/>
|
||||
<File sha1="434890f159cb67a73b0489e07471a101582e7168" name="Classes/ButtonControl.lua" part="program"/>
|
||||
<File sha1="991b3deecb4ae60eee54e5b81d4e10a67da80dc7" name="Classes/DropDownControl.lua" part="program"/>
|
||||
<File sha1="1571a47a5549a9ae38407b88012fda39f7ad1ce0" name="Classes/EditControl.lua" part="program"/>
|
||||
@@ -12,15 +12,15 @@
|
||||
<File sha1="1ab906e8f0c24bd930e9c1cd6d079f4304e3d277" name="Classes/ItemSlot.lua" part="program"/>
|
||||
<File sha1="ff2c50b66fc2805a30c2967f247ed5c2913a3412" name="Classes/PassiveSpec.lua" part="program"/>
|
||||
<File sha1="5596212c676dc4ca2994a312ca491b6c96a0179f" name="Classes/PassiveTree.lua" part="program"/>
|
||||
<File sha1="269af7a046f0b4c9109c7c78022f0d808cae7d4a" name="Classes/PassiveTreeView.lua" part="program"/>
|
||||
<File sha1="169af3ed2b9a2600c82e599432980795c9e190dd" name="Classes/PassiveTreeView.lua" part="program"/>
|
||||
<File sha1="aa07a6eeb69c767471a340ed341068d940879c0f" name="Modules/Build.lua" part="program"/>
|
||||
<File sha1="8eb0d9572492ea37f2f81e911692880e56ed1ef0" name="Modules/BuildList.lua" part="program"/>
|
||||
<File sha1="784a723e92de656044f9b88dadf64811a9e8fb6d" name="Modules/Calcs.lua" part="program"/>
|
||||
<File sha1="38eabf8c6012372393cf30411489e1bfb363826b" name="Modules/CalcsControl.lua" part="program"/>
|
||||
<File sha1="5f0b00ae2efcf03c8b82ce62fdf7fe90134da0ab" name="Modules/CalcsView.lua" part="program"/>
|
||||
<File sha1="cf3b4d40ddc30dba0230bcda4e9aeb5056673b4c" name="Modules/Common.lua" part="program"/>
|
||||
<File sha1="708ee4686c95b00d78823e1872c47a13123f7d06" name="Modules/Data.lua" part="program"/>
|
||||
<File sha1="cb1ad850071433aaceedbf404ccff693117c2625" name="Modules/Items.lua" part="program"/>
|
||||
<File sha1="78d300382ebcb532a80551c400f33b639c454989" name="Modules/Data.lua" part="program"/>
|
||||
<File sha1="9e46da96c639b066a9532de87b2ed4f7c8aef697" name="Modules/Items.lua" part="program"/>
|
||||
<File sha1="44febf05f971e01fd9999f420822e3c09b8b2662" name="Modules/ItemTools.lua" part="program"/>
|
||||
<File sha1="0fed968aa81a9732b54941f8f3a8d9f5a959d223" name="Modules/Main.lua" part="program"/>
|
||||
<File sha1="9a2e8a8ce4b31c9402ef1f7bd861f2bd76b11328" name="Modules/ModParser.lua" part="program"/>
|
||||
@@ -49,7 +49,7 @@
|
||||
<File sha1="e7ee7e5b6388facb7bf568517ecc401590757df7" name="Assets/ring.png" part="program"/>
|
||||
<File platform="win32" sha1="f545caeb86d355698eaff4d665b3af7f17154fb9" name="PathOfBuilding.exe" part="runtime"/>
|
||||
<File platform="win32" sha1="914d42ca1836c5152a5f60aad23020a86bcb46d9" name="lua51.dll" part="runtime"/>
|
||||
<File platform="win32" sha1="47c12f99207540649581d6d233e0f4e635be3f8e" name="SimpleGraphic.dll" part="runtime"/>
|
||||
<File platform="win32" sha1="0bda66c21bebd7423baa3b4e97a83b461d76bd21" name="SimpleGraphic.dll" part="runtime"/>
|
||||
<File platform="win32" sha1="887fd08cb3c2989a9d88adc9717d3ec00ab97462" name="libcurl.dll" part="runtime"/>
|
||||
<File platform="win32" sha1="607918daf9cbaecee0090e9cec8d0e221338678e" name="lcurl.dll" part="runtime"/>
|
||||
<File platform="win32" sha1="48a265c54cff51b88468085c52e8f711e0a92035" name="lzip.dll" part="runtime"/>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user