Adding runtime to repo

This commit is contained in:
Openarl
2016-05-18 19:14:21 +10:00
parent bab5a7c248
commit d482733c46
7 changed files with 46 additions and 32 deletions

View File

@@ -319,7 +319,7 @@ function TreeViewClass:DrawTree(build, viewPort, inputEvents)
if node.ascendancyName and node.ascendancyName ~= spec.curAscendClassName then
SetDrawColor(0.5, 0.5, 0.5)
end
if IsKeyDown("ALT") then
if launch.devMode and IsKeyDown("ALT") then
if node.extra then
SetDrawColor(1, 0, 0)
elseif node.unknown then
@@ -456,7 +456,7 @@ function TreeViewClass:AddNodeTooltip(node, build)
if jewel then
build.items:AddItemTooltip(jewel, build)
else
main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
main:AddTooltipLine(24, "^7"..node.dn..(launch.devMode and IsKeyDown("ALT") and " ["..node.id.."]" or ""))
end
main:AddTooltipSeperator(14)
main:AddTooltipLine(14, "^x80A080Tip: Right click this socket to go to the items page and choose the jewel for this socket.")
@@ -464,8 +464,8 @@ function TreeViewClass:AddNodeTooltip(node, build)
end
-- Node name
main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
if IsKeyDown("ALT") and node.power and node.power.dps then
main:AddTooltipLine(24, "^7"..node.dn..(launch.devMode and IsKeyDown("ALT") and " ["..node.id.."]" or ""))
if launch.devMode and IsKeyDown("ALT") and node.power and node.power.dps then
main:AddTooltipLine(16, string.format("DPS power: %g Defence power: %g", node.power.dps, node.power.def))
end
@@ -474,7 +474,7 @@ function TreeViewClass:AddNodeTooltip(node, build)
main:AddTooltipLine(16, "")
for i, line in ipairs(node.sd) do
if node.mods[i].list then
if IsKeyDown("ALT") then
if launch.devMode and IsKeyDown("ALT") then
local modStr
for k, v in pairs(node.mods[i].list) do
modStr = (modStr and modStr..", " or "^2") .. string.format("%s = %s", k, tostring(v))

View File

@@ -13,6 +13,11 @@ local launch = { }
SetMainObject(launch)
function launch:OnInit()
if GetScriptPath() ~= GetRuntimePath() then
-- We are running from an external runtime
-- Force developer mode to disable update checks
self.devMode = true
end
ConPrintf("Loading main script...")
local mainFile = io.open("Modules/Main.lua")
if mainFile then
@@ -40,7 +45,10 @@ function launch:OnInit()
self:ShowErrMsg("In 'Init': %s", errMsg)
end
end
self:CheckForUpdate(true)
if not self.devMode then
-- Run a background update check if developer mode is off
self:CheckForUpdate(true)
end
end
function launch:OnExit()
@@ -78,7 +86,9 @@ function launch:OnKeyDown(key, doubleClick)
if key == "F5" then
self.doRestart = true
elseif key == "u" and IsKeyDown("CTRL") then
self:CheckForUpdate()
if not self.devMode then
self:CheckForUpdate()
end
elseif self.promptMsg then
local errMsg, ret = PCall(self.promptFunc, key)
if errMsg then
@@ -157,7 +167,7 @@ function launch:ApplyUpdate(mode)
-- Update can be applied while normal environment is running
LoadModule("Update")
Restart()
self.doRestart = true -- Will show "Restarting" message if main window is showing
self.doRestart = true -- Will show "Restarting" message if main window is open
end
end
@@ -166,7 +176,7 @@ function launch:CheckForUpdate(inBackground)
self.updateChecking = not inBackground
self.updateMsg = ""
local update = io.open("Update.lua", "r")
LaunchSubScript(update:read("*a"), "MakeDir", "ConPrintf", "CHECK")
LaunchSubScript(update:read("*a"), "GetWorkDir,MakeDir", "ConPrintf", "CHECK")
update:close()
end
end

View File

@@ -318,7 +318,7 @@ function items:AddItemTooltip(item)
end
end
end
if IsKeyDown("ALT") then
if launch.devMode and IsKeyDown("ALT") then
main:AddTooltipSeperator(10)
local nameList = { }
for k in pairs(modList) do

View File

@@ -75,6 +75,10 @@ function main:OnFrame()
common.controlsDraw(self)
if launch.devMode then
DrawString(4, 4, "RIGHT", 18, "VAR", "^1Dev Mode")
end
wipeTable(self.inputEvents)
end
@@ -139,7 +143,7 @@ function main:LoadSettings()
end
self.buildPath = node.attrib.path
elseif node.elem == "DevMode" then
self.devMode = node.attrib.enable == "true"
launch.devMode = node.attrib.enable == "true"
end
end
end
@@ -161,7 +165,7 @@ function main:SaveSettings()
end
t_insert(setXML, mode)
t_insert(setXML, { elem = "BuildPath", attrib = { path = self.buildPath } })
t_insert(setXML, { elem = "DevMode", attrib = { enable = self.devMode and "true" or "false" } })
t_insert(setXML, { elem = "DevMode", attrib = { enable = launch.devMode and "true" or "false" } })
local res, errMsg = common.xml.SaveXMLFile(setXML, "Settings.xml")
if not res then
launch:ShowErrMsg("Error saving 'Settings.xml': %s", errMsg)

