Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
updated to new gui refactor, still are a couple things to sl[lit out …
Browse files Browse the repository at this point in the history
…into their own textures
  • Loading branch information
Trinsdar committed Aug 6, 2023
1 parent 228454c commit ed8e413
Show file tree
Hide file tree
Showing 59 changed files with 99 additions and 75 deletions.
2 changes: 1 addition & 1 deletion AntimatterAPI
Submodule AntimatterAPI updated 39 files
+1 −0 common/src/main/java/muramasa/antimatter/Data.java
+3 −0 common/src/main/java/muramasa/antimatter/capability/IGuiHandler.java
+1 −1 common/src/main/java/muramasa/antimatter/capability/machine/MachineRecipeHandler.java
+24 −13 common/src/main/java/muramasa/antimatter/gui/GuiData.java
+122 −0 common/src/main/java/muramasa/antimatter/gui/MachineWidgetData.java
+14 −0 common/src/main/java/muramasa/antimatter/gui/SlotData.java
+14 −7 common/src/main/java/muramasa/antimatter/gui/SlotType.java
+15 −0 common/src/main/java/muramasa/antimatter/gui/Widget.java
+3 −3 common/src/main/java/muramasa/antimatter/gui/screen/AntimatterContainerScreen.java
+25 −0 common/src/main/java/muramasa/antimatter/gui/slot/ISlotProvider.java
+1 −1 common/src/main/java/muramasa/antimatter/gui/widget/BackgroundWidget.java
+46 −40 common/src/main/java/muramasa/antimatter/gui/widget/IOWidget.java
+12 −1 common/src/main/java/muramasa/antimatter/gui/widget/MachineStateWidget.java
+18 −15 common/src/main/java/muramasa/antimatter/gui/widget/ProgressWidget.java
+31 −0 common/src/main/java/muramasa/antimatter/gui/widget/SlotWidget.java
+27 −0 common/src/main/java/muramasa/antimatter/gui/widget/TextureWidget.java
+14 −5 common/src/main/java/muramasa/antimatter/integration/jei/category/RecipeMapCategory.java
+20 −14 common/src/main/java/muramasa/antimatter/integration/rei/category/RecipeMapCategory.java
+10 −8 common/src/main/java/muramasa/antimatter/machine/types/BasicMachine.java
+1 −1 common/src/main/java/muramasa/antimatter/machine/types/BasicMultiMachine.java
+2 −2 common/src/main/java/muramasa/antimatter/machine/types/Machine.java
+10 −4 common/src/main/java/muramasa/antimatter/tile/TileEntityMachine.java
+3 −3 common/src/main/java/muramasa/antimatter/tile/multi/TileEntityBasicMultiMachine.java
+6 −0 common/src/main/java/muramasa/antimatter/tile/pipe/TileEntityPipe.java
+ common/src/main/resources/assets/antimatter/textures/gui/background/creative_generator.png
+ common/src/main/resources/assets/antimatter/textures/gui/background/machine_basic.png
+ common/src/main/resources/assets/antimatter/textures/gui/button/io.png
+ common/src/main/resources/assets/antimatter/textures/gui/button/machine_state.png
+ common/src/main/resources/assets/antimatter/textures/gui/progress_bars/default.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/battery.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/cell.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/cell_in.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/cell_out.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/energy.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/fluid.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/fluid_in.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/fluid_out.png
+ common/src/main/resources/assets/antimatter/textures/gui/slots/item.png
+6 −6 forge/src/main/java/muramasa/antimatter/mixin/forge/TileEntityMachineMixin.java
124 changes: 58 additions & 66 deletions common/src/main/java/muramasa/gregtech/data/Guis.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import javax.annotation.Nullable;

public class FusionButtonWidget extends Widget {
ResourceLocation middle = new ResourceLocation(GTIRef.ID, "textures/gui/machine/fusion_computer_middle_overlay.png");
ResourceLocation top_bottom = new ResourceLocation(GTIRef.ID, "textures/gui/machine/fusion_computer_top_bottom_overlay.png");
ResourceLocation middle = new ResourceLocation(GTIRef.ID, "textures/gui/background/fusion_computer_middle_overlay.png");
ResourceLocation top_bottom = new ResourceLocation(GTIRef.ID, "textures/gui/background/fusion_computer_top_bottom_overlay.png");

TileEntityFusionReactor.Display display = TileEntityFusionReactor.Display.REGULAR;

Expand Down
44 changes: 38 additions & 6 deletions common/src/main/java/muramasa/gregtech/machine/SteamMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
import com.google.common.collect.ImmutableMap;
import muramasa.antimatter.Data;
import muramasa.antimatter.gui.BarDir;
import muramasa.antimatter.gui.SlotData;
import muramasa.antimatter.gui.SlotType;
import muramasa.antimatter.gui.screen.AntimatterContainerScreen;
import muramasa.antimatter.gui.slot.ISlotProvider;
import muramasa.antimatter.gui.widget.*;
import muramasa.antimatter.machine.Tier;
import muramasa.antimatter.machine.types.Machine;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.tile.single.TileEntitySteamMachine;
import net.minecraft.resources.ResourceLocation;

import java.util.List;

import static muramasa.antimatter.machine.MachineFlag.*;
import static muramasa.antimatter.machine.Tier.*;
Expand All @@ -20,19 +27,44 @@ public SteamMachine(String domain, String id) {
addFlags(BASIC, STEAM, COVERABLE);
setGUI(Data.BASIC_MENU_HANDLER);
setClientTick();
setGuiTiers(ImmutableMap.<Tier, Tier>builder().put(BRONZE, BRONZE).put(STEEL, STEEL));
getGui().getMachineData().setMachineStateLocation(BRONZE, "bronze_machine_state").setMachineStateLocation(STEEL, "steel_machine_state");
String suffix = id.contains("furnace") || id.contains("smelter") || id.contains("boiler") ? "default" : id.replace("steam_", "");
getGui().getMachineData().setProgressLocation(BRONZE, "bronze_" + suffix).setProgressLocation(STEEL, "steel_" + suffix);
String bSuffix = id.contains("macerator") || id.contains("forge_hammer") ? id.replace("steam", "") : "";
if (id.contains("boiler")){
getGui().setBackgroundTexture(BRONZE, id + "_bronze").setBackgroundTexture(STEEL, id + "_steel");
} else {
getGui().setBackgroundTexture(BRONZE, "machine_bronze" + bSuffix).setBackgroundTexture(STEEL, "machine_steel" + bSuffix);
}
}

protected void setupGui() {
super.setupGui();
addGuiCallback(t -> {
t.addWidget(WidgetSupplier.build((a, b) -> TextWidget.build(((AntimatterContainerScreen<?>) b).getTitle().getString(), 4210752).build(a, b)).setPos(9, 5).clientSide());
if (has(RECIPE)) {
t.addWidget(ProgressWidget.build(BarDir.LEFT, true))
.addWidget(MachineStateWidget.build().setPos(84, 46).setWH(8, 8));
if (has(RECIPE) && !getId().contains("boiler")) {
t.addWidget(ProgressWidget.build())
.addWidget(MachineStateWidget.build());
}
// if ((has(ITEM) || has(FLUID)))
// t.addWidget(IOWidget.build(9, 63, 16, 16).onlyIf(u -> u.handler.getClass() == TileEntityMachine.class));
});
}

@Override
public Machine<SteamMachine> add(ISlotProvider<?> provider) {
List<SlotData<?>> list = provider.getAnySlots();
for (SlotData<?> slot : list) {
String suffix = slot.getType() == SlotType.FL_IN ? "fluid" : "item";
add(BRONZE, slot.getType(), slot.getX(), slot.getY(), new ResourceLocation(GTIRef.ID, "bronze_"+suffix));
add(STEEL, slot.getType(), slot.getX(), slot.getY(), new ResourceLocation(GTIRef.ID, "steel_"+suffix));
}
return this;
}

@Override
public Machine<SteamMachine> add(SlotType<?> type, int x, int y) {
String suffix = type == SlotType.FL_IN ? "fluid" : "item";
add(BRONZE, type, x, y, new ResourceLocation(GTIRef.ID, "bronze_"+suffix));
add(STEEL, type, x, y, new ResourceLocation(GTIRef.ID, "steel_"+suffix));
return this;
}
}
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.

0 comments on commit ed8e413

Please sign in to comment.