Fix: load how to play from server
This commit is contained in:
+19
-4
@@ -23,7 +23,8 @@ class Start {
|
||||
|
||||
|
||||
// contents
|
||||
this.printHowToPlay(appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName));
|
||||
// this.printHowToPlay(appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName));
|
||||
this.loadHowToPlay(sessionStorageManager.playingAppID);
|
||||
this.makeStartButton();
|
||||
let today = new Date();
|
||||
let date = DateUtil.getYYYYMMDD(today);
|
||||
@@ -58,14 +59,28 @@ class Start {
|
||||
let screenBottom = new ScreenBottom();
|
||||
screenBottom.makeBottomLine();
|
||||
screenBottom.printBottomLeftText("게임 진행 정보");
|
||||
let playingAppName = appInfoManager.getAppNameKorean(sessionStorageManager.playingAppName);
|
||||
screenBottom.printBottomCenterText(playingAppName);
|
||||
let playingAppKoreanName = sessionStorageManager.playingAppKoreanName;
|
||||
screenBottom.printBottomCenterText(playingAppKoreanName);
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
}
|
||||
|
||||
loadHowToPlay(appID) {
|
||||
this.dbConnectManager.requestHowToPlay(
|
||||
101, // space_invaders app ID
|
||||
(jsonData) => {
|
||||
let howToPlay = jsonData["HowToPlay"].replace(/\\n/g, "\n");
|
||||
this.printHowToPlay(howToPlay);
|
||||
},
|
||||
(jsonData) => {
|
||||
this.printHowToPlay("No data");
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
printHowToPlay(text) {
|
||||
const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
let howToPlayText = game.add.text(0, 0, appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName), style);
|
||||
let howToPlayText = game.add.text(0, 0, text, style);
|
||||
howToPlayText.setTextBounds(100, 100, game.world.width - 100, 200);
|
||||
howToPlayText.stroke = "#333";
|
||||
howToPlayText.strokeThickness = 5;
|
||||
|
||||
Reference in New Issue
Block a user