Skip to content

Commit b8d8233

Browse files
authored
return text instead of string
1 parent aa019d1 commit b8d8233

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/main/java/fast_reset/client/mixin/OptionsScreenMixin.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,27 @@ protected OptionsScreenMixin(Text title) {
1818
super(title);
1919
}
2020

21-
private static String getButtonText() {
21+
private static Text getButtonText() {
22+
String text;
2223
switch (FastReset.buttonLocation) {
2324
case 0:
24-
return "bottom right";
25+
text = "bottom right";
26+
break;
2527
case 1:
26-
return "center";
28+
text = "center";
29+
break;
2730
case 2:
2831
default:
29-
return "replace s&q";
32+
text = "replace s&q";
3033
}
34+
return new LiteralText(text);
3135
}
3236

3337
@Inject(method = "init", at=@At("TAIL"))
3438
public void initInject(CallbackInfo ci) {
35-
this.addButton(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 142 - 4, 150, 20, new LiteralText(getButtonText()), (buttonWidget) -> {
39+
this.addButton(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 142 - 4, 150, 20, getButtonText(), (buttonWidget) -> {
3640
FastReset.updateButtonLocation();
37-
buttonWidget.setMessage(new LiteralText(getButtonText()));
41+
buttonWidget.setMessage(getButtonText());
3842
}));
3943
}
4044
}

0 commit comments

Comments
 (0)