From 01f7d5585311f9b076bf84a1e2eecf11cf5cc080 Mon Sep 17 00:00:00 2001 From: Openarl Date: Mon, 8 May 2017 22:25:15 +1000 Subject: [PATCH] Increased build name limit --- Classes/BuildListControl.lua | 10 +++++++++- Classes/ImportTab.lua | 2 +- Modules/Build.lua | 24 ++++++++++++++++++------ Modules/BuildList.lua | 2 +- README.md | 3 ++- changelog.txt | 3 ++- manifest.xml | 10 +++++----- 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/Classes/BuildListControl.lua b/Classes/BuildListControl.lua index d72f7a66..b0650694 100644 --- a/Classes/BuildListControl.lua +++ b/Classes/BuildListControl.lua @@ -23,7 +23,7 @@ local BuildListClass = common.NewClass("BuildList", "Control", "ControlHost", fu self.controls.scrollBar.locked = function() return self.listMode.edit end - self.controls.nameEdit = common.New("EditControl", {"TOPLEFT",self,"TOPLEFT"}, 0, 0, 0, 20, nil, nil, "\\/:%*%?\"<>|%c", 50) + self.controls.nameEdit = common.New("EditControl", {"TOPLEFT",self,"TOPLEFT"}, 0, 0, 0, 20, nil, nil, "\\/:%*%?\"<>|%c", 100) self.controls.nameEdit.shown = function() return self.listMode.edit end @@ -104,6 +104,14 @@ function BuildListClass:Draw(viewPort) DrawImage(nil, 0, lineY + 1, width - 22, 18) if self.listMode.edit ~= index then DrawString(0, lineY + 2, "LEFT", 16, "VAR", "^7"..(build.buildName or "?")) + if mOverLine or index == selBuildIndex then + SetDrawColor(0.33, 0.33, 0.33) + elseif index % 2 == 0 then + SetDrawColor(0.05, 0.05, 0.05) + else + SetDrawColor(0, 0, 0) + end + DrawImage(nil, width - 162, lineY + 2, 162, 16) SetDrawColor(build.className and data.colorCodes[build.className:upper()] or "^7") DrawString(width - 160, lineY + 2, "LEFT", 16, "VAR", string.format("Level %d %s", build.level or 1, (build.ascendClassName ~= "None" and build.ascendClassName) or build.className or "?")) end diff --git a/Classes/ImportTab.lua b/Classes/ImportTab.lua index 238702aa..5ebeb2a9 100644 --- a/Classes/ImportTab.lua +++ b/Classes/ImportTab.lua @@ -215,7 +215,7 @@ You can get this from your web browser's cookies while logged into the Path of E self.controls.importCodeMode.enabled = function() return self.importCodeState == "VALID" and self.build.dbFileName end - self.controls.importCodeBuildName = common.New("EditControl", {"LEFT",self.controls.importCodeMode,"RIGHT"}, 4, 0, 400, 20, "", "New build name", "\\/:%*%?\"<>|%c", 50) + self.controls.importCodeBuildName = common.New("EditControl", {"LEFT",self.controls.importCodeMode,"RIGHT"}, 4, 0, 400, 20, "", "New build name", "\\/:%*%?\"<>|%c", 100) self.controls.importCodeBuildName.enabled = function() return self.importCodeState == "VALID" and self.controls.importCodeMode.sel == 2 end diff --git a/Modules/Build.lua b/Modules/Build.lua index 38ca1c84..a24ca9db 100644 --- a/Modules/Build.lua +++ b/Modules/Build.lua @@ -38,17 +38,29 @@ function buildMode:Init(dbFileName, buildName) end) self.controls.buildName = common.New("Control", {"LEFT",self.controls.back,"RIGHT"}, 8, 0, 0, 20) self.controls.buildName.width = function(control) - return DrawStringWidth(16, "VAR", self.buildName) + 98 + local limit = self.anchorTopBarRight:GetPos() - 98 - 40 - self.controls.back:GetSize() - self.controls.save:GetSize() - self.controls.saveAs:GetSize() + local bnw = DrawStringWidth(16, "VAR", self.buildName) + self.strWidth = m_min(bnw, limit) + self.strLimited = bnw > limit + return self.strWidth + 98 end self.controls.buildName.Draw = function(control) local x, y = control:GetPos() - local bnw = DrawStringWidth(16, "VAR", self.buildName) + local width, height = control:GetSize() SetDrawColor(0.5, 0.5, 0.5) - DrawImage(nil, x + 91, y, bnw + 6, 20) + DrawImage(nil, x + 91, y, self.strWidth + 6, 20) SetDrawColor(0, 0, 0) - DrawImage(nil, x + 92, y + 1, bnw + 4, 18) + DrawImage(nil, x + 92, y + 1, self.strWidth + 4, 18) SetDrawColor(1, 1, 1) - DrawString(x, y + 2, "LEFT", 16, "VAR", "Current build: "..self.buildName) + SetViewport(x, y + 2, self.strWidth + 94, 16) + DrawString(0, 0, "LEFT", 16, "VAR", "Current build: "..self.buildName) + SetViewport() + if control:IsMouseInBounds() and self.strLimited then + SetDrawLayer(nil, 10) + main:AddTooltipLine(16, self.buildName) + main:DrawTooltip(x, y, width, height, main.viewPort) + SetDrawLayer(nil, 0) + end end self.controls.save = common.New("ButtonControl", {"LEFT",self.controls.buildName,"RIGHT"}, 8, 0, 50, 20, "Save", function() self:SaveDBFile() @@ -596,7 +608,7 @@ function buildMode:OpenSaveAsPopup() local popup popup = main:OpenPopup(370, 100, self.dbFileName and "Save As" or "Save", { common.New("LabelControl", nil, 0, 20, 0, 16, "^7Enter new build name:"), - edit = common.New("EditControl", nil, 0, 40, 350, 20, self.dbFileName and self.buildName, nil, "\\/:%*%?\"<>|%c", 50, function(buf) + edit = common.New("EditControl", nil, 0, 40, 350, 20, self.dbFileName and self.buildName, nil, "\\/:%*%?\"<>|%c", 100, function(buf) newFileName = main.buildPath..buf..".xml" newBuildName = buf popup.controls.save.enabled = false diff --git a/Modules/BuildList.lua b/Modules/BuildList.lua index d55c4d7e..847cfc04 100644 --- a/Modules/BuildList.lua +++ b/Modules/BuildList.lua @@ -42,7 +42,7 @@ function listMode:Init(selBuildName) 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 = common.New("BuildList", {"TOP",self.anchor,"TOP"}, 0, 24, 640, 0, self) self.controls.buildList.height = function() return main.screenH - 32 end diff --git a/README.md b/README.md index f593dccc..fcc73ebf 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,12 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases) ## Changelog ### 1.4.9 - 2017/05/08 * AoE Radius and Weapon Range are now calculated and displayed in the "Skill type-specific Stats" section of the Calcs tab - * The breakdown for those calculations features a visual display of the area size + * The breakdowns for those calculations feature a visual display of the area size * The base radius values of some skills are not known, so they will not be shown * Explosive Arrow now has separate skill parts for 1 fuse and 5 fuses * Added support for Convocation * Rallying Cry's buff is now able to affect minions + * The character limit for build names has been increased to 100; the build list has also been widened * Spells of the correct type will now be considered to be Triggered when socketed into Mjolner and Cospri's Malice * Infernal Blow no longer incorrectly benefits from modifiers to area damage diff --git a/changelog.txt b/changelog.txt index a60421bc..eff151e6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,11 @@ VERSION[1.4.9][2017/05/08] * AoE Radius and Weapon Range are now calculated and displayed in the "Skill type-specific Stats" section of the Calcs tab - * The breakdown for those calculations features a visual display of the area size + * The breakdowns for those calculations feature a visual display of the area size * The base radius values of some skills are not known, so they will not be shown * Explosive Arrow now has separate skill parts for 1 fuse and 5 fuses * Added support for Convocation * Rallying Cry's buff is now able to affect minions + * The character limit for build names has been increased to 100; the build list has also been widened * Spells of the correct type will now be considered to be Triggered when socketed into Mjolner and Cospri's Malice * Infernal Blow no longer incorrectly benefits from modifiers to area damage VERSION[1.4.8][2017/05/02] diff --git a/manifest.xml b/manifest.xml index 951c686a..95dafb7c 100644 --- a/manifest.xml +++ b/manifest.xml @@ -7,8 +7,8 @@ - - + + @@ -20,7 +20,7 @@ - + @@ -43,8 +43,8 @@ - - + +