Skip to content

Commit eea4ef6

Browse files
committed
use fallback theme
1 parent 827a130 commit eea4ef6

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/main/java/gregtech/mixins/mui2/StyledTextMixin.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package gregtech.mixins.mui2;
22

3+
import com.cleanroommc.modularui.api.ITheme;
34
import com.cleanroommc.modularui.api.drawable.IKey;
45
import com.cleanroommc.modularui.drawable.text.AnimatedText;
56
import com.cleanroommc.modularui.drawable.text.StyledText;
@@ -35,12 +36,15 @@ public class StyledTextMixin {
3536
*/
3637
@Overwrite
3738
public TextWidget asWidget() {
38-
int color = this.color == null ? 0 : this.color;
39-
boolean shadow = this.shadow == null || this.shadow;
40-
return new TextWidget(this.key)
39+
var text = new TextWidget(this.key)
4140
.alignment(this.alignment)
42-
.color(color)
43-
.scale(this.scale)
41+
.scale(this.scale);
42+
43+
var theme = ITheme.getDefault().getTextFieldTheme();
44+
int color = this.color == null ? theme.getColor() : this.color;
45+
boolean shadow = this.shadow == null ? theme.getTextShadow() : this.shadow;
46+
47+
return text.color(color)
4448
.shadow(shadow);
4549
}
4650

@@ -50,12 +54,15 @@ public TextWidget asWidget() {
5054
*/
5155
@Overwrite
5256
public AnimatedText withAnimation() {
53-
int color = this.color == null ? 0 : this.color;
54-
boolean shadow = this.shadow == null || this.shadow;
55-
return new AnimatedText(this.key)
57+
var text = new AnimatedText(this.key)
5658
.alignment(this.alignment)
57-
.color(color)
58-
.scale(this.scale)
59+
.scale(this.scale);
60+
61+
var theme = ITheme.getDefault().getTextFieldTheme();
62+
int color = this.color == null ? theme.getColor() : this.color;
63+
boolean shadow = this.shadow == null ? theme.getTextShadow() : this.shadow;
64+
65+
return text.color(color)
5966
.shadow(shadow);
6067
}
6168
}

0 commit comments

Comments
 (0)