[P1 Bug][UI/UX] Address shop cursor target feedbacks (#4009)

* address shop cursor target feedbacks

* make rewards left-most

* fix tests breaking

* Update src/test/items/dire_hit.test.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update src/test/items/temp_stat_stage_booster.test.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Update src/locales/ja/settings.json

Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>

* update default value

* stylistic change

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Chapybara-jp <charlie.beer@hotmail.com>
This commit is contained in:
Adrian T. 2024-09-04 09:07:56 +08:00 committed by GitHub
parent f63492d545
commit 200deef0ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 69 additions and 43 deletions

View File

@ -130,7 +130,7 @@ export default class BattleScene extends SceneBase {
public gameSpeed: integer = 1; public gameSpeed: integer = 1;
public damageNumbersMode: integer = 0; public damageNumbersMode: integer = 0;
public reroll: boolean = false; public reroll: boolean = false;
public shopCursorTarget: number = ShopCursorTarget.CHECK_TEAM; public shopCursorTarget: number = ShopCursorTarget.REWARDS;
public showMovesetFlyout: boolean = true; public showMovesetFlyout: boolean = true;
public showArenaFlyout: boolean = true; public showArenaFlyout: boolean = true;
public showTimeOfDayWidget: boolean = true; public showTimeOfDayWidget: boolean = true;

View File

@ -1,13 +1,13 @@
/** /**
* Determines the cursor target when entering the shop phase. * Determines the row cursor target when entering the shop phase.
*/ */
export enum ShopCursorTarget { export enum ShopCursorTarget {
/** Cursor points to Reroll */ /** Cursor points to Reroll row */
REROLL, REROLL,
/** Cursor points to Items */ /** Cursor points to Rewards row */
ITEMS, REWARDS,
/** Cursor points to Shop */ /** Cursor points to Shop row */
SHOP, SHOP,
/** Cursor points to Check Team */ /** Cursor points to Check Team row */
CHECK_TEAM CHECK_TEAM
} }

View File

@ -100,7 +100,7 @@
"moveTouchControls": "Bewegung Touch Steuerung", "moveTouchControls": "Bewegung Touch Steuerung",
"shopOverlayOpacity": "Shop Overlay Deckkraft", "shopOverlayOpacity": "Shop Overlay Deckkraft",
"shopCursorTarget": "Shop-Cursor Ziel", "shopCursorTarget": "Shop-Cursor Ziel",
"items": "Items", "rewards": "Items",
"reroll": "Neu rollen", "reroll": "Neu rollen",
"shop": "Shop", "shop": "Shop",
"checkTeam": "Team überprüfen" "checkTeam": "Team überprüfen"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "Move Touch Controls", "moveTouchControls": "Move Touch Controls",
"shopOverlayOpacity": "Shop Overlay Opacity", "shopOverlayOpacity": "Shop Overlay Opacity",
"shopCursorTarget": "Shop Cursor Target", "shopCursorTarget": "Shop Cursor Target",
"items": "Items", "rewards": "Rewards",
"reroll": "Reroll", "reroll": "Reroll",
"shop": "Shop", "shop": "Shop",
"checkTeam": "Check Team" "checkTeam": "Check Team"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "Controles táctiles", "moveTouchControls": "Controles táctiles",
"shopOverlayOpacity": "Opacidad de la fase de compra", "shopOverlayOpacity": "Opacidad de la fase de compra",
"shopCursorTarget": "Cursor de la tienda", "shopCursorTarget": "Cursor de la tienda",
"items": "Objetos", "rewards": "Objetos",
"reroll": "Actualizar", "reroll": "Actualizar",
"shop": "Tienda", "shop": "Tienda",
"checkTeam": "Ver equipo" "checkTeam": "Ver equipo"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "Déplacer les contrôles tactiles", "moveTouchControls": "Déplacer les contrôles tactiles",
"shopOverlayOpacity": "Opacité boutique", "shopOverlayOpacity": "Opacité boutique",
"shopCursorTarget": "Choix après relance", "shopCursorTarget": "Choix après relance",
"items": "Obj. gratuits", "rewards": "Obj. gratuits",
"reroll": "Relance", "reroll": "Relance",
"shop": "Boutique", "shop": "Boutique",
"checkTeam": "Équipe" "checkTeam": "Équipe"

View File

@ -8,7 +8,7 @@
"moveTouchControls": "Move Touch Controls", "moveTouchControls": "Move Touch Controls",
"shopOverlayOpacity": "Opacità Finestra Negozio", "shopOverlayOpacity": "Opacità Finestra Negozio",
"shopCursorTarget": "Target Cursore Negozio", "shopCursorTarget": "Target Cursore Negozio",
"items": "Oggetti", "rewards": "Oggetti",
"reroll": "Rerolla", "reroll": "Rerolla",
"shop": "Negozio", "shop": "Negozio",
"checkTeam": "Squadra" "checkTeam": "Squadra"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "タッチ移動操作", "moveTouchControls": "タッチ移動操作",
"shopOverlayOpacity": "ショップオーバレイ不透明度", "shopOverlayOpacity": "ショップオーバレイ不透明度",
"shopCursorTarget": "ショップカーソル初位置", "shopCursorTarget": "ショップカーソル初位置",
"items": "アイテム", "rewards": "ご褒美",
"reroll": "選択肢変更", "reroll": "選択肢変更",
"shop": "ショップ", "shop": "ショップ",
"checkTeam": "手持ちを確認" "checkTeam": "手持ちを確認"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "터치 컨트롤 이동", "moveTouchControls": "터치 컨트롤 이동",
"shopOverlayOpacity": "상점 오버레이 투명도", "shopOverlayOpacity": "상점 오버레이 투명도",
"shopCursorTarget": "상점 커서 위치", "shopCursorTarget": "상점 커서 위치",
"items": "아이템", "rewards": "아이템",
"reroll": "갱신", "reroll": "갱신",
"shop": "상점", "shop": "상점",
"checkTeam": "파티 확인" "checkTeam": "파티 확인"

View File

@ -100,7 +100,7 @@
"moveTouchControls": "Mover Controles de Toque", "moveTouchControls": "Mover Controles de Toque",
"shopOverlayOpacity": "Opacidade da Loja", "shopOverlayOpacity": "Opacidade da Loja",
"shopCursorTarget": "Alvo do Cursor da Loja", "shopCursorTarget": "Alvo do Cursor da Loja",
"items": "Itens", "rewards": "Itens",
"reroll": "Atualizar", "reroll": "Atualizar",
"shop": "Loja", "shop": "Loja",
"checkTeam": "Checar Time" "checkTeam": "Checar Time"

View File

@ -99,7 +99,7 @@
"moveTouchControls": "移动触摸控制", "moveTouchControls": "移动触摸控制",
"shopOverlayOpacity": "商店显示不透明度", "shopOverlayOpacity": "商店显示不透明度",
"shopCursorTarget": "商店指针位置", "shopCursorTarget": "商店指针位置",
"items": "道具", "rewards": "道具",
"reroll": "刷新", "reroll": "刷新",
"shop": "购买", "shop": "购买",
"checkTeam": "检查队伍" "checkTeam": "检查队伍"

View File

@ -25,6 +25,7 @@ const VOLUME_OPTIONS: SettingOption[] = new Array(11).fill(null).map((_, i) => i
value: "Mute", value: "Mute",
label: getTranslation("settings:mute") label: getTranslation("settings:mute")
}); });
const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).map((_, i) => { const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).map((_, i) => {
const value = ((i + 1) * 10).toString(); const value = ((i + 1) * 10).toString();
return { return {
@ -32,6 +33,7 @@ const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).ma
label: value, label: value,
}; };
}); });
const OFF_ON: SettingOption[] = [ const OFF_ON: SettingOption[] = [
{ {
value: "Off", value: "Off",
@ -53,6 +55,40 @@ const AUTO_DISABLED: SettingOption[] = [
} }
]; ];
const SHOP_CURSOR_TARGET_OPTIONS: SettingOption[] = [
{
value: "Rewards",
label: i18next.t("settings:rewards")
},
{
value: "Shop",
label: i18next.t("settings:shop")
},
{
value: "Reroll",
label: i18next.t("settings:reroll")
},
{
value: "Check Team",
label: i18next.t("settings:checkTeam")
}
];
const shopCursorTargetIndexMap = SHOP_CURSOR_TARGET_OPTIONS.map(option => {
switch (option.value) {
case "Rewards":
return ShopCursorTarget.REWARDS;
case "Shop":
return ShopCursorTarget.SHOP;
case "Reroll":
return ShopCursorTarget.REROLL;
case "Check Team":
return ShopCursorTarget.CHECK_TEAM;
default:
throw new Error(`Unknown value: ${option.value}`);
}
});
/** /**
* Types for helping separate settings to different menus * Types for helping separate settings to different menus
*/ */
@ -103,7 +139,7 @@ export const SettingKeys = {
Damage_Numbers: "DAMAGE_NUMBERS", Damage_Numbers: "DAMAGE_NUMBERS",
Move_Animations: "MOVE_ANIMATIONS", Move_Animations: "MOVE_ANIMATIONS",
Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS", Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS",
Reroll_Target: "REROLL_TARGET", Shop_Cursor_Target: "SHOP_CURSOR_TARGET",
Candy_Upgrade_Notification: "CANDY_UPGRADE_NOTIFICATION", Candy_Upgrade_Notification: "CANDY_UPGRADE_NOTIFICATION",
Candy_Upgrade_Display: "CANDY_UPGRADE_DISPLAY", Candy_Upgrade_Display: "CANDY_UPGRADE_DISPLAY",
Move_Info: "MOVE_INFO", Move_Info: "MOVE_INFO",
@ -596,27 +632,10 @@ export const Setting: Array<Setting> = [
isHidden: () => !hasTouchscreen() isHidden: () => !hasTouchscreen()
}, },
{ {
key: SettingKeys.Reroll_Target, key: SettingKeys.Shop_Cursor_Target,
label: i18next.t("settings:shopCursorTarget"), label: i18next.t("settings:shopCursorTarget"),
options: [ options: SHOP_CURSOR_TARGET_OPTIONS,
{ default: 0,
value:"Reroll",
label: i18next.t("settings:reroll")
},
{
value:"Items",
label: i18next.t("settings:items")
},
{
value:"Shop",
label: i18next.t("settings:shop")
},
{
value:"Check Team",
label: i18next.t("settings:checkTeam")
}
],
default: ShopCursorTarget.CHECK_TEAM,
type: SettingType.DISPLAY type: SettingType.DISPLAY
}, },
{ {
@ -758,8 +777,10 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
case SettingKeys.Show_Stats_on_Level_Up: case SettingKeys.Show_Stats_on_Level_Up:
scene.showLevelUpStats = Setting[index].options[value].value === "On"; scene.showLevelUpStats = Setting[index].options[value].value === "On";
break; break;
case SettingKeys.Reroll_Target: case SettingKeys.Shop_Cursor_Target:
scene.shopCursorTarget = value; const selectedValue = shopCursorTargetIndexMap[value];
scene.shopCursorTarget = selectedValue;
break;
case SettingKeys.EXP_Gains_Speed: case SettingKeys.EXP_Gains_Speed:
scene.expGainsSpeed = value; scene.expGainsSpeed = value;
break; break;

View File

@ -13,6 +13,7 @@ import { Button } from "#app/enums/buttons";
import { CommandPhase } from "#app/phases/command-phase"; import { CommandPhase } from "#app/phases/command-phase";
import { NewBattlePhase } from "#app/phases/new-battle-phase"; import { NewBattlePhase } from "#app/phases/new-battle-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
describe("Items - Dire Hit", () => { describe("Items - Dire Hit", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
@ -77,8 +78,8 @@ describe("Items - Dire Hit", () => {
game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => {
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler; const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
// Traverse to first modifier slot // Traverse to first modifier slot
handler.processInput(Button.LEFT); handler.setCursor(0);
handler.processInput(Button.UP); handler.setRowCursor(ShopCursorTarget.REWARDS);
handler.processInput(Button.ACTION); handler.processInput(Button.ACTION);
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true); }, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true);

View File

@ -16,6 +16,7 @@ import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
import { TurnInitPhase } from "#app/phases/turn-init-phase"; import { TurnInitPhase } from "#app/phases/turn-init-phase";
import { BattleEndPhase } from "#app/phases/battle-end-phase"; import { BattleEndPhase } from "#app/phases/battle-end-phase";
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase"; import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
describe("Items - Temporary Stat Stage Boosters", () => { describe("Items - Temporary Stat Stage Boosters", () => {
@ -154,8 +155,8 @@ describe("Items - Temporary Stat Stage Boosters", () => {
game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => {
const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler; const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler;
// Traverse to first modifier slot // Traverse to first modifier slot
handler.processInput(Button.LEFT); handler.setCursor(0);
handler.processInput(Button.UP); handler.setRowCursor(ShopCursorTarget.REWARDS);
handler.processInput(Button.ACTION); handler.processInput(Button.ACTION);
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true); }, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(NewBattlePhase), true);

View File

@ -257,6 +257,9 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
if (this.scene.shopCursorTarget === ShopCursorTarget.CHECK_TEAM) { if (this.scene.shopCursorTarget === ShopCursorTarget.CHECK_TEAM) {
this.setRowCursor(0); this.setRowCursor(0);
this.setCursor(2); this.setCursor(2);
} else if ((this.scene.shopCursorTarget === ShopCursorTarget.SHOP) && this.scene.gameMode.hasNoShop) {
this.setRowCursor(ShopCursorTarget.REWARDS);
this.setCursor(0);
} else { } else {
this.setRowCursor(this.scene.shopCursorTarget); this.setRowCursor(this.scene.shopCursorTarget);
this.setCursor(0); this.setCursor(0);