-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port many blocks to MUI2 #2624
base: master
Are you sure you want to change the base?
Port many blocks to MUI2 #2624
Conversation
(Also doesn't sync properly)
(Also doesn't sync properly)
...java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/electric/MetaTileEntityFisher.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityPumpHatch.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityPumpHatch.java
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityPumpHatch.java
Outdated
Show resolved
Hide resolved
...java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java
Outdated
Show resolved
Hide resolved
...ain/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java
Show resolved
Hide resolved
...ain/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java
Outdated
Show resolved
Hide resolved
...ain/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityBuffer.java
Show resolved
Hide resolved
Fix being able to insert items into an object holder while research is in progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the mui2 code lgtm, just a few things
.child(new ItemSlot() { | ||
|
||
// Don't draw tooltip if the slot is blocked | ||
@Override | ||
public void drawForeground(ModularGuiContext context) { | ||
if (!isSlotBlocked()) super.drawForeground(context); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do:
.tooltip(t -> t.setAutoUpdate(false))
.onUpdateListener(itemSlot -> {
RichTooltip tooltip = itemSlot.tooltip();
if (isSlotBlocked()) {
tooltip.buildTooltip();
tooltip.clearText();
} else if (tooltip.isEmpty()) {
tooltip.markDirty();
}
})
to mimic and replace the tooltip override
|
||
import java.util.function.Supplier; | ||
|
||
public class DrawableColorOverlay implements IDrawable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho, usages of this class could just be a DynamicDrawable or lambda, maybe placed in GTGuiTextures.
private final Supplier<Boolean> drawOverlay; | ||
private final Supplier<Integer> OVERLAY_COLOR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this class is kept, these should be primitive suppliers, and OVERLAY_COLOR
needs to be camel case format and marked nullable.
public void draw(GuiContext context, int x, int y, int width, int height, WidgetTheme widgetTheme) { | ||
if (drawOverlay.get()) { | ||
GuiDraw.drawRect(x, y, width, height, OVERLAY_COLOR.get()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if OVERLAY_COLOR
is null, the color from the widget theme should be used
What
Ports a few machines and multiblock parts to use MUI2
Currently has:
Todo:
GTFluidSlot
once Update MUI2 dep to RC2 #2622 is merged (currently is not syncing properly)Outcome
Progress on moving to MUI2!