Skip to content

Commit

Permalink
🐞 Fixed bug of RailwaySignWallDouble
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Jun 9, 2024
1 parent 55ab3c9 commit 3283e7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ public static void drawSign(PoseStack matrices, MultiBufferSource vertexConsumer
final float extraMargin = margin - margin / selectedCount;
final float height = (size - extraMargin * 2) / selectedCount;
for (int i = 0; i < selectedIdsSorted.size(); i++) {
final float topOffset = i * height + extraMargin;
final float bottomOffset = (i + 1) * height + extraMargin;
final float topOffset = i * height + extraMargin + y;
final float bottomOffset = (i + 1) * height + extraMargin + y;
final float left = flipCustomText ? x - maxWidthLeft * size : x + margin;
final float right = flipCustomText ? x + size - margin : x + (maxWidthRight + 1) * size;
RenderTrains.scheduleRender(IRailwaySign.getPlatformSignResource(signId, selectedIdsSorted.get(i), flipCustomText ? HorizontalAlignment.RIGHT : HorizontalAlignment.LEFT, margin / size, (right - left) / (bottomOffset - topOffset), backgroundColor, ARGB_WHITE, backgroundColor, false), true, RenderTrains.QueuedRenderLayer.LIGHT_TRANSLUCENT, (matricesNew, vertexConsumer) -> {
storedMatrixTransformations.transform(matricesNew);
IDrawing.drawTexture(matricesNew, vertexConsumer, left, topOffset + y, 0, right, bottomOffset, 0, 0, 0, 1, 1, facing, -1, MAX_LIGHT_GLOWING);
IDrawing.drawTexture(matricesNew, vertexConsumer, left, topOffset, 0, right, bottomOffset, 0, 0, 0, 1, 1, facing, -1, MAX_LIGHT_GLOWING);
matricesNew.popPose();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static void drawSign(PoseStack matrices, MultiBufferSource vertexConsumer

RenderTrains.scheduleRender(IRailwaySign.getExitSignResource(signId, selectedExit.substring(0, 1), selectedExit.substring(1), backgroundColor, true), true, RenderTrains.QueuedRenderLayer.LIGHT_TRANSLUCENT, (matricesNew, vertexConsumer) -> {
storedMatrixTransformations.transform(matricesNew);
matricesNew.translate(x + margin + (flipCustomText ? signSize : 0), y + margin, 0);
matricesNew.translate(x + margin + (flipCustomText ? signSize : 0), margin, 0);
matricesNew.scale(Math.min(1, maxWidth / exitWidth), 1, 1);
IDrawing.drawTexture(matricesNew, vertexConsumer, offset, y, signSize, signSize, facing, MAX_LIGHT_GLOWING);
matricesNew.popPose();
Expand Down Expand Up @@ -220,13 +220,13 @@ public static void drawSign(PoseStack matrices, MultiBufferSource vertexConsumer
final float extraMargin = margin - margin / selectedCount;
final float height = (size - extraMargin * 2) / selectedCount;
for (int i = 0; i < selectedIdsSorted.size(); i++) {
final float topOffset = i * height + extraMargin;
final float bottomOffset = (i + 1) * height + extraMargin;
final float topOffset = i * height + extraMargin + y;
final float bottomOffset = (i + 1) * height + extraMargin + y;
final float left = flipCustomText ? x - maxWidthLeft * size : x + margin;
final float right = flipCustomText ? x + size - margin : x + (maxWidthRight + 1) * size;
RenderTrains.scheduleRender(IRailwaySign.getPlatformSignResource(signId, selectedIdsSorted.get(i), flipCustomText ? HorizontalAlignment.RIGHT : HorizontalAlignment.LEFT, margin / size, (right - left) / (bottomOffset - topOffset), backgroundColor, ARGB_WHITE, backgroundColor, true), true, RenderTrains.QueuedRenderLayer.LIGHT_TRANSLUCENT, (matricesNew, vertexConsumer) -> {
storedMatrixTransformations.transform(matricesNew);
IDrawing.drawTexture(matricesNew, vertexConsumer, left, topOffset + y, 0, right, bottomOffset, 0, 0, 0, 1, 1, facing, -1, MAX_LIGHT_GLOWING);
IDrawing.drawTexture(matricesNew, vertexConsumer, left, topOffset, 0, right, bottomOffset, 0, 0, 0, 1, 1, facing, -1, MAX_LIGHT_GLOWING);
matricesNew.popPose();
});
}
Expand Down

0 comments on commit 3283e7d

Please sign in to comment.