Skip to content

Commit

Permalink
feat: 开始支持中英双语
Browse files Browse the repository at this point in the history
  • Loading branch information
creeper12356 committed Aug 25, 2024
1 parent b1e3232 commit d46b347
Show file tree
Hide file tree
Showing 42 changed files with 16 additions and 9 deletions.
Binary file added assets/en/menutext_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_31.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/menutext_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/touch/tc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/touch/tok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public BasicMenuScreen(MyGame myGame, boolean okVisible, boolean cancelVisible)

// 加载图片
imgBackground = Resource.loadImage("background.png");
imgTouchButtonCancel = Resource.loadImage("touch/tc.png");
imgTouchButtonOk = Resource.loadImage("touch/tok.png");
imgTouchButtonCancel = Resource.loadImage(Resource.language + "/touch/tc.png");
imgTouchButtonOk = Resource.loadImage(Resource.language + "/touch/tok.png");

// 添加背景图片
Image img = new Image(imgBackground);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ public BoardScreen(MyGame myGame) {
imgButton[5] = Resource.loadImage("touch/t4.png");
imgButton[6] = Resource.loadImage("touch/tu.png");
imgButton[7] = Resource.loadImage("touch/td.png");
imgButton[8] = Resource.loadImage("touch/tc.png");
imgButton[9] = Resource.loadImage("touch/tok.png");
imgButton[8] = Resource.loadImage(Resource.language + "/touch/tc.png");
imgButton[9] = Resource.loadImage(Resource.language + "/touch/tok.png");

imgMoveNum[0] = Resource.loadImage("movenum_1.png");
imgMoveNum[1] = Resource.loadImage("movenum_3.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public MainMenuScreen(MyGame myGame) {
stage.addActor(table);

for (int i = 0; i < 7; ++i) {
imgMenuTextUp[i] = Resource.loadImage("menutext_1" + i + ".png");
imgMenuTextDown[i] = Resource.loadImage("menutext_2" + i + ".png");
imgMenuTextUp[i] = Resource.loadImage(Resource.language + "/menutext_1" + i + ".png");
imgMenuTextDown[i] = Resource.loadImage(Resource.language + "/menutext_2" + i + ".png");
}

addImageButton(imgMenuTextUp[0], imgMenuTextDown[0], new ClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public RoundMenuScreen(MyGame myGame) {

this.imgRound = Resource.loadImage("roundchip_3.png");

this.imgButtonOk = Resource.loadImage("touch/tok.png");
this.imgButtonOk = Resource.loadImage(Resource.language + "/touch/tok.png");
this.imgButtonLeft = Resource.loadImage("touch/tl.png");
this.imgButtonRight = Resource.loadImage("touch/tr.png");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public StoryMenuScreen(MyGame myGame) {
table.setFillParent(true);
stage.addActor(table);

imgTextNew = Resource.loadImage("menutext_31.png");
imgTextContinue = Resource.loadImage("menutext_32.png");
imgTextNew = Resource.loadImage(Resource.language + "/menutext_31.png");
imgTextContinue = Resource.loadImage(Resource.language + "/menutext_32.png");

addImageButton(imgTextNew, imgTextNew, new ClickListener() {
@Override
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/io/github/creeper12356/utils/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public class Resource {
public static final int KEY_NUM9 = 57;
public static final int KEY_STAR = 42;
public static final int KEY_POUND = 35;


public static Texture imgBackBuffer;

public static Texture[] imgDiaAvt; // 棋子头像图片
Expand All @@ -115,6 +117,9 @@ public class Resource {
public static float aniJumpDuration;
public static float aniDelayDuration;
public static int pointMgr;


public static String language;
// public static Animation aniTalkButton;

public static FreeTypeFontGenerator generator;
Expand Down Expand Up @@ -749,6 +754,8 @@ public static byte[] loadData(String filename) {
// pointMgr = new PointMgr();
// aniTalkButton = new Animation();

language = "en";

// 启动游戏时加载
Resource.loadGame();
}
Expand Down

0 comments on commit d46b347

Please sign in to comment.