Skip to content

Commit

Permalink
band-aid fix for unique search not including mods/not resetting gui vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Eruyome committed Oct 21, 2016
1 parent ae65549 commit 0b7c204
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions trade_data/TradeMacro.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ TradeMacroMainFunction(openSearchInBrowser = false, isAdvancedPriceCheck = false

if (Item.IsUnique) {
; returns mods with their ranges of the searched item if it is unique and has variable mods
uniqueWithVariableMods :=
uniqueWithVariableMods := FunctionFindUniqueItemIfItHasVariableRolls(Name)

; return if the advanced search was used but the checked item doesn't have variable mods
Expand All @@ -153,7 +154,8 @@ TradeMacroMainFunction(openSearchInBrowser = false, isAdvancedPriceCheck = false
UniqueStats := FunctionGetUniqueStats(Name)
if (uniqueWithVariableMods) {
Gui, SelectModsGui:Destroy


s :=
s := FunctionGetItemsPoeTradeUniqueMods(uniqueWithVariableMods)
Stats.Defense := FunctionParseItemDefenseStats(ItemData.Stats, s, Item.IsUnique)
Stats.Offense := FunctionParseItemOffenseStats(DamageDetails, s, Item.IsUnique)
Expand Down Expand Up @@ -1719,9 +1721,10 @@ AdvancedPriceCheckGui(advItem, Stats, Sockets, Links, UniqueStats = "", ChangedI
;https://autohotkey.com/board/topic/9715-positioning-of-controls-a-cheat-sheet/
Global

TradeGlobals.Set("AdvancedPriceCheckItem", advItem)
FunctionResetGUI()
;TradeGlobals.Set("AdvancedPriceCheckItem", advItem)
ValueRange := TradeOpts.AdvancedSearchModValueRange

Gui, SelectModsGui:Destroy
Gui, SelectModsGui:Add, Text, x10 y12, Percentage to pre-calculate min/max values:
Gui, SelectModsGui:Add, Text, x+5 yp+0 cGreen, % ValueRange "`%"
Expand Down Expand Up @@ -1851,6 +1854,7 @@ AdvancedPriceCheckGui(advItem, Stats, Sockets, Links, UniqueStats = "", ChangedI

TradeAdvancedStatParam%j% := stat.name
j++
TradeAdvancedStatsCount := j
k++
}
}
Expand Down Expand Up @@ -1968,6 +1972,7 @@ AdvancedPriceCheckGui(advItem, Stats, Sockets, Links, UniqueStats = "", ChangedI

TradeAdvancedParam%index% := advItem.mods[A_Index].param
l++
TradeAdvancedModsCount := l
}

m := 1
Expand Down Expand Up @@ -2010,6 +2015,37 @@ AdvancedOpenSearchOnPoeTrade:
TradeMacroMainFunction(true, false, true)
return

FunctionResetGUI(){
Global
Loop {
If (TradeAdvancedModMin%A_Index%) {
TradeAdvancedParam%A_Index% :=
TradeAdvancedSelected%A_Index% :=
TradeAdvancedModMin%A_Index% :=
TradeAdvancedModMax%A_Index% :=
}
Else If (A_Index >= 20){
TradeAdvancedStatCount :=
break
}
}

Loop {
If (TradeAdvancedStatMin%A_Index%) {
TradeAdvancedStatParam%A_Index% :=
TradeAdvancedStatSelected%A_Index% :=
TradeAdvancedStatMin%A_Index% :=
TradeAdvancedStatMax%A_Index% :=
}
Else If (A_Index >= 20){
TradeAdvancedModCount :=
break
}
}
;resetItem := {}
;TradeGlobals.Set("AdvancedPriceCheckItem", resetItem)
}

FunctionHandleGuiSubmit(){
Global

Expand All @@ -2036,7 +2072,7 @@ FunctionHandleGuiSubmit(){

mods.Push(mod)
}
Else {
Else If (A_Index >= 20) {
break
}
}
Expand All @@ -2051,7 +2087,7 @@ FunctionHandleGuiSubmit(){

stats.Push(stat)
}
Else {
Else If (A_Index >= 20) {
break
}
}
Expand Down

0 comments on commit 0b7c204

Please sign in to comment.