Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Openarl committed Feb 15, 2017
2 parents ef0d890 + ae0634b commit 6b3b6e1
Show file tree
Hide file tree
Showing 40 changed files with 1,549 additions and 230 deletions.
15 changes: 9 additions & 6 deletions Classes/ButtonControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ local ButtonClass = common.NewClass("ButtonControl", "Control", function(self, a
self.Control(anchor, x, y, width, height)
self.label = label
self.onClick = onClick
self.tooltipFunc = function()
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(14, tooltip)
end
end
end)

function ButtonClass:Click()
Expand Down Expand Up @@ -66,13 +72,10 @@ function ButtonClass:Draw(viewPort)
local overSize = self.overSizeText or 0
DrawString(x + width / 2, y + 2 - overSize, "CENTER_X", height - 4 + overSize * 2, "VAR",label )
end
if mOver and self.tooltip then
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(16, tooltip)
end
if mOver then
SetDrawLayer(nil, 100)
main:DrawTooltip(x, y, width, height, viewPort)
local col, center = self.tooltipFunc()
main:DrawTooltip(x, y, width, height, viewPort, col, center)
SetDrawLayer(nil, 0)
end
end
Expand Down
19 changes: 11 additions & 8 deletions Classes/CheckBoxControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ local CheckBoxClass = common.NewClass("CheckBoxControl", "Control", function(sel
self.Control(anchor, x, y, size, size)
self.label = label
self.changeFunc = changeFunc
self.tooltipFunc = function(state)
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(14, tooltip)
end
end
end)

function CheckBoxClass:IsMouseOver()
Expand Down Expand Up @@ -60,14 +66,11 @@ function CheckBoxClass:Draw(viewPort)
if label then
DrawString(x - 5, y + 2, "RIGHT_X", size - 4, "VAR", label)
end
if mOver and self.tooltip then
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(16, tooltip)
SetDrawLayer(nil, 100)
main:DrawTooltip(x, y, size, size, viewPort)
SetDrawLayer(nil, 0)
end
if mOver then
SetDrawLayer(nil, 100)
local col, center = self.tooltipFunc(self.state)
main:DrawTooltip(x, y, size, size, viewPort, col, center)
SetDrawLayer(nil, 0)
end
end

Expand Down
2 changes: 1 addition & 1 deletion Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local varList = {
{ var = "buffFortify", type = "check", label = "Do you have Fortify?", ifCond = "Fortify", apply = function(val, modList, enemyModList)
modList:NewMod("Misc", "LIST", { type = "Condition", var = "Fortify" }, "Config", { type = "Condition", var = "Combat" })
end },
{ var = "conditionUsingFlask", type = "check", label = "Do you have a Flask active?", ifCond = "UsingFlask", apply = function(val, modList, enemyModList) -- FIXME Flask release (autocondition note)
{ var = "conditionUsingFlask", type = "check", label = "Do you have a Flask active?", ifCond = "UsingFlask", tooltip = "This is automatically enabled if you have a flask active,\nbut you can use this option to force it if necessary.", apply = function(val, modList, enemyModList)
modList:NewMod("Misc", "LIST", { type = "Condition", var = "UsingFlask" }, "Config", { type = "Condition", var = "Combat" })
end },
{ var = "conditionOnConsecratedGround", type = "check", label = "Are you on Consecrated Ground?", tooltip = "In addition to allowing any 'while on Consecrated Ground' modifiers to apply,\nthis will apply the 4% life regen modifier granted by Consecrated Ground.", apply = function(val, modList, enemyModList)
Expand Down
20 changes: 15 additions & 5 deletions Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ local DropDownClass = common.NewClass("DropDownControl", "Control", "ControlHost
self.sel = 1
self.selFunc = selFunc
self.tooltip = tooltip
self.tooltipFunc = function(mode, sel, selVal)
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(14, self.tooltip)
end
end
end)

function DropDownClass:SelByValue(val)
Expand Down Expand Up @@ -140,13 +146,13 @@ function DropDownClass:Draw(viewPort)
SetDrawLayer(nil, 0)
end
if enabled then
SetDrawColor(1, 1, 1)
if (mOver or self.dropped) and self.tooltip then
if (mOver or self.dropped) and mOverComp ~= "DROP" then
local col, center = self.tooltipFunc(mOver and "BODY" or "OUT", self.sel, self.list[self.sel])
SetDrawLayer(nil, 10)
main:AddTooltipLine(14, self.tooltip)
main:DrawTooltip(x, y - (self.dropped and self.dropUp and dropExtra or 0), width, height + (self.dropped and dropExtra or 0), viewPort)
main:DrawTooltip(x, y - (self.dropped and self.dropUp and dropExtra or 0), width, height + (self.dropped and dropExtra or 0), viewPort, col, center)
SetDrawLayer(nil, 0)
end
SetDrawColor(1, 1, 1)
else
SetDrawColor(0.66, 0.66, 0.66)
end
Expand All @@ -162,9 +168,13 @@ function DropDownClass:Draw(viewPort)
self:DrawControls(viewPort)
local cursorX, cursorY = GetCursorPos()
self.hoverSel = mOver and not scrollBar:IsMouseOver() and math.floor((cursorY - dropY + scrollBar.offset) / (height - 4)) + 1
if self.hoverSel and self.hoverSel < 1 then
if self.hoverSel and not self.list[self.hoverSel] then
self.hoverSel = nil
end
if self.hoverSel then
local col, center = self.tooltipFunc("HOVER", self.hoverSel, self.list[self.hoverSel])
main:DrawTooltip(x, dropY + 2 + (self.hoverSel - 1) * (height - 4) - scrollBar.offset, width, height - 4, viewPort, col, center)
end
SetViewport(x + 2, dropY + 2, scrollBar.enabled and width - 22 or width - 4, dropHeight)
for index, listVal in ipairs(self.list) do
local y = (index - 1) * (height - 4) - scrollBar.offset
Expand Down
12 changes: 9 additions & 3 deletions Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ local EditClass = common.NewClass("EditControl", "ControlHost", "Control", "Undo
self.controls.scrollBarH.shown = false
self.controls.scrollBarV.shown = false
end
self.tooltipFunc = function()
local tooltip = self:GetProperty("tooltip")
if tooltip then
main:AddTooltipLine(14, tooltip)
end
end
end)

function EditClass:SetText(text, notify)
Expand Down Expand Up @@ -221,10 +227,10 @@ function EditClass:Draw(viewPort)
if not enabled then
return
end
if mOver and self.tooltip then
main:AddTooltipLine(16, self:GetProperty("tooltip"))
if mOver then
SetDrawLayer(nil, 100)
main:DrawTooltip(x, y, width, height, viewPort)
local col, center = self.tooltipFunc()
main:DrawTooltip(x, y, width, height, viewPort, col, center)
SetDrawLayer(nil, 0)
end
self:UpdateScrollBars()
Expand Down
14 changes: 14 additions & 0 deletions Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ function GemSelectClass:Draw(viewPort)
end
SetViewport()
self:DrawControls(viewPort)
if self.hoverSel then
local calcFunc, calcBase = self.skillsTab.build.calcsTab:GetMiscCalculator(self.build)
if calcFunc then
local gemList = self.skillsTab.displayGroup.gemList
local oldGem = gemList[self.index]
gemList[self.index] = copyTable(oldGem or { level = 20, quality = 0, enabled = true }, true)
gemList[self.index].name = self.list[self.hoverSel]
gemList[self.index].data = data.gems[self.list[self.hoverSel]]
local output = calcFunc()
gemList[self.index] = oldGem
self.skillsTab.build:AddStatComparesToTooltip(calcBase, output, "^7Selecting this gem will give you:")
main:DrawTooltip(x, y + height + 2 + (self.hoverSel - 1) * (height - 4) - scrollBar.offset, width, height - 4, viewPort)
end
end
SetDrawLayer(nil, 0)
else
local hoverControl
Expand Down
16 changes: 7 additions & 9 deletions Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function ImportTabClass:ImportItem(itemData, sockets)
local slotName
if itemData.inventoryId == "PassiveJewels" and sockets then
slotName = "Jewel "..sockets[itemData.x + 1]
elseif launch.enableFlasks and itemData.inventoryId == "Flask" then -- FIXME Flask release
elseif itemData.inventoryId == "Flask" then
slotName = "Flask "..(itemData.x + 1)
else
slotName = slotMap[itemData.inventoryId]
Expand Down Expand Up @@ -405,19 +405,17 @@ function ImportTabClass:ImportItem(itemData, sockets)
if itemData.implicitMods then
item.implicitLines = item.implicitLines + #itemData.implicitMods
for _, line in ipairs(itemData.implicitMods) do
for line in line:gmatch("[^\n]+") do
local modList, extra = modLib.parseMod(line)
t_insert(item.modLines, { line = line, extra = extra, mods = modList or { } })
end
line = line:gsub("\n"," ")
local modList, extra = modLib.parseMod(line)
t_insert(item.modLines, { line = line, extra = extra, mods = modList or { } })
end
end
if itemData.enchantMods then
item.implicitLines = item.implicitLines + #itemData.enchantMods
for _, line in ipairs(itemData.enchantMods) do
for line in line:gmatch("[^\n]+") do
local modList, extra = modLib.parseMod(line)
t_insert(item.modLines, { line = line, extra = extra, mods = modList or { }, crafted = true })
end
line = line:gsub("\n"," ")
local modList, extra = modLib.parseMod(line)
t_insert(item.modLines, { line = line, extra = extra, mods = modList or { }, crafted = true })
end
end
if itemData.explicitMods then
Expand Down
Loading

2 comments on commit 6b3b6e1

@ipbtaliz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi sorry if I'm writing a comment here, but I couldn't find another way to send you a PM (email, etc).
I've heard a lot about the OPness of poison builds so I tried to recreate in your program some of the many poison builds that I could find on PoE forums.
I've tried 2 build and in both of them the estimated dps was somewhere between 30k and 40k.
I've tried to import my friend's budget cyclone-based character and its estimated dps was 70k.
My questions are: is poison calculated correctly? Is there an option I'm missing while using the program? Like I'm not displaying everything, or maybe I'm not correctly applying auras/curses.
Ty in advance.

@Openarl
Copy link
Owner Author

@Openarl Openarl commented on 6b3b6e1 Feb 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any issues with poison calculations at the moment.
It's difficult to know exactly what's happening here without more specific details. If you could export some of the builds using the share code generator (the second section in the Import/Export tab) and give me the codes via Pastebin, that'd be great,
Also, the best way to contact me with queries like this is to PM me on the PoE forums.

Please sign in to comment.