Skip to content

Commit ec66fbc

Browse files
committed
Add wiki button
Related: #202
1 parent 45f92f7 commit ec66fbc

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

common/src/main/java/org/embeddedt/modernfix/screen/ModernFixConfigScreen.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
package org.embeddedt.modernfix.screen;
22

33
import com.mojang.blaze3d.vertex.PoseStack;
4+
import net.minecraft.Util;
45
import net.minecraft.client.gui.components.Button;
56
import net.minecraft.client.gui.screens.Screen;
6-
import net.minecraft.network.chat.CommonComponents;
7-
import net.minecraft.network.chat.Style;
8-
import net.minecraft.network.chat.TranslatableComponent;
7+
import net.minecraft.network.chat.*;
98
import org.jetbrains.annotations.Nullable;
109

1110
public class ModernFixConfigScreen extends Screen {
1211
private OptionList optionList;
1312
private Screen lastScreen;
1413

1514
public boolean madeChanges = false;
16-
private Button doneButton;
15+
private Button doneButton, wikiButton;
1716
public ModernFixConfigScreen(Screen lastScreen) {
1817
super(new TranslatableComponent("modernfix.config"));
1918
this.lastScreen = lastScreen;
@@ -23,9 +22,13 @@ public ModernFixConfigScreen(Screen lastScreen) {
2322
protected void init() {
2423
this.optionList = new OptionList(this, this.minecraft);
2524
this.children.add(this.optionList);
26-
this.doneButton = new Button(this.width / 2 - 100, this.height - 29, 200, 20, CommonComponents.GUI_DONE, (arg) -> {
25+
this.wikiButton = new Button(this.width / 2 - 155, this.height - 29, 150, 20, new TranslatableComponent("modernfix.config.wiki"), (arg) -> {
26+
Util.getPlatform().openUri("https://github.com/embeddedt/ModernFix/wiki/Summary-of-Patches");
27+
});
28+
this.doneButton = new Button(this.width / 2 - 155 + 160, this.height - 29, 150, 20, CommonComponents.GUI_DONE, (arg) -> {
2729
this.onClose();
2830
});
31+
this.addButton(this.wikiButton);
2932
this.addButton(this.doneButton);
3033
}
3134

common/src/main/resources/assets/modernfix/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"modernfix.perf_mod_warning": "It is recommended to install the mods, but the warning(s) can be disabled in the ModernFix config.",
99
"modernfix.config": "ModernFix mixin config",
1010
"modernfix.config.done_restart": "Done (restart required)",
11+
"modernfix.config.wiki": "Open wiki",
1112
"modernfix.message.reload_config": "A mod config file change was detected. To prevent loading files that aren't done saving, reloading must be triggered by running /mfrc.",
1213
"modernfix.option.on": "on",
1314
"modernfix.option.off": "off",

0 commit comments

Comments
 (0)