Skip to content

Commit

Permalink
Updated to beta-10
Browse files Browse the repository at this point in the history
WTF jonathan
  • Loading branch information
ZiYueCommentary committed Oct 4, 2024
1 parent 95c4352 commit 7870d6c
Show file tree
Hide file tree
Showing 21 changed files with 12 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,16 +767,16 @@ public static NativeImage generateExitSignLetterTianjin(String exitLetter, Strin
try {
final int size = scale / 2;
final boolean noNumber = exitNumber.isEmpty();
final int textSize = (int) (size * 1.25F);
final int textSize = size;

final DynamicTextureCache.Text letter = DynamicTextureCache.instance.getText(exitLetter, noNumber ? textSize : textSize * 2 / 3, textSize, textSize, size, size, HorizontalAlignment.CENTER, forceMTRFont);
final DynamicTextureCache.Text number = noNumber ? null : DynamicTextureCache.instance.getText(exitNumber, textSize / 3, textSize, textSize / 2, textSize / 2, size, HorizontalAlignment.CENTER, forceMTRFont);

final NativeImage nativeImage = new NativeImage(NativeImageFormat.RGBA, size, size, false);
nativeImage.fillRect(0, 0, size, size, backgroundColor);
drawString(nativeImage, letter, size / 2 - (noNumber ? 0 : textSize / 6 - size / 32), size / 2, HorizontalAlignment.CENTER, VerticalAlignment.CENTER, backgroundColor, textColor, false);
nativeImage.fillRect(0, 0, size, size, 0);
drawString(nativeImage, letter, size / 2 - (noNumber ? 0 : textSize / 6 - size / 32), size / 2, HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 0, textColor, false);
if (!noNumber) {
drawString(nativeImage, number, size / 2 + textSize / 3 - size / 32, size / 2 + textSize / 8, HorizontalAlignment.CENTER, VerticalAlignment.CENTER, backgroundColor, textColor, false);
drawString(nativeImage, number, size / 2 + textSize / 3 - size / 32, size / 2 + textSize / 8, HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 0, textColor, false);
}
return nativeImage;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import org.mtr.mapping.mapper.BlockEntityRenderer;
import org.mtr.mapping.mapper.GraphicsHolder;
import org.mtr.mod.InitClient;
import org.mtr.mod.QrCodeHelper;
import org.mtr.mod.block.BlockRailwaySign;
import org.mtr.mod.block.IBlock;
import org.mtr.mod.client.DynamicTextureCache;
import org.mtr.mod.client.IDrawing;
import org.mtr.mod.client.MinecraftClientData;
import org.mtr.mod.data.IGui;
import org.mtr.mod.generated.lang.TranslationProvider;
import org.mtr.mod.render.MainRenderer;
import org.mtr.mod.render.QueuedRenderLayer;
import org.mtr.mod.render.RenderRailwaySign;
Expand All @@ -30,7 +30,6 @@
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import ziyue.tjmetro.mod.block.base.IRailwaySign;
import ziyue.tjmetro.mod.data.IGuiExtension;

import javax.annotation.Nullable;
import java.util.ArrayList;
Expand Down Expand Up @@ -76,7 +75,6 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
final boolean isLine = IRailwaySign.signIsLine(signId);
final boolean isPlatform = IRailwaySign.signIsPlatform(signId);
final boolean isStation = IRailwaySign.signIsStation(signId);
final boolean isTransportSystemMap = signId.equals("transport_system_map") || signId.equals("transport_system_map_text") || signId.equals("transport_system_map_text_flipped");

if (storedMatrixTransformations != null && isExit) {
final Station station = InitClient.findStation(pos);
Expand Down Expand Up @@ -186,13 +184,7 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
});
}
} else {
if (storedMatrixTransformations != null && isTransportSystemMap) {
final StoredMatrixTransformations storedMatrixTransformationsNew = storedMatrixTransformations.copy();
storedMatrixTransformationsNew.add(graphicsHolderNew -> graphicsHolderNew.translate(x, y, 0));
QrCodeHelper.INSTANCE.renderQrCode(storedMatrixTransformationsNew, QueuedRenderLayer.LIGHT, signSize);
} else {
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);
}
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);

