Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
import com.cleanroommc.modularui.value.sync.IntSyncValue;
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
import com.cleanroommc.modularui.value.sync.StringSyncValue;
import com.cleanroommc.modularui.widgets.layout.Flow;
import com.cleanroommc.modularui.widgets.slot.ItemSlot;
import com.cleanroommc.modularui.widgets.layout.Column;
import com.cleanroommc.modularui.widgets.layout.Row;
import com.cleanroommc.modularui.widgets.slot.ModularSlot;
import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget;

Expand Down Expand Up @@ -61,13 +60,13 @@ public ModularPanel buildUI(GuiData data, PanelSyncManager syncManager, UISettin
}
ModularPanel panel = ModularPanel.defaultPanel("item_editor");
return panel.bindPlayerInventory()
.child(new Column()
.child(Flow.column()
.crossAxisAlignment(Alignment.CrossAxis.START)
.sizeRel(1f)
.margin(7)
.child(IKey.str("Item Editor").asWidget().marginTop(7).marginBottom(3))
.child(new ItemSlot().slot(new ModularSlot(this.stackHandler, 0)))
.child(new Row()
.child(Flow.row()
.crossAxisAlignment(Alignment.CrossAxis.CENTER)
.height(16)
.margin(0, 4)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cleanroommc/modularui/test/TestGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import com.cleanroommc.modularui.widgets.ButtonWidget;
import com.cleanroommc.modularui.widgets.Dialog;
import com.cleanroommc.modularui.widgets.SortableListWidget;
import com.cleanroommc.modularui.widgets.layout.Flow;
import com.cleanroommc.modularui.widgets.layout.Grid;
import com.cleanroommc.modularui.widgets.layout.Row;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void onClose() {
final Map<String, SortableListWidget.Item<String>> items = new Object2ObjectOpenHashMap<>();
for (String line : this.lines) {
items.put(line, new SortableListWidget.Item<>(line)
.child(item -> new Row()
.child(item -> Flow.row()
.child(new Widget<>()
.addTooltipLine(line)
.widgetTheme(IThemeApi.BUTTON)
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/cleanroommc/modularui/test/TestGuis.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@
import com.cleanroommc.modularui.widgets.TextWidget;
import com.cleanroommc.modularui.widgets.ToggleButton;
import com.cleanroommc.modularui.widgets.TransformWidget;
import com.cleanroommc.modularui.widgets.layout.Column;
import com.cleanroommc.modularui.widgets.layout.Flow;
import com.cleanroommc.modularui.widgets.layout.Grid;
import com.cleanroommc.modularui.widgets.layout.Row;
import com.cleanroommc.modularui.widgets.textfield.TextFieldWidget;

import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -220,10 +218,10 @@ public void onInit() {
Random rnd = new Random();
return new ModularPanel("main")
.coverChildren()
.child(new Column()
.child(Flow.column()
.margin(12)
.coverChildren()
.child(new Row()
.child(Flow.row()
.coverChildren()
.child(IKey.str("Post ").asWidget()
.transform((widget, stack) -> stack.translate(post.getValue(), 0)))
Expand Down Expand Up @@ -549,7 +547,7 @@ public static ModularPanel buildCollapseDisabledChildrenUI() {
return new ModularPanel("aspect_ratio")
.coverChildren()
.padding(10)
.child(new Row()
.child(Flow.row()
.childPadding(10)
.coverChildren()
.child(new Rectangle().color(Color.BLUE_ACCENT.main)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cleanroommc/modularui/test/TestItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.cleanroommc.modularui.value.sync.SyncHandlers;
import com.cleanroommc.modularui.widget.ParentWidget;
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
import com.cleanroommc.modularui.widgets.layout.Column;
import com.cleanroommc.modularui.widgets.layout.Flow;
import com.cleanroommc.modularui.widgets.slot.ItemSlot;
import com.cleanroommc.modularui.widgets.slot.ModularSlot;

Expand Down Expand Up @@ -63,7 +63,7 @@ public ModularPanel buildUI(PlayerInventoryGuiData guiData, PanelSyncManager gui
new ModularSlot(inv, index));
}
ModularPanel panel = ModularPanel.defaultPanel("knapping_gui").resizeableOnDrag(true);
panel.child(new Column().margin(7)
panel.child(Flow.column().margin(7)
.child(new ParentWidget<>().widthRel(1f).expanded()
.child(SlotGroupWidget.builder()
.row("II")
Expand Down
28 changes: 13 additions & 15 deletions src/main/java/com/cleanroommc/modularui/test/TestTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@
import com.cleanroommc.modularui.widgets.SliderWidget;
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
import com.cleanroommc.modularui.widgets.ToggleButton;
import com.cleanroommc.modularui.widgets.layout.Column;
import com.cleanroommc.modularui.widgets.layout.Flow;
import com.cleanroommc.modularui.widgets.layout.Row;
import com.cleanroommc.modularui.widgets.slot.FluidSlot;
import com.cleanroommc.modularui.widgets.slot.ItemSlot;
import com.cleanroommc.modularui.widgets.slot.ModularCraftingSlot;
Expand Down Expand Up @@ -176,7 +174,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
DynamicLinkedSyncHandler<GenericListSyncHandler<Integer>> dynamicLinkedSyncHandler = new DynamicLinkedSyncHandler<>(numberListSyncHandler)
.widgetProvider((syncManager1, value1) -> {
List<Integer> vals = value1.getValue();
return new Column()
return Flow.column()
.widthRel(1f)
.coverChildrenHeight()
.children(vals.size(), i -> IKey.str(String.valueOf(vals.get(i))).asWidget().padding(2));
Expand All @@ -195,7 +193,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.size(176, 220) // set a static size for the main panel
.align(Alignment.Center); // center the panel in the screen
panel
.child(new Row()
.child(Flow.row()
.name("Tab row")
.coverChildren()
.topRel(0f, 4, 1f)
Expand Down Expand Up @@ -252,13 +250,13 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.name("page 1 parent")
.sizeRel(1f, 1f)
.padding(7, 0)
.child(new Row()
.child(Flow.row()
.name("buttons, slots and more tests")
.height(137)
.coverChildrenWidth()
.verticalCenter()
//.padding(7)
.child(new Column()
.child(Flow.column()
.name("buttons and slots test")
.coverChildren()
.marginRight(8)
Expand Down Expand Up @@ -312,7 +310,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.child(new ScrollingTextWidget(IKey.str("Very very long test string")).widthRel(1f).height(16))
//.child(IKey.EMPTY.asWidget().debugName("Empty IKey"))
)
.child(new Column()
.child(Flow.column()
.name("button and slots test 2")
.coverChildren()
//.widthRel(0.5f)
Expand All @@ -324,7 +322,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.progress(() -> this.progress / (double) this.duration)
.texture(GuiTextures.PROGRESS_CYCLE, 20)
.direction(ProgressWidget.Direction.CIRCULAR_CW))
.child(new Row().coverChildrenWidth().height(18)
.child(Flow.row().coverChildrenWidth().height(18)
.reverseLayout(false)
.child(new ToggleButton()
.value(new BoolValue.Dynamic(() -> cycleStateValue.getIntValue() == 0, val -> cycleStateValue.setIntValue(0)))
Expand All @@ -350,7 +348,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.width(30)
.alwaysShowFull(false)
.syncHandler(SyncHandlers.fluidSlot(this.fluidTankPhantom).phantom(true)))
.child(new Column()
.child(Flow.column()
.name("button and slots test 3")
.coverChildren()
.child(new TextFieldWidget()
Expand All @@ -359,7 +357,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.setNumbers(0, 9999999)
.hintText("integer")))
)))
.addPage(new Column()
.addPage(Flow.column()
.name("Slots test page")
.coverChildren()
//.height(120)
Expand Down Expand Up @@ -388,7 +386,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.key('I', index -> ItemSlot.create(index >= 2).slot(new ModularSlot(this.mixerItems, index).slotGroup("mixer_items")))
.build().name("mixer inv")
.disableSortButtons())
.child(new Row()
.child(Flow.row()
.coverChildrenHeight()
.child(new CycleButtonWidget()
.size(14, 14)
Expand Down Expand Up @@ -430,7 +428,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.top(1)
.left(32)
.size(1, 40))*/
.child(new Row()
.child(Flow.row()
.name("test config 1")
.widthRel(1f).coverChildrenHeight()
.crossAxisAlignment(Alignment.CrossAxis.CENTER)
Expand All @@ -442,7 +440,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.margin(8, 4))
.child(IKey.str("Boolean config").asWidget()
.height(14)))
.child(new Row()
.child(Flow.row()
.name("test config 2")
.widthRel(1f).height(14)
.childPadding(2)
Expand All @@ -462,7 +460,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.left(5).height(14)
.tooltip(tooltip -> tooltip.showUpTimer(10)
.addLine(IKey.str("Config title tooltip"))))
.child(new Row()
.child(Flow.row()
.name("test config 3")
.widthRel(1f).height(14)
.childPadding(2)
Expand All @@ -475,7 +473,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager, UI
.addPage(new ParentWidget<>()
.name("page 4 storage")
.sizeRel(1f)
.child(new Column()
.child(Flow.column()
.padding(7)
.child(new ItemSlot()
.slot(new ModularSlot(this.storageInventory0, 0)
Expand Down
Loading