Merge remote-tracking branch 'origin/dev'

This commit is contained in:
Openarl
2017-06-11 00:19:50 +10:00
13 changed files with 93 additions and 49 deletions

View File

@@ -133,6 +133,14 @@ function CalcSectionClass:UpdatePos()
end
end
function CalcSectionClass:FormatVal(val, p)
if main.showThousandsCalcs then
return formatNumSep(tostring(round(val, p)))
else
return round(val, p)
end
end
function CalcSectionClass:FormatStr(str, actor, colData)
str = str:gsub("{output:([%a%.:]+)}", function(c)
local ns, var = c:match("^(%a+)%.(%a+)$")
@@ -145,9 +153,9 @@ function CalcSectionClass:FormatStr(str, actor, colData)
str = str:gsub("{(%d+):output:([%a%.:]+)}", function(p, c)
local ns, var = c:match("^(%a+)%.(%a+)$")
if ns then
return formatRound(actor.output[ns] and actor.output[ns][var] or 0, tonumber(p))
return self:FormatVal(actor.output[ns] and actor.output[ns][var] or 0, tonumber(p))
else
return formatRound(actor.output[c] or 0, tonumber(p))
return self:FormatVal(actor.output[c] or 0, tonumber(p))
end
end)
str = str:gsub("{(%d+):mod:(%d+)}", function(p, n)
@@ -165,7 +173,7 @@ function CalcSectionClass:FormatStr(str, actor, colData)
if sectionData.modType == "MORE" then
modVal = (modVal - 1) * 100
end
return formatRound(modVal, tonumber(p))
return self:FormatVal(modVal, tonumber(p))
end)
return str
end

View File

@@ -567,7 +567,7 @@ local ConfigTabClass = common.NewClass("ConfigTab", "UndoHandler", "ControlHost"
-- Special control for game version selector
self.controls.gameVersion = common.New("DropDownControl", {"TOPLEFT",self.sectionList[1],"TOPLEFT"}, 234, 0, 118, 16, gameVersionDropList, function(index, value)
if value.version ~= build.targetVersion then
main:OpenConfirmPopup("Convert Build", "^xFF9922Warning:^7 Converting a build to a different game version may have side effects.\nFor example, if the passive tree has changed, then some passives may be deallocated.\nYou should create a backup copy of the build before proceeding.", "Convert to "..value.versionPretty, function()
main:OpenConfirmPopup("Convert Build", colorCodes.WARNING.."Warning:^7 Converting a build to a different game version may have side effects.\nFor example, if the passive tree has changed, then some passives may be deallocated.\nYou should create a backup copy of the build before proceeding.", "Convert to "..value.versionPretty, function()
if build.unsaved then
build:OpenSavePopup("VERSION", value.version)
else

View File

@@ -14,12 +14,26 @@ local ImportTabClass = common.NewClass("ImportTab", "ControlHost", "Control", fu
self.build = build
self.charImportMode = "GETACCOUNTNAME"
self.charImportMode = build.targetVersion == liveTargetVersion and "GETACCOUNTNAME" or "VERSIONWARNING"
self.charImportStatus = "Idle"
self.controls.sectionCharImport = common.New("SectionControl", {"TOPLEFT",self,"TOPLEFT"}, 10, 18, 600, 230, "Character Import")
self.controls.charImportVersionWarning = common.New("LabelControl", {"TOPLEFT",self.controls.sectionCharImport,"TOPLEFT"}, 6, 20, 0, 16, colorCodes.WARNING..[[
Warning:^7 Characters may not import into this build correctly,
as the build's game version is different from the live game version.
Some passives may be deallocated, and some gems may not be recognised.
If possible, change the game version in the Configuration tab before importing.]])
self.controls.charImportVersionWarning.shown = function()
return self.charImportMode == "VERSIONWARNING"
end
self.controls.charImportVersionWarningGo = common.New("ButtonControl", {"TOPLEFT",self.controls.charImportVersionWarning,"TOPLEFT"}, 0, 70, 80, 20, "Continue", function()
self.charImportMode = "GETACCOUNTNAME"
end)
self.controls.charImportStatusLabel = common.New("LabelControl", {"TOPLEFT",self.controls.sectionCharImport,"TOPLEFT"}, 6, 14, 200, 16, function()
return "^7Character import status: "..self.charImportStatus
end)
self.controls.charImportStatusLabel.shown = function()
return self.charImportMode ~= "VERSIONWARNING"
end
-- Stage: input account name
self.controls.accountNameHeader = common.New("LabelControl", {"TOPLEFT",self.controls.sectionCharImport,"TOPLEFT"}, 6, 40, 200, 16, "^7To start importing a character, enter the character's account name:")
@@ -207,7 +221,7 @@ You can get this from your web browser's cookies while logged into the Path of E
end
self.controls.importCodeGo = common.New("ButtonControl", {"TOPLEFT",self.controls.importCodeMode,"BOTTOMLEFT"}, 0, 8, 60, 20, "Import", function()
if self.controls.importCodeMode.selIndex == 1 then
main:OpenConfirmPopup("Build Import", "^xFF9922Warning:^7 Importing to the current build will erase ALL existing data for this build.", "Import", function()
main:OpenConfirmPopup("Build Import", colorCodes.WARNING.."Warning:^7 Importing to the current build will erase ALL existing data for this build.", "Import", function()
self.build:Shutdown()
self.build:Init(self.build.dbFileName, self.build.buildName, self.importCodeXML)
self.build.viewMode = "TREE"

View File

@@ -421,7 +421,7 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
end
end
gem.skillId = gem.grantedEffect and gem.grantedEffect.id
if gem.grantedEffect.unsupported then
if gem.grantedEffect and gem.grantedEffect.unsupported then
gem.errMsg = gem.nameSpec.." is not supported yet"
gem.grantedEffect = nil
end

View File

@@ -14,6 +14,7 @@ colorCodes = {
CRAFTED = "^xB8DAF1",
CUSTOM = "^x5CF0BB",
UNSUPPORTED = "^xF05050",
WARNING = "^xFF9922",
FIRE = "^xD02020",
COLD = "^x60A0E7",
LIGHTNING = "^xFFD700",

View File

@@ -437,10 +437,12 @@ directiveTable.mods = function(state, args, out)
state.gem = nil
end
for _, name in pairs({"act_str","act_dex","act_int","other",--[["minion","spectre",]]"sup_str","sup_dex","sup_int"}) do
for _, name in pairs({"act_str","act_dex","act_int","other","minion","spectre","sup_str","sup_dex","sup_int"}) do
processTemplateFile("Skills/"..name, directiveTable)
end
os.execute("xcopy Skills\\*.lua ..\\Data\\3_0\\Skills\\ /Y /Q")
os.execute("xcopy Skills\\act_*.lua ..\\Data\\3_0\\Skills\\ /Y /Q")
os.execute("xcopy Skills\\sup_*.lua ..\\Data\\3_0\\Skills\\ /Y /Q")
os.execute("xcopy Skills\\other.lua ..\\Data\\3_0\\Skills\\ /Y /Q")
print("Skill data exported.")

View File

@@ -640,6 +640,9 @@ function buildMode:OnFrame(inputEvents)
self.calcsTab:BuildOutput()
self:RefreshStatList()
end
if main.showThousandsSidebar ~= self.lastShowThousandsSidebar then
self:RefreshStatList()
end
-- Update contents of main skill dropdowns
self:RefreshSkillSelectControls(self.controls, self.mainSocketGroup, "")
@@ -905,6 +908,18 @@ function buildMode:RefreshSkillSelectControls(controls, mainGroup, suffix)
end
end
function buildMode:FormatStat(statData, statVal)
local val = statVal * ((statData.pc or statData.mod) and 100 or 1) - (statData.mod and 100 or 0)
local color = (statVal >= 0 and "^7" or colorCodes.NEGATIVE)
local valStr = s_format("%"..statData.fmt, val)
if main.showThousandsSidebar then
return color..formatNumSep(valStr)
else
return color..valStr
end
self.lastShowThousandsSidebar = main.showThousandsSidebar
end
-- Add stat list for given actor
function buildMode:AddDisplayStatList(statList, actor)
local statBoxList = self.controls.statBox.list
@@ -916,7 +931,7 @@ function buildMode:AddDisplayStatList(statList, actor)
t_insert(statBoxList, {
height = 16,
"^7"..statData.label..":",
string.format("%s%"..statData.fmt, statVal >= 0 and "^7" or colorCodes.NEGATIVE, statVal * ((statData.pc or statData.mod) and 100 or 1) - (statData.mod and 100 or 0))
self:FormatStat(statData, statVal),
})
end
end

View File

@@ -221,35 +221,11 @@ function round(val, dec)
end
end
-- Formats 1234.56 -> "1,234.5" [dec=1]
function formatNumSep(val, dec)
dec = dec or 0
val = val or 0
local neg = val < 0
val = m_floor(m_abs(val * 10 ^ dec) + 0.5)
local str = string.reverse(s_format("%.0f", val))
if #str < (dec + 1) then
str = str .. string.rep("0", dec + 1 - #str)
end
local ret = ""
local pDec, pThou = dec, 3
for ci = 1, #str do
local c = str:sub(ci, ci)
ret = c .. ret
if pDec > 0 then
pDec = pDec - 1
if pDec == 0 then
ret = "." .. ret
end
else
pThou = pThou - 1
if pThou == 0 and ci < #str then
ret = "," .. ret
pThou = 3
end
end
end
return (neg and "-" or "") .. ret
-- Formats "1234.56" -> "1,234.5"
function formatNumSep(str)
return str:gsub("(%d*)(%d%.?)", function(s, e)
return s:reverse():gsub("(%d%d)(%d)","%1,%2"):reverse()..e
end)
end
function getFormatNumSep(dec)
return function(val)

View File

@@ -17,6 +17,7 @@ local m_cos = math.cos
local m_pi = math.pi
defaultTargetVersion = "2_6"
liveTargetVersion = "2_6"
targetVersionList = { "2_6", "3_0" }
LoadModule("Modules/Common")
@@ -420,6 +421,8 @@ function main:LoadSettings()
if node.attrib.nodePowerTheme then
self.nodePowerTheme = node.attrib.nodePowerTheme
end
self.showThousandsSidebar = node.attrib.showThousandsSidebar == "true"
self.showThousandsCalcs = node.attrib.showThousandsCalcs == "true"
end
end
end
@@ -455,6 +458,8 @@ function main:SaveSettings()
proxyURL = launch.proxyURL,
buildPath = (self.buildPath ~= self.defaultBuildPath and self.buildPath or nil),
nodePowerTheme = self.nodePowerTheme,
showThousandsSidebar = tostring(self.showThousandsSidebar),
showThousandsCalcs = tostring(self.showThousandsCalcs),
} })
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
if not res then
@@ -492,7 +497,18 @@ function main:OpenOptionsPopup()
controls.nodePowerThemeLabel = common.New("LabelControl", {"RIGHT",controls.nodePowerTheme,"LEFT"}, -4, 0, 0, 16, "^7Node Power colours:")
controls.nodePowerTheme.tooltip = "Changes the colour scheme used for the node power display on the passive tree."
controls.nodePowerTheme:SelByValue(self.nodePowerTheme, "theme")
controls.thousandsLabel = common.New("LabelControl", {"TOPRIGHT",nil,"TOPLEFT"}, 200, 94, 0, 16, "^7Show thousands separators in:")
controls.thousandsSidebar = common.New("CheckBoxControl", {"TOPLEFT",nil,"TOPLEFT"}, 270, 92, 20, "Sidebar:", function(state)
self.showThousandsSidebar = state
end)
controls.thousandsSidebar.state = self.showThousandsSidebar
controls.thousandsCalcs = common.New("CheckBoxControl", {"TOPLEFT",nil,"TOPLEFT"}, 370, 92, 20, "Calcs tab:", function(state)
self.showThousandsCalcs = state
end)
controls.thousandsCalcs.state = self.showThousandsCalcs
local initialNodePowerTheme = self.nodePowerTheme
local initialThousandsSidebar = self.showThousandsSidebar
local initialThousandsCalcs = self.showThousandsCalcs
controls.save = common.New("ButtonControl", nil, -45, 120, 80, 20, "Save", function()
if controls.proxyURL.buf:match("%w") then
launch.proxyURL = controls.proxyType.list[controls.proxyType.selIndex].scheme .. "://" .. controls.proxyURL.buf
@@ -514,6 +530,8 @@ function main:OpenOptionsPopup()
end)
controls.cancel = common.New("ButtonControl", nil, 45, 120, 80, 20, "Cancel", function()
self.nodePowerTheme = initialNodePowerTheme
self.showThousandsSidebar = initialThousandsSidebar
self.showThousandsCalcs = initialThousandsCalcs
main:ClosePopup()
end)
self:OpenPopup(450, 150, "Options", controls, "save", nil, "cancel")

View File

@@ -81,6 +81,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{F2327651-CAA5-4DA0-91DB-EFA5E0E07A51}"
ProjectSection(SolutionItems) = preProject
Data\Global.lua = Data\Global.lua
Data\Misc.lua = Data\Misc.lua
Data\New.lua = Data\New.lua
EndProjectSection
EndProject

View File

@@ -53,6 +53,11 @@ If you'd like to help support the development of Path of Building, I have a [Pat
![ss3](https://cloud.githubusercontent.com/assets/19189971/18089780/f0ff234a-6f04-11e6-8c88-6193fe59a5c4.png)
## Changelog
### 1.4.25 - 2017/06/11
* Added options to the Options dialog to show thousands separators in the sidebar or Calcs tab
* Fixed error that could result from importing a character into a 3.0 build
* A warning is now shown before importing a character into a 3.0 build
### 1.4.24 - 2017/06/09
* Converting builds between game versions will now automatically update the names of gems that been renamed
For 3.0 builds:

View File

@@ -1,3 +1,7 @@
VERSION[1.4.25][2017/06/11]
* Added options to the Options dialog to show thousands separators in the sidebar or Calcs tab
* Fixed error that could result from importing a character into a 3.0 build
* A warning is now shown before importing a character into a 3.0 build
VERSION[1.4.24][2017/06/09]
* Converting builds between game versions will now automatically update the names of gems that been renamed
For 3.0 builds:

View File

@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<PoBVersion>
<Version number="1.4.24"/>
<Version number="1.4.25"/>
<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="2fb719ed2a9648b2dd13a137f650b3c0e48705fa" name="Launch.lua" part="program"/>
<File sha1="72b9bea1871e94a643e4471fd84bbedbc7810336" name="UpdateCheck.lua" part="program"/>
<File sha1="4f17937f2b37784e169a3792b235f2a0a3961e61" name="UpdateApply.lua" part="program"/>
<File sha1="36571d7322246336a0c3967f4447aeda6716e829" name="changelog.txt" part="program"/>
<File sha1="53715cc6b622f7ecde4d586fbab013e1cf94eae5" name="changelog.txt" part="program"/>
<File sha1="3558da442f2fc18c3e1ea751b301be863dee56e8" name="Classes/BuildListControl.lua" part="program"/>
<File sha1="dc2ffb55b4aae04b86886b25bbf219a301b21340" name="Classes/ButtonControl.lua" part="program"/>
<File sha1="10c73542894d67bcd4ee90e05a3dbca1c3c326c9" name="Classes/CalcBreakdownControl.lua" part="program"/>
<File sha1="f7bced0e554bd4d99ef56bd87cf43294957cd179" name="Classes/CalcSectionControl.lua" part="program"/>
<File sha1="97870e6a3bb96e11765b2ef15bf19b8f93c9b5f1" name="Classes/CalcSectionControl.lua" part="program"/>
<File sha1="60a90d59a9ed9bb114ad9336a47d5ca3dd44c7f6" name="Classes/CalcsTab.lua" part="program"/>
<File sha1="573b791867ada18da1e93de8fc33ce6cf9ec9ab3" name="Classes/CheckBoxControl.lua" part="program"/>
<File sha1="de11b328637cda4744ac95c4e015c99aee522058" name="Classes/ConfigTab.lua" part="program"/>
<File sha1="0041f84a7f0e0784866bd30f7198b13a204efd1d" name="Classes/ConfigTab.lua" part="program"/>
<File sha1="216ef2c2f9b0165ab3c49cb71396401cfe913139" name="Classes/Control.lua" part="program"/>
<File sha1="45be3d636d1eaff18bed7095478c22abfd0590ef" name="Classes/ControlHost.lua" part="program"/>
<File sha1="66486b0b9e628bb450a080f0e81aa48256d76f6c" name="Classes/DropDownControl.lua" part="program"/>
<File sha1="276512f60a6634a1c4febd475fe1e280b81b23b4" name="Classes/EditControl.lua" part="program"/>
<File sha1="afa58b85c876e107edcd49e4a01c06a981843ff8" name="Classes/FolderListControl.lua" part="program"/>
<File sha1="bcc7e011659136d19d20a4e2f7b4f5eee3ac53eb" name="Classes/GemSelectControl.lua" part="program"/>
<File sha1="2b2b60dee9cefb146125e22f99e53961aa2ed885" name="Classes/ImportTab.lua" part="program"/>
<File sha1="d3b1a83187132307d21c441b1616835b83bd295d" name="Classes/ImportTab.lua" part="program"/>
<File sha1="0dd8a4a92e97e745d5cda2c76a7a5b9abffd097e" name="Classes/ItemDBControl.lua" part="program"/>
<File sha1="40387ab2538563591f991fbee6094fabe3e4163a" name="Classes/ItemListControl.lua" part="program"/>
<File sha1="d011280663e4d5f0c7451c6a5f19ac697e659f1b" name="Classes/ItemSlotControl.lua" part="program"/>
@@ -42,12 +42,12 @@
<File sha1="261dcf54a4542e6160fd7024d8edf4fc095d9c71" name="Classes/SectionControl.lua" part="program"/>
<File sha1="87ce364f5948dfcff82c83c70dd5b16c0a2704c2" name="Classes/SharedItemListControl.lua" part="program"/>
<File sha1="e2f80c852112e87ffb0d36acd3f277e723cce8ce" name="Classes/SkillListControl.lua" part="program"/>
<File sha1="332e160cf95a3ea81e006a59833f81232517cf1b" name="Classes/SkillsTab.lua" part="program"/>
<File sha1="1977afd7a82afc7a81177aa48f3f7ad61ed5cf5a" name="Classes/SkillsTab.lua" part="program"/>
<File sha1="6317bd9ba391832dccafcb62409a5ce2988d1928" name="Classes/SliderControl.lua" part="program"/>
<File sha1="ada27b91a3c466689111429105edd4ee28ad0c3f" name="Classes/TextListControl.lua" part="program"/>
<File sha1="5937806febd0a2613f441080af9256babe25b2cc" name="Classes/TreeTab.lua" part="program"/>
<File sha1="4b7675c8b4fe71cade7dd3d70793df1ed8022d01" name="Classes/UndoHandler.lua" part="program"/>
<File sha1="82435ee39f46e46445f972b9932b2106fbe677b1" name="Modules/Build.lua" part="program"/>
<File sha1="38f3a1b84a4b4a3aeef63ded8eab0335cde2b0cf" name="Modules/Build.lua" part="program"/>
<File sha1="44fab56072de8e555ff7e20ee32628230511d1d6" name="Modules/BuildList.lua" part="program"/>
<File sha1="f241e3b08e9d37d81f01a9b105e64a327c2a777e" name="Modules/CalcActiveSkill.lua" part="program"/>
<File sha1="b2b8d55258d9763d7c7a4a9ca1f99be3973528a8" name="Modules/CalcBreakdown.lua" part="program"/>
@@ -60,10 +60,10 @@
<File sha1="165db869bcc732e442817dff53fc4ee166e1b6bc" name="Modules/CalcSections-3_0.lua" part="program"/>
<File sha1="83cfda3731b4eab8b839b2bfa1fa1a711a28e138" name="Modules/CalcSetup.lua" part="program"/>
<File sha1="50952785b43fd5fa870001d1aa9a055672479d83" name="Modules/CalcTools.lua" part="program"/>
<File sha1="d103281d8289bc3897ac855921e15136c1cda0cf" name="Modules/Common.lua" part="program"/>
<File sha1="e7cc0cab4e1e373f780bf9c26d5f7265bcd4ee8c" name="Modules/Common.lua" part="program"/>
<File sha1="54de4b28bbf5bcb0244a4c21b7d191ae5b1eb812" name="Modules/Data.lua" part="program"/>
<File sha1="7cde2cb67e0b5a5d19d438e714f94b0ffe64743f" name="Modules/ItemTools.lua" part="program"/>
<File sha1="2ef13c53fbae978887cdbba97862367bd3c23725" name="Modules/Main.lua" part="program"/>
<File sha1="3ef5bd3b74d9c11eb204e5bba978aa6f7ea585f8" name="Modules/Main.lua" part="program"/>
<File sha1="23f4ba4b177a0c033069a5e8777eaa0cbecd8403" name="Modules/ModParser-2_6.lua" part="program"/>
<File sha1="66352b4ded4ec0adb79ab5c49270f1000fd4339f" name="Modules/ModParser-3_0.lua" part="program"/>
<File sha1="4e1067e5444062686cd06783034537e7ff4fbfe1" name="Modules/ModTools.lua" part="program"/>
@@ -72,7 +72,7 @@
<File sha1="4ebea5031fd03771a9b637a3fdccf394344e4782" name="Assets/range_guide.png" part="program"/>
<File sha1="e7ee7e5b6388facb7bf568517ecc401590757df7" name="Assets/ring.png" part="program"/>
<File sha1="9a320bfe629b1cf3f14fc77fbbf2508d0a5b2841" name="Assets/small_ring.png" part="program"/>
<File sha1="553102a3afafbd2398efa088c0c31354a544368d" name="Data/Global.lua" part="program"/>
<File sha1="0007efaeaab41c5f78e008e89e0170f05cc5c6cf" name="Data/Global.lua" part="program"/>
<File sha1="a725cc402e3b8bbac143ca49695eeabbc1e2ae19" name="Data/Misc.lua" part="program"/>
<File sha1="f4d68a2c4e5ddedc8930baab8ab65201e997fefc" name="Data/New.lua" part="program"/>
<File sha1="b2d9c88c211d72b0384473b3e0ad6d74ba74bb23" name="Data/Uniques/amulet.lua" part="program"/>