Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1538,18 +1538,43 @@ function ItemsTabClass:DeleteItem(item, deferUndoState)
end
end

local function copyAnointsAndEldritchImplicits(self, newItem)
if newItem.base and self.activeItemSet[newItem.base.type] then
local currentItem = self.activeItemSet[newItem.base.type].selItemId and self.items[self.activeItemSet[newItem.base.type].selItemId]
-- if you don't have an equipped item that matches the type of the newItem, no need to do anything
if currentItem then
-- if the new item is an amulet and does not have an anoint and your current amulet does, apply that anoint to the new item
if newItem.base.type == "Amulet" and #newItem.enchantModLines == 0 then
local currentAnoint = currentItem.enchantModLines
if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp
newItem.enchantModLines = currentAnoint
end
end
-- if the new item is a non-corrupted Normal, Magic, or Rare Helmet, Body Armour, Gloves, or Boots and does not have any influence
-- and your current respective item is Eater and/or Exarch, apply those implicits and influence to the new item
local eldritchBaseTypes = { "Helmet", "Body Armour", "Gloves", "Boots" }
local eldritchRarities = { "NORMAL", "MAGIC", "RARE" }
for _, influence in ipairs(itemLib.influenceInfo.default) do
if newItem[influence.key] then
return
end
end
if main.migrateEldritchImplicits and isValueInTable(eldritchBaseTypes, newItem.base.type) and isValueInTable(eldritchRarities, newItem.rarity)
and #newItem.implicitModLines == 0 and not newItem.corrupted and (currentItem.cleansing or currentItem.tangle) and currentItem.implicitModLines then
newItem.implicitModLines = currentItem.implicitModLines
newItem.tangle = currentItem.tangle
newItem.cleansing = currentItem.cleansing
end
newItem:BuildAndParseRaw()
end
end
end

-- Attempt to create a new item from the given item raw text and sets it as the new display item
function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise)
local newItem = new("Item", itemRaw)
if newItem.base then
-- if the new item is an amulet and does not have an anoint and your current amulet does, apply that anoint to the new item
if newItem.base.type == "Amulet" and #newItem.enchantModLines == 0 and self.activeItemSet["Amulet"].selItemId > 0 then
local currentAnoint = self.items[self.activeItemSet["Amulet"].selItemId].enchantModLines
if currentAnoint and #currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp
newItem.enchantModLines = currentAnoint
newItem:BuildAndParseRaw()
end
end
copyAnointsAndEldritchImplicits(self, newItem)
if normalise then
newItem:NormaliseQuality()
newItem:BuildModList()
Expand Down
18 changes: 16 additions & 2 deletions src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function main:Init()
self.dpiScaleOverridePercent = GetDPIScaleOverridePercent and GetDPIScaleOverridePercent() or 0
self.showWarnings = true
self.slotOnlyTooltips = true
self.migrateEldritchImplicits = true
self.notSupportedModTooltips = true
self.notSupportedTooltipText = " ^8(Not supported in PoB yet)"
self.POESESSID = ""
Expand Down Expand Up @@ -627,6 +628,9 @@ function main:LoadSettings(ignoreBuild)
if node.attrib.slotOnlyTooltips then
self.slotOnlyTooltips = node.attrib.slotOnlyTooltips == "true"
end
if node.attrib.migrateEldritchImplicits then
self.migrateEldritchImplicits = node.attrib.migrateEldritchImplicits == "true"
end
if node.attrib.notSupportedModTooltips then
self.notSupportedModTooltips = node.attrib.notSupportedModTooltips == "true"
end
Expand Down Expand Up @@ -761,6 +765,7 @@ function main:SaveSettings()
lastExportedWebsite = self.lastExportedWebsite,
showWarnings = tostring(self.showWarnings),
slotOnlyTooltips = tostring(self.slotOnlyTooltips),
migrateEldritchImplicits = tostring(self.migrateEldritchImplicits),
notSupportedModTooltips = tostring(self.notSupportedModTooltips),
POESESSID = self.POESESSID,
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
Expand Down Expand Up @@ -844,7 +849,7 @@ function main:OpenOptionsPopup()
end

local defaultLabelSpacingPx = -4
local defaultLabelPlacementX = 240
local defaultLabelPlacementX = popupWidth*0.45

drawSectionHeader("app", "Application options")

Expand Down Expand Up @@ -1030,7 +1035,14 @@ function main:OpenOptionsPopup()
self.slotOnlyTooltips = state
end)
controls.slotOnlyTooltips.state = self.slotOnlyTooltips


nextRow()
controls.migrateEldritchImplicits = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Copy Eldritch Implicits onto Display Item:", function(state)
self.migrateEldritchImplicits = state
end)
controls.migrateEldritchImplicits.tooltipText = "Apply Eldritch Implicits from current gear when comparing new gear, given the new item doesn't have any influence"
controls.migrateEldritchImplicits.state = self.migrateEldritchImplicits

nextRow()
controls.notSupportedModTooltips = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show tooltip for unsupported mods :", function(state)
self.notSupportedModTooltips = state
Expand Down Expand Up @@ -1074,6 +1086,7 @@ function main:OpenOptionsPopup()
local initialDefaultItemAffixQuality = self.defaultItemAffixQuality or 0.5
local initialShowWarnings = self.showWarnings
local initialSlotOnlyTooltips = self.slotOnlyTooltips
local initialMigrateEldritchImplicits = self.migrateEldritchImplicits
local initialNotSupportedModTooltips = self.notSupportedModTooltips
local initialInvertSliderScrollDirection = self.invertSliderScrollDirection
local initialDisableDevAutoSave = self.disableDevAutoSave
Expand Down Expand Up @@ -1128,6 +1141,7 @@ function main:OpenOptionsPopup()
self.defaultItemAffixQuality = initialDefaultItemAffixQuality
self.showWarnings = initialShowWarnings
self.slotOnlyTooltips = initialSlotOnlyTooltips
self.migrateEldritchImplicits = initialMigrateEldritchImplicits
self.notSupportedModTooltips = initialNotSupportedModTooltips
self.invertSliderScrollDirection = initialInvertSliderScrollDirection
self.disableDevAutoSave = initialDisableDevAutoSave
Expand Down