diff --git a/src/main/java/gregtech/common/terminal/app/capeselector/CapeSelectorApp.java b/src/main/java/gregtech/common/terminal/app/capeselector/CapeSelectorApp.java index 6a05f499425..cc53e1ca5f6 100644 --- a/src/main/java/gregtech/common/terminal/app/capeselector/CapeSelectorApp.java +++ b/src/main/java/gregtech/common/terminal/app/capeselector/CapeSelectorApp.java @@ -29,14 +29,14 @@ public AbstractApplication initApp() { this.addWidget(new SimpleTextWidget(166, 33, "", 0xFFFFFF, () -> { if(this.getCapeList().getCapes() == null || this.getCapeList().getCapes().isEmpty()) { - return "It looks like you haven't unlocked any capes yet!"; + return "terminal.cape_selector.empty"; } - return "Click on an unlocked cape to select it!"; + return "terminal.cape_selector.select"; })); this.addWidget(new SimpleTextWidget(166, 45, "", 0xFFFFFF, () -> { if(this.getCapeList().getCapes() == null || this.getCapeList().getCapes().isEmpty()) { - return "You can get these from high-level advancements."; + return "terminal.cape_selector.tip"; } return ""; })); diff --git a/src/main/java/gregtech/common/terminal/app/game/maze/MazeApp.java b/src/main/java/gregtech/common/terminal/app/game/maze/MazeApp.java index ec6c43c268f..469aeb6968f 100644 --- a/src/main/java/gregtech/common/terminal/app/game/maze/MazeApp.java +++ b/src/main/java/gregtech/common/terminal/app/game/maze/MazeApp.java @@ -48,8 +48,8 @@ public AbstractApplication initApp() { this.setOs(os); this.addWidget(new ImageWidget(5, 5, 333 - 10, 232 - 10, TerminalTheme.COLOR_B_2)); // enemy 0: Title - this.addWidget(new LabelWidget(333 / 2, 222 / 2 - 50, "Theseus's Escape", 0xFFFFFFFF).setXCentered(true), 0); - this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 - 10, 30, 30, "Play", + this.addWidget(new LabelWidget(333 / 2, 222 / 2 - 50, "terminal.maze.title", 0xFFFFFFFF).setXCentered(true), 0); + this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 - 10, 30, 30, "terminal.maze.play", (clickData -> { this.setGameState(1); this.resetGame(); @@ -60,13 +60,13 @@ public AbstractApplication initApp() { this.setEnemy(new EnemyWidget(-100, -100, this)); // GameState 2: Pause this.addWidget(new ImageWidget(5, 5, 333 - 10, 232 - 10, new ColorRectTexture(0xFF000000)), 2, 3); - this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 - 10, 50, 20, "Continue", (clickData) -> this.setGameState(1)).setShouldClientCallback(true), 2); - this.addWidget(new LabelWidget(333 / 2, 222 / 2 - 50, "Game Paused", 0xFFFFFFFF).setXCentered(true), 2); + this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 - 10, 50, 20, "terminal.maze.continue", (clickData) -> this.setGameState(1)).setShouldClientCallback(true), 2); + this.addWidget(new LabelWidget(333 / 2, 222 / 2 - 50, "terminal.maze.pause", 0xFFFFFFFF).setXCentered(true), 2); // GameState 3: Death - this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 40, "", 0xFFFFFFFF, () -> "Oh no! You were eaten by the Minotaur!", true), 3); - this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 28, "", 0xFFFFFFFF, () -> "You got through " + this.getMazesSolved() + " mazes before losing.", true), 3); - this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 16, "", 0xFFFFFFFF, () -> "Try again?", true), 3); - this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 + 10, 40, 20, "Retry", (clickData -> { + this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 40, "", 0xFFFFFFFF, () -> "terminal.maze.death.1", true), 3); + this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 28, "terminal.maze.death.2", 0xFFFFFFFF, () -> String.valueOf(this.getMazesSolved()),true), 3); + this.addWidget(new SimpleTextWidget(333 / 2, 232 / 2 - 16, "", 0xFFFFFFFF, () -> "terminal.maze.death.3", true), 3); + this.addWidget(new ClickButtonWidget(323 / 2 - 10, 222 / 2 + 10, 40, 20, "terminal.maze.retry", (clickData -> { this.setGameState(1); this.setMazesSolved(0); MAZE_SIZE = 9; diff --git a/src/main/java/gregtech/common/terminal/app/game/minesweeper/MinesweeperApp.java b/src/main/java/gregtech/common/terminal/app/game/minesweeper/MinesweeperApp.java index 8e4ef1aa6d5..ebe4fc13782 100644 --- a/src/main/java/gregtech/common/terminal/app/game/minesweeper/MinesweeperApp.java +++ b/src/main/java/gregtech/common/terminal/app/game/minesweeper/MinesweeperApp.java @@ -1,11 +1,13 @@ package gregtech.common.terminal.app.game.minesweeper; import gregtech.api.gui.widgets.SimpleTextWidget; +import gregtech.api.gui.widgets.WidgetGroup; import gregtech.api.terminal.app.AbstractApplication; import gregtech.common.terminal.app.game.minesweeper.widget.MineMapWidget; public class MinesweeperApp extends AbstractApplication { private MineMapWidget mineField; + private WidgetGroup textGroup; private int timer; private int resetCountdown = 100; @@ -18,7 +20,9 @@ public AbstractApplication initApp() { mineField = new MineMapWidget(20, 12, 40); this.addWidget(mineField); this.addWidget(new SimpleTextWidget(333 / 6, 10, "", 0xFFCCCCCC, this::getFlagsPercentage, true)); - this.addWidget(new SimpleTextWidget(333 / 8 * 5, 10, "", 0xFFCCCCCC, this::getStatus, true)); + textGroup = new WidgetGroup(0, 0, 200, 50); + this.addWidget(textGroup); + setTextStatus(); return this; } @@ -36,12 +40,14 @@ public void updateScreen() { mineField.notifyWon(); } resetCountdown--; + setTextStatus(); } else timer++; if (resetCountdown == 0) { mineField.resetData(); resetCountdown = 100; timer = 0; + setTextStatus(); } } @@ -49,12 +55,21 @@ public String getFlagsPercentage() { return mineField.flagsPlaced + "/" + mineField.mineCount; } - public String getStatus() { - return resetCountdown == 100 ? - (timer / 20) + " seconds elapsed" : // Normal - mineField.hasLost() ? - "You lost. Game will restart in " + resetCountdown / 20 + " seconds." : // Losing condition - "You won in " + (timer / 20) + " seconds! Game will restart in " + resetCountdown / 20; // Winning condition + public void setTextStatus() { //swap widget for localization + if (resetCountdown == 100) { + textGroup.clearAllWidgets(); + textGroup.addWidget(new SimpleTextWidget(333 / 8 * 5, 10, "terminal.minesweeper.time", 0xFFCCCCCC, ()->String.valueOf(timer / 20), true)); // Normal + } + else if(resetCountdown==99){ + textGroup.clearAllWidgets(); + if(mineField.hasLost()){ + textGroup.addWidget(new SimpleTextWidget(333 / 8 * 5, 10, "terminal.minesweeper.lose", 0xFFCCCCCC, ()->String.valueOf(resetCountdown / 20), true)); // Losing condition + } else{ + textGroup.addWidget(new SimpleTextWidget(333 / 8 * 5, 10, "terminal.minesweeper.win.1", 0xFFCCCCCC, ()->String.valueOf(timer / 20), true)); // Winning condition + textGroup.addWidget(new SimpleTextWidget(333 / 8 * 5, 20, "terminal.minesweeper.win.2", 0xFFCCCCCC, ()->String.valueOf(resetCountdown / 20), true)); + } + } + } @Override diff --git a/src/main/java/gregtech/common/terminal/app/settings/widgets/ThemeSettings.java b/src/main/java/gregtech/common/terminal/app/settings/widgets/ThemeSettings.java index c68a486b888..829a8fa6db4 100644 --- a/src/main/java/gregtech/common/terminal/app/settings/widgets/ThemeSettings.java +++ b/src/main/java/gregtech/common/terminal/app/settings/widgets/ThemeSettings.java @@ -41,7 +41,13 @@ public ThemeSettings(TerminalOSWidget os) { this.addColorButton(TerminalTheme.COLOR_B_3, "COLOR_B_3", (int) (x * 12), y); this.addWidget(new LabelWidget(323 / 2, 75, "terminal.settings.theme.wallpaper", -1).setXCentered(true)); this.addWidget(new ImageWidget((int) x, 95, 150, 105, TerminalTheme.WALL_PAPER).setBorder(2, -1)); - this.addWidget(new SelectorWidget((int) (x + 170), 95, 116, 20, Arrays.asList("resource", "url", "color", "file"), -1, TerminalTheme.WALL_PAPER::getTypeName, true) + this.addWidget(new SelectorWidget((int) (x + 170), 95, 116, 20, + Arrays.asList( + "terminal.settings.theme.wallpaper.resource", + "terminal.settings.theme.wallpaper.url", + "terminal.settings.theme.wallpaper.color", + "terminal.settings.theme.wallpaper.file"), + -1, this::getLocalizedWallpaperTypeName, true) .setIsUp(true) .setOnChanged(this::onModifyTextureChanged) .setColors(TerminalTheme.COLOR_B_2.getColor(), TerminalTheme.COLOR_F_1.getColor(), TerminalTheme.COLOR_B_2.getColor()) @@ -50,6 +56,16 @@ public ThemeSettings(TerminalOSWidget os) { this.addWidget(textureGroup); } + private String getLocalizedWallpaperTypeName(){ + switch(TerminalTheme.WALL_PAPER.getTypeName()){ + case "resource": return "terminal.settings.theme.wallpaper.resource"; + case "url": return "terminal.settings.theme.wallpaper.url"; + case "color": return "terminal.settings.theme.wallpaper.color"; + case "file": return "terminal.settings.theme.wallpaper.file"; + } + return null; + } + private void addColorButton(ColorRectTexture texture, String name, int x, int y) { CircleButtonWidget buttonWidget = new CircleButtonWidget(x, y, 8, 1, 0).setFill(texture.getColor()).setStrokeAnima(-1).setHoverText(name); buttonWidget.setClickListener(cd -> TerminalDialogWidget.showColorDialog(os, name, color -> { @@ -67,7 +83,7 @@ private void addColorButton(ColorRectTexture texture, String name, int x, int y) private void onModifyTextureChanged(String type) { textureGroup.clearAllWidgets(); switch (type) { - case "resource": + case "terminal.settings.theme.wallpaper.resource": if (!(TerminalTheme.WALL_PAPER.getTexture() instanceof TextureArea)) { TerminalTheme.WALL_PAPER.setTexture(new TextureArea(new ResourceLocation("gregtech:textures/gui/terminal/terminal_background.png"), 0.0, 0.0, 1.0, 1.0)); TerminalTheme.saveConfig(); @@ -78,7 +94,7 @@ private void onModifyTextureChanged(String type) { TerminalTheme.saveConfig(); }); break; - case "url": + case "terminal.settings.theme.wallpaper.url": if (!(TerminalTheme.WALL_PAPER.getTexture() instanceof URLTexture)) { TerminalTheme.WALL_PAPER.setTexture(new URLTexture(null)); TerminalTheme.saveConfig(); @@ -88,7 +104,7 @@ private void onModifyTextureChanged(String type) { TerminalTheme.saveConfig(); }); break; - case "color": + case "terminal.settings.theme.wallpaper.color": ColorRectTexture texture; if (!(TerminalTheme.WALL_PAPER.getTexture() instanceof ColorRectTexture)) { texture = new ColorRectTexture(-1); @@ -101,7 +117,7 @@ private void onModifyTextureChanged(String type) { .setColorSupplier(texture::getColor, true) .setOnColorChanged(texture::setColor)); break; - case "file": + case "terminal.settings.theme.wallpaper.file": if (!(TerminalTheme.WALL_PAPER.getTexture() instanceof FileTexture)) { TerminalTheme.WALL_PAPER.setTexture(new FileTexture(null)); TerminalTheme.saveConfig(); diff --git a/src/main/resources/assets/gregtech/lang/en_us.lang b/src/main/resources/assets/gregtech/lang/en_us.lang index e3be69e9607..cb22dd1a058 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -5005,6 +5005,10 @@ terminal.settings.description=The system settings for GTOS. terminal.settings.theme=Theme terminal.settings.theme.color=Theme Color Settings terminal.settings.theme.wallpaper=Wallpaper Settings +terminal.settings.theme.wallpaper.resource=resource +terminal.settings.theme.wallpaper.url=url +terminal.settings.theme.wallpaper.color=color +terminal.settings.theme.wallpaper.file=file terminal.settings.theme.select=Select terminal.settings.theme.image=Image File terminal.settings.home=Home Button @@ -5113,6 +5117,24 @@ terminal.vtank_viewer.refresh=Refresh tank index terminal.teleporter.dimension=Dimension: terminal.teleporter.spawn_portal=Engage +terminal.maze.title=Theseus's Escape +terminal.maze.play=Play +terminal.maze.continue=Continue +terminal.maze.pause=Game Paused +terminal.maze.death.1=Oh no! You were eaten by the Minotaur! +terminal.maze.death.2=You got through %s mazes before losing. +terminal.maze.death.3=Try again? +terminal.maze.retry=Retry + +terminal.minesweeper.time=%s seconds elapsed +terminal.minesweeper.lose=You lost. Game will restart in %s seconds. +terminal.minesweeper.win.1=You won in %s seconds! +terminal.minesweeper.win.2=Game will restart in %s + +terminal.cape_selector.empty=It looks like you haven't unlocked any capes yet! +terminal.cape_selector.select=Click on an unlocked cape to select it! +terminal.cape_selector.tip=You can get these from high-level advancements. + metaitem.cover.digital.title.mode=Mode: metaitem.cover.digital.title.spin=Spin: metaitem.cover.digital.wireless.tooltip.1=§eRight click on the central monitor to bind remotely to it. diff --git a/src/main/resources/assets/gregtech/lang/ja_jp.lang b/src/main/resources/assets/gregtech/lang/ja_jp.lang index 0a1ba1354aa..b8a667caeeb 100644 --- a/src/main/resources/assets/gregtech/lang/ja_jp.lang +++ b/src/main/resources/assets/gregtech/lang/ja_jp.lang @@ -4870,7 +4870,7 @@ gregtech.terminal.app_name.ore_prospector=鉱石探査 gregtech.terminal.app_name.fluid_prospector=液体探査 gregtech.terminal.app_name.pong=ポン gregtech.terminal.app_name.minesweeper=マインスイーパー -gregtech.terminal.app_name.maze=テセウスの迷宮 +gregtech.terminal.app_name.maze=テセウスの脱出 gregtech.terminal.app_name.console=GTコンソール @@ -4952,6 +4952,10 @@ terminal.settings.description=GTOSのシステム設定. terminal.settings.theme=テーマ terminal.settings.theme.color=テーマカラーの設定 terminal.settings.theme.wallpaper=壁紙設定 +terminal.settings.theme.wallpaper.resource=リソース +terminal.settings.theme.wallpaper.url=url +terminal.settings.theme.wallpaper.color=単色 +terminal.settings.theme.wallpaper.file=ファイル terminal.settings.theme.select=選択 terminal.settings.theme.image=画像ファイル terminal.settings.home=ホームボタン @@ -5057,6 +5061,24 @@ terminal.vtank_viewer.description=エンダーリンクの周波数を変更し terminal.vtank_viewer.title=バーチャルタンクビューア terminal.vtank_viewer.refresh=再読み込み +terminal.maze.title=テセウスの脱出 +terminal.maze.play=プレイ +terminal.maze.continue=ゲーム再開 +terminal.maze.pause=PAUSE +terminal.maze.death.1=なんてことだ! ミノタウロスに食われてしまった! +terminal.maze.death.2=生きている間に%sの迷路を突破した. +terminal.maze.death.3=再挑戦する? +terminal.maze.retry=リトライ + +terminal.minesweeper.time=%s秒経過 +terminal.minesweeper.lose=失敗! %s秒後にリスタートします. +terminal.minesweeper.win.1=%s秒で勝利しました! +terminal.minesweeper.win.2=%s秒後にリスタートします. + +terminal.cape_selector.empty=まだマントを一つも持っていません! +terminal.cape_selector.select=マントをクリックして選択してください! +terminal.cape_selector.tip=象徴的な実績を達成することでマントを獲得できます. + metaitem.cover.digital.title.mode=モード: metaitem.cover.digital.title.spin=回転: metaitem.cover.digital.wireless.tooltip.1=§eセントラルモニターを右クリックすることで無線でリンクできます. diff --git a/src/main/resources/assets/gregtech/lang/ru_ru.lang b/src/main/resources/assets/gregtech/lang/ru_ru.lang index 5cc1f507eb9..caf4aa8f960 100644 --- a/src/main/resources/assets/gregtech/lang/ru_ru.lang +++ b/src/main/resources/assets/gregtech/lang/ru_ru.lang @@ -4959,6 +4959,10 @@ terminal.settings.description=Системные настройки для те terminal.settings.theme=Тема terminal.settings.theme.color=Настройка цветов терминала terminal.settings.theme.wallpaper=Настройка фона +terminal.settings.theme.wallpaper.resource=resource +terminal.settings.theme.wallpaper.url=url +terminal.settings.theme.wallpaper.color=color +terminal.settings.theme.wallpaper.file=file terminal.settings.theme.select=Выбрать изображение terminal.settings.theme.image=Изображение terminal.settings.home=Кнопка домой @@ -5064,6 +5068,24 @@ terminal.vtank_viewer.description=Never lose any fluids to changing ender link f terminal.vtank_viewer.title=Виртуальный просмотр резервуаров terminal.vtank_viewer.refresh=Обновить +terminal.maze.title=Theseus's Escape +terminal.maze.play=Play +terminal.maze.continue=Continue +terminal.maze.pause=Game Paused +terminal.maze.death.1=Oh no! You were eaten by the Minotaur! +terminal.maze.death.2=You got through %s mazes before losing. +terminal.maze.death.3=Try again? +terminal.maze.retry=Retry + +terminal.minesweeper.time=%s seconds elapsed +terminal.minesweeper.lose=You lost. Game will restart in %s seconds. +terminal.minesweeper.win.1=You won in %s seconds! +terminal.minesweeper.win.2=Game will restart in %s + +terminal.cape_selector.empty=It looks like you haven't unlocked any capes yet! +terminal.cape_selector.select=Click on an unlocked cape to select it! +terminal.cape_selector.tip=You can get these from high-level advancements. + metaitem.cover.digital.title.mode=Режим: metaitem.cover.digital.title.spin=Поворот: metaitem.cover.digital.wireless.tooltip.1=§eЩелкните правой кнопкой мыши на центральный монитор, чтобы привязаться к нему. diff --git a/src/main/resources/assets/gregtech/lang/zh_cn.lang b/src/main/resources/assets/gregtech/lang/zh_cn.lang index c010ffa017d..59150affc65 100644 --- a/src/main/resources/assets/gregtech/lang/zh_cn.lang +++ b/src/main/resources/assets/gregtech/lang/zh_cn.lang @@ -5019,6 +5019,10 @@ terminal.settings.description=GTOS的系统设置 terminal.settings.theme=主题 terminal.settings.theme.color=主题颜色设置 terminal.settings.theme.wallpaper=壁纸设置 +terminal.settings.theme.wallpaper.resource=资源 +terminal.settings.theme.wallpaper.url=网址 +terminal.settings.theme.wallpaper.color=单色 +terminal.settings.theme.wallpaper.file=文件 terminal.settings.theme.select=选择 terminal.settings.theme.image=图像文件 terminal.settings.home=主页按钮 @@ -5124,6 +5128,24 @@ terminal.vtank_viewer.description=永远不要再次失去任何末影流体连 terminal.vtank_viewer.title=虚拟容器查看器 terminal.vtank_viewer.refresh=刷新容器指数 +terminal.maze.title=提修斯的逃跑 +terminal.maze.play=开始 +terminal.maze.continue=继续 +terminal.maze.pause=暂停 +terminal.maze.death.1=天啊! 你被弥诺陶洛斯吃掉了! +terminal.maze.death.2=你在死之前破解了%s个迷宫。 +terminal.maze.death.3=再玩一次? +terminal.maze.retry=重试 + +terminal.minesweeper.time=%s秒经过 +terminal.minesweeper.lose=你输了。游戏将在%s秒后重新开始. +terminal.minesweeper.win.1=你在%s秒内赢了! +terminal.minesweeper.win.2=游戏将在%s秒后重新开始. + +terminal.cape_selector.empty=看来你还没有开放任何披风! +terminal.cape_selector.select=点击已开放的披风以选择! +terminal.cape_selector.tip=你可以经过获得困难的进度以开放披风。 + metaitem.cover.digital.title.mode=模式: metaitem.cover.digital.title.spin=自旋: metaitem.cover.digital.wireless.tooltip.1=§e右击中央监视器以远程绑定到它。