diff --git a/.env b/.env new file mode 100644 index 000000000..86feafaa1 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_BYPASS_LOGIN=0 +VITE_BYPASS_TUTORIAL=0 \ No newline at end of file diff --git a/.env.development b/.env.development new file mode 100644 index 000000000..88dcdce61 --- /dev/null +++ b/.env.development @@ -0,0 +1,2 @@ +VITE_BYPASS_LOGIN=1 +VITE_BYPASS_TUTORIAL=0 \ No newline at end of file diff --git a/README.md b/README.md index ce917491f..299cd9b84 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,12 @@ node: 18.3.0 1. Clone the repo and in the root directory run `npm install` - *if you run into any errors, reach out in the **#dev-corner** channel in discord* -2. Run `npm run start` to locally run the project in `localhost:8000` +2. Run `npm run start:dev` to locally run the project in `localhost:8000` ### ❔ FAQ -**How do I test a new ability/move?** -- In the `pokemon.ts` file there are overrides you can set to apply the new move/ability to your active pokemon - -**How do I test a specific seed/wave?** -- In the `battle-scene.ts` file there are overrides for seed, starting level, starting wave, starting biome, and starting money +**How do I test a new _______?** +- In the `battle-scene.ts` file there are overrides for most values you'll need to change for testing ## 🪧 To Do diff --git a/package.json b/package.json index 035b77069..9065bc17a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "start": "vite", + "start:dev": "vite --mode development", "build": "vite build", "preview": "vite preview", "test": "vitest run", diff --git a/src/battle-scene.ts b/src/battle-scene.ts index d386aff41..abf347b18 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -59,7 +59,7 @@ import { UiTheme } from './enums/ui-theme'; import CacheBustedLoaderPlugin from './plugins/cache-busted-loader-plugin'; import { SceneBase } from './scene-base'; -export const bypassLogin = false; +export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; export const SEED_OVERRIDE = ''; export const STARTER_SPECIES_OVERRIDE = 0; @@ -115,7 +115,7 @@ export default class BattleScene extends SceneBase { public gameSpeed: integer = 1; public damageNumbersMode: integer = 0; public showLevelUpStats: boolean = true; - public enableTutorials: boolean = true; + public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1"; public uiTheme: UiTheme = UiTheme.DEFAULT; public windowType: integer = 0; public experimentalSprites: boolean = false; diff --git a/vite.env.d.ts b/vite.env.d.ts new file mode 100644 index 000000000..1bb3a15b5 --- /dev/null +++ b/vite.env.d.ts @@ -0,0 +1,11 @@ +/// + +interface ImportMetaEnv { + readonly VITE_BYPASS_LOGIN: string; + readonly VITE_BYPASS_TUTORIAL: string; + readonly VITE_API_BASE_URL: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} \ No newline at end of file