From 2e6f6fe729a224438cdc3a26caf8ae69d0c0fcf2 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 28 Jul 2024 18:10:54 +0100 Subject: [PATCH 1/8] chore: Add Termly consent preferences and policies links (#3187) * chore: Add Termly consent preferences and policies links Added Termly consent preferences link and links to Privacy Policy, Cookie Disclaimer, Terms & Conditions, and Acceptable Use Policy in the HTML file. Also included a script for blocking resources from Termly. * feat: Add consent preferences menu option This commit adds a new menu option for "Consent Preferences" in the UI. When clicked, it triggers a click event on the consent link element and focuses on it. This allows users to easily access and manage their consent preferences. --- index.html | 7 ++++++- src/ui/menu-ui-handler.ts | 24 +++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 3722bdd3422..0634385f38b 100644 --- a/index.html +++ b/index.html @@ -39,6 +39,7 @@ + + + Privacy Policy + Cookie Disclaimer + Terms & Conditions + Acceptable Use Policy - \ No newline at end of file diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 88c9791c689..a0cea2f78d5 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -193,17 +193,31 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { this.scene.gameData.tryExportData(GameDataType.SYSTEM); return true; + } + }, + { + label: "Consent Preferences", + handler: () => { + const consentLink = document.querySelector(".termly-display-preferences") as HTMLInputElement; + const clickEvent = new MouseEvent("click", { + view: window, + bubbles: true, + cancelable: true + }); + consentLink.dispatchEvent(clickEvent); + consentLink.focus(); + return true; }, keepOpen: true - }); - manageDataOptions.push({ + }, + { label: i18next.t("menuUiHandler:cancel"), handler: () => { this.scene.ui.revertMode(); return true; - } - } - ); + }, + keepOpen: true + }); this.manageDataConfig = { xOffset: 98, From 118db8c7d0a89a6110e280b82be0b4ccab2ea312 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Sun, 28 Jul 2024 20:35:51 +0100 Subject: [PATCH 2/8] chore: Update links layout and position in index.html --- index.css | 11 +++++++++++ index.html | 12 +++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/index.css b/index.css index 30e7c63d954..28c991c29b4 100644 --- a/index.css +++ b/index.css @@ -19,9 +19,20 @@ html { body { margin: 0; + display:flex; + flex-direction: column; + align-items: center; background: #484050; } +#links { + width: 90%; + text-align: center; + position: fixed; + bottom: 0; + display: flex; + justify-content: space-around; +} #app { display: flex; justify-content: center; diff --git a/index.html b/index.html index 0634385f38b..d567eba0866 100644 --- a/index.html +++ b/index.html @@ -117,10 +117,12 @@ - - Privacy Policy - Cookie Disclaimer - Terms & Conditions - Acceptable Use Policy + \ No newline at end of file From a8adfc2476c0d9907931a7b2c1a115dcf2d7cc5c Mon Sep 17 00:00:00 2001 From: "Adrian T." <68144167+torranx@users.noreply.github.com> Date: Mon, 29 Jul 2024 04:46:37 +0800 Subject: [PATCH 3/8] [Hotfix] Fix interactions of some moves not changing types (#3183) --- src/data/move.ts | 6 +++++- src/field/pokemon.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index a2b879a388b..ee7ad1abc02 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -717,9 +717,13 @@ export default class Move implements Localizable { * @returns The calculated power of the move. */ calculateBattlePower(source: Pokemon, target: Pokemon): number { - const power = new Utils.NumberHolder(this.power); + if (this.category === MoveCategory.STATUS) { + return -1; + } + const power = new Utils.NumberHolder(this.power); const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1); + applyPreAttackAbAttrs(MoveTypeChangeAttr, source, target, this, typeChangeMovePowerMultiplier); const sourceTeraType = source.getTeraType(); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f630cc16a48..cd9ff748b0a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1836,7 +1836,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const types = this.getTypes(true, true); const cancelled = new Utils.BooleanHolder(false); + const power = move.calculateBattlePower(source, this); const typeless = move.hasAttr(TypelessAttr); + const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType))) ? this.getAttackTypeEffectiveness(move, source, false, false) : 1); @@ -1861,7 +1863,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { case MoveCategory.PHYSICAL: case MoveCategory.SPECIAL: const isPhysical = moveCategory === MoveCategory.PHYSICAL; - const power = move.calculateBattlePower(source, this); const sourceTeraType = source.getTeraType(); if (!typeless) { From f25d4e1ee2ec0a04d1631fd1e1bcb74a90295e2a Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sun, 28 Jul 2024 14:06:38 -0700 Subject: [PATCH 4/8] [Hotfix] Fix wild spawns not having their HA (#3190) --- src/field/pokemon.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index cd9ff748b0a..b6cba8387df 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -135,10 +135,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // If abilityIndex is not provided, determine it based on species and hidden ability if (species.abilityHidden && hasHiddenAbility) { // If the species has a hidden ability and the hidden ability is present - this.abilityIndex = species.ability2 ? 2 : 1; // Use ability index 2 if species has a second ability, otherwise use 1 + this.abilityIndex = 2; } else { // If there is no hidden ability or species does not have a hidden ability - this.abilityIndex = species.ability2 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0 + this.abilityIndex = species.ability2 !== species.ability1 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0 } } if (formIndex !== undefined) { From 2d1fe13efad724d69fe40ec2ed240a349ae3d1d4 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer <110984302+ben-lear@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:03:38 -0400 Subject: [PATCH 5/8] [QoL] Toggle TNC display visibility (#3210) * toggle TNC display visibility on end of Title phase * move TNC toggle to helper util * update to use stylesheet * dynamically move TNC links according to window size * adjust TNC link spacing * adjust TNC link spacing * add early escape if links element not found * remove link hide functionality --------- Co-authored-by: ImperialSympathizer --- index.css | 12 ++++++++++++ index.html | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/index.css b/index.css index 28c991c29b4..85878e54fff 100644 --- a/index.css +++ b/index.css @@ -206,6 +206,18 @@ input:-internal-autofill-selected { } } +#tnc-links { + font-size: larger; + position: relative; + bottom: max(calc(92vh - 100vw / 16 * 9), 0%); +} + +a { + color: #328cea; + margin-right: 4px; + margin-left: 4px; +} + /* Firefox old*/ @-moz-keyframes blink { 0% { diff --git a/index.html b/index.html index d567eba0866..e37529572e5 100644 --- a/index.html +++ b/index.html @@ -117,12 +117,12 @@ - - - - + + + \ No newline at end of file From e1de9373a99b0cca4d07afe4c5c034c26ebe9571 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Tue, 30 Jul 2024 00:12:29 +0100 Subject: [PATCH 8/8] chore: Update TNC links font size in index.css (#3230) --- index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.css b/index.css index 749f432b8ea..be480ab6c78 100644 --- a/index.css +++ b/index.css @@ -208,7 +208,7 @@ input:-internal-autofill-selected { } #tnc-links { - font-size: larger; + font-size: xx-small; position: relative; }