From 815347457c2b929c8f8549031397aa73e06e04fa Mon Sep 17 00:00:00 2001 From: Openarl Date: Wed, 21 Sep 2016 03:45:43 +1000 Subject: [PATCH] Release 1.1.2 - Added check mark in gem dropdown to indicate valid supports - Fixed bug with Clear Mind's spell damage modifier --- Classes/CalcsTab.lua | 4 ++-- Classes/CheckBoxControl.lua | 3 +-- Classes/GemSelectControl.lua | 29 +++++++++++++++++-------- Classes/SkillsTab.lua | 2 +- Data/Gems/sup_dex.lua | 1 + Data/Gems/sup_int.lua | 1 + Data/Gems/sup_str.lua | 2 +- Modules/Build.lua | 2 +- Modules/Calcs.lua | 13 ++++++------ Modules/Main.lua | 8 +++++++ README.md | 41 +++++++++++++++++++++++++++++++++++- changelog.txt | 27 ++++++++++++++++++++++++ manifest.xml | 24 ++++++++++----------- 13 files changed, 122 insertions(+), 35 deletions(-) diff --git a/Classes/CalcsTab.lua b/Classes/CalcsTab.lua index c2f4e205..a89be8b3 100644 --- a/Classes/CalcsTab.lua +++ b/Classes/CalcsTab.lua @@ -124,10 +124,10 @@ end function CalcsTabClass:BuildOutput() self.powerBuildFlag = true - wipeTable(self.gridOutput) - self.calcs.buildOutput(self.build, self.input, self.gridOutput, "GRID") wipeTable(self.mainOutput) self.calcs.buildOutput(self.build, self.input, self.mainOutput, "MAIN") + wipeTable(self.gridOutput) + self.calcs.buildOutput(self.build, self.input, self.gridOutput, "GRID") -- Retrieve calculator functions self.nodeCalculator = { self.calcs.getNodeCalculator(self.build, self.input) } diff --git a/Classes/CheckBoxControl.lua b/Classes/CheckBoxControl.lua index a3fac012..55b2d84e 100644 --- a/Classes/CheckBoxControl.lua +++ b/Classes/CheckBoxControl.lua @@ -52,8 +52,7 @@ function CheckBoxClass:Draw(viewPort) else SetDrawColor(0.75, 0.75, 0.75) end - DrawImageQuad(nil, x + size * 0.15, y + size * 0.50, x + size * 0.30, y + size * 0.45, x + size * 0.50, y + size * 0.80, x + size * 0.40, y + size * 0.90) - DrawImageQuad(nil, x + size * 0.40, y + size * 0.90, x + size * 0.35, y + size * 0.75, x + size * 0.80, y + size * 0.10, x + size * 0.90, y + size * 0.20) + main:DrawCheckMark(x + size/2, y + size/2, size * 0.8) end if enabled then SetDrawColor(1, 1, 1) diff --git a/Classes/GemSelectControl.lua b/Classes/GemSelectControl.lua index 9e664f0a..4dff5e69 100644 --- a/Classes/GemSelectControl.lua +++ b/Classes/GemSelectControl.lua @@ -14,7 +14,7 @@ local m_floor = math.floor local GemSelectClass = common.NewClass("GemSelectControl", "EditControl", function(self, anchor, x, y, width, height, skillsTab, index, changeFunc) self.EditControl(anchor, x, y, width, height) - self.controls.scrollBar = common.New("ScrollBarControl", {"TOPRIGHT",self,"TOPRIGHT"}, -1, 0, 16, 0, (height - 4) * 4) + self.controls.scrollBar = common.New("ScrollBarControl", {"TOPRIGHT",self,"TOPRIGHT"}, -1, 0, 18, 0, (height - 4) * 4) self.controls.scrollBar.y = function() local width, height = self:GetSize() return height + 1 @@ -80,13 +80,16 @@ function GemSelectClass:BuildList(buf) end end -function GemSelectClass:UpdateGem(addUndo) +function GemSelectClass:UpdateGem(setText, addUndo) local gemName = self.list[m_max(self.selIndex, 1)] if self.buf:match("%S") and data.gems[gemName] then self.gemName = gemName else self.gemName = "" end + if setText then + self:SetText(self.gemName) + end self.gemChangeFunc(self.gemName, addUndo and self.gemName ~= self.initialBuf) end @@ -166,6 +169,16 @@ function GemSelectClass:Draw(viewPort) end end DrawString(0, y, "LEFT", height - 4, "VAR", self.list[index]) + if gemData and gemData.support and self.skillsTab.displayGroup.displaySkillList then + local gem = { data = gemData } + for _, activeSkill in ipairs(self.skillsTab.displayGroup.displaySkillList) do + if gemCanSupport(gem, activeSkill) then + SetDrawColor(0.33, 1, 0.33) + main:DrawCheckMark(width - 4 - height / 2 - (scrollBar.enabled and 18 or 0), y + (height - 4) / 2, (height - 4) * 0.8) + break + end + end + end end SetViewport() self:DrawControls(viewPort) @@ -212,8 +225,7 @@ function GemSelectClass:OnFocusLost() if self.noMatches then self:SetText("") end - self:UpdateGem(true) - self:SetText(self.gemName) + self:UpdateGem(true, true) end end @@ -237,7 +249,7 @@ function GemSelectClass:OnKeyDown(key, doubleClick) self.dropped = false self.selIndex = self.hoverSel self:SetText(self.list[self.selIndex]) - self:UpdateGem(true) + self:UpdateGem(false, true) return self end elseif key == "RETURN" then @@ -246,15 +258,14 @@ function GemSelectClass:OnKeyDown(key, doubleClick) self:SetText("") end self.selIndex = m_max(self.selIndex, 1) - self:UpdateGem(true) - self:SetText(self.gemName) + self:UpdateGem(true, true) return self elseif key == "ESCAPE" then self.dropped = false self:BuildList("") self.buf = self.initialBuf self.selIndex = self.initialIndex - self:UpdateGem(true) + self:UpdateGem(false, true) return elseif key == "WHEELUP" then self.controls.scrollBar:Scroll(-1) @@ -279,7 +290,7 @@ function GemSelectClass:OnKeyDown(key, doubleClick) self:ScrollSelIntoView() end end - elseif key == "RETURN" then + elseif key == "RETURN" or key == "RIGHTBUTTON" then self.dropped = true self.initialIndex = self.selIndex self.initialBuf = self.buf diff --git a/Classes/SkillsTab.lua b/Classes/SkillsTab.lua index 5ea99228..ab09bd51 100644 --- a/Classes/SkillsTab.lua +++ b/Classes/SkillsTab.lua @@ -342,7 +342,7 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup) else gem.errMsg, gem.name, gem.data = nil end - if gem.nameSpec:match("%S") or gem.level ~= 20 or gem.quality ~= 0 or gem.enabled ~= true or (socketGroup == self.displayGroup and self.gemSlots[index] and self.gemSlots[index].nameSpec.buf:match("%S")) then + if gem.nameSpec:match("%S") or gem.level ~= 20 or gem.quality ~= 0 or gem.enabled ~= true or (socketGroup == self.displayGroup and self.gemSlots[index] and self.gemSlots[index].nameSpec.dropped) then index = index + 1 else -- Empty gem, remove it diff --git a/Data/Gems/sup_dex.lua b/Data/Gems/sup_dex.lua index 16e6cf16..e89d5531 100644 --- a/Data/Gems/sup_dex.lua +++ b/Data/Gems/sup_dex.lua @@ -1097,6 +1097,7 @@ gems["Trap"] = { dexterity = true, support = true, trap = true, + require = "spell or projectile", addFlags = { trap = true, showAverage = true, diff --git a/Data/Gems/sup_int.lua b/Data/Gems/sup_int.lua index 91487d95..cac98f0c 100644 --- a/Data/Gems/sup_int.lua +++ b/Data/Gems/sup_int.lua @@ -936,6 +936,7 @@ gems["Remote Mine"] = { intelligence = true, support = true, mine = true, + require = "spell or projectile", addFlags = { mine = true, showAverage = true, diff --git a/Data/Gems/sup_str.lua b/Data/Gems/sup_str.lua index 3c9cf4bf..1ea2333d 100644 --- a/Data/Gems/sup_str.lua +++ b/Data/Gems/sup_str.lua @@ -481,7 +481,7 @@ gems["Iron Grip"] = { strength = true, support = true, projectile = true, - require = "projectile", + require = "attack and projectile", base = { ironGrip = true, }, diff --git a/Modules/Build.lua b/Modules/Build.lua index a9e19873..46a705d3 100644 --- a/Modules/Build.lua +++ b/Modules/Build.lua @@ -366,7 +366,7 @@ function buildMode:OnFrame(inputEvents) self.controls.mainSocketGroup.list[i] = { val = i, label = socketGroup.displayLabel } end if #self.controls.mainSocketGroup.list == 0 then - self.controls.mainSocketGroup.list[1] = { val = 1, label = "No skills added yet." } + self.controls.mainSocketGroup.list[1] = { val = 1, label = "" } self.controls.mainSkill.shown = false self.controls.mainSkillPart.shown = false else diff --git a/Modules/Calcs.lua b/Modules/Calcs.lua index c4fb04cb..3b34afb2 100644 --- a/Modules/Calcs.lua +++ b/Modules/Calcs.lua @@ -150,10 +150,11 @@ local function endWatch(env, key) end end --- Check if given support gem can support a skill with the given flags -local function gemCanSupport(gem, flags) +-- Check if given support gem can support the given active skill +-- Global function, as GemSelectControl needs to use it too +function gemCanSupport(gem, activeSkill) if gem.data.requireFunc then - setfenv(gem.data.requireFunc, flags) + setfenv(gem.data.requireFunc, activeSkill.baseFlags) return gem.data.requireFunc() == true else return true @@ -193,7 +194,7 @@ local function createActiveSkill(activeGem, supportList) baseFlags.projectile = true end for _, gem in ipairs(supportList) do - if gem.data.addFlags and gemCanSupport(gem, activeSkill.baseFlags) then + if gem.data.addFlags and gemCanSupport(gem, activeSkill) then -- Support gem adds flags to supported skills (eg. Remote Mine adds 'mine') for k in pairs(gem.data.addFlags) do baseFlags[k] = true @@ -203,7 +204,7 @@ local function createActiveSkill(activeGem, supportList) -- Process support gems for _, gem in ipairs(supportList) do - if gemCanSupport(gem, activeSkill.baseFlags) then + if gemCanSupport(gem, activeSkill) then t_insert(activeSkill.gemList, { name = gem.name, data = gem.data, @@ -982,7 +983,7 @@ local function finaliseMods(env, output) if getMiscVal(modDB, "gear", "UniqueCount", 0) > 0 then condList["UsingUniqueItem"] = true end - if output.manaReservedBase == 0 and output.manaReservedPercent == 0 then + if getMiscVal(modDB, "reserved", "manaBase", 0) == 0 and getMiscVal(modDB, "reserved", "manaPercent", 0) == 0 then condList["NoManaReserved"] = true end if modDB.Cond then diff --git a/Modules/Main.lua b/Modules/Main.lua index f743de78..73b48213 100644 --- a/Modules/Main.lua +++ b/Modules/Main.lua @@ -357,6 +357,14 @@ function main:DrawArrow(x, y, size, dir) end end +function main:DrawCheckMark(x, y, size) + size = size / 0.8 + x = x - size / 2 + y = y - size / 2 + DrawImageQuad(nil, x + size * 0.15, y + size * 0.50, x + size * 0.30, y + size * 0.45, x + size * 0.50, y + size * 0.80, x + size * 0.40, y + size * 0.90) + DrawImageQuad(nil, x + size * 0.40, y + size * 0.90, x + size * 0.35, y + size * 0.75, x + size * 0.80, y + size * 0.10, x + size * 0.90, y + size * 0.20) +end + function main:OpenPopup(width, height, title, controls) local popup = common.New("PopupDialog", width, height, title, controls) t_insert(self.popups, popup) diff --git a/README.md b/README.md index 6e5b3163..ede29481 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,11 @@ 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.1.2 - 2016/09/20 + * In the gem name dropdown list, support gems are now marked with a tick if they can apply to any of the + active skills in the current socket group + * Fixed issue causing the spell damage modifier on Clear Mind to fail to apply when no mana is reserved + ### 1.1.1 - 2016/09/20 * Added support for more "socketed gem" modifiers, particularly those from essences * Fixed a few minor issues @@ -178,4 +183,38 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases) ### 1.0.12 - 2016/09/01 * Updated tree to 2.4.0 - * Added latest patch note changes \ No newline at end of file + * Added latest patch note changes + +### 1.0.11 - 2016/09/01 + * Fixed node description searching + * Added + to Level of Socketed Minion Gems to helmet templates + +### 1.0.10 - 2016/08/31 + * Fixed crash bug affecting some users + +### 1.0.9 - 2016/08/31 + * Attempted fix for a crash bug some users have been experiencing + +### 1.0.8 - 2016/08/31 + * Fixed issue preventing the standalone version from updating correctly + +### 1.0.7 - 2016/08/31 + * Fixed items not being deleted after confirmation + +### 1.0.6 - 2016/08/31 + * Added the missing Amulet slot to the item databases' slot dropdown + +### 1.0.5 - 2016/08/31 + * Added "Save" button as an alternative to Ctrl+S + +### 1.0.4 - 2016/08/31 + * Attempt to fix bug causing the top of the UI to be hidden under the title bar + +### 1.0.3 - 2016/08/31 + * Made some tweaks to the build list screen to ward off some possible errors + +### 1.0.2 - 2016/08/31 + * Fixed an error relating to multipart skills + +### 1.0.1 - 2016/08/31 + * Fixed an error in the build list screen \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index af73efd7..8ef9cb01 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +VERSION[1.1.2][2016/09/20] + * In the gem name dropdown list, support gems are now marked with a tick if they can apply to any of the + active skills in the current socket group + * Fixed issue causing the spell damage modifier on Clear Mind to fail to apply when no mana is reserved VERSION[1.1.1][2016/09/20] * Added support for more "socketed gem" modifiers, particularly those from essences * Fixed a few minor issues @@ -110,3 +114,26 @@ VERSION[1.0.13][2016/09/01] VERSION[1.0.12][2016/09/01] * Updated tree to 2.4.0 * Added latest patch note changes +VERSION[1.0.11][2016/09/01] + * Fixed node description searching + * Added + to Level of Socketed Minion Gems to helmet templates +VERSION[1.0.10][2016/08/31] + * Fixed crash bug affecting some users +VERSION[1.0.9][2016/08/31] + * Attempted fix for a crash bug some users have been experiencing +VERSION[1.0.8][2016/08/31] + * Fixed issue preventing the standalone version from updating correctly +VERSION[1.0.7][2016/08/31] + * Fixed items not being deleted after confirmation +VERSION[1.0.6][2016/08/31] + * Added the missing Amulet slot to the item databases' slot dropdown +VERSION[1.0.5][2016/08/31] + * Added "Save" button as an alternative to Ctrl+S +VERSION[1.0.4][2016/08/31] + * Attempt to fix bug causing the top of the UI to be hidden under the title bar +VERSION[1.0.3][2016/08/31] + * Made some tweaks to the build list screen to ward off some possible errors +VERSION[1.0.2][2016/08/31] + * Fixed an error relating to multipart skills +VERSION[1.0.1][2016/08/31] + * Fixed an error in the build list screen diff --git a/manifest.xml b/manifest.xml index f7003d9b..b800b99d 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,22 +1,22 @@ - + - + - - + + - + @@ -31,20 +31,20 @@ - + - + - + - + @@ -55,9 +55,9 @@ - - - + + +