View File

@@ -210,22 +210,21 @@ if mode == "CHECK" then
xml.SaveXMLFile(localManXML, "Update/manifest.xml")
-- Build list of operations to apply the update
local coreUpdate = false
local updateMode = "normal"
local ops = { }
for _, data in pairs(updateFiles) do
if data.platform then
-- Core platform file, will need to update from the basic environment
coreUpdate = true
-- Tell update code to pause until this file is writable
table.insert(ops, 'wait "'..data.name..'"')
end
end
for _, data in pairs(updateFiles) do
-- Ensure that the destination path of this file exists
local dirStr = ""
for dir in data.name:gmatch("([^/]+/)") do
dirStr = dirStr .. dir
MakeDir(dirStr)
end
if data.platform then
-- Core platform file, will need to update from the basic environment
updateMode = "basic"
-- Tell update code to pause until this file is writable
table.insert(ops, 'wait "'..data.name..'"')
end
table.insert(ops, 'copy "'..data.updateFileName..'" "'..data.name..'"')
table.insert(ops, 'delete "'..data.updateFileName..'"')
end
@@ -234,7 +233,8 @@ if mode == "CHECK" then
end
table.insert(ops, 'copy "Update/manifest.xml" "manifest.xml"')
table.insert(ops, 'delete "Update/manifest.xml"')
if coreUpdate then
if updateMode == "basic" then
-- Update script will need to relaunch the normal environment after updating
table.insert(ops, 'launch')
end
@@ -244,7 +244,7 @@ if mode == "CHECK" then
opFile:close()
ConPrintf("Update is ready.")
return coreUpdate and "basic" or "normal"
return updateMode
end
print("Applying update...")

View File

@@ -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/master/"/>
<Source url="file://localhost/E:/Documents/Path%20of%20Exile/Calcs/win32.zip" part="runtime" platform="win32"/>
<File sha1="ab26bd775bea9fe99389bf501a81595e4d032d35" name="Launch.lua" part="program"/>
<File sha1="821f33f413e313792b7d9f96ab6f63c4f1f416b6" name="Update.lua" part="program"/>
<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"/>
<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,7 +12,7 @@
<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="2c4d949ef00875233150d0d71e57f056b0b6f803" name="Classes/PassiveTreeView.lua" part="program"/>
<File sha1="269af7a046f0b4c9109c7c78022f0d808cae7d4a" 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"/>
@@ -20,9 +20,9 @@
<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="f936142ba367e7cc895663fc7f0c45f315572e40" name="Modules/Items.lua" part="program"/>
<File sha1="cb1ad850071433aaceedbf404ccff693117c2625" name="Modules/Items.lua" part="program"/>
<File sha1="44febf05f971e01fd9999f420822e3c09b8b2662" name="Modules/ItemTools.lua" part="program"/>
<File sha1="0f1d852e26b0e066703c728b68bf90bc45c28f9a" name="Modules/Main.lua" part="program"/>
<File sha1="0fed968aa81a9732b54941f8f3a8d9f5a959d223" name="Modules/Main.lua" part="program"/>
<File sha1="9a2e8a8ce4b31c9402ef1f7bd861f2bd76b11328" name="Modules/ModParser.lua" part="program"/>
<File sha1="f7969bfa98360e358166e42bbfd9062ac0c9445f" name="Modules/ModTools.lua" part="program"/>
<File sha1="284687ef19bb15b9a49017667730ec49aa63fd9d" name="Items/axe.lua" part="program"/>
@@ -49,10 +49,10 @@
<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="235050cc51a8daddd8bbf941864c583ee9c55295" name="SimpleGraphic.dll" part="runtime"/>
<File platform="win32" sha1="47c12f99207540649581d6d233e0f4e635be3f8e" 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="f0c0f74958f742ac89bc83a6cccac1eb2ab15cde" name="lzip.dll" part="runtime"/>
<File platform="win32" sha1="48a265c54cff51b88468085c52e8f711e0a92035" name="lzip.dll" part="runtime"/>
<File sha1="74cc6c47e7cda18211e57b9e062368eab3c26bab" name="DLSG/Fonts/Bitstream Vera Sans Mono.10.tga" part="runtime"/>
<File sha1="1977206f0efc5035834ecbf93ca7d046010d8aab" name="DLSG/Fonts/Bitstream Vera Sans Mono.12.tga" part="runtime"/>
<File sha1="93a4309dc814914be7d2dee708e3821494f145a2" name="DLSG/Fonts/Bitstream Vera Sans Mono.14.tga" part="runtime"/>

BIN
runtime-win32.zip Normal file

Binary file not shown.