diff --git a/core/src/main/java/mrtjp/projectred/redui/ScrollBarNode.java b/core/src/main/java/mrtjp/projectred/redui/ScrollBarNode.java index f7bdca46c..1794d12d6 100644 --- a/core/src/main/java/mrtjp/projectred/redui/ScrollBarNode.java +++ b/core/src/main/java/mrtjp/projectred/redui/ScrollBarNode.java @@ -1,9 +1,11 @@ package mrtjp.projectred.redui; +import codechicken.lib.colour.EnumColour; import com.mojang.blaze3d.vertex.PoseStack; import mrtjp.projectred.lib.Point; import mrtjp.projectred.lib.Rect; import mrtjp.projectred.lib.Size; +import net.minecraft.client.gui.GuiComponent; public abstract class ScrollBarNode extends AbstractGuiNode { @@ -28,7 +30,12 @@ public void setSliderSize(int w, int h) { @Override public void drawBack(PoseStack stack, Point mouse, float partialFrame) { - // Draw scroll bar background + // Draw semi-transparent grey background + int x = getFrame().x(); + int y = getFrame().y(); + GuiComponent.fillGradient(stack, x, y, x + getFrame().width(), y + getFrame().height(), EnumColour.BLACK.argb(127), EnumColour.BLACK.argb(127), 0); + + // Draw slider rectangle drawSlider(stack, sliderFrame); } diff --git a/core/src/main/java/mrtjp/projectred/redui/SpriteButtonNode.java b/core/src/main/java/mrtjp/projectred/redui/SpriteButtonNode.java new file mode 100644 index 000000000..3dcbcdc8c --- /dev/null +++ b/core/src/main/java/mrtjp/projectred/redui/SpriteButtonNode.java @@ -0,0 +1,39 @@ +package mrtjp.projectred.redui; + +import com.mojang.blaze3d.vertex.PoseStack; + +import java.util.function.Supplier; + +public class SpriteButtonNode extends AbstractButtonNode { + + private RedUISprite sprite; + private Runnable clickReceiver = () -> { }; + private Supplier isDisabledProvider = () -> false; + + public SpriteButtonNode(RedUISprite sprite) { + this.sprite = sprite; + } + + public void setClickReceiver(Runnable clickReceiver) { + this.clickReceiver = clickReceiver; + } + + public void setIsDisabledProvider(Supplier isDisabledProvider) { + this.isDisabledProvider = isDisabledProvider; + } + + @Override + protected boolean isButtonDisabled() { + return isDisabledProvider.get(); + } + + @Override + protected void onButtonClicked() { + clickReceiver.run(); + } + + @Override + protected void drawButtonBody(PoseStack stack, boolean mouseover) { + blitSpriteCentered(stack, sprite); + } +} diff --git a/fabrication/src/main/generated/.cache/af9e6e51e4f0a9c76d168bf51cd141f0b8234be4 b/fabrication/src/main/generated/.cache/af9e6e51e4f0a9c76d168bf51cd141f0b8234be4 index 41322c2d9..5029e3fc2 100644 --- a/fabrication/src/main/generated/.cache/af9e6e51e4f0a9c76d168bf51cd141f0b8234be4 +++ b/fabrication/src/main/generated/.cache/af9e6e51e4f0a9c76d168bf51cd141f0b8234be4 @@ -1,2 +1,2 @@ -// 1.19.2 2024-04-05T16:47:53.695184 ProjectRed-Fabrication Languages: en_us -dd1226a77b7ec67a85f9d088ba5a3f78a16f2bf4 assets/projectred_fabrication/lang/en_us.json +// 1.19.2 2024-04-29T13:40:44.325463 ProjectRed-Fabrication Languages: en_us +5da5b8cc9a7b6e62337421001761920875beea36 assets/projectred_fabrication/lang/en_us.json diff --git a/fabrication/src/main/generated/assets/projectred_fabrication/lang/en_us.json b/fabrication/src/main/generated/assets/projectred_fabrication/lang/en_us.json index 2895e9e7c..76bce5331 100644 --- a/fabrication/src/main/generated/assets/projectred_fabrication/lang/en_us.json +++ b/fabrication/src/main/generated/assets/projectred_fabrication/lang/en_us.json @@ -12,12 +12,53 @@ "item.projectred_fabrication.rough_silicon_wafer": "Rough Silicon Wafer", "item.projectred_fabrication.valid_die": "Valid Die", "itemGroup.projectred_fabrication": "Project Red: Fabrication", - "projectred_fabrication.dimensions.dies": "%d dies x %d dies", - "projectred_fabrication.dimensions.dies_total": "%d dies x %d dies (%d dies^2)", - "projectred_fabrication.dimensions.nm": "%d nm x %d nm", - "projectred_fabrication.dimensions.nm_total": "%d nm x %d nm (%d nm^2)", - "projectred_fabrication.dimensions.tiles": "%d tiles x %d tiles", - "projectred_fabrication.dimensions.tiles_total": "%d tiles x %d tiles (%d tiles^2)", + "projectred_fabrication.compile.stack": "Stack", + "projectred_fabrication.compile.step.check_flat_maps": "Check flat maps", + "projectred_fabrication.compile.step.check_flat_maps.desc": "Check for flat maps to merge", + "projectred_fabrication.compile.step.check_tile_maps": "Check tile maps", + "projectred_fabrication.compile.step.check_tile_maps.desc": "Check for tile maps to compile", + "projectred_fabrication.compile.step.merge_flat_map": "Compile flat map", + "projectred_fabrication.compile.step.merge_flat_map.desc": "Merge flat map", + "projectred_fabrication.compile.step.merge_tile_map": "Compile tile map", + "projectred_fabrication.compile.step.merge_tile_map.desc": "Compile tile map", + "projectred_fabrication.compile.step.merge_tile_map_add_remaps": "Add remaps", + "projectred_fabrication.compile.step.merge_tile_map_add_remaps.desc": "Declare remaps", + "projectred_fabrication.compile.step.merge_tile_map_alloc": "Alloc", + "projectred_fabrication.compile.step.merge_tile_map_alloc.desc": "Output registers and gate allocation", + "projectred_fabrication.compile.step.merge_tile_map_collect": "Collect", + "projectred_fabrication.compile.step.merge_tile_map_collect.desc": "Gates and registers collected", + "projectred_fabrication.compile.step.merge_tile_map_consume_remaps": "Remap", + "projectred_fabrication.compile.step.merge_tile_map_consume_remaps.desc": "Apply remaps", + "projectred_fabrication.compile.step.merge_tile_map_manifest_search": "Lookup", + "projectred_fabrication.compile.step.merge_tile_map_manifest_search.desc": "Passing signals lookup", + "projectred_fabrication.compile.step.merge_tile_map_pathfind": "Pathfind", + "projectred_fabrication.compile.step.merge_tile_map_pathfind.desc": "Input register search", + "projectred_fabrication.compile.step.merge_tile_map_phase1": "Allocation phase", + "projectred_fabrication.compile.step.merge_tile_map_phase1.desc": "Allocate memory for all tiles", + "projectred_fabrication.compile.step.merge_tile_map_phase2": "Pathfind phase", + "projectred_fabrication.compile.step.merge_tile_map_phase2.desc": "Search for connected registers", + "projectred_fabrication.compile.step.merge_tile_map_phase3": "Lookup phase", + "projectred_fabrication.compile.step.merge_tile_map_phase3.desc": "Look up passing signals", + "projectred_fabrication.compile.step.merge_tile_map_phase4": "Add remaps phase", + "projectred_fabrication.compile.step.merge_tile_map_phase4.desc": "Declare register remaps", + "projectred_fabrication.compile.step.merge_tile_map_phase5": "Remap phase", + "projectred_fabrication.compile.step.merge_tile_map_phase5.desc": "Apply register remaps", + "projectred_fabrication.compile.step.merge_tile_map_phase6": "Collection phase", + "projectred_fabrication.compile.step.merge_tile_map_phase6.desc": "Collect gates and registers", + "projectred_fabrication.compile.step.merge_tile_map_post": "Post-compile", + "projectred_fabrication.compile.step.merge_tile_map_post.desc": "Post-compile", + "projectred_fabrication.compile.step.merge_tile_map_pre": "Pre-compile", + "projectred_fabrication.compile.step.merge_tile_map_pre.desc": "Pre-compile", + "projectred_fabrication.compile.tree": "Tree", + "projectred_fabrication.f.dimensions.dies": "%d dies x %d dies", + "projectred_fabrication.f.dimensions.dies_total": "%d dies x %d dies (%d dies^2)", + "projectred_fabrication.f.dimensions.nm": "%d nm x %d nm", + "projectred_fabrication.f.dimensions.nm_total": "%d nm x %d nm (%d nm^2)", + "projectred_fabrication.f.dimensions.tiles": "%d tiles x %d tiles", + "projectred_fabrication.f.dimensions.tiles_total": "%d tiles x %d tiles (%d tiles^2)", + "projectred_fabrication.f.unit.errors": "%d errors", + "projectred_fabrication.f.unit.ticks": "%d ticks", + "projectred_fabrication.f.unit.warnings": "%d warnings", "projectred_fabrication.interact.default_state": "Default state", "projectred_fabrication.interact.delay": "Delay", "projectred_fabrication.interact.io_direction": "IO direction", @@ -111,8 +152,9 @@ "projectred_fabrication.ui.wafer_type": "Wafer type", "projectred_fabrication.ui.yield": "Yield", "projectred_fabrication.ui.yield_calculator": "Yield Calculator", - "projectred_fabrication.unit.errors": "%d errors", - "projectred_fabrication.unit.ticks": "%d ticks", - "projectred_fabrication.unit.warnings": "%d warnings", - "projectred_fabrication.unit_only.ticks": "ticks" + "projectred_fabrication.unit.gates": "gates", + "projectred_fabrication.unit.none": "none", + "projectred_fabrication.unit.registers": "registers", + "projectred_fabrication.unit.remaps": "remaps", + "projectred_fabrication.unit.ticks": "ticks" } \ No newline at end of file diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/data/FabricationLanguageProvider.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/data/FabricationLanguageProvider.java index 99b75cccd..a53996a55 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/data/FabricationLanguageProvider.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/data/FabricationLanguageProvider.java @@ -66,6 +66,46 @@ protected void addTranslations() { add(UL_TIME_DELAY, "Delay"); add(UL_DEFAULT_STATE, "Default state"); + add(UL_COMPILE_TREE, "Tree"); + add(UL_COMPILE_STACK, "Stack"); + add(UL_COMPILE_CHECK_TILE_MAP, "Check tile maps"); + add(UL_COMPILE_CHECK_FLAT_MAP, "Check flat maps"); + add(UL_COMPILE_MERGE_TILE_MAP, "Compile tile map"); + add(UL_COMPILE_MERGE_FLAT_MAP, "Compile flat map"); + add(UL_COMPILE_MERGE_TILE_MAP_PRE, "Pre-compile"); + add(UL_COMPILE_PHASE_1, "Allocation phase"); + add(UL_COMPILE_ALLOC, "Alloc"); + add(UL_COMPILE_PHASE_2, "Pathfind phase"); + add(UL_COMPILE_PATHFIND, "Pathfind"); + add(UL_COMPILE_PHASE_3, "Lookup phase"); + add(UL_COMPILE_PF_MANIFEST, "Lookup"); + add(UL_COMPILE_PHASE_4, "Add remaps phase"); + add(UL_COMPILE_ADD_REMAPS, "Add remaps"); + add(UL_COMPILE_PHASE_5, "Remap phase"); + add(UL_COMPILE_REMAP, "Remap"); + add(UL_COMPILE_PHASE_6, "Collection phase"); + add(UL_COMPILE_COLLECT, "Collect"); + add(UL_COMPILE_MERGE_TILE_MAP_POST, "Post-compile"); + + add(UL_COMPILE_CHECK_TILE_MAP_DESC, "Check for tile maps to compile"); + add(UL_COMPILE_CHECK_FLAT_MAP_DESC, "Check for flat maps to merge"); + add(UL_COMPILE_MERGE_TILE_MAP_DESC, "Compile tile map"); + add(UL_COMPILE_MERGE_FLAT_MAP_DESC, "Merge flat map"); + add(UL_COMPILE_MERGE_TILE_MAP_PRE_DESC, "Pre-compile"); + add(UL_COMPILE_PHASE_1_DESC, "Allocate memory for all tiles"); + add(UL_COMPILE_ALLOC_DESC, "Output registers and gate allocation"); + add(UL_COMPILE_PHASE_2_DESC, "Search for connected registers"); + add(UL_COMPILE_PATHFIND_DESC, "Input register search"); + add(UL_COMPILE_PHASE_3_DESC, "Look up passing signals"); + add(UL_COMPILE_PF_MANIFEST_DESC, "Passing signals lookup"); + add(UL_COMPILE_PHASE_4_DESC, "Declare register remaps"); + add(UL_COMPILE_ADD_REMAPS_DESC, "Declare remaps"); + add(UL_COMPILE_PHASE_5_DESC, "Apply register remaps"); + add(UL_COMPILE_REMAP_DESC, "Apply remaps"); + add(UL_COMPILE_PHASE_6_DESC, "Collect gates and registers"); + add(UL_COMPILE_COLLECT_DESC, "Gates and registers collected"); + add(UL_COMPILE_MERGE_TILE_MAP_POST_DESC, "Post-compile"); + add(UL_MULTIPLE_DRIVERS_TITLE, "Multiple drivers"); add(UL_MULTIPLE_DRIVERS_DESC, "Multiple registers connected to an input:"); add(UL_DEAD_WIRE_TITLE, "Dead wire"); @@ -155,5 +195,9 @@ protected void addTranslations() { add(UL_DIMENSIONS_DIES_TOTAL, "%d dies x %d dies (%d dies^2)"); add(UL_UNIT_ONLY_TICKS, "ticks"); + add(UL_UNIT_ONLY_REGISTERS, "registers"); + add(UL_UNIT_ONLY_GATES, "gates"); + add(UL_UNIT_ONLY_REMAPS, "remaps"); + add(UL_UNIT_ONLY_NONE, "none"); } } diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/log/ICCompilerLog.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/log/ICCompilerLog.java index 17a5ee548..cdb623ca8 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/log/ICCompilerLog.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/engine/log/ICCompilerLog.java @@ -29,6 +29,8 @@ public class ICCompilerLog implements ICStepThroughAssembler.EventReceiver { private int warningCount = 0; private int errorCount = 0; + private final List treeChangedListeners = new LinkedList<>(); + public ICCompilerLog(ICEditorStateMachine stateMachine) { this.stateMachine = stateMachine; } @@ -100,6 +102,7 @@ public void clear() { problems.clear(); warningCount = 0; errorCount = 0; + notifyListeners(); } public int getTotalSteps() { @@ -122,6 +125,16 @@ public int getWarningCount() { return warningCount; } + public void addTreeChangedListener(Runnable listener) { + treeChangedListeners.add(listener); + } + + private void notifyListeners() { + for (Runnable listener : treeChangedListeners) { + listener.run(); + } + } + //region ICStepThroughAssembler.EventReceiver @Override public void onStepAdded(ICStepThroughAssembler.AssemblerStepDescriptor descriptor) { @@ -129,6 +142,7 @@ public void onStepAdded(ICStepThroughAssembler.AssemblerStepDescriptor descripto node.step = descriptor.getStepType(); sendNodeAdded(node, descriptor.getTreePath()); + notifyListeners(); } @Override @@ -144,6 +158,7 @@ public void onStepExecuted(ICStepThroughAssembler.AssemblerStepResult result) { completedSteps++; sendNodeExecuted(node, result.getTreePath()); + notifyListeners(); } //endregion @@ -162,20 +177,11 @@ public void addProblem(CompileProblem problem) { //region Packet handling public void readLogStream(MCDataInput in, int key) { switch (key) { - case KEY_COMPILER_LOG_CLEARED: - clear(); - break; - case KEY_COMPILER_LOG_NODE_ADDED: - readNodeAdded(in); - break; - case KEY_COMPILER_LOG_NODE_EXECUTED: - readNodeExecuted(in); - break; - case KEY_COMPILER_LOG_PROBLEM_ADDED: - readProblemAdded(in); - break; - default: - throw new IllegalArgumentException("Unknown compiler stream key: " + key); + case KEY_COMPILER_LOG_CLEARED -> clear(); + case KEY_COMPILER_LOG_NODE_ADDED -> readNodeAdded(in); + case KEY_COMPILER_LOG_NODE_EXECUTED -> readNodeExecuted(in); + case KEY_COMPILER_LOG_PROBLEM_ADDED -> readProblemAdded(in); + default -> throw new IllegalArgumentException("Unknown compiler stream key: " + key); } } //endregion @@ -215,6 +221,7 @@ private void addProblemInternal(CompileProblem problem) { case WARNING -> warningCount++; case ERROR -> errorCount++; } + notifyListeners(); } //endregion @@ -227,6 +234,7 @@ private void readNodeAdded(MCDataInput in) { } CompileTreeNode node = compileTree.findOrCreateNode(path); node.step = ICStepThroughAssembler.AssemblerStepType.values()[in.readUByte()]; + notifyListeners(); } private void readNodeExecuted(MCDataInput in) { @@ -241,6 +249,7 @@ private void readNodeExecuted(MCDataInput in) { currentPath.clear(); currentPath.addAll(path); completedSteps++; + notifyListeners(); } private void readProblemAdded(MCDataInput in) { @@ -253,6 +262,10 @@ public List getCurrentStack() { return compileTree.getStack(currentPath); } + public List getRootNodes() { + return compileTree.rootNodes; + } + public int getProgressScaled(int scale) { int size = compileTree.size(); return size == 0 ? 0 : completedSteps * scale / size; @@ -399,6 +412,46 @@ protected void readDesc(MCDataInput in) { children.add(child); } } + + public int countRegIdsInSubtree() { + //TODO cache + int count = registerIds.size(); + for (CompileTreeNode child : children) { + count += child.countRegIdsInSubtree(); + } + return count; + } + + public int countGateIdsInSubtree() { + //TODO cache + int count = gateIds.size(); + for (CompileTreeNode child : children) { + count += child.countGateIdsInSubtree(); + } + return count; + } + + public int countRemapsInSubtree() { + //TODO cache + int count = registerRemaps.size(); + for (CompileTreeNode child : children) { + count += child.countRemapsInSubtree(); + } + return count; + } + + public boolean isEmpty() { + return registerIds.isEmpty() && gateIds.isEmpty() && registerRemaps.isEmpty(); + } + + public void getPositionsInTree(List pList) { + if (!isEmpty()) { + pList.addAll(tileCoords); + for (CompileTreeNode child : children) { + child.getPositionsInTree(pList); + } + } + } } public static class CompileTree { diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CTNListNode.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CTNListNode.java index 0af7a58fa..14431d2f4 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CTNListNode.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CTNListNode.java @@ -7,20 +7,23 @@ import mrtjp.projectred.lib.Point; import mrtjp.projectred.lib.Rect; import mrtjp.projectred.redui.AbstractGuiNode; -import net.minecraft.client.gui.GuiComponent; +import mrtjp.projectred.redui.RedUISprite; import net.minecraft.network.chat.Component; +import javax.annotation.Nullable; import java.util.LinkedList; import java.util.List; +import static mrtjp.projectred.fabrication.editor.ICWorkbenchEditor.UNIFORM; + public class CTNListNode extends AbstractGuiNode { private final List nodeList = new LinkedList<>(); - private final AbstractGuiNode listParent = new AbstractGuiNode() { - }; + private double scroll = 0; + public CTNListNode() { initSubNodes(); } @@ -30,9 +33,11 @@ private void initSubNodes() { } public void setNodeList(List nodeList) { - this.nodeList.clear(); - this.nodeList.addAll(nodeList); - refreshListItems(); + if (!this.nodeList.equals(nodeList)) { + this.nodeList.clear(); + this.nodeList.addAll(nodeList); + refreshListItems(); + } } private void refreshListItems() { @@ -46,6 +51,32 @@ private void refreshListItems() { listParent.addChild(item); y += item.calculateAccumulatedFrame().height(); } + + moveListToScroll(); + } + + public void setScrollPercentage(double scrollPercentage) { + this.scroll = scrollPercentage; + moveListToScroll(); + } + + private void moveListToScroll() { + Rect subFrame = calculateChildrenFrame(); + if (subFrame.height() <= getFrame().height()) return; + + int totalScroll = subFrame.height() - getFrame().height(); // How much scroll is possible + int dist = (int) (totalScroll * scroll); // How much we want to scroll + + listParent.setPosition(0, -dist); + } + + public @Nullable CompileTreeNode getSelectedNode() { + for (var child : listParent.getOurChildren()) { + if (child instanceof CompileTreeNodeListItem item && item.selected) { + return item.node; + } + } + return null; } @Override @@ -63,27 +94,34 @@ public void onSubTreePostDrawBack() { RenderSystem.disableScissor(); } + private void selectNodeInList(CompileTreeNodeListItem node) { + for (var child : listParent.getOurChildren()) { + if (child instanceof CompileTreeNodeListItem item) { + item.selected = item == node; + } + } + } + private class CompileTreeNodeListItem extends AbstractGuiNode { + private static final RedUISprite BACKGROUND_UNSELECTED = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 1, 375, 79, 12, 512, 512); + private static final RedUISprite BACKGROUND_SELECTED = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 81, 375, 79, 12, 512, 512); + private final CompileTreeNode node; + private boolean selected = false; public CompileTreeNodeListItem(CompileTreeNode node) { this.node = node; - - setSize(67, 16); + setSize(68, 12); } @Override public void drawBack(PoseStack stack, Point mouse, float partialFrame) { - RenderSystem.setShaderTexture(0, ICWorkbenchCompileTab.TAB_BACKGROUND); + blitSprite(stack, selected ? BACKGROUND_SELECTED : BACKGROUND_UNSELECTED); - GuiComponent.blit(stack, getFrame().x(), getFrame().y(), 1, 358, getFrame().width(), getFrame().height(), 512, 512); - - String s = node.step.toString(); - if (s.length() > 10) { - s = s.substring(s.length() - 10); - } - getRoot().getFontRenderer().draw(stack, s, getFrame().x() + 2, getFrame().y() + 2, 0xFFFFFF); + var fr = getRoot().getFontRenderer(); + Component c = CompileTreeTab.getTitleForCTNNode(node).copy().withStyle(UNIFORM); + fr.draw(stack, c, getFrame().x() + 2, getFrame().y() + getFrame().height() / 2f - fr.lineHeight / 2f, 0xFFFFFF); } @Override @@ -92,12 +130,7 @@ public void drawFront(PoseStack stack, Point mouse, float partialFrame) { if (!isFirstHit(mouse)) return; List toolTip = new LinkedList<>(); - toolTip.add(Component.literal(node.step.toString())); //TODO localize - toolTip.add(Component.literal("Positions: " + node.tileCoords.size())); - toolTip.add(Component.literal("Registers: " + node.registerIds.size())); - toolTip.add(Component.literal("Gates: " + node.gateIds.size())); - toolTip.add(Component.literal("Remaps: " + node.registerRemaps.size())); - + CompileTreeTab.buildTooltipForCTNNode(node, toolTip); renderTooltip(stack, mouse, toolTip); } @@ -105,5 +138,14 @@ public void drawFront(PoseStack stack, Point mouse, float partialFrame) { public boolean checkHit(Point absPoint) { return super.checkHit(absPoint) && CTNListNode.this.convertParentRectToScreen(CTNListNode.this.getFrame()).contains(absPoint); } + + @Override + public boolean mouseClicked(Point p, int glfwMouseButton, boolean consumed) { + if (!consumed && isFirstHit(p)) { + selectNodeInList(this); + return true; + } + return false; + } } } diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileProblemsTab.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileProblemsTab.java index e63e1f686..2b2328846 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileProblemsTab.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileProblemsTab.java @@ -35,10 +35,10 @@ private void initSubNodes() { // Stack issueListNode.setPosition(6, 31); - issueListNode.setSize(67, 95); + issueListNode.setSize(79, 95); addChild(issueListNode); - // Scrollbar //TODO + // Scrollbar ScrollBar scrollBar = new ScrollBar(); scrollBar.setPosition(77, 31); scrollBar.setZPosition(0.2); @@ -54,11 +54,13 @@ public void drawBack(PoseStack stack, Point mouse, float partialFrame) { } @Override - public void update() { - if (!isHidden()) { - // TODO only do this when issue log changes - issueListNode.setProblemList(editor.getStateMachine().getCompilerLog().getProblems()); - } + public void onAddedToParent() { + editor.getStateMachine().getCompilerLog().addTreeChangedListener(this::refreshList); + refreshList(); + } + + private void refreshList() { + issueListNode.setProblemList(editor.getStateMachine().getCompilerLog().getProblems()); } //region ICompileTabOverlayRenderer diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileStackTab.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileStackTab.java index d095abcf4..a6707c8da 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileStackTab.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileStackTab.java @@ -37,7 +37,7 @@ private void initSubNodes() { // Stack ctnListNode.setPosition(6, 31); - ctnListNode.setSize(67, 95); + ctnListNode.setSize(79, 95); addChild(ctnListNode); // Scrollbar //TODO @@ -56,12 +56,14 @@ public void drawBack(PoseStack stack, Point mouse, float partialFrame) { } @Override - public void update() { - if (!isHidden()) { - // TODO only do this when the stack changes - List execStack = editor.getStateMachine().getCompilerLog().getCurrentStack(); - ctnListNode.setNodeList(execStack); - } + public void onAddedToParent() { + editor.getStateMachine().getCompilerLog().addTreeChangedListener(this::refreshList); + refreshList(); + } + + private void refreshList() { + List execStack = editor.getStateMachine().getCompilerLog().getCurrentStack(); + ctnListNode.setNodeList(execStack); } private void renderCompileTreeNode(ICCompilerLog.CompileTreeNode node, CCRenderState ccrs, MultiBufferSource getter, PoseStack matrixStack) { diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileTreeTab.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileTreeTab.java index 555cd1eef..ead8f1ae8 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileTreeTab.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/CompileTreeTab.java @@ -1,23 +1,93 @@ package mrtjp.projectred.fabrication.gui; +import codechicken.lib.colour.EnumColour; import codechicken.lib.render.CCRenderState; import codechicken.lib.vec.Vector3; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; +import mrtjp.fengine.TileCoord; +import mrtjp.fengine.api.ICStepThroughAssembler; import mrtjp.projectred.fabrication.editor.ICWorkbenchEditor; +import mrtjp.projectred.fabrication.engine.log.ICCompilerLog.CompileTreeNode; import mrtjp.projectred.fabrication.gui.screen.ICWorkbenchCompileTab; import mrtjp.projectred.lib.Point; +import mrtjp.projectred.lib.Rect; import mrtjp.projectred.redui.AbstractGuiNode; +import mrtjp.projectred.redui.RedUISprite; +import mrtjp.projectred.redui.ScrollBarNode; +import mrtjp.projectred.redui.SpriteButtonNode; +import net.covers1624.quack.collection.FastStream; import net.minecraft.client.gui.GuiComponent; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.Style; -import java.util.List; +import javax.annotation.Nullable; +import java.util.*; + +import static mrtjp.fengine.api.ICStepThroughAssembler.AssemblerStepType.*; +import static mrtjp.projectred.fabrication.editor.ICWorkbenchEditor.UNIFORM_DARK_GRAY; +import static mrtjp.projectred.fabrication.editor.ICWorkbenchEditor.UNIFORM_GRAY; +import static mrtjp.projectred.fabrication.init.FabricationUnlocal.*; public class CompileTreeTab extends AbstractGuiNode implements ICompileOverlayRenderer { + public static final Map STEP_TYPE_NAMES; + public static final Map STEP_TYPE_DESC; + static { + Map map = new EnumMap<>(ICStepThroughAssembler.AssemblerStepType.class); + map.put(CHECK_OPEN_TILE_MAPS, UL_COMPILE_CHECK_TILE_MAP); + map.put(CHECK_OPEN_FLAT_MAPS, UL_COMPILE_CHECK_FLAT_MAP); + map.put(MERGE_TILE_MAP, UL_COMPILE_MERGE_TILE_MAP); + map.put(MERGE_FLAT_MAP, UL_COMPILE_MERGE_FLAT_MAP); + map.put(MERGE_TILE_MAP_PRE, UL_COMPILE_MERGE_TILE_MAP_PRE); + map.put(MERGE_TILE_MAP_PHASE1, UL_COMPILE_PHASE_1); + map.put(PHASE1_ALLOC, UL_COMPILE_ALLOC); + map.put(MERGE_TILE_MAP_PHASE2, UL_COMPILE_PHASE_2); + map.put(PHASE2_PATHFIND, UL_COMPILE_PATHFIND); + map.put(MERGE_TILE_MAP_PHASE3, UL_COMPILE_PHASE_3); + map.put(PHASE3_PF_MANIFEST_SEARCH, UL_COMPILE_PF_MANIFEST); + map.put(MERGE_TILE_MAP_PHASE4, UL_COMPILE_PHASE_4); + map.put(PHASE4_REGISTER_REMAPS, UL_COMPILE_ADD_REMAPS); + map.put(MERGE_TILE_MAP_PHASE5, UL_COMPILE_PHASE_5); + map.put(PHASE5_CONSUME_REMAPS, UL_COMPILE_REMAP); + map.put(MERGE_TILE_MAP_PHASE6, UL_COMPILE_PHASE_6); + map.put(PHASE6_COLLECT, UL_COMPILE_COLLECT); + map.put(MERGE_TILE_MAP_POST, UL_COMPILE_MERGE_TILE_MAP_POST); + STEP_TYPE_NAMES = Collections.unmodifiableMap(map); + + map = new EnumMap<>(ICStepThroughAssembler.AssemblerStepType.class); + map.put(CHECK_OPEN_TILE_MAPS, UL_COMPILE_CHECK_TILE_MAP_DESC); + map.put(CHECK_OPEN_FLAT_MAPS, UL_COMPILE_CHECK_FLAT_MAP_DESC); + map.put(MERGE_TILE_MAP, UL_COMPILE_MERGE_TILE_MAP_DESC); + map.put(MERGE_FLAT_MAP, UL_COMPILE_MERGE_FLAT_MAP_DESC); + map.put(MERGE_TILE_MAP_PRE, UL_COMPILE_MERGE_TILE_MAP_PRE_DESC); + map.put(MERGE_TILE_MAP_PHASE1, UL_COMPILE_PHASE_1_DESC); + map.put(PHASE1_ALLOC, UL_COMPILE_ALLOC_DESC); + map.put(MERGE_TILE_MAP_PHASE2, UL_COMPILE_PHASE_2_DESC); + map.put(PHASE2_PATHFIND, UL_COMPILE_PATHFIND_DESC); + map.put(MERGE_TILE_MAP_PHASE3, UL_COMPILE_PHASE_3_DESC); + map.put(PHASE3_PF_MANIFEST_SEARCH, UL_COMPILE_PF_MANIFEST_DESC); + map.put(MERGE_TILE_MAP_PHASE4, UL_COMPILE_PHASE_4_DESC); + map.put(PHASE4_REGISTER_REMAPS, UL_COMPILE_ADD_REMAPS_DESC); + map.put(MERGE_TILE_MAP_PHASE5, UL_COMPILE_PHASE_5_DESC); + map.put(PHASE5_CONSUME_REMAPS, UL_COMPILE_REMAP_DESC); + map.put(MERGE_TILE_MAP_PHASE6, UL_COMPILE_PHASE_6_DESC); + map.put(PHASE6_COLLECT, UL_COMPILE_COLLECT_DESC); + map.put(MERGE_TILE_MAP_POST, UL_COMPILE_MERGE_TILE_MAP_POST_DESC); + STEP_TYPE_DESC = Collections.unmodifiableMap(map); + } + + private static final RedUISprite STEP_OUT_SPRITE = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 335, 41, 14, 14, 512, 512); + private static final RedUISprite STEP_IN_SPRITE = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 320, 41, 14, 14, 512, 512); + private final ICWorkbenchEditor editor; + private final CTNListNode ctnListNode = new CTNListNode(); + + private final Stack backStack = new Stack<>(); + private @Nullable CompileTreeNode currentNode = null; + public CompileTreeTab(ICWorkbenchEditor editor) { this.editor = editor; setSize(91, 134); @@ -25,23 +95,242 @@ public CompileTreeTab(ICWorkbenchEditor editor) { } private void initSubNodes() { + + // Stack + ctnListNode.setPosition(6, 31); + ctnListNode.setSize(79, 95); + addChild(ctnListNode); + + // Scrollbar + ScrollBar scrollBar = new ScrollBar(); + scrollBar.setPosition(77, 31); + scrollBar.setZPosition(0.2); + scrollBar.setSize(8, 95); + scrollBar.setSliderSize(8, 16); + addChild(scrollBar); + + // Step out button + SpriteButtonNode stepOut = new SpriteButtonNode(STEP_OUT_SPRITE); + stepOut.setClickReceiver(this::stepOut); + stepOut.setIsDisabledProvider(() -> currentNode == null); + stepOut.setPosition(5, 5); + stepOut.setSize(16, 16); + addChild(stepOut); + + // Step in button + SpriteButtonNode stepIn = new SpriteButtonNode(STEP_IN_SPRITE); + stepIn.setClickReceiver(this::stepIn); + stepIn.setIsDisabledProvider(() -> { + var n = ctnListNode.getSelectedNode(); + return n == null || n.children.isEmpty(); + }); + stepIn.setPosition(23, 5); + stepIn.setSize(16, 16); + addChild(stepIn); } @Override public void drawBack(PoseStack stack, Point mouse, float partialFrame) { RenderSystem.setShaderTexture(0, ICWorkbenchCompileTab.TAB_BACKGROUND); GuiComponent.blit(stack, getFrame().x(), getFrame().y(), 92, 223, getFrame().width(), getFrame().height(), 512, 512); + + // Title of current node + if (currentNode != null) { + var fr = getRoot().getFontRenderer(); + Component c = getTitleForCTNNode(currentNode).copy().withStyle(UNIFORM_DARK_GRAY); + fr.draw(stack, c, getFrame().x() + 6, getFrame().y() + 21, 0xFFFFFF); + } + } + + //region Navigation control + private void stepIn() { + // Get the selected node that we will step into + var selected = ctnListNode.getSelectedNode(); + if (selected == null) return; + + // Add current node to backstack and switch to new node + if (currentNode != null) backStack.push(currentNode); + currentNode = selected; + + // Update list + refreshList(); + } + + private void stepOut() { + // Set to null if no more previous nodes. This will force root nodes to be displayed + currentNode = backStack.isEmpty() ? null : backStack.pop(); + + // Refresh list + refreshList(); + } + //endregion + + @Override + public void onAddedToParent() { + editor.getStateMachine().getCompilerLog().addTreeChangedListener(this::refreshList); + refreshList(); + } + + private void refreshList() { + var log = editor.getStateMachine().getCompilerLog(); + if (log.getCurrentStack().isEmpty()) { //TODO separate receiver for this case? + currentNode = null; + backStack.clear(); + } else if (currentNode == null) { + ctnListNode.setNodeList(editor.getStateMachine().getCompilerLog().getRootNodes()); + } else { + ctnListNode.setNodeList(currentNode.children); + } } //region ICompileTabOverlayRenderer @Override public void renderOverlay(ICRenderNode renderNode, Vector3 mousePosition, boolean isFirstHit, CCRenderState ccrs, MultiBufferSource getter, PoseStack matrixStack) { + var node = ctnListNode.getSelectedNode(); + if (node == null) node = currentNode; + + if (node != null) { + renderOverlayForNode(node, ccrs, getter, matrixStack); + } } @Override public void buildTooltip(ICRenderNode renderNode, Vector3 mousePosition, List tooltip) { } + + private void renderOverlayForNode(CompileTreeNode node, CCRenderState ccrs, MultiBufferSource getter, PoseStack matrixStack) { + ccrs.reset(); + ccrs.bind(ICRenderTypes.selectionRenderType, getter, matrixStack); + + // Render subnode positions in fainter color + ccrs.baseColour = EnumColour.WHITE.rgba(127); + + List coords = new LinkedList<>(); + for (var c : node.children) { + c.getPositionsInTree(coords); + } + + for (var pos : coords) { + Vector3 p = new Vector3(pos.x, pos.y, pos.z); + ICRenderTypes.renderSelection(ccrs, p, p.copy().add(0.01), 3 / 16D, 2 / 16D); + } + + // Render current node positions in full color + ccrs.baseColour = EnumColour.WHITE.rgba(); + for (var pos : node.tileCoords) { + Vector3 p = new Vector3(pos.x, pos.y, pos.z); + ICRenderTypes.renderSelection(ccrs, p, p.copy().add(0.01), 3 / 16D, 2 / 16D); + } + } //endregion + + public static Component getTitleForCTNNode(CompileTreeNode node) { + + String pos = node.tileCoords.isEmpty() ? "" : "[%d, %d, %d]".formatted(node.tileCoords.get(0).x, node.tileCoords.get(0).y, node.tileCoords.get(0).z); + return switch (node.step) { + case PHASE1_ALLOC -> Component.translatable(UL_COMPILE_ALLOC).append(" " + pos); + case PHASE2_PATHFIND -> Component.translatable(UL_COMPILE_PATHFIND).append(" " + pos); + case PHASE3_PF_MANIFEST_SEARCH -> Component.translatable(UL_COMPILE_PF_MANIFEST).append(" " + pos); + case PHASE4_REGISTER_REMAPS -> Component.translatable(UL_COMPILE_ADD_REMAPS).append(" " + pos); + case PHASE5_CONSUME_REMAPS -> Component.translatable(UL_COMPILE_REMAP).append(" " + pos); + case PHASE6_COLLECT -> Component.translatable(UL_COMPILE_COLLECT).append(" " + pos); + + default -> Component.translatable(STEP_TYPE_NAMES.get(node.step)); + }; + } + + public static void buildTooltipForCTNNode(CompileTreeNode node, List toolTip) { + toolTip.add(getTitleForCTNNode(node)); + toolTip.add(Component.translatable(STEP_TYPE_DESC.get(node.step)).withStyle(UNIFORM_GRAY)); + + if (!node.registerIds.isEmpty()) { + toolTip.add(Component.translatable(UL_UNIT_ONLY_REGISTERS).append(":").withStyle(UNIFORM_GRAY)); + addIntegerList(toolTip, node.registerIds, "R", 2, 4, UNIFORM_GRAY); + } + + if (!node.gateIds.isEmpty()) { + toolTip.add(Component.translatable(UL_UNIT_ONLY_GATES).append(":").withStyle(UNIFORM_GRAY)); + addIntegerList(toolTip, node.gateIds, "G", 2, 4, UNIFORM_GRAY); + } + + if (!node.registerRemaps.isEmpty()) { + toolTip.add(Component.translatable(UL_UNIT_ONLY_REMAPS).append(":").withStyle(UNIFORM_GRAY)); + addIntegerMap(toolTip, node.registerRemaps, "R", 2, 4, UNIFORM_GRAY); + } + + if (!node.children.isEmpty()) { + int r = node.countRegIdsInSubtree(); + int g = node.countGateIdsInSubtree(); + int m = node.countRemapsInSubtree(); + + if (r > 0) { + toolTip.add(Component.literal(" " + r + " ").append(Component.translatable(UL_UNIT_ONLY_REGISTERS)).withStyle(UNIFORM_GRAY)); + } + if (g > 0) { + toolTip.add(Component.literal(" " + g + " ").append(Component.translatable(UL_UNIT_ONLY_GATES)).withStyle(UNIFORM_GRAY)); + } + if (m > 0) { + toolTip.add(Component.literal(" " + m + " ").append(Component.translatable(UL_UNIT_ONLY_REMAPS)).withStyle(UNIFORM_GRAY)); + } + } + } + + private static void addIntegerMap(List toolTip, Map regMap, String prefix, int indent, int limitPerLine, Style style) { + var list = FastStream.of(regMap.entrySet()).map(e -> prefix + e.getKey() + " -> " + prefix + e.getValue()).toList(); + addStringList(toolTip, list, indent, limitPerLine, style); + } + + private static void addIntegerList(List toolTip, List regList, String prefix, int indent, int limitPerLine, Style style) { + var list = FastStream.of(regList).map(i -> prefix + i).toList(); + addStringList(toolTip, list, indent, limitPerLine, style); + } + + private static void addStringList(List toolTip, List strList, int indent, int limitPerLine, Style style) { + + Component indentStr = Component.literal(" ".repeat(indent)); + + if (strList.isEmpty()) { + toolTip.add(indentStr.copy().append(Component.translatable(UL_UNIT_ONLY_NONE)).withStyle(UNIFORM_GRAY)); + return; + } + + StringBuilder s = new StringBuilder(); + int i = 0; + for (var str : strList) { + s.append(str); + + // Add comma if not last element + if (i < strList.size() - 1) { + s.append(", "); + } + + i++; + + // If last string or line is ended + if (i == strList.size() || (i > 0 && i % limitPerLine == 0)) { + toolTip.add(indentStr.copy().append(s.toString()).withStyle(style)); + s = new StringBuilder(); + } + } + } + + private class ScrollBar extends ScrollBarNode { + + public ScrollBar() { + super(ScrollAxis.VERTICAL); + } + + @Override + protected void drawSlider(PoseStack stack, Rect sliderFrame) { + RenderSystem.setShaderTexture(0, ICWorkbenchCompileTab.TAB_BACKGROUND); + GuiComponent.blit(stack, sliderFrame.x(), sliderFrame.y(), 305, 58, sliderFrame.width(), sliderFrame.height(), 512, 512); + } + + @Override + protected void adjustContent(double scrollPercentage) { + ctnListNode.setScrollPercentage(scrollPercentage); + } + } } diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/ProblemListNode.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/ProblemListNode.java index 0ab125ecd..e84f614fe 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/ProblemListNode.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/gui/ProblemListNode.java @@ -2,12 +2,13 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; +import mrtjp.projectred.fabrication.editor.ICWorkbenchEditor; import mrtjp.projectred.fabrication.engine.log.CompileProblem; import mrtjp.projectred.fabrication.gui.screen.ICWorkbenchCompileTab; import mrtjp.projectred.lib.Point; import mrtjp.projectred.lib.Rect; import mrtjp.projectred.redui.AbstractGuiNode; -import net.minecraft.client.gui.GuiComponent; +import mrtjp.projectred.redui.RedUISprite; import net.minecraft.network.chat.Component; import java.util.LinkedList; @@ -84,21 +85,23 @@ public void onSubTreePostDrawBack() { private class IssueListItemNode extends AbstractGuiNode { + private static final RedUISprite BACKGROUND_UNSELECTED = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 1, 375, 79, 12, 512, 512); +// private static final RedUISprite BACKGROUND_SELECTED = new RedUISprite(ICWorkbenchCompileTab.TAB_BACKGROUND, 81, 375, 79, 12, 512, 512); + private final CompileProblem issue; public IssueListItemNode(CompileProblem issue) { this.issue = issue; - setSize(67, 12); + setSize(79, 12); } @Override public void drawBack(PoseStack stack, Point mouse, float partialFrame) { - RenderSystem.setShaderTexture(0, ICWorkbenchCompileTab.TAB_BACKGROUND); - - GuiComponent.blit(stack, getFrame().x(), getFrame().y(), 1, 375, getFrame().width(), getFrame().height(), 512, 512); + blitSprite(stack, BACKGROUND_UNSELECTED); - Component s = issue.getName(); - getRoot().getFontRenderer().draw(stack, s, getFrame().x() + 2, getFrame().y() + 2, 0xFFFFFF); + var fr = getRoot().getFontRenderer(); + Component c = issue.getName().copy().withStyle(ICWorkbenchEditor.UNIFORM); + fr.draw(stack, c, getFrame().x() + 2, getFrame().y() + getFrame().height() / 2f - fr.lineHeight / 2f, 0xFFFFFF); } @Override @@ -106,6 +109,7 @@ public void drawFront(PoseStack stack, Point mouse, float partialFrame) { if (!isFirstHit(mouse)) return; List toolTip = new LinkedList<>(); + toolTip.add(issue.getName()); issue.buildToolTip(toolTip); renderTooltip(stack, mouse, toolTip); } diff --git a/fabrication/src/main/java/mrtjp/projectred/fabrication/init/FabricationUnlocal.java b/fabrication/src/main/java/mrtjp/projectred/fabrication/init/FabricationUnlocal.java index 1f2b7d161..e4d990e4a 100644 --- a/fabrication/src/main/java/mrtjp/projectred/fabrication/init/FabricationUnlocal.java +++ b/fabrication/src/main/java/mrtjp/projectred/fabrication/init/FabricationUnlocal.java @@ -34,6 +34,48 @@ public class FabricationUnlocal { public static final String UL_TIME_DELAY = PREFIX + "interact.delay"; public static final String UL_DEFAULT_STATE = PREFIX + "interact.default_state"; + // Compile + public static final String UL_COMPILE_TREE = PREFIX + "compile.tree"; + public static final String UL_COMPILE_STACK = PREFIX + "compile.stack"; + public static final String UL_COMPILE_CHECK_TILE_MAP = PREFIX + "compile.step.check_tile_maps"; + public static final String UL_COMPILE_CHECK_FLAT_MAP = PREFIX + "compile.step.check_flat_maps"; + public static final String UL_COMPILE_MERGE_TILE_MAP = PREFIX + "compile.step.merge_tile_map"; + public static final String UL_COMPILE_MERGE_FLAT_MAP = PREFIX + "compile.step.merge_flat_map"; + public static final String UL_COMPILE_MERGE_TILE_MAP_PRE = PREFIX + "compile.step.merge_tile_map_pre"; + public static final String UL_COMPILE_PHASE_1 = PREFIX + "compile.step.merge_tile_map_phase1"; + public static final String UL_COMPILE_ALLOC = PREFIX + "compile.step.merge_tile_map_alloc"; + public static final String UL_COMPILE_PHASE_2 = PREFIX + "compile.step.merge_tile_map_phase2"; + public static final String UL_COMPILE_PATHFIND = PREFIX + "compile.step.merge_tile_map_pathfind"; + public static final String UL_COMPILE_PHASE_3 = PREFIX + "compile.step.merge_tile_map_phase3"; + public static final String UL_COMPILE_PF_MANIFEST = PREFIX + "compile.step.merge_tile_map_manifest_search"; + public static final String UL_COMPILE_PHASE_4 = PREFIX + "compile.step.merge_tile_map_phase4"; + public static final String UL_COMPILE_ADD_REMAPS = PREFIX + "compile.step.merge_tile_map_add_remaps"; + public static final String UL_COMPILE_PHASE_5 = PREFIX + "compile.step.merge_tile_map_phase5"; + public static final String UL_COMPILE_REMAP = PREFIX + "compile.step.merge_tile_map_consume_remaps"; + public static final String UL_COMPILE_PHASE_6 = PREFIX + "compile.step.merge_tile_map_phase6"; + public static final String UL_COMPILE_COLLECT = PREFIX + "compile.step.merge_tile_map_collect"; + public static final String UL_COMPILE_MERGE_TILE_MAP_POST = PREFIX + "compile.step.merge_tile_map_post"; + + public static final String UL_COMPILE_CHECK_TILE_MAP_DESC = PREFIX + "compile.step.check_tile_maps.desc"; + public static final String UL_COMPILE_CHECK_FLAT_MAP_DESC = PREFIX + "compile.step.check_flat_maps.desc"; + public static final String UL_COMPILE_MERGE_TILE_MAP_DESC = PREFIX + "compile.step.merge_tile_map.desc"; + public static final String UL_COMPILE_MERGE_FLAT_MAP_DESC = PREFIX + "compile.step.merge_flat_map.desc"; + public static final String UL_COMPILE_MERGE_TILE_MAP_PRE_DESC = PREFIX + "compile.step.merge_tile_map_pre.desc"; + public static final String UL_COMPILE_PHASE_1_DESC = PREFIX + "compile.step.merge_tile_map_phase1.desc"; + public static final String UL_COMPILE_ALLOC_DESC = PREFIX + "compile.step.merge_tile_map_alloc.desc"; + public static final String UL_COMPILE_PHASE_2_DESC = PREFIX + "compile.step.merge_tile_map_phase2.desc"; + public static final String UL_COMPILE_PATHFIND_DESC = PREFIX + "compile.step.merge_tile_map_pathfind.desc"; + public static final String UL_COMPILE_PHASE_3_DESC = PREFIX + "compile.step.merge_tile_map_phase3.desc"; + public static final String UL_COMPILE_PF_MANIFEST_DESC = PREFIX + "compile.step.merge_tile_map_manifest_search.desc"; + public static final String UL_COMPILE_PHASE_4_DESC = PREFIX + "compile.step.merge_tile_map_phase4.desc"; + public static final String UL_COMPILE_ADD_REMAPS_DESC = PREFIX + "compile.step.merge_tile_map_add_remaps.desc"; + public static final String UL_COMPILE_PHASE_5_DESC = PREFIX + "compile.step.merge_tile_map_phase5.desc"; + public static final String UL_COMPILE_REMAP_DESC = PREFIX + "compile.step.merge_tile_map_consume_remaps.desc"; + public static final String UL_COMPILE_PHASE_6_DESC = PREFIX + "compile.step.merge_tile_map_phase6.desc"; + public static final String UL_COMPILE_COLLECT_DESC = PREFIX + "compile.step.merge_tile_map_collect.desc"; + public static final String UL_COMPILE_MERGE_TILE_MAP_POST_DESC = PREFIX + "compile.step.merge_tile_map_post.desc"; + + // Problems public static final String UL_MULTIPLE_DRIVERS_TITLE = PREFIX + "problems.multiple_drivers.title"; public static final String UL_MULTIPLE_DRIVERS_DESC = PREFIX + "problems.multiple_drivers.desc"; @@ -119,15 +161,19 @@ public class FabricationUnlocal { public static final String UL_INTERFACE_BUNDLED = PREFIX + "interface.bundled"; // Numbers and measurements //TODO drop this formattable ones and just do it in code - public static final String UL_UNIT_WARNINGS = PREFIX + "unit.warnings"; - public static final String UL_UNIT_ERRORS = PREFIX + "unit.errors"; - public static final String UL_UNIT_TICKS = PREFIX + "unit.ticks"; - public static final String UL_DIMENSIONS_NM = PREFIX + "dimensions.nm"; - public static final String UL_DIMENSIONS_TILES = PREFIX + "dimensions.tiles"; - public static final String UL_DIMENSIONS_DIES = PREFIX + "dimensions.dies"; - public static final String UL_DIMENSIONS_NM_TOTAL = PREFIX + "dimensions.nm_total"; - public static final String UL_DIMENSIONS_TILES_TOTAL = PREFIX + "dimensions.tiles_total"; - public static final String UL_DIMENSIONS_DIES_TOTAL = PREFIX + "dimensions.dies_total"; - - public static final String UL_UNIT_ONLY_TICKS = PREFIX + "unit_only.ticks"; + public static final String UL_UNIT_WARNINGS = PREFIX + "f.unit.warnings"; + public static final String UL_UNIT_ERRORS = PREFIX + "f.unit.errors"; + public static final String UL_UNIT_TICKS = PREFIX + "f.unit.ticks"; + public static final String UL_DIMENSIONS_NM = PREFIX + "f.dimensions.nm"; + public static final String UL_DIMENSIONS_TILES = PREFIX + "f.dimensions.tiles"; + public static final String UL_DIMENSIONS_DIES = PREFIX + "f.dimensions.dies"; + public static final String UL_DIMENSIONS_NM_TOTAL = PREFIX + "f.dimensions.nm_total"; + public static final String UL_DIMENSIONS_TILES_TOTAL = PREFIX + "f.dimensions.tiles_total"; + public static final String UL_DIMENSIONS_DIES_TOTAL = PREFIX + "f.dimensions.dies_total"; + + public static final String UL_UNIT_ONLY_TICKS = PREFIX + "unit.ticks"; + public static final String UL_UNIT_ONLY_REGISTERS = PREFIX + "unit.registers"; + public static final String UL_UNIT_ONLY_GATES = PREFIX + "unit.gates"; + public static final String UL_UNIT_ONLY_REMAPS = PREFIX + "unit.remaps"; + public static final String UL_UNIT_ONLY_NONE = PREFIX + "unit.none"; } diff --git a/fabrication/src/main/resources/assets/projectred_fabrication/textures/gui/compile_tab.png b/fabrication/src/main/resources/assets/projectred_fabrication/textures/gui/compile_tab.png index 22f3fb547..6aa7ca8b5 100644 Binary files a/fabrication/src/main/resources/assets/projectred_fabrication/textures/gui/compile_tab.png and b/fabrication/src/main/resources/assets/projectred_fabrication/textures/gui/compile_tab.png differ diff --git a/gradle.properties b/gradle.properties index 7bf035b23..605ac8bf8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,6 +11,6 @@ cbm_version=3.2.0.+ jei_version=11.5.0.+ cct_version=1.101.3 -fabrication_version=0.1.0-alpha-17 +fabrication_version=0.1.0-alpha-19 org.gradle.jvmargs=-Xmx4096M