@@ -14,7 +14,9 @@ public partial class StatsTab : ContentPage
1414 public int maxEV = 252 ;
1515 public int maxAV = 200 ;
1616 public int maxGV = 10 ;
17- public StatsTab ( )
17+ public List < ComboItem > types ;
18+
19+ public StatsTab ( )
1820 {
1921 InitializeComponent ( ) ;
2022 foreach ( var ty in Enum . GetNames ( typeof ( MoveType ) ) )
@@ -23,7 +25,10 @@ public StatsTab()
2325 foreach ( var typ in Enum . GetNames ( typeof ( MoveType ) ) )
2426 MainTeratypepicker . Items . Add ( typ ) ;
2527 MainTeratypepicker . Items . Add ( "Stellar" ) ;
26- HiddenPowerPicker . ItemsSource = Enum . GetValues ( typeof ( MoveType ) ) ;
28+ var hptypes = GameInfo . Strings . types . AsSpan ( 1 , HiddenPower . TypeCount ) ;
29+ types = Util . GetCBList ( hptypes ) ;
30+ HiddenPowerPicker . ItemsSource = types ;
31+ HiddenPowerPicker . ItemDisplayBinding = new Binding ( "Text" ) ;
2732 ICommand refreshCommand = new Command ( async ( ) =>
2833 {
2934 await applystatsinfo ( pk ) ;
@@ -170,7 +175,7 @@ public async Task applystatsinfo(PKM pkm)
170175 {
171176 HiddenPowerPicker . IsVisible = true ;
172177 HiddenPLabel . IsVisible = true ;
173- HiddenPowerPicker . SelectedItem = ( MoveType ) pkm . HPType ;
178+ HiddenPowerPicker . SelectedItem = types . Find ( z => z . Value == pkm . HPType ) ;
174179 }
175180 SkipEvent = false ;
176181 }
@@ -676,8 +681,10 @@ private void applyHiddenPower(object sender, EventArgs e)
676681 {
677682 if ( ! SkipEvent )
678683 {
679- pk . HPType = HiddenPowerPicker . SelectedIndex ;
680- HiddenPower . SetIVs ( HiddenPowerPicker . SelectedIndex , pk . IVs , pk . Context ) ;
684+ var hptype = ( ( ComboItem ) HiddenPowerPicker . SelectedItem ) . Value ;
685+ pk . HPType = hptype ;
686+ HiddenPower . SetIVs ( hptype , pk . IVs , pk . Context ) ;
687+ applystatsinfo ( pk ) ;
681688 }
682689 }
683690}
0 commit comments