Quick fix for the save buttons covering the points display at low resolutions

This commit is contained in:
Openarl
2017-02-18 23:20:09 +10:00
parent af35d1818b
commit 4e8cd1990e
4 changed files with 30 additions and 15 deletions

View File

@@ -37,10 +37,12 @@ function buildMode:Init(dbFileName, buildName)
end
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
end
self.controls.buildName.Draw = function(control)
local x, y = control:GetPos()
local bnw = DrawStringWidth(16, "VAR", self.buildName)
control.width = bnw + 98
SetDrawColor(0.5, 0.5, 0.5)
DrawImage(nil, x + 91, y, bnw + 6, 20)
SetDrawColor(0, 0, 0)
@@ -63,29 +65,40 @@ function buildMode:Init(dbFileName, buildName)
-- Controls: top bar, right side
self.anchorTopBarRight = common.New("Control", nil, function() return main.screenW / 2 + 6 end, 4, 0, 20)
self.controls.pointDisplay = common.New("Control", {"RIGHT",self.anchorTopBarRight,"LEFT"}, -12, 0, 0, 20)
self.controls.pointDisplay.Draw = function(control)
local x, y = control:GetPos()
self.controls.pointDisplay = common.New("Control", {"LEFT",self.anchorTopBarRight,"RIGHT"}, -12, 0, 0, 20)
self.controls.pointDisplay.x = function(control)
local width, height = control:GetSize()
if self.controls.saveAs:GetPos() + self.controls.saveAs:GetSize() < self.anchorTopBarRight:GetPos() - width - 16 then
return -12 - width
else
return 0
end
end
self.controls.pointDisplay.width = function(control)
local used, ascUsed = self.spec:CountAllocNodes()
local usedMax = 120 + (self.calcsTab.mainOutput.ExtraPoints or 0)
local ascMax = 8
local str = string.format("%s%3d / %3d %s%d / %d", used > usedMax and "^1" or "^7", used, usedMax, ascUsed > ascMax and "^1" or "^7", ascUsed, ascMax)
local strW = DrawStringWidth(16, "FIXED", str) + 6
control.width = strW + 2
control.str = string.format("%s%3d / %3d %s%d / %d", used > usedMax and "^1" or "^7", used, usedMax, ascUsed > ascMax and "^1" or "^7", ascUsed, ascMax)
control.req = "Required level: "..m_max(1, (100 + used - usedMax))
return DrawStringWidth(16, "FIXED", control.str) + 8
end
self.controls.pointDisplay.Draw = function(control)
local x, y = control:GetPos()
local width, height = control:GetSize()
SetDrawColor(1, 1, 1)
DrawImage(nil, x, y, strW + 2, 20)
DrawImage(nil, x, y, width, height)
SetDrawColor(0, 0, 0)
DrawImage(nil, x + 1, y + 1, strW, 18)
DrawImage(nil, x + 1, y + 1, width - 2, height - 2)
SetDrawColor(1, 1, 1)
DrawString(x + 4, y + 2, "LEFT", 16, "FIXED", str)
DrawString(x + 4, y + 2, "LEFT", 16, "FIXED", control.str)
if control:IsMouseInBounds() then
SetDrawLayer(nil, 10)
main:AddTooltipLine(16, "Required level: "..m_max(1, (100 + used - usedMax)))
main:DrawTooltip(x, y, control.width, control.height, main.viewPort)
main:AddTooltipLine(16, control.req)
main:DrawTooltip(x, y, width, height, main.viewPort)
SetDrawLayer(nil, 0)
end
end
self.controls.characterLevel = common.New("EditControl", {"LEFT",self.anchorTopBarRight,"RIGHT"}, 0, 0, 106, 20, "", "Level", "%D", 3, function(buf)
self.controls.characterLevel = common.New("EditControl", {"LEFT",self.controls.pointDisplay,"RIGHT"}, 12, 0, 106, 20, "", "Level", "%D", 3, function(buf)
self.characterLevel = m_min(tonumber(buf) or 1, 100)
self.modFlag = true
self.buildFlag = true

View File

@@ -50,6 +50,7 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases)
### 1.3.2 - 2017/02/18
* Added support for the "increased Effect of Buffs on You" modifier on Ichimonji
* Added basic support for Detonate Dead; only the base damage is used
* The points display in the top bar will now move to the right of center if the Save/Save As buttons would cover it
* Fixed issue preventing Unarmed from being correctly detected
### 1.3.1 - 2017/02/18

View File

@@ -1,6 +1,7 @@
VERSION[1.3.2][2017/02/18]
* Added support for the "increased Effect of Buffs on You" modifier on Ichimonji
* Added basic support for Detonate Dead; only the base damage is used
* The points display in the top bar will now move to the right of center if the Save/Save As buttons would cover it
* Fixed issue preventing Unarmed from being correctly detected
VERSION[1.3.1][2017/02/18]
* Added socket count to the tooltips in the passive tree selection dropdown menu

View File

@@ -7,7 +7,7 @@
<File sha1="5ffc5d4ad59c4a165657132a8a3ddb206a64d99f" name="Launch.lua" part="program"/>
<File sha1="d8e42beeb38baabcc197d658e4c0af33419eeff3" name="UpdateCheck.lua" part="program"/>
<File sha1="4f17937f2b37784e169a3792b235f2a0a3961e61" name="UpdateApply.lua" part="program"/>
<File sha1="96659c28386f653eb706b88917a909212dd5a7d4" name="changelog.txt" part="program"/>
<File sha1="8162ee9f9bf50f8dbc9842b0c748519ca4d53a7a" name="changelog.txt" part="program"/>
<File sha1="231a4fe264d84294427edacbf3e29ec4b301712e" name="Classes/BuildListControl.lua" part="program"/>
<File sha1="deffd663ba726d938fcbe2870aab8a4e982587fa" name="Classes/ButtonControl.lua" part="program"/>
<File sha1="412639a254d0e275d9cc2286c5d76d3b0a9a0e8e" name="Classes/CalcBreakdownControl.lua" part="program"/>
@@ -42,7 +42,7 @@
<File sha1="a4f9cc96ba474d0a75c768a0eabec92837e027cf" name="Classes/TextListControl.lua" part="program"/>
<File sha1="2dab39fe6d0cfe8899b55ae756f1c87c3dde9692" name="Classes/TreeTab.lua" part="program"/>
<File sha1="4b7675c8b4fe71cade7dd3d70793df1ed8022d01" name="Classes/UndoHandler.lua" part="program"/>
<File sha1="f97f4ea58bc0a71fed52b9be8e81bf0b44fd1dc2" name="Modules/Build.lua" part="program"/>
<File sha1="5f4089664ac5a7a311a1f03e74667c2143333728" name="Modules/Build.lua" part="program"/>
<File sha1="8a07fe01c53b785ebb6256236e781fbaabd36c0e" name="Modules/BuildList.lua" part="program"/>
<File sha1="568b5d531c37bb36ffbc8b96a17ca4b71a32acf5" name="Modules/Calcs.lua" part="program"/>
<File sha1="40457c8f60f921144ecb1af6a63cc4dad0312b69" name="Modules/CalcSections.lua" part="program"/>