Skip to content

Commit 4a8e1c3

Browse files
committed
initial work to compile
1 parent 52f68e0 commit 4a8e1c3

22 files changed

+87
-87
lines changed

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
dependencies {
4141
// Published dependencies
4242
api("codechicken:codechickenlib:3.2.3.358")
43-
api("com.cleanroommc:modularui:2.5.0-rc1") { transitive = false }
43+
api("com.cleanroommc:modularui:2.5.0-rc2") { transitive = false }
4444
api("com.cleanroommc:groovyscript:1.1.1") { transitive = false }
4545
api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700")
4646
api("appeng:ae2-uel:v0.56.4") { transitive = false }

src/main/java/gregtech/api/cover/CoverWithUI.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
3030
import com.cleanroommc.modularui.widget.ParentWidget;
3131
import com.cleanroommc.modularui.widgets.ToggleButton;
32-
import com.cleanroommc.modularui.widgets.layout.Row;
32+
import com.cleanroommc.modularui.widgets.layout.Flow;
3333
import org.jetbrains.annotations.ApiStatus;
3434

3535
public interface CoverWithUI extends Cover, IUIHolder, IGuiHolder<SidedPosGuiData> {
@@ -98,12 +98,15 @@ default void markAsDirty() {
9898
/**
9999
* Create the Title bar widget for a Cover.
100100
*/
101-
static Row createTitleRow(ItemStack stack) {
102-
return new Row()
101+
static Flow createTitleRow(ItemStack stack) {
102+
return Flow.row()
103103
.pos(4, 4)
104104
.height(16).coverChildrenWidth()
105105
.child(new ItemDrawable(stack).asWidget().size(16).marginRight(4))
106-
.child(IKey.str(stack.getDisplayName()).color(UI_TITLE_COLOR).asWidget().heightRel(1.0f));
106+
.child(IKey.str(stack.getDisplayName())
107+
.color(UI_TITLE_COLOR)
108+
.shadow(true)
109+
.asWidget().heightRel(1.0f));
107110
}
108111

109112
/**
@@ -204,8 +207,8 @@ private BoolValue.Dynamic boolValueOf(EnumSyncValue<T> syncValue, T value) {
204207
return new BoolValue.Dynamic(() -> syncValue.getValue() == value, $ -> syncValue.setValue(value));
205208
}
206209

207-
public Row build() {
208-
var row = new Row().marginBottom(2).coverChildrenHeight().widthRel(1f);
210+
public Flow build() {
211+
var row = Flow.row().marginBottom(2).coverChildrenHeight().widthRel(1f);
209212
if (this.enumValue != null && this.syncValue != null) {
210213
for (var enumVal : enumValue.getEnumConstants()) {
211214
var button = new ToggleButton().size(18).marginRight(2)

src/main/java/gregtech/api/mui/GTGuiTheme.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import com.cleanroommc.modularui.api.ITheme;
1010
import com.cleanroommc.modularui.api.IThemeApi;
1111
import com.cleanroommc.modularui.drawable.UITexture;
12-
import com.cleanroommc.modularui.screen.Tooltip;
12+
import com.cleanroommc.modularui.screen.RichTooltip;
1313
import com.cleanroommc.modularui.theme.ReloadThemeEvent;
1414
import com.cleanroommc.modularui.utils.JsonBuilder;
1515
import org.jetbrains.annotations.Nullable;
@@ -108,7 +108,7 @@ public static void onReloadThemes(ReloadThemeEvent.Pre event) {
108108
public static Builder templateBuilder(String themeId) {
109109
Builder builder = new Builder(themeId);
110110
builder.openCloseAnimation(0);
111-
builder.tooltipPos(Tooltip.Pos.NEXT_TO_MOUSE);
111+
builder.tooltipPos(RichTooltip.Pos.NEXT_TO_MOUSE);
112112
builder.smoothProgressBar(true);
113113
return builder;
114114
}
@@ -163,7 +163,7 @@ public Builder smoothProgressBar(boolean smoothBar) {
163163
}
164164

165165
/** Set the tooltip pos for this theme. Overrides global cfg. */
166-
public Builder tooltipPos(Tooltip.Pos tooltipPos) {
166+
public Builder tooltipPos(RichTooltip.Pos tooltipPos) {
167167
theme.elementBuilder.add(b -> b.add("tooltipPos", tooltipPos.name()));
168168
return this;
169169
}

src/main/java/gregtech/api/mui/widget/GhostCircuitSlotWidget.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import gregtech.api.recipes.ingredients.IntCircuitIngredient;
77
import gregtech.client.utils.TooltipHelper;
88

9-
import net.minecraft.item.ItemStack;
109
import net.minecraft.network.PacketBuffer;
1110
import net.minecraft.util.text.TextComponentTranslation;
1211
import net.minecraftforge.items.IItemHandler;
@@ -16,7 +15,7 @@
1615
import com.cleanroommc.modularui.api.widget.IWidget;
1716
import com.cleanroommc.modularui.drawable.ItemDrawable;
1817
import com.cleanroommc.modularui.screen.ModularScreen;
19-
import com.cleanroommc.modularui.screen.Tooltip;
18+
import com.cleanroommc.modularui.screen.RichTooltip;
2019
import com.cleanroommc.modularui.utils.MouseData;
2120
import com.cleanroommc.modularui.value.sync.ItemSlotSH;
2221
import com.cleanroommc.modularui.widgets.ButtonWidget;
@@ -27,14 +26,14 @@
2726

2827
import java.io.IOException;
2928
import java.util.ArrayList;
30-
import java.util.Collections;
3129
import java.util.List;
3230

3331
public class GhostCircuitSlotWidget extends ItemSlot {
3432

3533
private static final int SYNC_CIRCUIT_INDEX = 10;
3634

3735
public GhostCircuitSlotWidget() {
36+
super();
3837
tooltipBuilder(this::getCircuitSlotTooltip);
3938
}
4039

@@ -67,13 +66,13 @@ public ItemSlot slot(ModularSlot slot) {
6766
return this;
6867
}
6968

70-
@Override
71-
protected List<String> getItemTooltip(ItemStack stack) {
72-
// we don't want the item tooltip
73-
return Collections.emptyList();
74-
}
69+
// @Override
70+
// protected List<String> getItemTooltip(ItemStack stack) {
71+
// // we don't want the item tooltip
72+
// return Collections.emptyList();
73+
// }
7574

76-
protected void getCircuitSlotTooltip(@NotNull Tooltip tooltip) {
75+
protected void getCircuitSlotTooltip(@NotNull RichTooltip tooltip) {
7776
String configString;
7877
int value = getSyncHandler().getGhostCircuitHandler().getCircuitValue();
7978
if (value == GhostCircuitItemStackHandler.NO_CONFIG) {
@@ -134,7 +133,8 @@ private void createSelectorPanel() {
134133
.left(7).right(7).top(41).height(4 * 18)
135134
.matrix(options)
136135
.minColWidth(18).minRowHeight(18)
137-
.minElementMargin(0, 0)))
136+
.minElementMargin(0, 0)),
137+
true)
138138
.openPanel();
139139
}
140140

src/main/java/gregtech/common/covers/CoverConveyor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
import com.cleanroommc.modularui.value.sync.StringSyncValue;
5656
import com.cleanroommc.modularui.widget.ParentWidget;
5757
import com.cleanroommc.modularui.widgets.ButtonWidget;
58-
import com.cleanroommc.modularui.widgets.layout.Column;
59-
import com.cleanroommc.modularui.widgets.layout.Row;
58+
import com.cleanroommc.modularui.widgets.layout.Flow;
6059
import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget;
6160
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
6261
import it.unimi.dsi.fastutil.ints.IntArrayList;
@@ -514,8 +513,8 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
514513
.bindPlayerInventory();
515514
}
516515

517-
protected ParentWidget<Column> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
518-
var column = new Column().top(24).margin(7, 0)
516+
protected ParentWidget<Flow> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
517+
var column = Flow.column().top(24).margin(7, 0)
519518
.widthRel(1f).coverChildrenHeight();
520519

521520
EnumSyncValue<ManualImportExportMode> manualIOmode = new EnumSyncValue<>(ManualImportExportMode.class,
@@ -539,7 +538,7 @@ protected ParentWidget<Column> createUI(ModularPanel mainPanel, PanelSyncManager
539538
guiSyncManager.syncValue("throughput", throughput);
540539

541540
if (createThroughputRow())
542-
column.child(new Row().coverChildrenHeight()
541+
column.child(Flow.row().coverChildrenHeight()
543542
.marginBottom(2).widthRel(1f)
544543
.child(new ButtonWidget<>()
545544
.left(0).width(18)

src/main/java/gregtech/common/covers/CoverFluidFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import com.cleanroommc.modularui.value.sync.EnumSyncValue;
4040
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
4141
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
42-
import com.cleanroommc.modularui.widgets.layout.Column;
42+
import com.cleanroommc.modularui.widgets.layout.Flow;
4343
import org.jetbrains.annotations.NotNull;
4444
import org.jetbrains.annotations.Nullable;
4545

@@ -148,7 +148,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
148148
return getFilter().createPanel(guiSyncManager)
149149
.size(176, 194).padding(7)
150150
.child(CoverWithUI.createTitleRow(getFilterContainer().getFilterStack()))
151-
.child(new Column().widthRel(1f).align(Alignment.TopLeft).top(22).coverChildrenHeight()
151+
.child(Flow.column().widthRel(1f).align(Alignment.TopLeft).top(22).coverChildrenHeight()
152152
.child(new EnumRowBuilder<>(FluidFilterMode.class)
153153
.value(filteringMode)
154154
.lang("cover.filter.mode.title")

src/main/java/gregtech/common/covers/CoverFluidVoiding.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
3333
import com.cleanroommc.modularui.widget.ParentWidget;
3434
import com.cleanroommc.modularui.widgets.ToggleButton;
35-
import com.cleanroommc.modularui.widgets.layout.Row;
35+
import com.cleanroommc.modularui.widgets.layout.Flow;
3636
import org.jetbrains.annotations.NotNull;
3737

3838
public class CoverFluidVoiding extends CoverPump {
@@ -80,7 +80,7 @@ protected ParentWidget<?> createUI(ModularPanel mainPanel, PanelSyncManager sync
8080
var isWorking = new BooleanSyncValue(this::isWorkingEnabled, this::setWorkingEnabled);
8181

8282
return super.createUI(mainPanel, syncManager)
83-
.child(new Row().height(18).widthRel(1f)
83+
.child(Flow.row().height(18).widthRel(1f)
8484
.marginBottom(2)
8585
.child(new ToggleButton()
8686
.value(isWorking)

src/main/java/gregtech/common/covers/CoverItemFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import com.cleanroommc.modularui.value.sync.EnumSyncValue;
3939
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
4040
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
41-
import com.cleanroommc.modularui.widgets.layout.Column;
41+
import com.cleanroommc.modularui.widgets.layout.Flow;
4242
import org.jetbrains.annotations.NotNull;
4343
import org.jetbrains.annotations.Nullable;
4444

@@ -150,7 +150,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
150150
return getFilter().createPanel(guiSyncManager)
151151
.size(176, 194).padding(7)
152152
.child(CoverWithUI.createTitleRow(getFilterContainer().getFilterStack()).left(4))
153-
.child(new Column().widthRel(1f).align(Alignment.TopLeft).top(22).coverChildrenHeight()
153+
.child(Flow.column().widthRel(1f).align(Alignment.TopLeft).top(22).coverChildrenHeight()
154154
.child(new EnumRowBuilder<>(ItemFilterMode.class)
155155
.value(filteringMode)
156156
.lang("cover.filter.mode.title")

src/main/java/gregtech/common/covers/CoverItemVoiding.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
3030
import com.cleanroommc.modularui.widget.ParentWidget;
3131
import com.cleanroommc.modularui.widgets.ToggleButton;
32-
import com.cleanroommc.modularui.widgets.layout.Column;
33-
import com.cleanroommc.modularui.widgets.layout.Row;
32+
import com.cleanroommc.modularui.widgets.layout.Flow;
3433
import org.jetbrains.annotations.NotNull;
3534

3635
public class CoverItemVoiding extends CoverConveyor {
@@ -78,11 +77,11 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
7877
}
7978

8079
@Override
81-
protected ParentWidget<Column> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
80+
protected ParentWidget<Flow> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
8281
var isWorking = new BooleanSyncValue(this::isWorkingEnabled, this::setWorkingEnabled);
8382

8483
return super.createUI(mainPanel, guiSyncManager)
85-
.child(new Row().height(18).widthRel(1f)
84+
.child(Flow.row().height(18).widthRel(1f)
8685
.marginBottom(2)
8786
.child(new ToggleButton()
8887
.value(isWorking)

src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
2525
import com.cleanroommc.modularui.value.sync.StringSyncValue;
2626
import com.cleanroommc.modularui.widget.ParentWidget;
27-
import com.cleanroommc.modularui.widgets.layout.Column;
28-
import com.cleanroommc.modularui.widgets.layout.Row;
27+
import com.cleanroommc.modularui.widgets.layout.Flow;
2928
import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget;
3029
import org.jetbrains.annotations.NotNull;
3130

@@ -94,7 +93,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
9493
}
9594

9695
@Override
97-
protected ParentWidget<Column> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
96+
protected ParentWidget<Flow> createUI(ModularPanel mainPanel, PanelSyncManager guiSyncManager) {
9897
var voidingMode = new EnumSyncValue<>(VoidingMode.class, this::getVoidingMode, this::setVoidingMode);
9998
guiSyncManager.syncValue("voiding_mode", voidingMode);
10099

@@ -112,7 +111,7 @@ protected ParentWidget<Column> createUI(ModularPanel mainPanel, PanelSyncManager
112111
.lang("cover.voiding.voiding_mode")
113112
.overlay(16, GTGuiTextures.VOIDING_MODE_OVERLAY)
114113
.build())
115-
.child(new Row().right(0).coverChildrenHeight()
114+
.child(Flow.row().right(0).coverChildrenHeight()
116115
.child(transferTextField
117116
.setEnabledIf(w -> this.itemFilterContainer.showGlobalTransferLimitSlider() &&
118117
this.voidingMode == VoidingMode.VOID_OVERFLOW)

0 commit comments

Comments
 (0)