Skip to content

Commit

Permalink
Improve Sawbench Textures
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Mar 7, 2024
1 parent 511b222 commit 5c402b6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static class ModIntegration {
@Config.RequiresMcRestart
public boolean enableAdvancedRocketryIntegration = true;

@Config.Comment({"Whether to enable ArchitectureCraft Integration, which adds new slope variants.",
@Config.Comment({"Whether to enable ArchitectureCraft Integration, which adds new slope variants, and improves the GUI of the Sawbench.",
"[default: true]"})
@Config.LangKey("config.nomilabs.mod_integration.architecture_craft")
@Config.RequiresMcRestart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
*/
@Mixin(value = GuiSawbench.class, remap = false)
public class GuiSawbenchMixin extends BaseGui.Screen {
@Unique
private static final String ORIGINAL_GUI_PATH = "gui/gui_sawbench.png";

@Unique
private static final String NEW_GUI_PATH = "gui/labs_gui_sawbench.png";

@Unique
private static final String ORIGINAL_GUI_BG_PATH = "gui/shapemenu_bg.png";

@Unique
private static final String NEW_GUI_BG_PATH = "gui/labs_shapemenu_bg.png";

@Unique
private static final String ORIGINAL_GUI_ITEMS_PATH = "gui/shapemenu_items.png";

Expand All @@ -26,8 +38,20 @@ public GuiSawbenchMixin(Container container, int width, int height) {
super(container, width, height);
}

@Redirect(method = "drawShapeMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;bindTexture(Ljava/lang/String;II)V"), remap = false)
@Redirect(method = "drawBackgroundLayer", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;bindTexture(Ljava/lang/String;II)V"))
public void bindNewGuiTexture(GuiSawbench instance, String texture, int u, int v) {
if (texture.equals(ORIGINAL_GUI_PATH)) {
instance.bindTexture(NEW_GUI_PATH, u, v);
return;
}
instance.bindTexture(texture, u, v);
}

@Redirect(method = "drawShapeMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;bindTexture(Ljava/lang/String;II)V"))
public void bindNewGuiShapeTexture(GuiSawbench instance, String texture, int u, int v) {
if (texture.equals(ORIGINAL_GUI_BG_PATH)) {
instance.bindTexture(NEW_GUI_BG_PATH, u, v);
}
if (texture.equals(ORIGINAL_GUI_ITEMS_PATH)) {
instance.bindTexture(NEW_GUI_ITEMS_PATH, u, v);
return;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5c402b6

Please sign in to comment.