Made button functional added icon + proper functionality

This commit is contained in:
Runakai1 committed 2022-08-13 15:41:55 +02:00
1 parent 2fc407ce61
commit b3f3ecfe2e
5 files changed
+22 -13

No files matched your search

@@ -34,8 +34,8 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
private GuiImgButton substitutionsEnabledBtn;
private GuiImgButton substitutionsDisabledBtn;
private GuiImgButton fluidPrioritizedEnabledBtn;
private GuiImgButton fluidPrioritizedDisabledBtn;
private GuiFCImgButton fluidPrioritizedEnabledBtn;
private GuiFCImgButton fluidPrioritizedDisabledBtn;
private GuiImgButton encodeBtn;
private GuiImgButton invertBtn;
private GuiImgButton clearBtn;
@@ -104,15 +104,13 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
this.substitutionsDisabledBtn.setHalfSize( true );
this.buttonList.add( this.substitutionsDisabledBtn );
this.fluidPrioritizedEnabledBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, Settings.ACTIONS, FluidPrioritization.ENABLED );
this.fluidPrioritizedEnabledBtn = new GuiFCImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 143, "FORCE_PRIO", "DO_PRIO" );
this.fluidPrioritizedEnabledBtn.setHalfSize( true );
this.buttonList.add( this.fluidPrioritizedEnabledBtn );
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("ENABLED IMMER"));
this.fluidPrioritizedDisabledBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, Settings.ACTIONS, FluidPrioritization.DISABLED );
this.fluidPrioritizedDisabledBtn = new GuiFCImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 143, "NOT_PRIO", "DONT_PRIO" );
this.fluidPrioritizedDisabledBtn.setHalfSize( true );
this.buttonList.add( this.fluidPrioritizedDisabledBtn );
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("DISABLED IMMER"));
invertBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 153, Settings.ACTIONS, container.inverted ? PatternSlotConfig.C_4_16 : PatternSlotConfig.C_16_4);
invertBtn.setHalfSize( true );
@@ -162,13 +160,11 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
{
this.fluidPrioritizedEnabledBtn.visible = false;
this.fluidPrioritizedDisabledBtn.visible = true;
// MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("ENABLED"));
}
else
{
this.fluidPrioritizedEnabledBtn.visible = true;
this.fluidPrioritizedDisabledBtn.visible = false;
//MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("DISABLED"));
}
if ( this.container.combine )
@@ -229,8 +225,8 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
substitutionsEnabledBtn.xPosition = this.guiLeft + 97 + offset;
substitutionsDisabledBtn.xPosition = this.guiLeft + 97 + offset;
fluidPrioritizedEnabledBtn.xPosition = this.guiLeft + 87 + offset;
fluidPrioritizedDisabledBtn.xPosition = this.guiLeft + 87 + offset;
fluidPrioritizedEnabledBtn.xPosition = this.guiLeft + 97 + offset;
fluidPrioritizedDisabledBtn.xPosition = this.guiLeft + 97 + offset;
doubleBtn.xPosition = this.guiLeft + 97 + offset;
clearBtn.xPosition = this.guiLeft + 87 + offset;
invertBtn.xPosition = this.guiLeft + 87 + offset;
@@ -37,6 +37,8 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
appearances = new HashMap<>();
this.registerApp( 0, "NOT_COMBINE", "DONT_COMBINE", "not_combine" );
this.registerApp( 1, "FORCE_COMBINE", "DO_COMBINE", "combine" );
this.registerApp( 2, "FORCE_PRIO", "DO_PRIO", "prio" );
this.registerApp( 3, "NOT_PRIO", "DONT_PRIO", "not_prio" );
}
}
@@ -41,16 +41,22 @@ public final class FluidRecipe {
IRecipeExtractor extractor = IdentifierMap.get(tRecipe.getOverlayIdentifier());
if (extractor == null) return new ArrayList<>();
List<PositionedStack> tmp = new ArrayList<>(tRecipe.getIngredientStacks(index));
List<PositionedStack> fluidClone = new ArrayList<>();
if (priority) {
for (int i = 0; i < tmp.size(); i++) {
if(tmp.get(i).item.getItem() instanceof GT_FluidDisplayItem) {
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(String.valueOf(tmp.size())));
PositionedStack Stack = tmp.get(i);
tmp.remove(Stack);
tmp.add(0, Stack);
fluidClone.add(Stack);
}
}
for (int i = 0; i < fluidClone.size(); i++) {
tmp.remove(fluidClone.get(i));
}
Collections.reverse(fluidClone);
for (int i = 0; i < fluidClone.size(); i++) {
tmp.add(0, fluidClone.get(i));
}
}
return extractor.getInputIngredients(tmp, recipe, index);
}