Add IO Config Widget #108
No reviewers
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/io-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Adds a widget to let you configure IO sides for machine blocks
Todo
Checklist:
@ -0,0 +1,421 @@package com.enderio.machines.client.gui.widget.ioconfig;This could be:
@ -0,0 +1,421 @@package com.enderio.machines.client.gui.widget.ioconfig;oh I did not know Optional.map takes care of empty. I will replace it
Impressive, well done!
@ -101,6 +101,13 @@ public abstract class EIOScreen<T extends AbstractContainerMenu> extends Abstracreturn super.mouseClicked(pMouseX, pMouseY, pButton);send the dragging only to the currently focused GuiEventListener using getFocused. if the return value of that dragging is true, return true, otherwise return super mouseDragged
send mouseMoved only to hovered widgets, determine the GuiEventListener using getChildAt(pMouseX, pMouseY)
this will do the visibility and active checks for you
it also doesn't look like this would be needed at all, there are no widgets that use mouseMoved
@ -12,8 +12,8 @@ import net.minecraft.world.entity.player.Inventory;import net.minecraft.world.inventory.AbstractContainerMenu;restore original formatting
@ -0,0 +1,421 @@package com.enderio.machines.client.gui.widget.ioconfig;client config?
remove @NotNull and add a package-info.java to mark everything as not null by defaul
remove notNull
also check if loc is already in neighbours, some multiconfigurable configuration could result in adding the same position multiple times
use pos.relative(dir)
rename to vec3Origin or something similar, no _ in the beginning
remove code comment
use Comparator.comparingDouble(entry -> entry.getValue().distToCenterSqr(vec3Origin)) instead of the manual substraction
directly map the optional and store it in selection, you don't need to assign the optional in opt
always render the block model and blockentityrenderer, you probably will not render the book on enchanting tables at the moment or the fluid in fluid tanks
rename rt -> renderType
remove notnull annotation
make constructor private
@ -101,6 +101,13 @@ public abstract class EIOScreen<T extends AbstractContainerMenu> extends Abstracreturn super.mouseClicked(pMouseX, pMouseY, pButton);This breaks since the new widget doesn't actually get focus
@ -101,6 +101,13 @@ public abstract class EIOScreen<T extends AbstractContainerMenu> extends Abstracreturn super.mouseClicked(pMouseX, pMouseY, pButton);okay, maybe still change it so that it returns true on the first widget returning true, meaning it handled the dragging? So no slotdragging would occur or similar
@ -0,0 +1,421 @@package com.enderio.machines.client.gui.widget.ioconfig;Is it required ? I don't think it will be useful and we will then need to make sure the custom code works for all values
@ -0,0 +1,421 @@package com.enderio.machines.client.gui.widget.ioconfig;I have added the config. I am not able to test it
While there' nothing wrong with doing it this way, can it be made cleaner? Also this seems to be useful in other render things we have right now? I think maybe conduits or the fluid tank?
@ -0,0 +388,4 @@}}private static class GhostRenderLayer extends RenderType {We should put a reference to patchouli in the class and methods.
@ -6,8 +6,13 @@ public class MachinesClientConfig {machineParticles seems the wrong string for this no?
@ -6,8 +6,13 @@ public class MachinesClientConfig {Yep, that is a mistake. (shouldnt blindly copy paste)
I don't use that function for anything (tried it for a small duration and then switched back to custom impl).
It's not helpful for conduit rendering
Yeah this seems to be a very old review comment that I didn't remove
@ -102,2 +102,4 @@}@Overridepublic boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) {return true here
@ -0,0 +369,4 @@screenFont.draw(poseStack, map.getComponent(), x + 4, y + height - 2 - screenFont.lineHeight, 0xFFFFFFFF);poseStack.popPose();}}remove NotNull from direction
I think the Soul binder also needs the config screen. (It might not work a 100% right now since it meanly uses fluids and isn't really something you automate, but it should have it).
@ferriarnus the soulbinder uses fixed IOConfig in Pull mode. I have added the widget but it does nothing right now. Should I revert or do we keep it as is until we figure out fluid support ?
The soul binder doesn't need to be fixed anymore. I needed for testing, since a fluid is needed for the recipe. But now with the io config widget, you can easily set a side to pull and it will work. We will indeed rewrite some stuff for fluid support, but the current io config is good enough to handel it I think?
Ok I will change soul binder config and keep the widget
last tiny nitpick with code
feature works as intended, well done
@ -101,6 +101,13 @@ public abstract class EIOScreen<T extends AbstractContainerMenu> extends Abstracreturn super.mouseClicked(pMouseX, pMouseY, pButton);}