@@ -1000,89 +1000,91 @@ private void populateSettingsFromScore(long scoreId)
10001000
10011001 Task . Run ( async ( ) =>
10021002 {
1003- try
1004- {
1005- var scoreInfo = await apiManager . GetJsonFromApi < SoloScoreInfo > ( $ "scores/{ scoreId } ") . ConfigureAwait ( false ) ;
1003+ var scoreInfo = await apiManager . GetJsonFromApi < SoloScoreInfo > ( $ "scores/{ scoreId } ") . ConfigureAwait ( false ) ;
10061004
1007- Schedule ( ( ) =>
1005+ Schedule ( ( ) =>
1006+ {
1007+ if ( scoreInfo . BeatmapID != working . BeatmapInfo . OnlineID )
10081008 {
1009- if ( scoreInfo . BeatmapID != working . BeatmapInfo . OnlineID )
1010- {
1011- beatmapIdTextBox . Text = string . Empty ;
1012- changeBeatmap ( scoreInfo . BeatmapID . ToString ( ) ) ;
1013- }
1009+ beatmapIdTextBox . Text = string . Empty ;
1010+ changeBeatmap ( scoreInfo . BeatmapID . ToString ( ) ) ;
1011+ }
10141012
1015- ruleset . Value = rulesets . GetRuleset ( scoreInfo . RulesetID ) ;
1016- appliedMods . Value = scoreInfo . Mods . Select ( x => x . ToMod ( ruleset . Value . CreateInstance ( ) ) ) . ToList ( ) ;
1013+ ruleset . Value = rulesets . GetRuleset ( scoreInfo . RulesetID ) ;
1014+ appliedMods . Value = scoreInfo . Mods . Select ( x => x . ToMod ( ruleset . Value . CreateInstance ( ) ) ) . ToList ( ) ;
10171015
1018- legacyTotalScore = scoreInfo . LegacyTotalScore ;
1016+ legacyTotalScore = scoreInfo . LegacyTotalScore ;
10191017
1020- fullScoreDataSwitch . Current . Value = true ;
1018+ fullScoreDataSwitch . Current . Value = true ;
10211019
1022- // TODO: this shouldn't be done in 2 lines
1023- comboTextBox . Value . Value = scoreInfo . MaxCombo ;
1024- comboTextBox . Text = scoreInfo . MaxCombo . ToString ( ) ;
1020+ // TODO: this shouldn't be done in 2 lines
1021+ comboTextBox . Value . Value = scoreInfo . MaxCombo ;
1022+ comboTextBox . Text = scoreInfo . MaxCombo . ToString ( ) ;
10251023
1026- resetMisses ( ) ;
1027- updateMissesTextboxes ( ) ;
1024+ resetMisses ( ) ;
1025+ updateMissesTextboxes ( ) ;
10281026
1029- if ( scoreInfo . Statistics . TryGetValue ( HitResult . Miss , out int misses ) )
1030- {
1031- missesTextBox . Value . Value = misses ;
1032- missesTextBox . Text = misses . ToString ( ) ;
1033- }
1027+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . Miss , out int misses ) )
1028+ {
1029+ missesTextBox . Value . Value = misses ;
1030+ missesTextBox . Text = misses . ToString ( ) ;
1031+ }
10341032
1035- if ( scoreInfo . Statistics . TryGetValue ( HitResult . Ok , out int oks ) )
1036- {
1037- goodsTextBox . Value . Value = oks ;
1038- goodsTextBox . Text = oks . ToString ( ) ;
1039- }
1033+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . Ok , out int oks ) )
1034+ {
1035+ goodsTextBox . Value . Value = oks ;
1036+ goodsTextBox . Text = oks . ToString ( ) ;
1037+ }
10401038
1041- if ( scoreInfo . Statistics . TryGetValue ( HitResult . Meh , out int mehs ) )
1042- {
1043- mehsTextBox . Value . Value = mehs ;
1044- mehsTextBox . Text = mehs . ToString ( ) ;
1045- }
1039+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . Meh , out int mehs ) )
1040+ {
1041+ mehsTextBox . Value . Value = mehs ;
1042+ mehsTextBox . Text = mehs . ToString ( ) ;
1043+ }
10461044
1047- if ( ruleset . Value ? . ShortName == "fruits" )
1045+ if ( ruleset . Value ? . ShortName == "fruits" )
1046+ {
1047+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . LargeTickHit , out int largeTickHits ) )
10481048 {
1049- if ( scoreInfo . Statistics . TryGetValue ( HitResult . LargeTickHit , out int largeTickHits ) )
1050- {
1051- goodsTextBox . Value . Value = largeTickHits ;
1052- goodsTextBox . Text = largeTickHits . ToString ( ) ;
1053- }
1054-
1055- if ( scoreInfo . Statistics . TryGetValue ( HitResult . SmallTickHit , out int smallTickHits ) )
1056- {
1057- mehsTextBox . Value . Value = smallTickHits ;
1058- mehsTextBox . Text = smallTickHits . ToString ( ) ;
1059- }
1049+ goodsTextBox . Value . Value = largeTickHits ;
1050+ goodsTextBox . Text = largeTickHits . ToString ( ) ;
10601051 }
10611052
1062- if ( scoreInfo . Statistics . TryGetValue ( HitResult . LargeTickMiss , out int largeTickMisses ) )
1053+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . SmallTickHit , out int smallTickHits ) )
10631054 {
1064- largeTickMissesTextBox . Value . Value = largeTickMisses ;
1065- largeTickMissesTextBox . Text = largeTickMisses . ToString ( ) ;
1055+ mehsTextBox . Value . Value = smallTickHits ;
1056+ mehsTextBox . Text = smallTickHits . ToString ( ) ;
10661057 }
1058+ }
10671059
1068- if ( scoreInfo . Statistics . TryGetValue ( HitResult . SliderTailHit , out int sliderTailHits ) )
1069- {
1070- int sliderTailMisses = scoreInfo . MaximumStatistics [ HitResult . SliderTailHit ] - sliderTailHits ;
1071- sliderTailMissesTextBox . Value . Value = sliderTailMisses ;
1072- sliderTailMissesTextBox . Text = sliderTailMisses . ToString ( ) ;
1073- }
1060+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . LargeTickMiss , out int largeTickMisses ) )
1061+ {
1062+ largeTickMissesTextBox . Value . Value = largeTickMisses ;
1063+ largeTickMissesTextBox . Text = largeTickMisses . ToString ( ) ;
1064+ }
10741065
1075- calculateDifficulty ( ) ;
1076- calculatePerformance ( ) ;
1066+ if ( scoreInfo . Statistics . TryGetValue ( HitResult . SliderTailHit , out int sliderTailHits ) )
1067+ {
1068+ int sliderTailMisses = scoreInfo . MaximumStatistics [ HitResult . SliderTailHit ] - sliderTailHits ;
1069+ sliderTailMissesTextBox . Value . Value = sliderTailMisses ;
1070+ sliderTailMissesTextBox . Text = sliderTailMisses . ToString ( ) ;
1071+ }
10771072
1078- scoreIdPopulateButton . State . Value = ButtonState . Done ;
1079- } ) ;
1080- }
1081- catch ( Exception e )
1073+ calculateDifficulty ( ) ;
1074+ calculatePerformance ( ) ;
1075+
1076+ scoreIdPopulateButton . State . Value = ButtonState . Done ;
1077+ } ) ;
1078+ } ) . ContinueWith ( t =>
1079+ {
1080+ showError ( t . Exception ) ;
1081+ } , TaskContinuationOptions . OnlyOnFaulted ) . ContinueWith ( t =>
1082+ {
1083+ Schedule ( ( ) =>
10821084 {
1083- Schedule ( ( ) => showError ( e ) ) ;
1084- }
1085- } ) ;
1085+ scoreIdPopulateButton . State . Value = ButtonState . Done ;
1086+ } ) ;
1087+ } , TaskContinuationOptions . None ) ;
10861088 }
10871089
10881090 private void resetMisses ( )
0 commit comments