@@ -8,6 +8,8 @@ import com.reco1l.andengine.container.Orientation
88import com.reco1l.andengine.container.UILinearContainer
99import com.reco1l.andengine.container.UIScrollableContainer
1010import com.reco1l.andengine.text.UIText
11+ import com.reco1l.andengine.theme.FontSize
12+ import com.reco1l.andengine.theme.pct
1113import com.reco1l.andengine.ui.UIModal
1214import com.reco1l.framework.Color4
1315import com.reco1l.framework.math.Vec4
@@ -25,7 +27,6 @@ import com.rian.osu.utils.CircleSizeCalculator
2527import com.rian.osu.utils.ModUtils
2628import kotlin.math.roundToInt
2729import ru.nsu.ccfit.zuev.osu.GlobalManager
28- import ru.nsu.ccfit.zuev.osu.ResourceManager
2930
3031/* *
3132 * A [UIScene] containing a [UIModal] that shows the attributes of a beatmap, adjusted for the given mods.
@@ -134,15 +135,15 @@ open class BeatmapAttributeDisplay(difficulty: BeatmapDifficulty, mods: Iterable
134135 spacing = 5f
135136
136137 + UIText ().apply {
137- font = ResourceManager .getInstance().getFont( " font " )
138+
138139 text = name
139- applyTheme = { color = it.accentColor }
140+ style = { color = it.accentColor }
140141 }
141142
142143 + UIText ().apply {
143- font = ResourceManager .getInstance().getFont( " smallFont " )
144+ fontSize = FontSize . SM
144145 text = description
145- applyTheme = { color = it.accentColor }
146+ style = { color = it.accentColor }
146147 }
147148 }
148149
@@ -151,9 +152,9 @@ open class BeatmapAttributeDisplay(difficulty: BeatmapDifficulty, mods: Iterable
151152
152153 metrics.fastForEach { metric ->
153154 + UIText ().apply {
154- font = ResourceManager .getInstance().getFont( " smallFont " )
155+ fontSize = FontSize . SM
155156 text = " ${metric.name} : ${metric.value} "
156- applyTheme = { color = metric.color ? : (it.accentColor * 0.8f ) }
157+ style = { color = metric.color ? : (it.accentColor * 0.8f ) }
157158 }
158159 }
159160 }
@@ -164,17 +165,17 @@ open class BeatmapAttributeDisplay(difficulty: BeatmapDifficulty, mods: Iterable
164165
165166 if (originalValue != adjustedValue) {
166167 + UIText ().apply {
167- font = ResourceManager .getInstance().getFont( " smallFont " )
168+ fontSize = FontSize . SM
168169 text = " This value is being adjusted by mods (${originalValue.roundBy(2 )} ➜ ${adjustedValue.roundBy(2 )} )."
169- applyTheme = { color = it.accentColor * 0.6f }
170+ style = { color = it.accentColor * 0.6f }
170171 }
171172 }
172173
173174 additionalInfo.fastForEach { info ->
174175 + UIText ().apply {
175- font = ResourceManager .getInstance().getFont( " smallFont " )
176+ fontSize = FontSize . SM
176177 text = info
177- applyTheme = { color = it.accentColor * 0.6f }
178+ style = { color = it.accentColor * 0.6f }
178179 }
179180 }
180181 }
@@ -185,9 +186,8 @@ open class BeatmapAttributeDisplay(difficulty: BeatmapDifficulty, mods: Iterable
185186 private inner class BeatmapAttributeModal : UIModal (
186187 UIScrollableContainer ().apply {
187188 scrollAxes = Axes .Y
188- relativeSizeAxes = Axes .Both
189- width = 0.8f
190- height = 0.75f
189+ width = 0.8f .pct
190+ height = 0.75f .pct
191191 anchor = Anchor .Center
192192 origin = Anchor .Center
193193 clipToBounds = true
0 commit comments