From 0f6170b3f71ce84d64e407468456d264dbe3628f Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sat, 24 Aug 2024 17:42:20 +0100 Subject: [PATCH 1/6] GetModeChain in window.gameInfo for prod debugging --- src/battle-scene.ts | 9 +++++---- src/ui/menu-ui-handler.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 4faf3863e3c..65b4042afca 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -50,8 +50,8 @@ import CandyBar from "./ui/candy-bar"; import { Variant, variantData } from "./data/variant"; import { Localizable } from "#app/interfaces/locales"; import Overrides from "#app/overrides"; -import {InputsController} from "./inputs-controller"; -import {UiInputs} from "./ui-inputs"; +import { InputsController } from "./inputs-controller"; +import { UiInputs } from "./ui-inputs"; import { NewArenaEvent } from "./events/battle-scene"; import { ArenaFlyout } from "./ui/arena-flyout"; import { EaseType } from "#enums/ease-type"; @@ -66,7 +66,7 @@ import { Species } from "#enums/species"; import { UiTheme } from "#enums/ui-theme"; import { TimedEventManager } from "#app/timed-event-manager.js"; import i18next from "i18next"; -import {TrainerType} from "#enums/trainer-type"; +import { TrainerType } from "#enums/trainer-type"; import { battleSpecDialogue } from "./data/dialogue"; import { LoadingScene } from "./loading-scene"; @@ -2652,7 +2652,8 @@ export default class BattleScene extends SceneBase { wave: this.currentBattle?.waveIndex || 0, party: this.party ? this.party.map(p => { return { name: p.name, level: p.level }; - }) : [] + }) : [], + modeChain: this.ui.getModeChain(), }; (window as any).gameInfo = gameInfo; } diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 24e76035972..5ca932e9da6 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -8,7 +8,7 @@ import { OptionSelectConfig, OptionSelectItem } from "./abstact-option-select-ui import { Tutorial, handleTutorial } from "../tutorial"; import { loggedInUser, updateUserInfo } from "../account"; import i18next from "i18next"; -import {Button} from "#enums/buttons"; +import { Button } from "#enums/buttons"; import { GameDataType } from "#enums/game-data-type"; import BgmBar from "#app/ui/bgm-bar"; @@ -97,7 +97,7 @@ export default class MenuUiHandler extends MessageUiHandler { render() { const ui = this.getUi(); - console.log(ui.getModeChain()); + this.scene.updateGameInfo(); this.excludedMenus = () => [ { condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain()[0]), options: [ MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] }, { condition: bypassLogin, options: [ MenuOptions.LOG_OUT ] } From 38d4a594a096a6a3f2558843511529602ce4819b Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sat, 24 Aug 2024 17:44:36 +0100 Subject: [PATCH 2/6] revert fix --- src/ui/menu-ui-handler.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 5ca932e9da6..0693a805b04 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -97,7 +97,6 @@ export default class MenuUiHandler extends MessageUiHandler { render() { const ui = this.getUi(); - this.scene.updateGameInfo(); this.excludedMenus = () => [ { condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain()[0]), options: [ MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] }, { condition: bypassLogin, options: [ MenuOptions.LOG_OUT ] } From 2d0cf54a7f374f21ad7710a43b429221687d9e67 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sat, 24 Aug 2024 17:47:21 +0100 Subject: [PATCH 3/6] revert modechain debug info --- src/battle-scene.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 65b4042afca..ea4a8f980c3 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2653,7 +2653,6 @@ export default class BattleScene extends SceneBase { party: this.party ? this.party.map(p => { return { name: p.name, level: p.level }; }) : [], - modeChain: this.ui.getModeChain(), }; (window as any).gameInfo = gameInfo; } From 0df40893b24920462c2a23b31a825a5615e3692d Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sat, 24 Aug 2024 17:59:41 +0100 Subject: [PATCH 4/6] Add modeChain to gameInfo for debug purposes --- src/battle-scene.ts | 1 + src/ui/ui.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index ea4a8f980c3..4329a2f2441 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2653,6 +2653,7 @@ export default class BattleScene extends SceneBase { party: this.party ? this.party.map(p => { return { name: p.name, level: p.level }; }) : [], + modeChain: this.ui?.getModeChain() ?? [], }; (window as any).gameInfo = gameInfo; } diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 67002e32283..e7810bbf95e 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -1,4 +1,4 @@ -import {default as BattleScene} from "../battle-scene"; +import { default as BattleScene } from "../battle-scene"; import UiHandler from "./ui-handler"; import BattleMessageUiHandler from "./battle-message-ui-handler"; import CommandUiHandler from "./command-ui-handler"; @@ -24,7 +24,7 @@ import EggHatchSceneHandler from "./egg-hatch-scene-handler"; import EggListUiHandler from "./egg-list-ui-handler"; import EggGachaUiHandler from "./egg-gacha-ui-handler"; import VouchersUiHandler from "./vouchers-ui-handler"; -import {addWindow} from "./ui-theme"; +import { addWindow } from "./ui-theme"; import LoginFormUiHandler from "./login-form-ui-handler"; import RegistrationFormUiHandler from "./registration-form-ui-handler"; import LoadingModalUiHandler from "./loading-modal-ui-handler"; @@ -37,8 +37,8 @@ import SavingIconHandler from "./saving-icon-handler"; import UnavailableModalUiHandler from "./unavailable-modal-ui-handler"; import OutdatedModalUiHandler from "./outdated-modal-ui-handler"; import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler"; -import {Button} from "#enums/buttons"; -import i18next, {ParseKeys} from "i18next"; +import { Button } from "#enums/buttons"; +import i18next, { ParseKeys } from "i18next"; import GamepadBindingUiHandler from "./settings/gamepad-binding-ui-handler"; import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; import KeyboardBindingUiHandler from "#app/ui/settings/keyboard-binding-ui-handler"; @@ -453,6 +453,7 @@ export default class UI extends Phaser.GameObjects.Container { } if (chainMode && this.mode && !clear) { this.modeChain.push(this.mode); + (this.scene as BattleScene).updateGameInfo(); } this.mode = mode; const touchControls = document?.getElementById("touchControls"); @@ -500,6 +501,7 @@ export default class UI extends Phaser.GameObjects.Container { resetModeChain(): void { this.modeChain = []; + (this.scene as BattleScene).updateGameInfo(); } revertMode(): Promise { @@ -513,6 +515,7 @@ export default class UI extends Phaser.GameObjects.Container { const doRevertMode = () => { this.getHandler().clear(); this.mode = this.modeChain.pop()!; // TODO: is this bang correct? + (this.scene as BattleScene).updateGameInfo(); const touchControls = document.getElementById("touchControls"); if (touchControls) { touchControls.dataset.uiMode = Mode[this.mode]; From f6fd091d9b27156dae2a0045e166e9b193d1e22c Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 25 Aug 2024 02:09:29 +0100 Subject: [PATCH 5/6] Doc update (#3742) * Update feature_request.yml Fix auto labels * add CODEOWNERS file * Update CODEOWNERS * Update pull_request_template.md --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> --- .github/CODEOWNERS | 45 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/pull_request_template.md | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..ce942deba5f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,45 @@ +# Order is important; the last matching pattern takes the most precedence. + +# everything (whole code-base) - Junior Devs +* @pagefaultgames/junior-dev-team + +# github actions/templates etc. - Dev Leads +/.github @pagefaultgames/dev-leads + +# --- Translations --- + +# all translations - Translation Leads +/src/locales @pagefaultgames/translation-leads + +# Catalan (Spain/Spanish) +/src/locales/ca_ES @pagefaultgames/catalan-translation-team + +# German +/src/locales/de @pagefaultgames/german-translation-team + +# English +/src/locales/en @pagefaultgames/english-translation-team + +# Spanish +/src/locales/es @pagefaultgames/spanish-translation-team + +# French +/src/locales/fr @pagefaultgames/french-translation-team + +# Italian +/src/locales/it @pagefaultgames/italian-translation-team + +# Japenese +/src/locales/ja @pagefaultgames/japanese-translation-team + +# Korean +/src/locales/ko @pagefaultgames/korean-translation-team + +# Brasilian (Brasil/Portuguese) +/src/locales/pt_BR @pagefaultgames/portuguese_br-translation-team + +# Chinese (simplified) +/src/locales/zh_CN @pagefaultgames/chinese_simplified-translation-team + +# Chinese (traditional) +/src/locales/zh_TW @pagefaultgames/chinese_traditional-translation-team diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 5aec86a0463..843f7feab59 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: Feature Request description: Suggest an idea for this project title: "[Feature] " -labels: ["enhancement"] +labels: ["Enhancement"] body: - type: markdown attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a765ed4a114..3e6b8bf6d0d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -30,7 +30,7 @@ - [ ] The PR is self-contained and cannot be split into smaller PRs? - [ ] Have I provided a clear explanation of the changes? - [ ] Have I considered writing automated tests for the issue? -- [ ] If I have text, did I add placeholders for them in locales? +- [ ] If I have text, did I add make it translatable and added a key in the English language? - [ ] Have I tested the changes (manually)? - [ ] Are all unit tests still passing? (`npm run test`) - [ ] Are the changes visual? From 2c4f02098f50d4d2d15a7585eaa22bfccbf4a6f4 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 25 Aug 2024 02:35:16 +0100 Subject: [PATCH 6/6] chore: Fix import formatting in ui.ts file --- src/ui/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/ui.ts b/src/ui/ui.ts index e7810bbf95e..a7e36fb3d24 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -24,7 +24,7 @@ import EggHatchSceneHandler from "./egg-hatch-scene-handler"; import EggListUiHandler from "./egg-list-ui-handler"; import EggGachaUiHandler from "./egg-gacha-ui-handler"; import VouchersUiHandler from "./vouchers-ui-handler"; -import { addWindow } from "./ui-theme"; +import {addWindow} from "./ui-theme"; import LoginFormUiHandler from "./login-form-ui-handler"; import RegistrationFormUiHandler from "./registration-form-ui-handler"; import LoadingModalUiHandler from "./loading-modal-ui-handler";