Skip to content

Commit

Permalink
[Feature] Add wiki link to the function info screens for all post-pro…
Browse files Browse the repository at this point in the history
…cessing related functions.
  • Loading branch information
AlignedCookie88 committed Nov 18, 2024
1 parent f674922 commit 1770a1c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ default String getDescription() {
default boolean hidden() {
return false;
}

default String getWikiLink() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ public void execute(Object[] providedArguments) {
public String getDescription() {
return "Removes the post-processing effect.";
}

@Override
public String getWikiLink() {
return "https://github.com/AlignedCookie88/FireClient/wiki/Post%E2%80%90Processing-Shaders";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ public void execute(Object[] providedArguments) {
public String getDescription() {
return "Sets the post-processing effect.";
}

@Override
public String getWikiLink() {
return "https://github.com/AlignedCookie88/FireClient/wiki/Post%E2%80%90Processing-Shaders";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public void execute(Object[] providedArguments) {
public String getDescription() {
return "Sets a post-processing uniform.";
}

@Override
public String getWikiLink() {
return "https://github.com/AlignedCookie88/FireClient/wiki/Post%E2%80%90Processing-Shaders";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -57,6 +58,13 @@ protected void init() {
Utility.giveItem(FireFunctionSerialiser.serialiseFunction(function));
MinecraftClient.getInstance().setScreen(null);
}).dimensions(x1+6+((pane_width-8)/2), y2-24, ((pane_width-8)/2)-2, 20).build());

String wiki = function.getWikiLink();
if (wiki != null) {
addDrawableChild(ButtonWidget.builder(Text.literal("Open Wiki Article"), button -> {
ConfirmLinkScreen.open(this, wiki, true);
}).dimensions(x1, y2+10, pane_width, 20).build());
}
}

@Override
Expand Down

0 comments on commit 1770a1c

Please sign in to comment.