diff --git a/Classes/PassiveTreeView.lua b/Classes/PassiveTreeView.lua index dd8eeee9..c32fe495 100644 --- a/Classes/PassiveTreeView.lua +++ b/Classes/PassiveTreeView.lua @@ -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 diff --git a/Launch.lua b/Launch.lua index 4a599a24..8b5efa44 100644 --- a/Launch.lua +++ b/Launch.lua @@ -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) diff --git a/LaunchInstall.lua b/LaunchInstall.lua index 94e8596f..6ce89635 100644 --- a/LaunchInstall.lua +++ b/LaunchInstall.lua @@ -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() diff --git a/Modules/Data.lua b/Modules/Data.lua index 45b5d40c..511f1de2 100644 --- a/Modules/Data.lua +++ b/Modules/Data.lua @@ -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, diff --git a/Modules/Items.lua b/Modules/Items.lua index 225fbe19..fcc7d305 100644 --- a/Modules/Items.lua +++ b/Modules/Items.lua @@ -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 diff --git a/Update.lua b/Update.lua index 24946e12..394cd928 100644 --- a/Update.lua +++ b/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 } }) diff --git a/manifest.xml b/manifest.xml index 723c9f5c..3d40a5fc 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,10 +1,10 @@ - - - - - + + + + + @@ -12,15 +12,15 @@ - + - - + + @@ -49,7 +49,7 @@ - + diff --git a/runtime-win32.zip b/runtime-win32.zip index db294b41..73bc5e41 100644 Binary files a/runtime-win32.zip and b/runtime-win32.zip differ