Sneaking in more features

- Added MoM total to Calcs tab
- Quality normalisation now only occurs when an item is first added
This commit is contained in:
Openarl
2017-02-21 02:48:31 +10:00
parent 8dc54c000c
commit 56db57024a
8 changed files with 32 additions and 17 deletions

View File

@@ -262,7 +262,7 @@ function ItemDBClass:OnKeyDown(key, doubleClick)
self.selIndex = index
if IsKeyDown("CTRL") then
-- Immediately add and equip it
self.itemsTab:CreateDisplayItemFromRaw(selItem.raw)
self.itemsTab:CreateDisplayItemFromRaw(selItem.raw, true)
local newItem = self.itemsTab.displayItem
self.itemsTab:AddDisplayItem(true)
itemLib.buildItemModList(newItem)
@@ -282,7 +282,7 @@ function ItemDBClass:OnKeyDown(key, doubleClick)
end
end
elseif doubleClick then
self.itemsTab:CreateDisplayItemFromRaw(selItem.raw)
self.itemsTab:CreateDisplayItemFromRaw(selItem.raw, true)
end
end
end
@@ -322,7 +322,7 @@ function ItemDBClass:OnKeyUp(key)
if self.selDragActive then
self.selDragActive = false
if self.itemsTab.controls.itemList:IsMouseOver() and self.itemsTab.controls.itemList.selDragIndex then
self.itemsTab:CreateDisplayItemFromRaw(self.selItem.raw)
self.itemsTab:CreateDisplayItemFromRaw(self.selItem.raw, true)
local newItem = self.itemsTab.displayItem
self.itemsTab:AddDisplayItem()
itemLib.buildItemModList(newItem)
@@ -332,7 +332,7 @@ function ItemDBClass:OnKeyUp(key)
for slotName, slot in pairs(self.itemsTab.slots) do
if not slot.inactive and slot:IsMouseOver() then
if self.itemsTab:IsItemValidForSlot(self.selItem, slotName) then
self.itemsTab:CreateDisplayItemFromRaw(self.selItem.raw)
self.itemsTab:CreateDisplayItemFromRaw(self.selItem.raw, true)
local newItem = self.itemsTab.displayItem
self.itemsTab:AddDisplayItem(true)
itemLib.buildItemModList(newItem)

View File

@@ -266,7 +266,7 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
if event.key == "v" and IsKeyDown("CTRL") then
local newItem = Paste()
if newItem then
self:CreateDisplayItemFromRaw(newItem)
self:CreateDisplayItemFromRaw(newItem, true)
end
elseif event.key == "z" and IsKeyDown("CTRL") then
self:Undo()
@@ -360,6 +360,7 @@ function ItemsTabClass:CraftItem()
else
item.implicitLines = 0
end
itemLib.normaliseQuality(item)
return itemLib.makeItemFromRaw(itemLib.createItemRaw(item))
end
popup = main:OpenPopup(370, 130, "Craft Item", {
@@ -420,7 +421,7 @@ function ItemsTabClass:EditDisplayItemText()
edit = common.New("EditControl", nil, 0, 40, 480, 420, "", nil, "^%C\t\n", nil, nil, 14),
save = common.New("ButtonControl", nil, -45, 470, 80, 20, self.displayItem and "Save" or "Create", function()
local id = self.displayItem and self.displayItem.id
self:CreateDisplayItemFromRaw(buildRaw())
self:CreateDisplayItemFromRaw(buildRaw(), not self.displayItem)
self.displayItem.id = id
main:ClosePopup()
end),
@@ -457,9 +458,12 @@ function ItemsTabClass:EditDisplayItemText()
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)
function ItemsTabClass:CreateDisplayItemFromRaw(itemRaw, normalise)
local newItem = itemLib.makeItemFromRaw(itemRaw)
if newItem then
if normalise then
itemLib.normaliseQuality(newItem)
end
self:SetDisplayItem(newItem)
end
end

View File

@@ -659,5 +659,6 @@ return {
{ breakdown = "BlockDuration" },
{ modName = { "StunRecovery", "BlockRecovery" }, },
}, },
{ label = "Mind over Matter", { format = "{0:mod:1}%", { modName = "DamageTakenFromManaBeforeLife" }, }, },
} },
}

