1+ using System . Text . Json ;
12using System . Text . RegularExpressions ;
23using Sidekick . Apis . Poe . Items ;
34using Sidekick . Apis . Poe . Languages ;
@@ -96,13 +97,10 @@ public override void Parse(Item item)
9697
9798 if ( item . Properties . Rarity == Rarity . Unique )
9899 {
99- return Task . FromResult < TradeFilter ? > ( new UniqueRarityFilter
100- {
101- AutoSelectSettingKey = $ "Trade_Filter_{ nameof ( RarityProperty ) } _{ game . GetValueAttribute ( ) } ",
102- } ) ;
100+ return Task . FromResult < TradeFilter ? > ( new UniqueRarityFilter ( ) ) ;
103101 }
104102
105- var filter = new RarityFilter
103+ var filter = new RarityFilter ( item . Game )
106104 {
107105 Text = gameLanguageProvider . Language . DescriptionRarity ,
108106 Value = rarityLabel ,
@@ -114,9 +112,40 @@ public override void Parse(Item item)
114112
115113public class RarityFilter : StringPropertyFilter
116114{
117- public RarityFilter ( )
115+ public RarityFilter ( GameType game )
118116 {
119- DefaultAutoSelect = AutoSelectPreferences . Create ( false ) ;
117+ if ( game == GameType . PathOfExile1 )
118+ {
119+ DefaultAutoSelect = AutoSelectPreferences . Create ( false ) ;
120+ }
121+ else
122+ {
123+ DefaultAutoSelect = new AutoSelectPreferences
124+ {
125+ Mode = AutoSelectMode . Default ,
126+ Rules =
127+ [
128+ new AutoSelectRule ( )
129+ {
130+ Checked = true ,
131+ Conditions =
132+ [
133+ new AutoSelectCondition ( )
134+ {
135+ Type = AutoSelectConditionType . Rarity ,
136+ Comparison = AutoSelectComparisonType . IsContainedIn ,
137+ Value = JsonSerializer . Serialize ( new List < Rarity > ( )
138+ {
139+ Rarity . Normal ,
140+ Rarity . Magic ,
141+ } , AutoSelectPreferences . JsonSerializerOptions ) ,
142+ } ,
143+ ] ,
144+ } ,
145+ ] ,
146+ } ;
147+
148+ }
120149 }
121150
122151 public override void PrepareTradeRequest ( Query query , Item item )
0 commit comments