diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml new file mode 100644 index 000000000..755acc027 --- /dev/null +++ b/.github/workflows/branch.yml @@ -0,0 +1,43 @@ +name: Immersive Railroading Build Pipeline + +on: + push: + branches-ignore: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + branch: [1.12.2-forge, 1.16.5-forge] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: keyscan + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts + - name: Install deps + run: sudo apt install -y pngquant findutils xvfb + - name: Setup Universal Mod Core (and helpers) + env: + BRANCH: ${{ matrix.branch }} + run: java -jar UMCSetup.jar ${BRANCH} https + - name: Gradle compile + run: ./gradlew classes + - name: Process images + run: find src/main/resources/assets/immersiverailroading/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo + - name: Run Data (optionalish) + run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true + - name: Gradle build + run: ./gradlew build + - name: Gradle publish + env: + MAVENCI_PASS: ${{ secrets.MAVENCI_PASS }} + run: ./gradlew publish + - uses: actions/upload-artifact@v2 + with: + name: Immersive Railroading ${{matrix.branch}} + path: build/libs/ImmersiveRailroading-${{matrix.branch}}-* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fba7dd32c..6e8f418e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,9 @@ name: Immersive Railroading Build Pipeline -on: [push] +on: + push: + branches: + - 'master' jobs: build: diff --git a/src/main/java/cam72cam/immersiverailroading/gui/overlay/GuiBuilder.java b/src/main/java/cam72cam/immersiverailroading/gui/overlay/GuiBuilder.java index 7b23040ea..41488bcd7 100644 --- a/src/main/java/cam72cam/immersiverailroading/gui/overlay/GuiBuilder.java +++ b/src/main/java/cam72cam/immersiverailroading/gui/overlay/GuiBuilder.java @@ -36,8 +36,8 @@ public class GuiBuilder { private final Vertical screen_y; private final Identifier image; - private final int imageWidth; - private final int imageHeight; + private final int width; + private final int height; private final String text; private final float textHeight; @@ -130,17 +130,6 @@ protected GuiBuilder(DataBlock data) throws IOException { this.screen_x = Horizontal.from(data.getValue("screen_x").asString()); this.screen_y = Vertical.from(data.getValue("screen_y").asString()); - // Image stuff - this.image = data.getValue("image").asIdentifier(null); - if (image != null) { - BufferedImage tmp = ImageIO.read(this.image.getResourceStream()); - imageWidth = tmp.getWidth(); - imageHeight = tmp.getHeight(); - } else { - imageWidth = 0; - imageHeight = 0; - } - // Text stuff DataBlock txt = data.getBlock("text"); if (txt != null) { @@ -151,6 +140,20 @@ protected GuiBuilder(DataBlock data) throws IOException { textHeight = 0; } + // Image stuff + this.image = data.getValue("image").asIdentifier(null); + if (image != null) { + BufferedImage tmp = ImageIO.read(this.image.getResourceStream()); + width = tmp.getWidth(); + height = tmp.getHeight(); + } else if (text != null) { + width = (int) (textHeight/4 * text.length()); // Guesstimate + height = (int) textHeight; + } else { + width = 0; + height = 0; + } + // Controls String readout = data.getValue("readout").asString(); this.readout = readout != null ? Readouts.valueOf(readout.toUpperCase(Locale.ROOT)) : null; @@ -329,9 +332,9 @@ private void render(EntityRollingStock stock, RenderState state, int maxx, int m if (image != null) { DirectDraw draw = new DirectDraw(); draw.vertex(0, 0, 0).uv(0, 0); - draw.vertex(0, imageHeight, 0).uv(0, 1); - draw.vertex(imageWidth, imageHeight, 0).uv(1, 1); - draw.vertex(imageWidth, 0, 0).uv(1, 0); + draw.vertex(0, height, 0).uv(0, 1); + draw.vertex(width, height, 0).uv(1, 1); + draw.vertex(width, 0, 0).uv(1, 0); draw.draw(state.clone() .texture(Texture.wrap(image)) .alpha_test(false) @@ -374,7 +377,7 @@ private GuiBuilder find(EntityRollingStock stock, Matrix4 matrix, int maxx, int } } - if (image != null && interactable()) { + if (interactable() && (image != null || text != null)) { if (control == null && setting == null && texture_variant == null) { if (readout == null) { return null; @@ -397,10 +400,10 @@ private GuiBuilder find(EntityRollingStock stock, Matrix4 matrix, int maxx, int } } int border = 2; - Vec3d cornerA = matrix.apply(new Vec3d(-border, -border, 0)); - Vec3d cornerB = matrix.apply(new Vec3d(-border, imageHeight + border, 0)); - Vec3d cornerC = matrix.apply(new Vec3d(imageWidth + border, -border, 0)); - Vec3d cornerD = matrix.apply(new Vec3d(imageWidth + border, imageHeight + border, 0)); + Vec3d cornerA = matrix.apply(new Vec3d((image == null ? -width : 0)-border, -border, 0)); + Vec3d cornerB = matrix.apply(new Vec3d((image == null ? -width : 0)-border, height + border, 0)); + Vec3d cornerC = matrix.apply(new Vec3d(width + border, -border, 0)); + Vec3d cornerD = matrix.apply(new Vec3d(width + border, height + border, 0)); Polygon poly = new Polygon( new int[]{(int) cornerA.x, (int) cornerB.x, (int) cornerC.x, (int) cornerD.x}, @@ -455,7 +458,7 @@ private void onMouseMove(EntityRollingStock stock, Matrix4 matrix, GuiBuilder ta temp.scale(scalex != null ? scalex * checkValue : 1, scaley != null ? scaley * checkValue : 1, 1); } - Vec3d checkMiddle = temp.apply(new Vec3d(imageWidth/2f, imageHeight/2f, 0)); + Vec3d checkMiddle = temp.apply(new Vec3d(width /2f, height /2f, 0)); double delta = checkMiddle.distanceTo(new Vec3d(x, y, 0)); if (delta < closestDelta) { closestDelta = delta; diff --git a/src/main/java/cam72cam/immersiverailroading/model/part/SwaySimulator.java b/src/main/java/cam72cam/immersiverailroading/model/part/SwaySimulator.java index 45dbbdb0c..6880e7b39 100644 --- a/src/main/java/cam72cam/immersiverailroading/model/part/SwaySimulator.java +++ b/src/main/java/cam72cam/immersiverailroading/model/part/SwaySimulator.java @@ -111,8 +111,13 @@ public double getRollDegrees() { } public void removed() { - clackFront.stop(); - clackRear.stop(); + // These should never be null, but for some reason they are + if (clackFront != null) { + clackFront.stop(); + } + if (clackRear != null) { + clackRear.stop(); + } } } diff --git a/src/main/resources/assets/immersiverailroading/gui/default/cab_car.caml b/src/main/resources/assets/immersiverailroading/gui/default/cab_car.caml index 4c4baa3a2..bb9b0eca3 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/cab_car.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/cab_car.caml @@ -1,80 +1,89 @@ element: - # left panel - x = 10 - y = -95 - image = "immersiverailroading:gui/overlay_handcar.png" - element: - # ind brake - x = 17 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "INDEPENDENT_BRAKE" - translate = - x = 0 - y = -50 - element: - # brake pressure - x = 11 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "BRAKE_PRESSURE" - translate = - x = 0 - y = -50 - color = - 0.0 = "0xDDa22020" - element: - # train brake - x = 11 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "TRAIN_BRAKE" - translate = - x = 0 - y = -50 - element: - # throttle - x = 32 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "THROTTLE" - translate = - x = 0 - y = -50 - element: - # reverser - x = 38 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "REVERSER" - translate = - x = 0 - y = -50 - element: - # speed readout - text = - value = "stat.speed" - height = 6 - x = 30 - y = 8 - element: - # top labels - y = 19 - element: - x = 20 - text = - value = "label.brake" - height = 4 - element: - x = 38 - text = - value = "label.throttle" - height = 4 + import: "immersiverailroading:gui/default/common/settings.caml" + +element: + import: "immersiverailroading:gui/default/common/opacity.caml" element: - # bottom labels - y = 78 + import: "immersiverailroading:gui/default/common/scale.caml" + screen_x = LEFT + screen_y = BOTTOM element: - x = 38 - text = - value = "label.reverser" - height = 4 + # left panel + x = 10 + y = -95 + image = "immersiverailroading:gui/overlay_handcar.png" + element: + # ind brake + x = 17 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "INDEPENDENT_BRAKE" + translate = + x = 0 + y = -50 + element: + # brake pressure + x = 11 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "BRAKE_PRESSURE" + translate = + x = 0 + y = -50 + color = + 0.0 = "0xDDa22020" + element: + # train brake + x = 11 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "TRAIN_BRAKE" + translate = + x = 0 + y = -50 + element: + # throttle + x = 32 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "THROTTLE" + translate = + x = 0 + y = -50 + element: + # reverser + x = 38 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "REVERSER" + translate = + x = 0 + y = -50 + element: + # speed readout + text = + value = "stat.speed" + height = 6 + x = 30 + y = 8 + element: + # top labels + y = 19 + element: + x = 20 + text = + value = "label.brake" + height = 4 + element: + x = 38 + text = + value = "label.throttle" + height = 4 + element: + # bottom labels + y = 78 + element: + x = 38 + text = + value = "label.reverser" + height = 4 diff --git a/src/main/resources/assets/immersiverailroading/gui/default/common/settings.caml b/src/main/resources/assets/immersiverailroading/gui/default/common/settings.caml index 298912a50..5dfe8f89b 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/common/settings.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/common/settings.caml @@ -72,3 +72,28 @@ element: translate = x = 200 + + element: + x = 25 + y = 90 + + element: + text = + value = "Original GUI" + height = 6 + setting = "legacy_gui" + toggle = true + color = + 0.0 = "0xFFFFFFFF" + 1.0 = "0xFF999999" + element: + x = 50 + setting = "legacy_gui" + text = + value = "Advanced GUI" + height = 6 + toggle = true + invert = true + color = + 0.0 = "0xFFFFFFFF" + 1.0 = "0xFF999999" diff --git a/src/main/resources/assets/immersiverailroading/gui/default/diesel.caml b/src/main/resources/assets/immersiverailroading/gui/default/diesel.caml index 9ef8cc910..cdfe3aefb 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/diesel.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/diesel.caml @@ -1,149 +1,17 @@ element: import: "immersiverailroading:gui/default/common/settings.caml" -element: - screen_x = RIGHT - screen_y = BOTTOM +element: import: "immersiverailroading:gui/default/common/opacity.caml" element: - import: "immersiverailroading:gui/default/common/scale.caml" - - element: - image = "immersiverailroading:gui/default/diesel/diesel_base.png" - x = -120 - y = -190 - - element: - x = 55 - element: - y = 2.5 - image = "immersiverailroading:gui/default/diesel/dial.png" - import: "immersiverailroading:gui/default/diesel/gauge_speed_face.caml" - - element: - y = 65 - image = "immersiverailroading:gui/default/diesel/dial.png" - import: "immersiverailroading:gui/default/diesel/gauge_brake_face.caml" - - element: - y = 127.5 - image = "immersiverailroading:gui/default/diesel/dial.png" - import: "immersiverailroading:gui/default/diesel/gauge_temperature_face.caml" - - - element: - element: - x = 5 - y = 80 - image = "immersiverailroading:gui/default/diesel/horn.png" - - readout = HORN - - rotate = - x = 0 - y = 10 - degrees = 10 - - element: - x = 5 - y = 95 - image = "immersiverailroading:gui/default/diesel/button.png" + setting = "legacy_gui" + translucent = true + invert = true + import: "immersiverailroading:gui/default/diesel_v0.caml" - readout = ENGINE - toggle = true - color = - 0.0 = 0xFF006000 - 1.0 = 0xFF008000 - - element: - x = 35 - y = 95 - image = "immersiverailroading:gui/default/diesel/button.png" - - readout = BELL - toggle = true - color = - 0.0 = 0xFFAAAA00 - 1.0 = 0xFFCCCC00 - - element: - x = 5 - y = 115 - image = "immersiverailroading:gui/default/diesel/throttle_base.png" - - element: - x = 11.5 - y = 13 - image = "immersiverailroading:gui/default/diesel/throttle_lever.png" - readout = "THROTTLE" - rotate = - x = 1.5 - y = -13 - degrees = -90 - offset = 45 - sound = - engage = "immersiverailroading:sounds/default/lever_engage.ogg" - disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" - - element: - x = 34 - y = 115 - image = "immersiverailroading:gui/default/diesel/reverser_base.png" - - element: - x = 9 - y = 10 - image = "immersiverailroading:gui/default/diesel/reverser_lever.png" - readout = "REVERSER" - rotate = - x = 1 - y = -10 - degrees = -90 - offset = 45 - sound = - engage = "immersiverailroading:sounds/default/lever_engage.ogg" - disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" - - element: - x = 12 - y = 145 - image = "immersiverailroading:gui/default/diesel/brake_stand.png" - - element: - x = 10 - y = 2.5 - image = "immersiverailroading:gui/default/diesel/brake_lever.png" - readout = "TRAIN_BRAKE_LEVER" - rotate = - x = -5 - y = 2.5 - degrees = 30 - offset = -15 - color = - 0.0 = 0xFF806600 - sound = - engage = "immersiverailroading:sounds/default/lever_engage.ogg" - move = "immersiverailroading:sounds/default/pressure.ogg" - disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" - - element: - x = 12 - y = 165 - image = "immersiverailroading:gui/default/diesel/brake_stand.png" - element: - x = 10 - y = 2.5 - image = "immersiverailroading:gui/default/diesel/brake_lever.png" - readout = "INDEPENDENT_BRAKE" - rotate = - x = -5 - y = 2.5 - degrees = -15 - offset = 0 - color = - 0.0 = 0xFF800000 - sound = - engage = "immersiverailroading:sounds/default/lever_engage.ogg" - disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" + element: + setting = "legacy_gui" + translucent = true + import: "immersiverailroading:gui/default/diesel_v1.caml" diff --git a/src/main/resources/assets/immersiverailroading/gui/default/diesel_v0.caml b/src/main/resources/assets/immersiverailroading/gui/default/diesel_v0.caml new file mode 100644 index 000000000..66f0c1512 --- /dev/null +++ b/src/main/resources/assets/immersiverailroading/gui/default/diesel_v0.caml @@ -0,0 +1,139 @@ +element: + screen_x = LEFT + screen_y = BOTTOM + import: "immersiverailroading:gui/default/common/scale.caml" + element: + # left panel + x = 10 + y = -95 + image = "immersiverailroading:gui/overlay_diesel.png" + element: + # fuel level + x = 5 + y = 75 + image = "immersiverailroading:gui/fluid.png" + readout = "LIQUID" + translate = + x = 0 + y = -50 + scale = + y = 1 + color = + 0 = "0xAA79650c" + element: + # engine temp + x = 25 + y = 75 + image = "immersiverailroading:gui/fluid.png" + readout = "TEMPERATURE" + translate = + x = 0 + y = -50 + scale = + y = 1 + color = + 0 = "0x992a81af" + 0.5 = "0x992a933a" + 0.6666 = "0x99d16c15" + 0.9333 = "0x99a21010" + element: + # brake pressure + x = 41 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "BRAKE_PRESSURE" + translate = + x = 0 + y = -50 + color = + 0.0 = "0xDDa22020" + element: + # train brake + x = 41 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "TRAIN_BRAKE" + translate = + x = 0 + y = -50 + element: + # ind brake + x = 47 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "INDEPENDENT_BRAKE" + translate = + x = 0 + y = -50 + element: + # throttle + x = 61 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "THROTTLE" + translate = + x = 0 + y = -50 + element: + # reverser + x = 67 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "REVERSER" + translate = + x = 0 + y = -50 + element: + # speed readout + text = + value = "stat.speed stat.units_speed" + height = 6 + x = 38 + y = 8 + element: + # top labels + y = 19 + element: + x = 10 + text = + value = "stat.liquidstat.units_liquid" + height = 4 + element: + x = 30 + text = + value = "stat.temperaturestat.units_temperature" + height = 4 + element: + x = 48 + text = + value = "label.brake" + height = 4 + element: + x = 69 + text = + value = "label.throttle" + height = 4 + element: + # bottom labels + y = 78 + element: + x = 10 + text = + value = "stat.max_liquidstat.units_liquid" + height = 4 + element: + x = 30 + y = 0 + text = + value = "stat.max_temperaturestat.units_temperature" + height = 4 + element: + x = 48 + text = + value = "" + height = 4 + element: + x = 69 + text = + value = "label.reverser" + height = 4 diff --git a/src/main/resources/assets/immersiverailroading/gui/default/diesel_v1.caml b/src/main/resources/assets/immersiverailroading/gui/default/diesel_v1.caml new file mode 100644 index 000000000..2f1fc845b --- /dev/null +++ b/src/main/resources/assets/immersiverailroading/gui/default/diesel_v1.caml @@ -0,0 +1,142 @@ +element: + screen_x = RIGHT + screen_y = BOTTOM + import: "immersiverailroading:gui/default/common/scale.caml" + + element: + image = "immersiverailroading:gui/default/diesel/diesel_base.png" + x = -120 + y = -190 + + element: + x = 55 + element: + y = 2.5 + image = "immersiverailroading:gui/default/diesel/dial.png" + import: "immersiverailroading:gui/default/diesel/gauge_speed_face.caml" + + element: + y = 65 + image = "immersiverailroading:gui/default/diesel/dial.png" + import: "immersiverailroading:gui/default/diesel/gauge_brake_face.caml" + + element: + y = 127.5 + image = "immersiverailroading:gui/default/diesel/dial.png" + import: "immersiverailroading:gui/default/diesel/gauge_temperature_face.caml" + + + element: + element: + x = 5 + y = 80 + image = "immersiverailroading:gui/default/diesel/horn.png" + + readout = HORN + + rotate = + x = 0 + y = 10 + degrees = 10 + + element: + x = 5 + y = 95 + image = "immersiverailroading:gui/default/diesel/button.png" + + readout = ENGINE + toggle = true + color = + 0.0 = 0xFF006000 + 1.0 = 0xFF008000 + + element: + x = 35 + y = 95 + image = "immersiverailroading:gui/default/diesel/button.png" + + readout = BELL + toggle = true + color = + 0.0 = 0xFFAAAA00 + 1.0 = 0xFFCCCC00 + + element: + x = 5 + y = 115 + image = "immersiverailroading:gui/default/diesel/throttle_base.png" + + element: + x = 11.5 + y = 13 + image = "immersiverailroading:gui/default/diesel/throttle_lever.png" + readout = "THROTTLE" + rotate = + x = 1.5 + y = -13 + degrees = -90 + offset = 45 + sound = + engage = "immersiverailroading:sounds/default/lever_engage.ogg" + disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" + + element: + x = 34 + y = 115 + image = "immersiverailroading:gui/default/diesel/reverser_base.png" + + element: + x = 9 + y = 10 + image = "immersiverailroading:gui/default/diesel/reverser_lever.png" + readout = "REVERSER" + rotate = + x = 1 + y = -10 + degrees = -90 + offset = 45 + sound = + engage = "immersiverailroading:sounds/default/lever_engage.ogg" + disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" + + element: + x = 12 + y = 145 + image = "immersiverailroading:gui/default/diesel/brake_stand.png" + + element: + x = 10 + y = 2.5 + image = "immersiverailroading:gui/default/diesel/brake_lever.png" + readout = "TRAIN_BRAKE_LEVER" + rotate = + x = -5 + y = 2.5 + degrees = 30 + offset = -15 + color = + 0.0 = 0xFF806600 + sound = + engage = "immersiverailroading:sounds/default/lever_engage.ogg" + move = "immersiverailroading:sounds/default/pressure.ogg" + disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" + + element: + x = 12 + y = 165 + image = "immersiverailroading:gui/default/diesel/brake_stand.png" + element: + x = 10 + y = 2.5 + image = "immersiverailroading:gui/default/diesel/brake_lever.png" + readout = "INDEPENDENT_BRAKE" + rotate = + x = -5 + y = 2.5 + degrees = -15 + offset = 0 + color = + 0.0 = 0xFF800000 + sound = + engage = "immersiverailroading:sounds/default/lever_engage.ogg" + disengage = "immersiverailroading:sounds/default/lever_disengage.ogg" diff --git a/src/main/resources/assets/immersiverailroading/gui/default/handcar.caml b/src/main/resources/assets/immersiverailroading/gui/default/handcar.caml index ffc8b30bf..44cc59080 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/handcar.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/handcar.caml @@ -1,43 +1,52 @@ element: - # left panel - x = 10 - y = -95 - image = "immersiverailroading:gui/overlay_handcar.png" - element: - # ind brake - x = 14 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "INDEPENDENT_BRAKE" - translate = - x = 0 - y = -50 - element: - # reverser - x = 35 - y = 74 - image = "immersiverailroading:gui/indicator.png" - readout = "REVERSER" - translate = - x = 0 - y = -50 - element: - # speed readout - text = - value = "stat.speed" - height = 6 - x = 30 - y = 8 + import: "immersiverailroading:gui/default/common/settings.caml" + +element: + import: "immersiverailroading:gui/default/common/opacity.caml" element: - # top labels - y = 19 - element: - x = 20 - text = - value = "label.brake" - height = 4 + import: "immersiverailroading:gui/default/common/scale.caml" + screen_x = LEFT + screen_y = BOTTOM element: - x = 38 - text = - value = "label.throttle" - height = 4 + # left panel + x = 10 + y = -95 + image = "immersiverailroading:gui/overlay_handcar.png" + element: + # ind brake + x = 14 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "INDEPENDENT_BRAKE" + translate = + x = 0 + y = -50 + element: + # reverser + x = 35 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "REVERSER" + translate = + x = 0 + y = -50 + element: + # speed readout + text = + value = "stat.speed" + height = 6 + x = 30 + y = 8 + element: + # top labels + y = 19 + element: + x = 20 + text = + value = "label.brake" + height = 4 + element: + x = 38 + text = + value = "label.throttle" + height = 4 diff --git a/src/main/resources/assets/immersiverailroading/gui/default/independent.caml b/src/main/resources/assets/immersiverailroading/gui/default/independent.caml index 7d2838a51..abde13071 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/independent.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/independent.caml @@ -1,20 +1,29 @@ element: - # left panel - x = 10 - y = -95 - image = "immersiverailroading:gui/overlay_independent.png" - element: - # ind brake - x = 4 - y = 59 - image = "immersiverailroading:gui/indicator.png" - readout = "INDEPENDENT_BRAKE" - translate = - x = 0 - y = -50 + import: "immersiverailroading:gui/default/common/settings.caml" + +element: + import: "immersiverailroading:gui/default/common/opacity.caml" element: - x = 9 - y = 4 - text = - value = "label.brake" - height = 4 + import: "immersiverailroading:gui/default/common/scale.caml" + screen_x = LEFT + screen_y = BOTTOM + element: + # left panel + x = 10 + y = -95 + image = "immersiverailroading:gui/overlay_independent.png" + element: + # ind brake + x = 4 + y = 59 + image = "immersiverailroading:gui/indicator.png" + readout = "INDEPENDENT_BRAKE" + translate = + x = 0 + y = -50 + element: + x = 9 + y = 4 + text = + value = "label.brake" + height = 4 diff --git a/src/main/resources/assets/immersiverailroading/gui/default/steam.caml b/src/main/resources/assets/immersiverailroading/gui/default/steam.caml index dd74b1da1..0dc072dcb 100644 --- a/src/main/resources/assets/immersiverailroading/gui/default/steam.caml +++ b/src/main/resources/assets/immersiverailroading/gui/default/steam.caml @@ -1,69 +1,17 @@ element: import: "immersiverailroading:gui/default/common/settings.caml" + element: import: "immersiverailroading:gui/default/common/opacity.caml" element: - screen_x = RIGHT - screen_y = BOTTOM - import: "immersiverailroading:gui/default/common/scale.caml" - - element: - y = -60 - element: - import: "immersiverailroading:gui/default/steam/dial_right.caml" - import: "immersiverailroading:gui/default/steam/gauge_speed_face.caml" - - element: - y = -120 - element: - import: "immersiverailroading:gui/default/steam/dial_right.caml" - import: "immersiverailroading:gui/default/steam/gauge_brake_face.caml" - - element: - x = -70 - import: "immersiverailroading:gui/default/steam/reverser.caml" - - element: - y = -65 - import: "immersiverailroading:gui/default/steam/brake_lever.caml" - - element: - y = -150 - import: "immersiverailroading:gui/default/steam/throttle.caml" - - element: - screen_x = RIGHT - screen_y = TOP - import: "immersiverailroading:gui/default/common/scale.caml" - - element: - import: "immersiverailroading:gui/default/steam/whistle.caml" + setting = "legacy_gui" + translucent = true + invert = true + import: "immersiverailroading:gui/default/steam_v0.caml" element: - screen_x = LEFT - screen_y = MIDDLE - import: "immersiverailroading:gui/default/common/scale.caml" - - element: - y = -50 - x = -90 - import: "immersiverailroading:gui/default/steam/gauge_water_left.caml" - - element: - screen_x = LEFT - screen_y = TOP - import: "immersiverailroading:gui/default/common/scale.caml" - - element: - x = 0 - element: - import: "immersiverailroading:gui/default/steam/dial_up.caml" - import: "immersiverailroading:gui/default/steam/gauge_boiler_face.caml" - - element: - x = 60 - element: - import: "immersiverailroading:gui/default/steam/dial_up.caml" - import: "immersiverailroading:gui/default/steam/gauge_temperature_face.caml" \ No newline at end of file + setting = "legacy_gui" + translucent = true + import: "immersiverailroading:gui/default/steam_v1.caml" diff --git a/src/main/resources/assets/immersiverailroading/gui/default/steam_v0.caml b/src/main/resources/assets/immersiverailroading/gui/default/steam_v0.caml new file mode 100644 index 000000000..43ed2ea3c --- /dev/null +++ b/src/main/resources/assets/immersiverailroading/gui/default/steam_v0.caml @@ -0,0 +1,161 @@ +element: + screen_x = LEFT + screen_y = BOTTOM + import: "immersiverailroading:gui/default/common/scale.caml" + element: + # left panel + x = 10 + y = -95 + image = "immersiverailroading:gui/overlay_steam.png" + element: + # water level + x = 5 + y = 75 + image = "immersiverailroading:gui/fluid.png" + readout = "LIQUID" + translate = + x = 0 + y = -50 + scale = + y = 1 + color = + 0 = "0xAA0F0FFF" + element: + # steam level + x = 25 + y = 75 + image = "immersiverailroading:gui/fluid.png" + readout = "BOILER_PRESSURE" + translate = + x = 0 + y = -50 + scale = + y = 1 + color = + 0 = "0x99DDDDDD" + element: + # boiler temp + x = 45 + y = 75 + image = "immersiverailroading:gui/fluid.png" + readout = "TEMPERATURE" + translate = + x = 0 + y = -40 + scale = + y = 0.8 + color = + 0 = "0x99d1c715" + 0.95 = "0x99d16c15" + 1.05 = "0x99a21010" + element: + # brake pressure + x = 61 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "BRAKE_PRESSURE" + translate = + x = 0 + y = -50 + color = + 0.0 = "0xDDa22020" + element: + # train brake + x = 61 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "TRAIN_BRAKE" + translate = + x = 0 + y = -50 + element: + # ind brake + x = 67 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "INDEPENDENT_BRAKE" + translate = + x = 0 + y = -50 + element: + # throttle + x = 81 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "THROTTLE" + translate = + x = 0 + y = -50 + element: + # reverser + x = 87 + y = 74 + image = "immersiverailroading:gui/indicator.png" + readout = "REVERSER" + translate = + x = 0 + y = -50 + element: + # speed readout + text = + value = "stat.speed stat.units_speed" + height = 6 + x = 50 + y = 8 + element: + # top labels + y = 19 + element: + x = 10 + text = + value = "stat.liquidstat.units_liquid" + height = 4 + element: + x = 30 + text = + value = "stat.boiler_pressurestat.units_boiler_pressure" + height = 4 + element: + x = 50 + text = + value = "stat.temperaturestat.units_temperature" + height = 4 + element: + x = 68 + text = + value = "label.brake" + height = 4 + element: + x = 89 + text = + value = "label.throttle" + height = 4 + element: + # bottom labels + y = 78 + element: + x = 10 + text = + value = "stat.max_liquidstat.units_liquid" + height = 4 + element: + x = 30 + text = + value = "stat.max_boiler_pressurestat.units_boiler_pressure" + height = 4 + element: + x = 50 + y = 0 + text = + value = "stat.max_temperaturestat.units_temperature" + height = 4 + element: + x = 68 + text = + value = "" + height = 4 + element: + x = 89 + text = + value = "label.reverser" + height = 4 \ No newline at end of file diff --git a/src/main/resources/assets/immersiverailroading/gui/default/steam_v1.caml b/src/main/resources/assets/immersiverailroading/gui/default/steam_v1.caml new file mode 100644 index 000000000..70d3f8e0f --- /dev/null +++ b/src/main/resources/assets/immersiverailroading/gui/default/steam_v1.caml @@ -0,0 +1,63 @@ +element: + screen_x = RIGHT + screen_y = BOTTOM + import: "immersiverailroading:gui/default/common/scale.caml" + + element: + y = -60 + element: + import: "immersiverailroading:gui/default/steam/dial_right.caml" + import: "immersiverailroading:gui/default/steam/gauge_speed_face.caml" + + element: + y = -120 + element: + import: "immersiverailroading:gui/default/steam/dial_right.caml" + import: "immersiverailroading:gui/default/steam/gauge_brake_face.caml" + + element: + x = -70 + import: "immersiverailroading:gui/default/steam/reverser.caml" + + element: + y = -65 + import: "immersiverailroading:gui/default/steam/brake_lever.caml" + + element: + y = -150 + import: "immersiverailroading:gui/default/steam/throttle.caml" + +element: + screen_x = RIGHT + screen_y = TOP + import: "immersiverailroading:gui/default/common/scale.caml" + + element: + import: "immersiverailroading:gui/default/steam/whistle.caml" + +element: + screen_x = LEFT + screen_y = MIDDLE + import: "immersiverailroading:gui/default/common/scale.caml" + + element: + y = -50 + x = -90 + import: "immersiverailroading:gui/default/steam/gauge_water_left.caml" + +element: + screen_x = LEFT + screen_y = TOP + import: "immersiverailroading:gui/default/common/scale.caml" + + element: + x = 0 + element: + import: "immersiverailroading:gui/default/steam/dial_up.caml" + import: "immersiverailroading:gui/default/steam/gauge_boiler_face.caml" + + element: + x = 60 + element: + import: "immersiverailroading:gui/default/steam/dial_up.caml" + import: "immersiverailroading:gui/default/steam/gauge_temperature_face.caml" \ No newline at end of file