@@ -19,7 +19,7 @@ use bathbot_util::{
1919 numbers:: round,
2020} ;
2121use eyre:: { Report , Result } ;
22- use rosu_pp:: model:: beatmap:: BeatmapAttributes ;
22+ use rosu_pp:: model:: beatmap:: { AdjustedBeatmapAttributes , BeatmapAttributes } ;
2323use rosu_render:: { ClientError as OrdrError , client:: error:: ApiError as OrdrApiError } ;
2424use rosu_v2:: {
2525 error:: OsuError ,
@@ -615,11 +615,13 @@ fn apply_settings(
615615 writer. push ( '*' ) ;
616616 }
617617
618+ let adjusted_map_attrs = map_attrs. apply_clock_rate ( ) ;
619+
618620 let fmt = match curr. inner {
619- Value :: Ar => MapAttribute :: AR . fmt ( data, & map_attrs ) ,
620- Value :: Cs => MapAttribute :: CS . fmt ( data, & map_attrs ) ,
621- Value :: Hp => MapAttribute :: HP . fmt ( data, & map_attrs ) ,
622- Value :: Od => MapAttribute :: OD . fmt ( data, & map_attrs ) ,
621+ Value :: Ar => MapAttribute :: AR . fmt ( data, & adjusted_map_attrs ) ,
622+ Value :: Cs => MapAttribute :: CS . fmt ( data, & adjusted_map_attrs ) ,
623+ Value :: Hp => MapAttribute :: HP . fmt ( data, & adjusted_map_attrs ) ,
624+ Value :: Od => MapAttribute :: OD . fmt ( data, & adjusted_map_attrs ) ,
623625 _ => unreachable ! ( ) ,
624626 } ;
625627
@@ -642,11 +644,13 @@ fn apply_settings(
642644 writer. push ( '*' ) ;
643645 }
644646
647+ let adjusted_map_attrs = map_attrs. apply_clock_rate ( ) ;
648+
645649 let fmt = match curr. inner {
646- Value :: Ar => MapAttribute :: AR . fmt ( data, & map_attrs ) ,
647- Value :: Cs => MapAttribute :: CS . fmt ( data, & map_attrs ) ,
648- Value :: Hp => MapAttribute :: HP . fmt ( data, & map_attrs ) ,
649- Value :: Od => MapAttribute :: OD . fmt ( data, & map_attrs ) ,
650+ Value :: Ar => MapAttribute :: AR . fmt ( data, & adjusted_map_attrs ) ,
651+ Value :: Cs => MapAttribute :: CS . fmt ( data, & adjusted_map_attrs ) ,
652+ Value :: Hp => MapAttribute :: HP . fmt ( data, & adjusted_map_attrs ) ,
653+ Value :: Od => MapAttribute :: OD . fmt ( data, & adjusted_map_attrs ) ,
650654 _ => unreachable ! ( ) ,
651655 } ;
652656
@@ -690,11 +694,13 @@ fn apply_settings(
690694 writer. push ( '*' ) ;
691695 }
692696
697+ let adjusted_map_attrs = map_attrs. apply_clock_rate ( ) ;
698+
693699 let fmt = match curr. inner {
694- Value :: Ar => MapAttribute :: AR . fmt ( data, & map_attrs ) ,
695- Value :: Cs => MapAttribute :: CS . fmt ( data, & map_attrs ) ,
696- Value :: Hp => MapAttribute :: HP . fmt ( data, & map_attrs ) ,
697- Value :: Od => MapAttribute :: OD . fmt ( data, & map_attrs ) ,
700+ Value :: Ar => MapAttribute :: AR . fmt ( data, & adjusted_map_attrs ) ,
701+ Value :: Cs => MapAttribute :: CS . fmt ( data, & adjusted_map_attrs ) ,
702+ Value :: Hp => MapAttribute :: HP . fmt ( data, & adjusted_map_attrs ) ,
703+ Value :: Od => MapAttribute :: OD . fmt ( data, & adjusted_map_attrs ) ,
698704 _ => unreachable ! ( ) ,
699705 } ;
700706
@@ -977,7 +983,7 @@ fn write_value(
977983 let _ = write ! ( writer, "{}★" , round( data. stars) ) ;
978984 }
979985 Value :: Length => {
980- let clock_rate = map_attrs. clock_rate as f32 ;
986+ let clock_rate = map_attrs. clock_rate ( ) as f32 ;
981987 let seconds_drain = ( data. map . seconds_drain ( ) as f32 / clock_rate) as u32 ;
982988
983989 if value. y < SettingValue :: FOOTER_Y {
@@ -995,11 +1001,13 @@ fn write_value(
9951001 writer. push ( '`' ) ;
9961002 }
9971003
1004+ let adjusted_map_attrs = map_attrs. apply_clock_rate ( ) ;
1005+
9981006 let fmt = match & value. inner {
999- Value :: Ar => MapAttribute :: AR . fmt ( data, map_attrs ) ,
1000- Value :: Cs => MapAttribute :: CS . fmt ( data, map_attrs ) ,
1001- Value :: Hp => MapAttribute :: HP . fmt ( data, map_attrs ) ,
1002- Value :: Od => MapAttribute :: OD . fmt ( data, map_attrs ) ,
1007+ Value :: Ar => MapAttribute :: AR . fmt ( data, & adjusted_map_attrs ) ,
1008+ Value :: Cs => MapAttribute :: CS . fmt ( data, & adjusted_map_attrs ) ,
1009+ Value :: Hp => MapAttribute :: HP . fmt ( data, & adjusted_map_attrs ) ,
1010+ Value :: Od => MapAttribute :: OD . fmt ( data, & adjusted_map_attrs ) ,
10031011 _ => unreachable ! ( ) ,
10041012 } ;
10051013
@@ -1010,7 +1018,7 @@ fn write_value(
10101018 }
10111019 }
10121020 Value :: Bpm ( emote_text) => {
1013- let clock_rate = map_attrs. clock_rate as f32 ;
1021+ let clock_rate = map_attrs. clock_rate ( ) as f32 ;
10141022 let bpm = round ( data. map . bpm ( ) * clock_rate) ;
10151023
10161024 if value. y < SettingValue :: FOOTER_Y {
@@ -1153,7 +1161,14 @@ impl Display for MapAttributeFormatter<'_> {
11531161 } )
11541162 . collect ( ) ;
11551163
1156- let map_attrs = self . data . map . attributes ( ) . mods ( alt_mods) . build ( ) ;
1164+ let map_attrs = self
1165+ . data
1166+ . map
1167+ . attributes ( )
1168+ . mods ( alt_mods)
1169+ . build ( )
1170+ . apply_clock_rate ( ) ;
1171+
11571172 let alt_value = self . map_attr . get_value ( & map_attrs) ;
11581173
11591174 let symbol = match self . value . partial_cmp ( & alt_value) {
@@ -1178,16 +1193,16 @@ impl MapAttribute {
11781193 fn fmt < ' a > (
11791194 self ,
11801195 data : & ' a ScoreEmbedData ,
1181- attrs : & BeatmapAttributes ,
1196+ attrs : & AdjustedBeatmapAttributes ,
11821197 ) -> MapAttributeFormatter < ' a > {
11831198 MapAttributeFormatter :: new ( data, self , self . get_value ( attrs) )
11841199 }
11851200
1186- fn get_value ( self , attrs : & BeatmapAttributes ) -> f64 {
1201+ fn get_value ( self , attrs : & AdjustedBeatmapAttributes ) -> f64 {
11871202 match self {
11881203 MapAttribute :: AR => attrs. ar ,
1189- MapAttribute :: CS => attrs. cs ,
1190- MapAttribute :: HP => attrs. hp ,
1204+ MapAttribute :: CS => f64 :: from ( attrs. cs ) ,
1205+ MapAttribute :: HP => f64 :: from ( attrs. hp ) ,
11911206 MapAttribute :: OD => attrs. od ,
11921207 }
11931208 }
0 commit comments