Skip to content

Commit

Permalink
Merge PR #2235 by @BdeBock - new subtitle.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cervator committed Mar 16, 2016
2 parents ebd9117 + eb48570 commit a16aa63
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.terasology.engine.module.ModuleManager;
import org.terasology.engine.module.StandardModuleExtension;
import org.terasology.game.GameManifest;
import org.terasology.i18n.TranslationSystem;
import org.terasology.module.DependencyInfo;
import org.terasology.module.DependencyResolver;
import org.terasology.module.Module;
Expand Down Expand Up @@ -75,6 +76,9 @@ public class CreateGameScreen extends CoreScreenLayer {
@In
private GameEngine gameEngine;

@In
private TranslationSystem translationSystem;

@In
private Config config;

Expand All @@ -83,6 +87,23 @@ public class CreateGameScreen extends CoreScreenLayer {
@Override
@SuppressWarnings("unchecked")
public void initialise() {


UILabel gameTypeTitle = find("gameTypeTitle", UILabel.class);
if (gameTypeTitle != null) {
gameTypeTitle.bindText(new ReadOnlyBinding<String>() {
@Override
public String get() {
if (loadingAsServer) {
return translationSystem.translate("${engine:menu#select-multiplayer-game-sub-title}");
} else {
return translationSystem.translate("${engine:menu#select-singleplayer-game-sub-title}");
}
}
});
}


final UIText worldName = find("worldName", UIText.class);
if (worldName != null) {
int gameNum = 1;
Expand Down
16 changes: 15 additions & 1 deletion engine/src/main/resources/assets/ui/menu/createGameScreen.ui
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@
}
}
},
{
"type" : "UILabel",
"id" : "gameTypeTitle",
"family" : "subtitle",
"text": "${engine:menu#select-singleplayer-game-sub-title}",
"layoutInfo" : {
"height" : 30,
"position-horizontal-center" : {},
"position-top" : {
"target" : "BOTTOM",
"widget" : "subtitle"
}
}
},
{
"type" : "UIBox",
"content" : {
Expand Down Expand Up @@ -148,7 +162,7 @@
"position-top" : {
"target" : "BOTTOM",
"offset" : 16,
"widget" : "subtitle"
"widget" : "gameTypeTitle"
}
}
},
Expand Down

0 comments on commit a16aa63

Please sign in to comment.