if (hasCustomText) {
final float fixedMargin = size * (1 - BlockRailwaySign.SMALL_SIGN_PERCENTAGE) / 2;
Expand All @@ -207,7 +199,7 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
signText = IGui.mergeStations(selectedIds.longStream()
.filter(MinecraftClientData.getInstance().stationIdMap::containsKey)
.sorted()
.mapToObj(stationId -> IGuiExtension.insertTranslation("gui.mtr.station_cjk", "gui.mtr.station", 1, MinecraftClientData.getInstance().stationIdMap.get(stationId).getName()))
.mapToObj(stationId -> IGui.insertTranslation(TranslationProvider.GUI_MTR_STATION_CJK, TranslationProvider.GUI_MTR_STATION, 1, MinecraftClientData.getInstance().stationIdMap.get(stationId).getName()))
.collect(Collectors.toList())
);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.mtr.mapping.mapper.GraphicsHolder;
import org.mtr.mod.Init;
import org.mtr.mod.InitClient;
import org.mtr.mod.QrCodeHelper;
import org.mtr.mod.block.BlockRailwaySign;
import org.mtr.mod.block.IBlock;
import org.mtr.mod.client.IDrawing;
Expand Down Expand Up @@ -250,13 +249,7 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
});
}
} else {
if (storedMatrixTransformations != null && isTransportSystemMap) {
final StoredMatrixTransformations storedMatrixTransformationsNew = storedMatrixTransformations.copy();
storedMatrixTransformationsNew.add(graphicsHolderNew -> graphicsHolderNew.translate(x, y, 0));
QrCodeHelper.INSTANCE.renderQrCode(storedMatrixTransformationsNew, QueuedRenderLayer.LIGHT, signSize);
} else {
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);
}
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);

if (hasCustomText) {
final float fixedMargin = size * (1 - BlockRailwaySign.SMALL_SIGN_PERCENTAGE) / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.mtr.mapping.mapper.GraphicsHolder;
import org.mtr.mod.Init;
import org.mtr.mod.InitClient;
import org.mtr.mod.QrCodeHelper;
import org.mtr.mod.block.BlockRailwaySign;
import org.mtr.mod.block.IBlock;
import org.mtr.mod.client.IDrawing;
Expand Down Expand Up @@ -239,13 +238,7 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
});
}
} else {
if (storedMatrixTransformations != null && isTransportSystemMap) {
final StoredMatrixTransformations storedMatrixTransformationsNew = storedMatrixTransformations.copy();
storedMatrixTransformationsNew.add(graphicsHolderNew -> graphicsHolderNew.translate(x, y, 0));
QrCodeHelper.INSTANCE.renderQrCode(storedMatrixTransformationsNew, QueuedRenderLayer.LIGHT, signSize);
} else {
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);
}
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);

if (hasCustomText) {
final float fixedMargin = size * (1 - BlockRailwaySign.SMALL_SIGN_PERCENTAGE) / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.mtr.mapping.mapper.GraphicsHolder;
import org.mtr.mod.Init;
import org.mtr.mod.InitClient;
import org.mtr.mod.QrCodeHelper;
import org.mtr.mod.block.BlockRailwaySign;
import org.mtr.mod.block.IBlock;
import org.mtr.mod.client.DynamicTextureCache;
Expand Down Expand Up @@ -256,13 +255,7 @@ public static void drawSign(GraphicsHolder graphicsHolder, @Nullable StoredMatri
});
}
} else {
if (storedMatrixTransformations != null && isTransportSystemMap) {
final StoredMatrixTransformations storedMatrixTransformationsNew = storedMatrixTransformations.copy();
storedMatrixTransformationsNew.add(graphicsHolderNew -> graphicsHolderNew.translate(x, y, 0));
QrCodeHelper.INSTANCE.renderQrCode(storedMatrixTransformationsNew, QueuedRenderLayer.LIGHT, signSize);
} else {
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);
}
drawTexture.drawTexture(sign.getTexture(), x + margin, y + margin, signSize, flipTexture);

if (hasCustomText) {
final float fixedMargin = size * (1 - BlockRailwaySign.SMALL_SIGN_PERCENTAGE) / 2;
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ org.gradle.daemon=false
minecraft_version=1.20.4

# Mod Properties
mod_version=1.0.0-beta-2
mod_version=1.0.0-beta-2-hotfix-1
maven_group=ziyue.tjmetro
archives_base_name=tjmetro

# Dependencies
mtr_version=4.0.0-beta-9
mtr_version=4.0.0-beta-10
Loading

0 comments on commit 7870d6c

Please sign in to comment.