View File

@@ -257,15 +257,18 @@ function itemLib.parseItemRaw(item)
item.affixLimit = (item.base.type == "Jewel" and 4 or 6)
end
end
if not item.corrupted and not item.uniqueID and item.base and (item.base.armour or item.base.weapon or item.base.flask) then
item.quality = 20
end
if item.variantList then
item.variant = m_min(#item.variantList, item.variant or #item.variantList)
end
itemLib.buildItemModList(item)
end
function itemLib.normaliseQuality(item)
if not item.corrupted and not item.uniqueID and item.base and (item.base.armour or item.base.weapon or item.base.flask) then
item.quality = 20
end
end
-- Create raw item data for given item
function itemLib.createItemRaw(item)
local rawLines = { }

View File

@@ -109,6 +109,7 @@ local modNameList = {
["to avoid being chilled"] = "AvoidChilled",
["to avoid being ignited"] = "AvoidIgnite",
["to avoid elemental status ailments"] = { "AvoidShock", "AvoidFrozen", "AvoidChilled", "AvoidIgnite" },
["damage is taken from mana before life"] = { "DamageTakenFromManaBeforeLife" },
-- Stun modifiers
["stun recovery"] = "StunRecovery",
["stun and block recovery"] = "StunRecovery",
@@ -328,6 +329,7 @@ local preFlagList = {
["^socketed curse gems have "] = { tag = { type = "SocketedIn", keyword = "curse" } },
["^socketed melee gems have "] = { tag = { type = "SocketedIn", keyword = "melee" } },
["^your flasks grant "] = { },
["^when hit, "] = { },
["^auras you cast grant "] = { addToAura = true },
["^you and allies affected by your auras have "] = { tag = { type = "Condition", var = "HaveAuraActive" } },
}
@@ -947,7 +949,8 @@ local function parseMod(line, order)
elseif modForm == "CONV" then
modSuffix, line = scan(line, convTypes, true)
if not modSuffix then
return { }, line
modSuffix = ""
--return { }, line
end
elseif modForm == "PEN" then
modName, line = scan(line, penTypes, true)

View File

@@ -57,6 +57,8 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases)
* Have you used a Warcry Recently?
* Consumed a corpse Recently?
* Added support for the "Consecrated Ground grants 40% increased Damage" modifier from Sanctify
* The total Damage taken from Mana before Life is now displayed in the Other Defences section in the Calcs tab
* The Items tab now only normalises quality on items when they are first added, allowing the quality to be edited if necessary
### 1.3.4 - 2017/02/20
* Added support for the Offering skills and Mistress of Sacrifice

View File

@@ -8,6 +8,8 @@ VERSION[1.3.5][2017/02/21]
* Have you used a Warcry Recently?
* Consumed a corpse Recently?
* Added support for the "Consecrated Ground grants 40% increased Damage" modifier from Sanctify
* The total Damage taken from Mana before Life is now displayed in the Other Defences section in the Calcs tab
* The Items tab now only normalises quality on items when they are first added, allowing the quality to be edited if necessary
VERSION[1.3.4][2017/02/20]
* Added support for the Offering skills and Mistress of Sacrifice
VERSION[1.3.3][2017/02/19]

View File

@@ -7,7 +7,7 @@
<File sha1="8a7163c306feb866be7f8d66c71b282c9f99be94" name="Launch.lua" part="program"/>
<File sha1="d8e42beeb38baabcc197d658e4c0af33419eeff3" name="UpdateCheck.lua" part="program"/>
<File sha1="4f17937f2b37784e169a3792b235f2a0a3961e61" name="UpdateApply.lua" part="program"/>
<File sha1="aba6191496174d311eb5a6398385da7bb32a5716" name="changelog.txt" part="program"/>
<File sha1="8159f9399bbf94b81716a0f4ca8114449b1e58bc" 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"/>
@@ -21,10 +21,10 @@
<File sha1="19f25ed4278994079fe43eaedbecaf2b486aae91" name="Classes/EditControl.lua" part="program"/>
<File sha1="062b89dfbef58b3473db6bd9712af3de53dd5200" name="Classes/GemSelectControl.lua" part="program"/>
<File sha1="f2e6303d1717e18d334a7e4c3522ff5be6b62d6c" name="Classes/ImportTab.lua" part="program"/>
<File sha1="67161a81d79a7c720cc8c74d2a2a7b37dc044335" name="Classes/ItemDBControl.lua" part="program"/>
<File sha1="0e89284fecdbe76d276de30ede6ec251c775c8cb" name="Classes/ItemDBControl.lua" part="program"/>
<File sha1="5ecb01b4b82c19420b15a116027e00530f673045" name="Classes/ItemListControl.lua" part="program"/>
<File sha1="3e1063c0ccb7b4ec5c76e9f40174c2c39d1d8c77" name="Classes/ItemSlotControl.lua" part="program"/>
<File sha1="21738e93803c168323b01af5418c2dd28a4ce9b9" name="Classes/ItemsTab.lua" part="program"/>
<File sha1="ef609d1cec73a91d2a26c54e8343fcf60ceb832f" name="Classes/ItemsTab.lua" part="program"/>
<File sha1="62138c7db82d57d638a16610a26acd0de75d3486" name="Classes/LabelControl.lua" part="program"/>
<File sha1="62a5a9ce8e3bc3000c9c0445e2fca60c0b2e9e8d" name="Classes/ModDB.lua" part="program"/>
<File sha1="c2cc7ad12754df03ec5401df02bce45894bbe3bd" name="Classes/ModList.lua" part="program"/>
@@ -45,12 +45,12 @@
<File sha1="06cef31ee7a133da6a9c4b8b4b9e859901c4a4a4" name="Modules/Build.lua" part="program"/>
<File sha1="8a07fe01c53b785ebb6256236e781fbaabd36c0e" name="Modules/BuildList.lua" part="program"/>
<File sha1="bd26c62326f763ca16fbd35c23e24bedb1f644a9" name="Modules/Calcs.lua" part="program"/>
<File sha1="4063501d4bf32511b5eddcb08ad8037866846179" name="Modules/CalcSections.lua" part="program"/>
<File sha1="c745848cd1fe1f399f557c100c361989d5084955" name="Modules/CalcSections.lua" part="program"/>
<File sha1="761af85f3e1c5601fdb790356a09aefe2f5a64e3" name="Modules/Common.lua" part="program"/>
<File sha1="cc9721ab97b5cfb9c707f4523168b9df618db083" name="Modules/Data.lua" part="program"/>
<File sha1="4426369a8320676d96df73dea35e1a6cafdd3d19" name="Modules/ItemTools.lua" part="program"/>
<File sha1="9d115de26ddb7a480d46f5d59603e4b48c239b12" name="Modules/ItemTools.lua" part="program"/>
<File sha1="e66e6bd244bb5d6112dbade17f7d4640a58f6b3a" name="Modules/Main.lua" part="program"/>
<File sha1="757d5d348dce142a8f348c8c6428d73f2da285be" name="Modules/ModParser.lua" part="program"/>
<File sha1="245b203edc713eaae023465db9af073a6750cc06" name="Modules/ModParser.lua" part="program"/>
<File sha1="5f93a9d8f58e0d5990a1f84e1ab1d53fbd35fb56" name="Modules/ModTools.lua" part="program"/>
<File sha1="e7ee7e5b6388facb7bf568517ecc401590757df7" name="Assets/ring.png" part="program"/>
<File sha1="9a320bfe629b1cf3f14fc77fbbf2508d0a5b2841" name="Assets/small_ring.png" part="program"/>