-
Notifications
You must be signed in to change notification settings - Fork 198
Port many blocks to MUI2 #2624
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
Merged
ALongStringOfNumbers
merged 29 commits into
GregTechCEu:master
from
Zorbatron:zb-lotsa-mui2
Jan 29, 2025
Merged
Port many blocks to MUI2 #2624
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b73a731
Muffler
Zorbatron 87e99ae
Battery buffer
Zorbatron adec34e
PA machine hatch
Zorbatron 3681360
Block breaker
Zorbatron 73642ab
Object holder
Zorbatron 0f71bfa
Don't use the full path like that
Zorbatron b795417
pre rebase
Zorbatron c8f1cbd
Merge branch 'master' into zb-lotsa-mui2
Zorbatron e41e351
Intermediate commit (tank not syncing?)
Zorbatron b8d7c85
Fix reservoir hatch input slot filtering
Zorbatron faa16f0
spotless :skull:
Zorbatron 2b0c1b3
Fisher
Zorbatron 85a980a
Primitive pump hatch
Zorbatron 62d9bad
Steam hatch
Zorbatron f38a3db
Buffers
Zorbatron b82aff5
Rotor holder
Zorbatron ce2803e
Merge branch 'master' into zb-lotsa-mui2
Zorbatron cd2fd3c
Merge branch 'GregTechCEu:master' into zb-lotsa-mui2
Zorbatron 16df071
Compiles again!
Zorbatron 76e1c1f
Merge branch 'master' into zb-lotsa-mui2
Zorbatron 5ab3620
Address reservoir hatch review
Zorbatron 7475050
Address fisher review
Zorbatron 1e491fb
Address steam hatch review
Zorbatron eeddd04
Address pump hatch review
Zorbatron 6694a0d
Use custom IDrawable overlay.
Zorbatron abffbac
Remove DrawableColorOverlay and use lambdas
Zorbatron 6086da9
Don't use anonymous class to hide tooltip in Machine Hatches
Zorbatron 5e3b7ac
Fogor some if statements
Zorbatron ed6af5e
Don't mark tooltip dirty
Zorbatron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/main/java/gregtech/api/mui/widget/BlockableSlotWidget.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package gregtech.api.mui.widget; | ||
|
||
import com.cleanroommc.modularui.drawable.GuiDraw; | ||
import com.cleanroommc.modularui.screen.viewport.ModularGuiContext; | ||
import com.cleanroommc.modularui.theme.WidgetTheme; | ||
import com.cleanroommc.modularui.widgets.ItemSlot; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
/** | ||
* Basically just your normal SlotWidget, but can render the slot as "grayed-out" with a Supplier value. | ||
* MUI2 version of {@link gregtech.api.gui.widgets.BlockableSlotWidget} | ||
*/ | ||
public class BlockableSlotWidget extends ItemSlot { | ||
|
||
private static final int OVERLAY_COLOR = 0x80404040; | ||
|
||
private BooleanSupplier isBlocked = () -> false; | ||
|
||
public BlockableSlotWidget() { | ||
super(); | ||
} | ||
|
||
public BlockableSlotWidget setIsBlocked(BooleanSupplier isBlocked) { | ||
this.isBlocked = isBlocked; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean isHovering() { | ||
return super.isHovering() && !isBlocked.getAsBoolean(); | ||
} | ||
|
||
@Override | ||
public void draw(ModularGuiContext context, WidgetTheme widgetTheme) { | ||
super.draw(context, widgetTheme); | ||
if (isBlocked.getAsBoolean()) { | ||
GuiDraw.drawRect(1, 1, 16, 16, OVERLAY_COLOR); | ||
} | ||
} | ||
|
||
@Override | ||
public void drawForeground(ModularGuiContext context) { | ||
if (isBlocked.getAsBoolean()) return; | ||
super.drawForeground(context); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.