Skip to content

Commit

Permalink
loading screen disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
brain-frog committed Jun 5, 2024
1 parent 5464f96 commit 7c9e5e9
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 6 deletions.
43 changes: 37 additions & 6 deletions src/loading-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,17 @@ export class LoadingScene extends SceneBase {
const width = this.cameras.main.width;
const height = this.cameras.main.height;

const logo = this.add.image(width / 2, 240, "");
const midWidth = width / 2;
const midHeight = height / 2;

const logo = this.add.image(midWidth, 240, "");
logo.setVisible(false);
logo.setOrigin(0.5, 0.5);
logo.setScale(4);

const percentText = this.make.text({
x: width / 2,
y: height / 2 - 24,
x: midWidth,
y: midHeight - 24,
text: "0%",
style: {
font: "72px emerald",
Expand All @@ -369,8 +372,8 @@ export class LoadingScene extends SceneBase {
percentText.setOrigin(0.5, 0.5);

const assetText = this.make.text({
x: width / 2,
y: height / 2 + 48,
x: midWidth,
y: midHeight + 48,
text: "",
style: {
font: "48px emerald",
Expand All @@ -379,6 +382,32 @@ export class LoadingScene extends SceneBase {
});
assetText.setOrigin(0.5, 0.5);

const disclaimerText = this.make.text({
x: midWidth,
y: assetText.y + 152,
text: i18next.t("menu:disclaimer"),
style: {
font: "72px emerald",
color: "#DA3838",
},
});
disclaimerText.setOrigin(0.5, 0.5);

const disclaimerDescriptionText = this.make.text({
x: midWidth,
y: disclaimerText.y + 120,
text: i18next.t("menu:disclaimerDescription"),
style: {
font: "48px emerald",
color: "#ffffff",
align: "center"
},
});
disclaimerDescriptionText.setOrigin(0.5, 0.5);

disclaimerText.setVisible(false);
disclaimerDescriptionText.setVisible(false);

const intro = this.add.video(0, 0);
intro.setOrigin(0, 0);
intro.setScale(3);
Expand All @@ -388,7 +417,7 @@ export class LoadingScene extends SceneBase {
percentText.setText(`${Math.floor(parsedValue * 100)}%`);
progressBar.clear();
progressBar.fillStyle(0xffffff, 0.8);
progressBar.fillRect(width / 2 - 320, 360, 640 * parsedValue, 64);
progressBar.fillRect(midWidth - 320, 360, 640 * parsedValue, 64);
});

this.load.on("fileprogress", file => {
Expand Down Expand Up @@ -423,6 +452,8 @@ export class LoadingScene extends SceneBase {
ease: "Sine.easeIn"
});
loadingGraphics.map(g => g.setVisible(true));
disclaimerText.setVisible(true);
disclaimerDescriptionText.setVisible(true);
});
intro.play();
break;
Expand Down
2 changes: 2 additions & 0 deletions src/locales/de/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"Leer",
"yes":"Ja",
"no":"Nein",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/en/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"Empty",
"yes":"Yes",
"no":"No",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/es/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"Vacío",
"yes":"Sí",
"no":"No",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/fr/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"Vide",
"yes":"Oui",
"no":"Non",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/it/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"Vuoto",
"yes":"Si",
"no":"No",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/ko/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"빈 슬롯",
"yes":"예",
"no":"아니오",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/pt_BR/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty": "Vazio",
"yes": "Sim",
"no": "Não",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/zh_CN/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty": "空",
"yes": "是",
"no": "否",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;
2 changes: 2 additions & 0 deletions src/locales/zh_TW/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ export const menu: SimpleTranslationEntries = {
"empty":"空",
"yes":"是",
"no":"否",
"disclaimer": "DISCLAIMER",
"disclaimerDescription": "This game is an unfinished product; it might have playability issues (including the potential loss of save data),\n change without notice, and may or may not be updated further or completed."
} as const;

0 comments on commit 7c9e5e9

Please sign in to comment.