Skip to content

Commit

Permalink
adapting new iteminfo format for 3.15
Browse files Browse the repository at this point in the history
  • Loading branch information
TheL1ne committed Aug 2, 2021
1 parent d9e58dc commit a6caf2e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions resources/ahk/POE-ItemInfo.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -6943,6 +6943,7 @@ PreProcessContents(CBContents)

; Remove the line that indicates an item cannot be used due to missing character stats
; Matches "Rarity: ..." + anything until "--------"\r\n
CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1)
If (RegExMatch(CBContents, "s)^(.+?:.+?\r\n)(.+?-{8}\r\n)(.*)", match)) {
; Matches any ".", looking for the 2 sentences saying "You cannot use this item. Its stats will be ignored."
; Could be improved, should suffice though because the alternative would be the item name/type, which can't have any dots.
Expand Down Expand Up @@ -7365,12 +7366,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = ""

Loop, Parse, ItemDataChunk, `n, `r
{
If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 4)
{
return
}

If (A_Index = 2)
If (A_Index == 1)
{
IfNotInString, A_LoopField, Rarity:
{
Expand All @@ -7381,7 +7377,13 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = ""
Continue
}
}
If (A_Index = 3)

If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 3)
{
return
}

If (A_Index = 2)
{
If InStr(A_LoopField, ">>")
{
Expand Down Expand Up @@ -7432,7 +7434,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = ""
}
}
}
If (A_Index = 4)
If (A_Index = 3)
{
ItemBaseName := A_LoopField
}
Expand Down Expand Up @@ -13408,4 +13410,4 @@ ShowHotKeyConflictUI(hkeyObj, hkey, hkeyLabel, oldLabel = "", preventedAssignmen


; ############ (user) macros #############
; macros are being appended here by merge script
; macros are being appended here by merge script

0 comments on commit a6caf2e

Please sign in to comment.