Skip to content

Commit b91f1a1

Browse files
committed
Fix #581: Allow any machine progress bar sizes through KubeJS (not just 20x20)
1 parent 6208eca commit b91f1a1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/ADDING_MACHINES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The following parameters need to be provided, in order:
7171
- GUI configuration:
7272
- 5: Height of the background in the machine screen.
7373
- 6: Where the progress bar is located, in pixels, and the type of progress bar to use. You can look at the available progress bars [here](../src/main/resources/assets/modern_industrialization/textures/gui/progress_bar/).
74+
75+
By default, the progress bar has 20x20 pixels. This can be changed by adding a width and a height as 4th and 5th parameters when creating it.
76+
For example, for a 40x20 long arrow: `event.progressBar(x pos, y pos, "long_arrow", 40, 20)`.
7477
- 7: Where the efficiency bar goes. This is where the current overclock is displayed (only in electric machines).
7578
- 8: Where the energy bar goes. This is where the current energy is displayed (only in electric machines).
7679
- Slot configuration:

src/main/java/aztech/modern_industrialization/compat/kubejs/machine/RegisterMachinesEventJS.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public ProgressBar.Parameters progressBar(int renderX, int renderY, String type)
6161
return new ProgressBar.Parameters(renderX, renderY, type);
6262
}
6363

64+
public ProgressBar.Parameters progressBar(int renderX, int renderY, String type, int width, int height) {
65+
return new ProgressBar.Parameters(renderX, renderY, type, width, height, false);
66+
}
67+
6468
public RecipeEfficiencyBar.Parameters efficiencyBar(int renderX, int renderY) {
6569
return new RecipeEfficiencyBar.Parameters(renderX, renderY);
6670
}

0 commit comments

Comments
 (0)