Skip to content

Commit

Permalink
more localization; fix UI
Browse files Browse the repository at this point in the history
  • Loading branch information
hundun000 committed Feb 26, 2023
1 parent 532150e commit b3a87a7
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 69 deletions.
Binary file removed IdleDemo-game/core/assets/fonts/KOMTITK_.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ button2_rounded_CC
orig: 48, 20
offset: 0, 0
index: -1
button2_rounded_CC_disable
rotate: false
xy: 51, 156
size: 48, 20
split: 22, 18, 8, 6
orig: 48, 20
offset: 0, 0
index: -1
button2_rounded_CC_down
rotate: false
xy: 1, 134
Expand All @@ -22,29 +30,29 @@ button2_rounded_CC_down
index: -1
check-off
rotate: false
xy: 31, 118
xy: 80, 140
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
textfield
rotate: false
xy: 31, 118
xy: 80, 140
size: 14, 14
split: 3, 3, 3, 3
orig: 14, 14
offset: 0, 0
index: -1
check-on
rotate: false
xy: 132, 162
xy: 31, 87
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
cursor
rotate: false
xy: 31, 113
xy: 60, 113
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
Expand All @@ -59,47 +67,47 @@ default
index: -1
default-pane
rotate: false
xy: 81, 151
xy: 80, 135
size: 5, 3
split: 1, 1, 1, 1
orig: 5, 3
offset: 0, 0
index: -1
default-rect-pad
rotate: false
xy: 81, 151
xy: 80, 135
size: 5, 3
split: 1, 1, 1, 1
orig: 5, 3
offset: 0, 0
index: -1
default-pane-noborder
rotate: false
xy: 47, 131
xy: 76, 131
size: 1, 1
split: 0, 0, 0, 0
orig: 1, 1
offset: 0, 0
index: -1
default-rect
rotate: false
xy: 17, 46
xy: 123, 157
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-rect-down
rotate: false
xy: 1, 8
xy: 139, 173
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-round
rotate: false
xy: 1, 13
xy: 1, 30
size: 12, 20
split: 5, 5, 5, 4
pad: 4, 4, 1, 1
Expand All @@ -108,7 +116,7 @@ default-round
index: -1
default-round-down
rotate: false
xy: 164, 156
xy: 1, 8
size: 12, 20
split: 5, 5, 5, 4
pad: 4, 4, 1, 1
Expand All @@ -117,54 +125,54 @@ default-round-down
index: -1
default-round-large
rotate: false
xy: 110, 156
xy: 101, 156
size: 20, 20
split: 5, 5, 5, 4
orig: 20, 20
offset: 0, 0
index: -1
default-scroll
rotate: false
xy: 1, 51
xy: 1, 52
size: 20, 20
split: 2, 2, 2, 2
orig: 20, 20
offset: 0, 0
index: -1
default-select
rotate: false
xy: 81, 156
xy: 51, 134
size: 27, 20
split: 4, 14, 4, 4
orig: 27, 20
offset: 0, 0
index: -1
default-select-selection
rotate: false
xy: 132, 157
xy: 15, 47
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-slider
rotate: false
xy: 51, 138
xy: 96, 146
size: 8, 8
split: 2, 2, 2, 2
orig: 8, 8
offset: 0, 0
index: -1
default-slider-knob
rotate: false
xy: 178, 158
xy: 23, 54
size: 9, 18
orig: 9, 18
offset: 0, 0
index: -1
default-splitpane
rotate: false
xy: 23, 68
xy: 47, 98
size: 5, 3
split: 0, 5, 0, 0
orig: 5, 3
Expand All @@ -180,22 +188,22 @@ default-splitpane-vertical
index: -1
default-window
rotate: false
xy: 1, 73
xy: 31, 103
size: 27, 29
split: 4, 3, 20, 3
orig: 27, 29
offset: 0, 0
index: -1
selection
rotate: false
xy: 51, 135
xy: 96, 143
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
testNinePatch
rotate: false
xy: 51, 148
xy: 1, 104
size: 28, 28
split: 8, 8, 8, 8
pad: 8, 6, 8, 6
Expand All @@ -204,29 +212,29 @@ testNinePatch
index: -1
testNinePatch_down
rotate: false
xy: 1, 104
xy: 1, 74
size: 28, 28
split: 8, 8, 8, 8
orig: 28, 28
offset: 0, 0
index: -1
tree-minus
rotate: false
xy: 1, 35
xy: 60, 118
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
tree-plus
rotate: false
xy: 148, 162
xy: 123, 162
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
white
rotate: false
xy: 189, 173
xy: 31, 82
size: 3, 3
orig: 3, 3
offset: 0, 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
"com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle": {
"default": {
"up": "button2_rounded_CC",
"down": "button2_rounded_CC_down"
"down": "button2_rounded_CC_down",
"disabled": "button2_rounded_CC_disable"
},
"toggle": {
"up": "default-round",
Expand Down Expand Up @@ -168,7 +169,8 @@
"font": "MiSans-Bold",
"fontColor": "black",
"up": "button2_rounded_CC",
"down": "button2_rounded_CC_down"
"down": "button2_rounded_CC_down",
"disabled": "button2_rounded_CC_disable"
},
"toggle": {
"font": "default-font",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import hundun.gdxgame.idleshare.gamelib.framework.model.construction.base.UpgradeComponent;
import hundun.gdxgame.idleshare.gamelib.framework.model.resource.ResourcePack;
import hundun.gdxgame.idleshare.gamelib.framework.model.resource.ResourcePair;
import hundun.gdxgame.idleshare.gamelib.framework.util.text.IGameDictionary;
import hundun.gdxgame.idleshare.gamelib.framework.util.text.Language;


Expand All @@ -31,7 +32,6 @@ public List<BaseConstruction> provide(Language language) {
// clicker-provider
{
BaseConstruction construction = new BaseClickGatherConstruction(ConstructionId.COOKIE_CLICK_PROVIDER);
construction.detailDescroptionConstPart = "Click gain some cookie";
construction.descriptionPackage = DescriptionPackageFactory.getGatherDescriptionPackage(language);

OutputComponent outputComponent = new OutputComponent(construction);
Expand All @@ -51,7 +51,6 @@ public List<BaseConstruction> provide(Language language) {
// auto-provider
{
BaseConstruction construction = new BaseAutoConstruction(ConstructionId.COOKIE_AUTO_PROVIDER);
construction.detailDescroptionConstPart = "Auto gain some cookie";
construction.descriptionPackage = DescriptionPackageFactory.getMaxLevelAutoDescriptionPackage(language);

OutputComponent outputComponent = new OutputComponent(construction);
Expand All @@ -75,7 +74,6 @@ public List<BaseConstruction> provide(Language language) {
// seller
{
BaseConstruction construction = new BaseAutoConstruction(ConstructionId.COOKIE_SELLER);
construction.detailDescroptionConstPart = "Auto sell cookies";
construction.descriptionPackage = DescriptionPackageFactory.getWorkingLevelAutoDescriptionPackage(language);

OutputComponent outputComponent = new OutputComponent(construction);
Expand All @@ -102,7 +100,6 @@ public List<BaseConstruction> provide(Language language) {
// win
{
BaseConstruction construction = new BaseBuffConstruction(ConstructionId.WIN_PROVIDER, BuffId.WIN);
construction.detailDescroptionConstPart = "Get a trophy and win the game";
construction.descriptionPackage = DescriptionPackageFactory.getWinDescriptionPackage(language);

OutputComponent outputComponent = new OutputComponent(construction);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package hundun.gdxgame.idledemo.logic;

import java.util.List;

import hundun.gdxgame.gamelib.base.util.JavaFeatureForGwt;
import hundun.gdxgame.idleshare.gamelib.framework.util.text.IGameDictionary;
import hundun.gdxgame.idleshare.gamelib.framework.util.text.Language;

/**
* @author hundun
Expand All @@ -9,20 +13,80 @@
public class DemoGameDictionary implements IGameDictionary {


public String constructionIdToShowName(String constructionId) {
switch (constructionId) {
public String constructionIdToShowName(Language language, String constructionId) {
switch (language) {
case CN:
switch (constructionId) {
case ConstructionId.COOKIE_CLICK_PROVIDER:
return "大饼干";
case ConstructionId.COOKIE_AUTO_PROVIDER:
return "自动点击器";
case ConstructionId.COOKIE_SELLER:
return "自动销售器";
case ConstructionId.WIN_PROVIDER:
return "奖杯购买处";
default:
return "口口";
}
default:
switch (constructionId) {
case ConstructionId.COOKIE_CLICK_PROVIDER:
return "main cookie";
case ConstructionId.COOKIE_AUTO_PROVIDER:
return "cliker";
case ConstructionId.COOKIE_SELLER:
return "seller";
case ConstructionId.WIN_PROVIDER:
return "win";
default:
return "[dic lost]";
}
}

case ConstructionId.COOKIE_CLICK_PROVIDER:
return "main cookie";
case ConstructionId.COOKIE_AUTO_PROVIDER:
return "cliker";
case ConstructionId.COOKIE_SELLER:
return "seller";
case ConstructionId.WIN_PROVIDER:
return "win";

}

@Override
public String constructionIdToDetailDescroptionConstPart(Language language, String constructionId) {
switch (language) {
case CN:
switch (constructionId) {
case ConstructionId.COOKIE_CLICK_PROVIDER:
return "戳一戳,获得饼干";
case ConstructionId.COOKIE_AUTO_PROVIDER:
return "自动获得饼干";
case ConstructionId.COOKIE_SELLER:
return "自动获得饼干";
case ConstructionId.WIN_PROVIDER:
return "购买一个奖杯以赢得胜利";
default:
return "[dic lost]";
}
default:
switch (constructionId) {
case ConstructionId.COOKIE_CLICK_PROVIDER:
return "Click gain some cookie";
case ConstructionId.COOKIE_AUTO_PROVIDER:
return "Auto gain some cookie";
case ConstructionId.COOKIE_SELLER:
return "Auto sell cookies";
case ConstructionId.WIN_PROVIDER:
return "Get a trophy and win the game";
default:
return "[dic lost]";
}
}


}

@Override
public List<String> getMemuScreenTexts(Language language) {
switch (language) {
case CN:
return JavaFeatureForGwt.arraysAsList("Idle样例", "新游戏", "继续游戏");
default:
return "[dic:" + constructionId + "]";
return JavaFeatureForGwt.arraysAsList("Demo游戏", "新游戏", "继续游戏");
}
}
}
Loading

0 comments on commit b3a87a7

Please sign in to comment.