-
Notifications
You must be signed in to change notification settings - Fork 204
Port Singleblock Recipemap Machines + Generators to MUI2 #2808
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
Open
ghzdude
wants to merge
56
commits into
master
Choose a base branch
from
gh/sb-recipe-map-mui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 30 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
52288e8
stuff
serenibyss fa6c9b4
group slots, fix shift clicking
serenibyss 5acd5fd
clean up toggle buttons
serenibyss 707f89b
cleanups
serenibyss 56f1ecd
2.4 fix
serenibyss 7c18f9a
Logo as part of GTGuiTheme
serenibyss 23e54e5
clickable progress bar (partial)
serenibyss ca3f023
finish previous commit
serenibyss 6359932
fix progress bar sync
serenibyss 453b0fe
fix button/toggle button theme builder calls
serenibyss c7cdbf8
fix rebase
ghzdude 41c6ead
move mui2 related methods into builder
ghzdude 70dd55d
use unary operator instead
ghzdude bee91a7
port arc, assembler, autoclave
ghzdude 8ae5c93
spotless
ghzdude a56538d
simplify builder to modify map ui directly
ghzdude c1576f1
move back to consumer
ghzdude ed7c327
add comment clarifying null supression
ghzdude d39b1ff
set mui2 for map ui
ghzdude 9fe269c
use progress value directly in widget
ghzdude 80a721c
rework slot overlay methods
ghzdude da09ea8
port steam machines to mui2
ghzdude 4f6cfac
actually port steam machines to mui2
ghzdude 4db04a4
port singleblock generators to mui2
ghzdude e9b07ec
spotless
ghzdude a3e50d0
improve/cleanup existing mui2 code
ghzdude 1cc2681
spotless
ghzdude 14a0221
null check ui builder and simplify
ghzdude 8f1d82f
Merge branch 'master' into gh/sb-recipe-map-mui
Zorbatron 2ca12cb
Actually merge master in properly :facepalm:
Zorbatron a3b023b
remove old ui code from SteamBoiler and extending classes
ghzdude 8a94916
fix SteamLavaBoiler lava fluid slot
ghzdude 8473cb2
use `slotOverlay()` directly
ghzdude bbb2991
rename mui2 special drawable
ghzdude 9c9b9a5
rename mui2 special drawable and method
ghzdude 88bfa5a
remove irrelevant todo
ghzdude e7d7b82
remove commented code
ghzdude 83dc765
actually sync the sync value and remove todo
ghzdude 8d1cc64
spotless
ghzdude 79891d8
initial rework of `addInventorySlotGroup()` for mui2
ghzdude ef0a7b8
more work on the rewrite
ghzdude 7595eb3
use modular panel instead of redundant parent widget
ghzdude e8bc2c9
rework mostly done
ghzdude 7a53dd9
clean + spotless
ghzdude 7651ce1
cleanup pt 2
ghzdude 0639de4
fix no energy indicator
ghzdude caae70e
replace special texture with a widget consumer
ghzdude 341a3ac
fix special textures
ghzdude 526c738
remove if condition for simple machines
ghzdude 9f57e43
increase progress widget margin
ghzdude ecd5559
improve centering slots around progress widget
ghzdude 1bb7c67
improve item/fluid groups
ghzdude 05f15e8
make `setSize()` a builder method
ghzdude 13fc654
create CalculatedGrid to simplify and cleanup logic
ghzdude 7cb191a
fix logo in SimpleGeneratorMetaTileEntity
ghzdude 393d540
remove unused field
ghzdude 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
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
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
63 changes: 63 additions & 0 deletions
63
src/main/java/gregtech/api/mui/widget/RecipeProgressWidget.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,63 @@ | ||
| package gregtech.api.mui.widget; | ||
|
|
||
| import gregtech.api.GregTechAPI; | ||
| import gregtech.api.recipes.RecipeMap; | ||
| import gregtech.api.recipes.RecipeMaps; | ||
| import gregtech.integration.IntegrationModule; | ||
| import gregtech.integration.jei.JustEnoughItemsModule; | ||
| import gregtech.integration.jei.recipe.RecipeMapCategory; | ||
| import gregtech.modules.GregTechModules; | ||
|
|
||
| import com.cleanroommc.modularui.api.drawable.IKey; | ||
| import com.cleanroommc.modularui.api.widget.Interactable; | ||
| import com.cleanroommc.modularui.widgets.ProgressWidget; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Collection; | ||
| import java.util.List; | ||
|
|
||
| public class RecipeProgressWidget extends ProgressWidget implements Interactable { | ||
|
|
||
| private RecipeMap<?> recipeMap; | ||
|
|
||
| public RecipeProgressWidget recipeMap(RecipeMap<?> recipeMap) { | ||
| this.recipeMap = recipeMap; | ||
| if (GregTechAPI.moduleManager.isModuleEnabled(GregTechModules.MODULE_JEI)) { | ||
| tooltip(t -> t.addLine(IKey.lang("gui.widget.recipeProgressWidget.default_tooltip"))); | ||
| } | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull Result onMousePressed(int mouseButton) { | ||
| if (recipeMap == null) { | ||
| return Result.IGNORE; | ||
| } | ||
| if (mouseButton == 0 || mouseButton == 1) { | ||
| if (!GregTechAPI.moduleManager.isModuleEnabled(GregTechModules.MODULE_JEI)) { | ||
| return Result.ACCEPT; | ||
| } | ||
|
|
||
| Collection<RecipeMapCategory> categories = RecipeMapCategory.getCategoriesFor(recipeMap); | ||
| if (categories != null && !categories.isEmpty()) { | ||
| List<String> categoryID = new ArrayList<>(); | ||
| if (recipeMap == RecipeMaps.FURNACE_RECIPES) { | ||
| categoryID.add("minecraft.smelting"); | ||
| } else { | ||
| for (RecipeMapCategory category : categories) { | ||
| categoryID.add(category.getUid()); | ||
| } | ||
| } | ||
|
|
||
| if (JustEnoughItemsModule.jeiRuntime == null) { | ||
| IntegrationModule.logger.error("GTCEu JEI integration has crashed, this is not a good thing"); | ||
| return Result.ACCEPT; | ||
| } | ||
| JustEnoughItemsModule.jeiRuntime.getRecipesGui().showCategories(categoryID); | ||
| return Result.SUCCESS; | ||
| } | ||
| } | ||
| return Result.IGNORE; | ||
| } | ||
| } |
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.