Skip to content

Conversation

@ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Nov 29, 2024

What

Ports every multiblock with a UI to use MUI2.

Implementation Details

  • Classes extending MultiMapMultiblockController will need to be updated (GCYM) or override usesMui2() to return false.
  • added KeyUtils to replace TextComponantUtil
  • multiblocks need to override createUIFactory() to create needed sync values and return a configured MultiblockUIFactory
  • createUIFactory() is called during writeInitialSyncData() and receiveInitialSyncData() so that values can be synced correctly before the ui is opened

Currently ported multis are:

  • Large Combustion Engine
  • Large Gas/Plasma/Steam Turbine
  • Electric Blast Furnace
  • Large Boiler
  • Assembly Line
  • Cracking Unit
  • Distillation Tower
  • Fusion Reactor
  • Implosion Compressor
  • Large Chemical Reactor
  • MultiSmelter
  • Processing Array
  • Pyrolyse Oven
  • Research Station
  • Vacuum Freezer

Outcome

multiblock uis are fancier

@ghzdude ghzdude added the type: refactor Suggestion to refactor a section of code label Nov 29, 2024
@ghzdude ghzdude force-pushed the tc/mui2-multis branch 3 times, most recently from 55fefcd to 4dad110 Compare January 9, 2025 23:00
@ghzdude ghzdude force-pushed the tc/mui2-multis branch 2 times, most recently from 6b5159d to 87fdbca Compare January 29, 2025 21:29
@ghzdude ghzdude force-pushed the tc/mui2-multis branch 2 times, most recently from 2b804a0 to 0dfce00 Compare February 3, 2025 22:07
@ghzdude ghzdude force-pushed the tc/mui2-multis branch 2 times, most recently from 2978280 to 1c82647 Compare March 4, 2025 04:59
* @param maxLines the maximum number of lines to print until truncating with {@code ...}
*/
public MultiblockUIBuilder addRecipeOutputLine(AbstractRecipeLogic arl, int maxLines) {
// todo doing this every tick on the server is probably not good
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow check if the previous recipe is the same as the current one? Or if we are calling this method before the recipe completes?

Since we have the expected recipe duration, we should be able to only call this method after the expected amount of time passes (Would probably need to track that time). Pausing the recipe or low power situations would need to adjust this expected recipe completion time as well.

@ghzdude ghzdude marked this pull request as ready for review March 25, 2025 04:54
@ghzdude ghzdude requested a review from a team as a code owner March 25, 2025 04:54
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got this error when messing around with the LBB,
[19:55:11] [Client thread/INFO] [modularui]: unit WIDTH of widget Flow was already used and will be overwritten with unit RIGHT. Was messing with the throttle screen, adding in large numbers, and negative numbers, trying to break it. Actually, I think this happens when mousing over the bars displayed at the bottom of some multiblocks.

If you add letters to the throttle adjuster in the LBB, it will spit out an error into the log, which is a bit overkill in my opinion. https://pastebin.com/GhSeRQd7
For some reason, the syntax checker didn't error on the letter a though.

Since you changed the multiblock button textures to overlays, any buttons that have no functionality are now no longer automatically depressed.

Running a recipe in the PA caused the display to start showing all possible texts, see discord for video.
This was what showed up in the logs https://pastebin.com/QritzP9H

I noticed that the large boilers are not formed in JEI, not sure if that is because of this PR or not.

The coke oven should use the primitive theme, and actually needs to be ported.

The primitive theme in the PBF feels a little brighter to me than it was before, but maybe this is just me going insane. I would prefer it a little dimmer if possible, but I am not sure if it is different at all than on master.

Would be cool if the logo was used for warnings about different recipe start failure conditions, eg, not high enough voltage, no fluid input, etc.

Something is wrong with the chanced outputs display, see discord for the implosion compressor video, but it is showing 2500/s. The recipe is actually 25% chance at 1 item per second (base time, not counting overclocks, which I was doing)

Having an issue running the recipe Enderpearl dust + dynamite in implosion compressor.
Same issue with a recipe in the pyrolyse. These are newly constructed multiblock structures, so something with the previous recipe cache might be going wrong.

In the display of an invalid structure, the GT Logo should be red, not the normal blue.

In the Fusion Reactor GUI, for some reason the tooltip for the ECE is moved really far to the left. Doesn't happen when not in the GUI
image

Fusion Reactor doesn't have the 2 bottom bars still (One for energy stored, one for heat)

@ghzdude
Copy link
Contributor Author

ghzdude commented Mar 31, 2025

Got this error when messing around with the LBB, [19:55:11] [Client thread/INFO] [modularui]: unit WIDTH of widget Flow was already used and will be overwritten with unit RIGHT. Was messing with the throttle screen, adding in large numbers, and negative numbers, trying to break it. Actually, I think this happens when mousing over the bars displayed at the bottom of some multiblocks.

this is from MUI2. i don't know where it's being caused but it happens for every multiblock.

Since you changed the multiblock button textures to overlays, any buttons that have no functionality are now no longer automatically depressed.

i assume you mean "pressed" as in "selected/activated". this is fixed now.

Running a recipe in the PA caused the display to start showing all possible texts, see discord for video. This was what showed up in the logs https://pastebin.com/QritzP9H

attempting to cache the recipe in the builder was causing the problem. i removed it and it works now, thought i'll revisit this later.

Something is wrong with the chanced outputs display, see discord for the implosion compressor video, but it is showing 2500/s. The recipe is actually 25% chance at 1 item per second (base time, not counting overclocks, which I was doing)

the chance was being passed into the parameter for count, and vice versa. it was also being divided by zero if no recipes were being run.

Having an issue running the recipe Enderpearl dust + dynamite in implosion compressor. Same issue with a recipe in the pyrolyse. These are newly constructed multiblock structures, so something with the previous recipe cache might be going wrong.

these recipes run for me

In the Fusion Reactor GUI, for some reason the tooltip for the ECE is moved really far to the left. Doesn't happen when not in the GUI

this is a MUI2 issue present in all UIs using the "next to mouse" option for tooltips

@ghzdude
Copy link
Contributor Author

ghzdude commented Mar 31, 2025

If you add letters to the throttle adjuster in the LBB, it will spit out an error into the log, which is a bit overkill in my opinion. https://pastebin.com/GhSeRQd7
For some reason, the syntax checker didn't error on the letter a though.

this is from mui2's default math parser for text field widgets, i've replaced it with a custom validator so it doesn't log an error

@ALongStringOfNumbers
Copy link
Contributor

Server crash opening the GUI of a Processing Array on a server https://pastebin.com/Zb8nfMnU

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The power button in the multiblock GUI has the default button sound now, rather than the custom sound that it had before

I am having issues getting the Fusion Reactor to run, can you get it to run recipe correctly?

The recipe outputs is not applied to the Research Station. You could maybe add on the output to the Researching line that comes up when the RS is running.

The tooltips in the HPCA GUI diagram are not correct. It it showing 0s for all parts, even parts that provide computation and cooling.
image

Probably not related to this PR, but the auto build on the Active Transformer builds an invalid structure.

@ghzdude
Copy link
Contributor Author

ghzdude commented Apr 10, 2025

The power button in the multiblock GUI has the default button sound now, rather than the custom sound that it had before

i was not aware the power button had a unique sound. (this is what happens when i haven't played gt in forever)

I am having issues getting the Fusion Reactor to run, can you get it to run recipe correctly?

i am also not able to run a fusion reactor recipe,

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Tooltips in the HPCA are still wrong. In an HPCA with 8 basic coolers, and 1 advanced Computation Unit, it is displaying that there is 4L of coolant required, which is false. The PCB Coolant is only for the active coolers, which there are none of in the structure.

Also, is the tooltip supposed to display the total stats when hovering over the diagram in the middle, or the individual stats of each block when hovering over each block in the diagram in the middle?

The Distillation Tower might need to be special cased for the recipe outputs, as you can build a Distillation Tower without a fluid output hatch on a layer, and it will auto void that fluid output corresponding to that layer. Since this is the case, do we even show the output that is auto voided in the recipe outputs? It might be a bit confusing for it to show up, when it is being purposely voided. However, voided fluid or item outputs still show in the list when using the voiding mode button, so showing it in the Distillation Tower is consistent. Not sure what the best thing to do here would be.

After completing a research in the Research Station, the Researching xxx text in not removed from the GUI

When there is a GUI with a scrollbar, the scrollbar overlaps the Gregtech logo a little bit in one of the corners, which doesn't really look that good in my opinion. Not sure what we can do about it though, because moving the logo gets it out of line with the 3 buttons, and I am not sure if we can move the scrollbar.

The warning text is not displaying for some reason in the Extreme Combusion Engine. I have an IV Dynamo hatch, the controller says it is producing LuV voltage, but the warning is not coming up that the dynamo tier is too low. So either the amount being produced is incorrect, or the warning is being swallowed somewhere.

Something is off with the Combustion Engines on this branch. On master, they keep running when the dynamo hatch is full, but on this branch they stop, but keep displaying that they are working. So I think something is not synced correctly somewhere.

this.internal.clear();
clear();
onRebuild();
runAction();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just be markDirty(), since all this is called if the structure is dirty during build? Or does this not guarantee that build will be called?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually used to be markDirty(), but it causes problems when using the builder in tooltips since they only "build" when they are hovered. so i just ensure that the builder is rebuilt on sync instead of waiting

public MultiblockUIBuilder addEnergyUsageLine(IEnergyContainer energyContainer) {
if (!isStructureFormed || energyContainer == null) return this;
boolean hasEnergy = getSyncer().syncBoolean(energyContainer.getEnergyCapacity() > 0);
if (!hasEnergy) return this;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure when this would ever happen, but do we want to add a special warning text just in case? Something like "Energy Hatch does not provide any energy capacity."

* Added if the structure is formed, if the amperage is greater than zero and if the max voltage is greater than
* zero.
*/
public MultiblockUIBuilder addEnergyProductionAmpsLine(long maxVoltage, int amperage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be something other than gray maybe. And instead of being displayed as Max EU/t, it could maybe be Producing...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line shows the max EU/t the multi is capable of producing. Do you think there should be a line for the EU/t the multiblock is producing currently (from the recipe), or change this line fundamentally?

@ghzdude
Copy link
Contributor Author

ghzdude commented Apr 12, 2025

Also, is the tooltip supposed to display the total stats when hovering over the diagram in the middle, or the individual stats of each block when hovering over each block in the diagram in the middle?

i've decided to keep with master behavior and show the total stats, but showing individual stats would also be possible

The warning text is not displaying for some reason in the Extreme Combusion Engine. I have an IV Dynamo hatch, the controller says it is producing LuV voltage, but the warning is not coming up that the dynamo tier is too low. So either the amount being produced is incorrect, or the warning is being swallowed somewhere.

master has the same behavior. the listed max eut is for the boosted amount (4A IV) while the actual eut is 1A IV. it shows no warning in the icon, but it does for the oxygen bar tooltip.

Something is off with the Combustion Engines on this branch. On master, they keep running when the dynamo hatch is full, but on this branch they stop, but keep displaying that they are working. So I think something is not synced correctly somewhere.

the combustion engine is not supposed to produce (and void) power when the dynamo hatch is full. the observed behavior is the same for master and this branch.

controllable = (IControllable) mte;
}

var detail = GTGuiTextures.BUTTON_POWER_DETAIL.asIcon().size(18, 6).marginTop(24);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove this from primitive and steam multis?
or at least make this theme-appliable?
looks kinda off atm
1c98ec4ee0f290fe391a7b6103ded5e6

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HPCA continues playing its running sound after disabling it with the power button. Same with Network Switch and Data Bank.

Zorbatron and others added 21 commits June 13, 2025 20:50
…f deprecating it, since it is completely unused
wrap voltage name with IKey instead of appending TextFormatting
simplify fluid drill's drilled fluid line
add todo
@ALongStringOfNumbers ALongStringOfNumbers merged commit 21eccdf into master Jun 18, 2025
3 checks passed
@ALongStringOfNumbers ALongStringOfNumbers deleted the tc/mui2-multis branch June 18, 2025 01:47
@github-project-automation github-project-automation bot moved this from Hard to Done in MUI2 Port Jun 18, 2025
Zorbatron added a commit that referenced this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Suggestion to refactor a section of code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants