Release 1.2.16

- Added sort dropdown to build list
- Save prompt can now show when closing program
- Fixed issue caused by right-clicking a jewel socket on the passive tree when there's no jewels in the build
This commit is contained in:
Openarl
2016-11-26 02:04:48 +10:00
parent 32911059bb
commit 9c203c595a
10 changed files with 133 additions and 32 deletions

View File

@@ -126,6 +126,9 @@ function BuildListClass:OnKeyDown(key, doubleClick)
if not self:IsMouseOver() and key:match("BUTTON") then
return
end
if self.listMode.edit then
return self
end
if key == "LEFTBUTTON" then
self.listMode.sel = nil
local x, y = self:GetPos()

View File

@@ -9,6 +9,7 @@ local launch, main = ...
local pairs = pairs
local ipairs = ipairs
local t_insert = table.insert
local t_remove = table.remove
local m_min = math.min
local m_max = math.max
local m_floor = math.floor
@@ -165,8 +166,13 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
else
local lastPathNode = self.tracePath[#self.tracePath]
if hoverNode ~= lastPathNode then
-- If node is not in the trace path, but is directly linked to the last node in the path, then add it
if not isValueInArray(hoverNode, self.tracePath) and isValueInArray(hoverNode.linked, lastPathNode) then
-- If node is directly linked to the last node in the path, add it
if isValueInArray(hoverNode.linked, lastPathNode) then
local index = isValueInArray(self.tracePath, hoverNode)
if index then
-- Node is already in the trace path, remove it first
t_remove(self.tracePath, index)
end
t_insert(self.tracePath, hoverNode)
else
hoverNode = nil
@@ -208,11 +214,13 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
end
elseif treeClick == "RIGHT" then
if hoverNode and hoverNode.alloc and hoverNode.type == "socket" then
-- User right-clicked a jewel socket, jump to the item page and focus the corresponding item slot control
build.viewMode = "ITEMS"
local slot = build.itemsTab.sockets[hoverNode.id]
slot.dropped = true
build.itemsTab:SelectControl(slot)
if slot:IsEnabled() then
-- User right-clicked a jewel socket, jump to the item page and focus the corresponding item slot control
slot.dropped = true
build.itemsTab:SelectControl(slot)
build.viewMode = "ITEMS"
end
end
end
@@ -513,8 +521,10 @@ function PassiveTreeViewClass:AddNodeTooltip(node, build)
else
main:AddTooltipLine(24, "^7"..node.dn..(launch.devMode and IsKeyDown("ALT") and " ["..node.id.."]" or ""))
end
main:AddTooltipSeparator(14)
main:AddTooltipLine(14, "^x80A080Tip: Right click this socket to go to the items page and choose the jewel for this socket.")
if socket:IsEnabled() then
main:AddTooltipSeparator(14)
main:AddTooltipLine(14, "^x80A080Tip: Right click this socket to go to the items page and choose the jewel for this socket.")
end
return
end
@@ -590,11 +600,15 @@ function PassiveTreeViewClass:AddNodeTooltip(node, build)
-- Pathing distance
if node.path and #node.path > 0 then
main:AddTooltipSeparator(14)
main:AddTooltipLine(14, "^7"..#node.path .. " points to node")
if #node.path > 1 then
-- Handy hint!
main:AddTooltipLine(14, "^x80A080")
main:AddTooltipLine(14, "Tip: To reach this node by a different path, hold Shift, then trace the path and click this node")
if self.traceMode and isValueInArray(self.tracePath, node) then
main:AddTooltipLine(14, "^7"..#self.tracePath .. " nodes in trace path")
else
main:AddTooltipLine(14, "^7"..#node.path .. " points to node")
if #node.path > 1 then
-- Handy hint!
main:AddTooltipLine(14, "^x80A080")
main:AddTooltipLine(14, "Tip: To reach this node by a different path, hold Shift, then trace the path and click this node")
end
end
end
if node.depends and #node.depends > 1 then

View File

@@ -72,6 +72,19 @@ function launch:OnInit()
end
end
function launch:CanExit()
if self.main and self.main.CanExit and not self.promptMsg then
local errMsg, ret = PCall(self.main.CanExit, self.main)
if errMsg then
self:ShowErrMsg("In 'CanExit': %s", errMsg)
return false
else
return ret
end
end
return true
end
function launch:OnExit()
if self.main and self.main.Shutdown then
PCall(self.main.Shutdown, self.main)

View File

@@ -128,6 +128,7 @@ function buildMode:Init(dbFileName, buildName)
end
self.controls.characterLevel = common.New("EditControl", {"LEFT",self.anchorTopBarRight,"RIGHT"}, 0, 0, 106, 20, "", "Level", "%D", 3, function(buf)
self.characterLevel = m_min(tonumber(buf) or 1, 100)
self.modFlag = true
self.buildFlag = true
end)
self.controls.characterLevel.tooltip = function()
@@ -380,6 +381,28 @@ function buildMode:Init(dbFileName, buildName)
self.abortSave = false
end
function buildMode:CanExit()
if not self.unsaved then
return true
end
main:OpenPopup(280, 100, "Save Changes", {
common.New("LabelControl", nil, 0, 20, 0, 16, "^7This build has unsaved changes.\nDo you want to save them before exiting?"),
common.New("ButtonControl", nil, -90, 70, 80, 20, "Save", function()
self:SaveDBFile()
main:ClosePopup()
Exit()
end),
common.New("ButtonControl", nil, 0, 70, 80, 20, "Don't Save", function()
main:ClosePopup()
Exit()
end),
common.New("ButtonControl", nil, 90, 70, 80, 20, "Cancel", function()
main:ClosePopup()
end),
})
return false
end
function buildMode:Shutdown()
if launch.devMode and not self.abortSave then
self:SaveDBFile()

View File

@@ -17,25 +17,30 @@ function listMode:Init(selBuildName)
return main.screenW / 2
end
self.controls.new = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, -68*2, 0, 60, 20, "New", function()
self.controls.new = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, -210, 0, 60, 20, "New", function()
self:New()
end)
self.controls.open = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, -68, 0, 60, 20, "Open", function()
self.controls.open = common.New("ButtonControl", {"LEFT",self.controls.new,"RIGHT"}, 8, 0, 60, 20, "Open", function()
self:LoadSel()
end)
self.controls.open.enabled = function() return self.sel ~= nil end
self.controls.copy = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, 0, 0, 60, 20, "Copy", function()
self.controls.copy = common.New("ButtonControl", {"LEFT",self.controls.open,"RIGHT"}, 8, 0, 60, 20, "Copy", function()
self:CopySel()
end)
self.controls.copy.enabled = function() return self.sel ~= nil end
self.controls.rename = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, 68, 0, 60, 20, "Rename", function()
self.controls.rename = common.New("ButtonControl", {"LEFT",self.controls.copy,"RIGHT"}, 8, 0, 60, 20, "Rename", function()
self:RenameSel()
end)
self.controls.rename.enabled = function() return self.sel ~= nil end
self.controls.delete = common.New("ButtonControl", {"TOP",self.anchor,"TOP"}, 68*2, 0, 60, 20, "Delete", function()
self.controls.delete = common.New("ButtonControl", {"LEFT",self.controls.rename,"RIGHT"}, 8, 0, 60, 20, "Delete", function()
self:DeleteSel()
end)
self.controls.delete.enabled = function() return self.sel ~= nil end
self.controls.sort = common.New("DropDownControl", {"LEFT",self.controls.delete,"RIGHT"}, 8, 0, 140, 20, {{val="NAME",label="Sort by Name"},{val="CLASS",label="Sort by Class"},{val="EDITED",label="Sort by Last Edited"}}, function(sel, val)
main.buildSortMode = val.val
self:SortList()
end)
self.controls.sort:SelByValue(main.buildSortMode)
self.controls.buildList = common.New("BuildList", {"TOP",self.anchor,"TOP"}, 0, 24, 500, 0, self)
self.controls.buildList.height = function()
@@ -81,6 +86,7 @@ function listMode:BuildList()
local fileName = handle:GetFileName()
local build = { }
build.fileName = fileName
build.modified = handle:GetFileModifiedTime()
build.buildName = fileName:gsub("%.xml$","")
local dbXML = common.xml.LoadXMLFile(main.buildPath..fileName)
if dbXML and dbXML[1].elem == "PathOfBuilding" then
@@ -102,7 +108,22 @@ end
function listMode:SortList()
local oldSelFileName = self.sel and self.list[self.sel] and self.list[self.sel].fileName
table.sort(self.list, function(a, b) return a.fileName:upper() < b.fileName:upper() end)
table.sort(self.list, function(a, b)
if main.buildSortMode == "EDITED" then
return a.modified > b.modified
elseif main.buildSortMode == "CLASS" then
if a.className and not b.className then
return false
elseif not a.className and b.className then
return true
elseif a.className ~= b.className then
return a.className < b.className
elseif a.ascendClassName ~= b.ascendClassName then
return a.ascendClassName < b.ascendClassName
end
end
return a.fileName:upper() < b.fileName:upper()
end)
if oldSelFileName then
self:SelByFileName(oldSelFileName)
end
@@ -169,7 +190,7 @@ function listMode:New()
outFile:close()
self.list[self.edit].fileName = fileName
self.list[self.edit].buildName = buf
self:SortList()
self:BuildList()
end)
end
@@ -211,7 +232,7 @@ function listMode:CopySel()
outFile:close()
self.list[self.edit].fileName = dstName
self.list[self.edit].buildName = buf
self:SortList()
self:BuildList()
end)
end

View File

@@ -196,11 +196,22 @@ function main:Init()
self.accountSessionIDs = { }
self.buildSortMode = "NAME"
self:SetMode("LIST")
self:LoadSettings()
end
function main:CanExit()
local ret = self:CallMode("CanExit")
if ret ~= nil then
return ret
else
return true
end
end
function main:Shutdown()
self:CallMode("Shutdown")
@@ -264,7 +275,7 @@ end
function main:CallMode(func, ...)
local modeTbl = self.modes[self.mode]
if modeTbl[func] then
modeTbl[func](modeTbl, ...)
return modeTbl[func](modeTbl, ...)
end
end
@@ -305,6 +316,10 @@ function main:LoadSettings()
self.accountSessionIDs[child.attrib.accountName] = child.attrib.sessionID
end
end
elseif node.elem == "Misc" then
if node.attrib.buildSortMode then
self.buildSortMode = node.attrib.buildSortMode
end
end
end
end
@@ -330,6 +345,7 @@ function main:SaveSettings()
t_insert(accounts, { elem = "Account", attrib = { accountName = accountName, sessionID = sessionID } })
end
t_insert(setXML, accounts)
t_insert(setXML, { elem = "Misc", attrib = { buildSortMode = self.buildSortMode } })
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
if not res then
launch:ShowErrMsg("Error saving 'Settings.xml': %s", errMsg)

View File

@@ -49,6 +49,12 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases)
![ss3](https://cloud.githubusercontent.com/assets/19189971/18089780/f0ff234a-6f04-11e6-8c88-6193fe59a5c4.png)
## Changelog
### 1.2.16 - 2016/11/25
* The build list can now be sorted by name, class or time of last edit
* The save prompt will now show when closing the program if there are unsaved changes
* Fixed issue caused by right-clicking a jewel socket on the passive tree when there's no jewels in the build
* Various minor tweaks and fixes
### 1.2.15 - 2016/11/25
* Added all uniques so far announced for 2.5.0
* Most of their special modifiers should be working; as usual anything in blue should work, anything in red won't

View File

@@ -1,3 +1,8 @@
VERSION[1.2.16][2016/11/25]
* The build list can now be sorted by name, class or time of last edit
* The save prompt will now show when closing the program if there are unsaved changes
* Fixed issue caused by right-clicking a jewel socket on the passive tree when there's no jewels in the build
* Various minor tweaks and fixes
VERSION[1.2.15][2016/11/25]
* Added all uniques so far announced for 2.5.0
* Most of their special modifiers should be working; as usual anything in blue should work, anything in red won't

View File

@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<PoBVersion>
<Version number="1.2.15"/>
<Version number="1.2.16"/>
<Source part="program" url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/{branch}/"/>
<Source part="tree" url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/{branch}/tree.zip"/>
<Source url="https://raw.githubusercontent.com/Openarl/PathOfBuilding/{branch}/runtime-win32.zip" part="runtime" platform="win32"/>
<File sha1="6bb074e0d3a4043f0e5dcbd25c33f8e5e1f5cfe0" name="Launch.lua" part="program"/>
<File sha1="d4d8e00d3ecc2ffb3d0c2df0876c009bfe0937d2" name="Launch.lua" part="program"/>
<File sha1="93e19c2a160eb49993d50d9e2b47ea79962373d9" name="UpdateCheck.lua" part="program"/>
<File sha1="4f17937f2b37784e169a3792b235f2a0a3961e61" name="UpdateApply.lua" part="program"/>
<File sha1="48a17cb141b2c69ed4b4c04ae513fdc42b6c8614" name="changelog.txt" part="program"/>
<File sha1="33bfc41d8a96435d283a46af0fdf952f803c44c6" name="Classes/BuildListControl.lua" part="program"/>
<File sha1="93794dc9ec13cacd23bafa746410a87506b23025" name="changelog.txt" part="program"/>
<File sha1="231a4fe264d84294427edacbf3e29ec4b301712e" name="Classes/BuildListControl.lua" part="program"/>
<File sha1="47c28993f5653955c9e76714775d87ac22b077da" name="Classes/ButtonControl.lua" part="program"/>
<File sha1="8df790619a3284b8ed78075f59dd34d5b00d28a3" name="Classes/CalcBreakdownControl.lua" part="program"/>
<File sha1="23171916fa590c5344b17e67bd8d378574922388" name="Classes/CalcSectionControl.lua" part="program"/>
@@ -31,7 +31,7 @@
<File sha1="9bc0d8791e7825e52070e96e7894d29fad70cf98" name="Classes/NotesTab.lua" part="program"/>
<File sha1="6f8f98d6ee505af53441c1fe9ad74fbff86d56ad" name="Classes/PassiveSpec.lua" part="program"/>
<File sha1="9a6bce38a62d9c07851cdd095e91f088e37cea4e" name="Classes/PassiveTree.lua" part="program"/>
<File sha1="5a136be72fe9722bf59ac6f85dc411a16165e65e" name="Classes/PassiveTreeView.lua" part="program"/>
<File sha1="34d2d1635817867020689394c6cf2aa55f80ba1f" name="Classes/PassiveTreeView.lua" part="program"/>
<File sha1="fd75c7a6a55b13163ac4068bbef9cb49a898eb24" name="Classes/PopupDialog.lua" part="program"/>
<File sha1="86fee3127d9520144fc741f6fccc3c1d9f1aa532" name="Classes/ScrollBarControl.lua" part="program"/>
<File sha1="261dcf54a4542e6160fd7024d8edf4fc095d9c71" name="Classes/SectionControl.lua" part="program"/>
@@ -42,14 +42,14 @@
<File sha1="a4f9cc96ba474d0a75c768a0eabec92837e027cf" name="Classes/TextListControl.lua" part="program"/>
<File sha1="aa9975d9b7e6fe56df19a5ada400da6b6e718478" name="Classes/TreeTab.lua" part="program"/>
<File sha1="4b7675c8b4fe71cade7dd3d70793df1ed8022d01" name="Classes/UndoHandler.lua" part="program"/>
<File sha1="1eaafeb5fcbf330547603b6cdadf0c9ff6605bb1" name="Modules/Build.lua" part="program"/>
<File sha1="c03a7796aea3e9aa832fbb92c1f674ef5af690ca" name="Modules/BuildList.lua" part="program"/>
<File sha1="c927eb267a13720de07d5c768151d748af54274c" name="Modules/Build.lua" part="program"/>
<File sha1="8888e736942ad025f3f81ceec2e1c433a9866942" name="Modules/BuildList.lua" part="program"/>
<File sha1="5d82b8d51b1e1d982c8f75803db5428e016befa8" name="Modules/Calcs.lua" part="program"/>
<File sha1="c0715b212c732d9120997984de8205ef83a3f8c4" name="Modules/CalcSections.lua" part="program"/>
<File sha1="f207df4010cb3c7bc6cce98be2529a3b8a708b8f" name="Modules/Common.lua" part="program"/>
<File sha1="bad785f71247b99ff76d9a359f725968aa71da5f" name="Modules/Data.lua" part="program"/>
<File sha1="80871a0ce0fd3f2007dfe3db943cd4e920fc19c0" name="Modules/ItemTools.lua" part="program"/>
<File sha1="5425585d5fd0b428029a1e3d892bfa0f137f1622" name="Modules/Main.lua" part="program"/>
<File sha1="524318a7986bf14ed2cdddf055b9d829d521b871" name="Modules/Main.lua" part="program"/>
<File sha1="2fcee850f493bddb18cde13ff23c73942353452a" name="Modules/ModParser.lua" part="program"/>
<File sha1="5f93a9d8f58e0d5990a1f84e1ab1d53fbd35fb56" name="Modules/ModTools.lua" part="program"/>
<File sha1="e7ee7e5b6388facb7bf568517ecc401590757df7" name="Assets/ring.png" part="program"/>
@@ -101,10 +101,10 @@
<File sha1="3054ba5a1cdc0720a39e4f69496564b9ad9b9dc8" name="Data/Uniques/wand.lua" part="program"/>
<File platform="win32" sha1="e8581e70cefa0b68583be298483418c004c8152f" name="Path of Building.exe" part="runtime"/>
<File platform="win32" sha1="914d42ca1836c5152a5f60aad23020a86bcb46d9" name="lua51.dll" part="runtime"/>
<File platform="win32" sha1="c23384f05400c8cda1a1fd6383d2632c77b1e99d" name="SimpleGraphic.dll" part="runtime"/>
<File platform="win32" sha1="3d0acb0adccf73ba3493ce4490aa2562cf5cf5ce" 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="229feec79a1269be868bb32a11f141258481170f" name="lzip.dll" part="runtime"/>
<File platform="win32" sha1="61d5ddef00d18ecddbd1d6d77caf80d0aac73110" name="lzip.dll" part="runtime"/>
<File sha1="74cc6c47e7cda18211e57b9e062368eab3c26bab" name="SimpleGraphic/Fonts/Bitstream Vera Sans Mono.10.tga" part="runtime"/>
<File sha1="1977206f0efc5035834ecbf93ca7d046010d8aab" name="SimpleGraphic/Fonts/Bitstream Vera Sans Mono.12.tga" part="runtime"/>
<File sha1="93a4309dc814914be7d2dee708e3821494f145a2" name="SimpleGraphic/Fonts/Bitstream Vera Sans Mono.14.tga" part="runtime"/>

Binary file not shown.