|
@@ -39,6 +39,13 @@ const customMenuState = {
|
|
|
...textStyles.h1_,
|
|
|
fill: colors.green,
|
|
|
});
|
|
|
+
|
|
|
+ this.lbl_description = game.add.text(
|
|
|
+ context.canvas.width / 2,
|
|
|
+ 170,
|
|
|
+ '',
|
|
|
+ textStyles.h2_
|
|
|
+ );
|
|
|
|
|
|
|
|
|
navigation.add.left(['back'], 'menu');
|
|
@@ -58,7 +65,7 @@ const customMenuState = {
|
|
|
let y = getFrameInfo().y;
|
|
|
|
|
|
this.renderSectionTitles(x, y, offsetW, offsetH);
|
|
|
- this.renderCheckBox(x, y, offsetW, offsetH);
|
|
|
+ this.renderCheckBox(x, y, offsetW, offsetH, curGame);
|
|
|
this.renderModeSection(x, y, offsetW, offsetH, curGame);
|
|
|
this.renderOperationSection(x, y, offsetW, offsetH, curGame);
|
|
|
this.renderDifficultySection(x, y, offsetW, offsetH, curGame);
|
|
@@ -213,6 +220,7 @@ const customMenuState = {
|
|
|
if (overIcon) {
|
|
|
|
|
|
document.body.style.cursor = 'pointer';
|
|
|
+ self.showTitle(self.menuIcons[overIcon]);
|
|
|
self.menuIcons.forEach((cur) => {
|
|
|
if (cur.iconType == self.menuIcons[overIcon].iconType) {
|
|
|
|
|
@@ -228,6 +236,7 @@ const customMenuState = {
|
|
|
});
|
|
|
} else {
|
|
|
|
|
|
+ self.clearTitle();
|
|
|
if (self.enterText) self.enterText.style = textStyles.btn;
|
|
|
self.menuIcons.forEach((cur) => {
|
|
|
cur.scale = cur.initialScale;
|
|
@@ -275,7 +284,7 @@ const customMenuState = {
|
|
|
gameList[gameId].assets.customMenu.auxiliarTitle(x, y, offsetW, offsetH);
|
|
|
},
|
|
|
|
|
|
- renderCheckBox: function (x, y, offsetW, offsetH) {
|
|
|
+ renderCheckBox: function (x, y, offsetW, offsetH, curGame) {
|
|
|
y += 60;
|
|
|
const frame = showFractions ? 1 : 0;
|
|
|
|
|
@@ -288,6 +297,8 @@ const customMenuState = {
|
|
|
);
|
|
|
selectionBox.anchor(0.5, 0.5);
|
|
|
selectionBox.iconType = 'selectionBox';
|
|
|
+ selectionBox.description = curGame.assets.customMenu.gameLabelDescription;
|
|
|
+
|
|
|
self.menuIcons.push(selectionBox);
|
|
|
},
|
|
|
|
|
@@ -312,6 +323,7 @@ const customMenuState = {
|
|
|
);
|
|
|
icon.anchor(0.5, 0.5);
|
|
|
|
|
|
+ icon.description = curGame.assets.customMenu.gameModeDescription[i];
|
|
|
icon.gameMode = curGame.gameMode[i];
|
|
|
icon.iconType = 'gameMode';
|
|
|
|
|
@@ -347,6 +359,7 @@ const customMenuState = {
|
|
|
1
|
|
|
);
|
|
|
icon.anchor(0.5, 0.5);
|
|
|
+ icon.description = curGame.assets.customMenu.gameOperationDescription[i];
|
|
|
|
|
|
icon.gameOperation = curGame.gameOperation[i];
|
|
|
icon.iconType = 'gameOperation';
|
|
@@ -379,6 +392,7 @@ const customMenuState = {
|
|
|
|
|
|
const icon = game.add.sprite(curX, y - 5, 'btn_square', 1, 0.8);
|
|
|
icon.anchor(0.5, 0.5);
|
|
|
+ icon.description = curGame.assets.customMenu.gameDifficultyDescription[i];
|
|
|
icon.difficulty = i + 1;
|
|
|
icon.iconType = 'difficulty';
|
|
|
|
|
@@ -462,4 +476,21 @@ const customMenuState = {
|
|
|
|
|
|
document.querySelector('.ifr-modal__infobox').innerHTML = content;
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ * Display the description the game mode on screen
|
|
|
+ *
|
|
|
+ * @param {object} icon icon for the game mode
|
|
|
+ */
|
|
|
+ showTitle: function (icon) {
|
|
|
+ if (icon.iconType !== 'infoIcon')
|
|
|
+ self.lbl_description.name = game.lang[icon.description];
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ * Remove the description the game mode from screen
|
|
|
+ */
|
|
|
+ clearTitle: function () {
|
|
|
+ self.lbl_description.name = '';
|
|
|
+ },
|
|
|
};
|