mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-18 02:07:44 +00:00
[Enhancement][QoL] Add option to adjust shop overlay opacity (#2622)
* add option to adjust shop overlay opacity * add localization * fix bug * Update src/locales/fr/settings.ts Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> * Update src/locales/zh_CN/settings.ts Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> * Update src/locales/fr/settings.ts Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> * update default value * update setting values * re-add value 10 * Update src/locales/pt_BR/settings.ts Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> * Update src/locales/ko/settings.ts Co-authored-by: Enoch <enoch.jwsong@gmail.com> * Update src/locales/es/settings.ts Co-authored-by: InnocentGameDev <asdargmng@gmail.com> * Update settings.ts --------- Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr> Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com> Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br> Co-authored-by: Enoch <enoch.jwsong@gmail.com> Co-authored-by: InnocentGameDev <asdargmng@gmail.com> Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
This commit is contained in:
parent
dd361c5615
commit
e879b3c6a0
@ -224,6 +224,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
private fieldOverlay: Phaser.GameObjects.Rectangle;
|
private fieldOverlay: Phaser.GameObjects.Rectangle;
|
||||||
private shopOverlay: Phaser.GameObjects.Rectangle;
|
private shopOverlay: Phaser.GameObjects.Rectangle;
|
||||||
|
private shopOverlayShown: boolean = false;
|
||||||
|
private shopOverlayOpacity: number = .80;
|
||||||
|
|
||||||
public modifiers: PersistentModifier[];
|
public modifiers: PersistentModifier[];
|
||||||
private enemyModifiers: PersistentModifier[];
|
private enemyModifiers: PersistentModifier[];
|
||||||
public uiContainer: Phaser.GameObjects.Container;
|
public uiContainer: Phaser.GameObjects.Container;
|
||||||
@ -1428,19 +1431,29 @@ export default class BattleScene extends SceneBase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateShopOverlayOpacity(value: number): void {
|
||||||
|
this.shopOverlayOpacity = value;
|
||||||
|
|
||||||
|
if (this.shopOverlayShown) {
|
||||||
|
this.shopOverlay.setAlpha(this.shopOverlayOpacity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
showShopOverlay(duration: integer): Promise<void> {
|
showShopOverlay(duration: integer): Promise<void> {
|
||||||
|
this.shopOverlayShown = true;
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: this.shopOverlay,
|
targets: this.shopOverlay,
|
||||||
alpha: 0.8,
|
alpha: this.shopOverlayOpacity,
|
||||||
ease: "Sine.easeOut",
|
ease: "Sine.easeOut",
|
||||||
duration: duration,
|
duration,
|
||||||
onComplete: () => resolve()
|
onComplete: () => resolve()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
hideShopOverlay(duration: integer): Promise<void> {
|
hideShopOverlay(duration: integer): Promise<void> {
|
||||||
|
this.shopOverlayShown = false;
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: this.shopOverlay,
|
targets: this.shopOverlay,
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "Controller",
|
"controller": "Controller",
|
||||||
"gamepadSupport": "Controllerunterstützung",
|
"gamepadSupport": "Controllerunterstützung",
|
||||||
"showBgmBar": "Musiknamen anzeigen",
|
"showBgmBar": "Musiknamen anzeigen",
|
||||||
|
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "Controller",
|
"controller": "Controller",
|
||||||
"gamepadSupport": "Gamepad Support",
|
"gamepadSupport": "Gamepad Support",
|
||||||
"showBgmBar": "Show Music Names",
|
"showBgmBar": "Show Music Names",
|
||||||
|
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "Controller",
|
"controller": "Controller",
|
||||||
"gamepadSupport": "Gamepad Support",
|
"gamepadSupport": "Gamepad Support",
|
||||||
"showBgmBar": "Show Music Names",
|
"showBgmBar": "Show Music Names",
|
||||||
|
"shopOverlayOpacity": "Opacidad de la fase de compra"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -95,5 +95,6 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"mute": "Muet",
|
"mute": "Muet",
|
||||||
"controller": "Controller",
|
"controller": "Controller",
|
||||||
"gamepadSupport": "Gamepad Support",
|
"gamepadSupport": "Gamepad Support",
|
||||||
"showBgmBar": "Montrer titre de la musique",
|
"showBgmBar": "Titre de la musique",
|
||||||
|
"shopOverlayOpacity": "Opacité boutique"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -3,7 +3,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales.js";
|
|||||||
export const settings: SimpleTranslationEntries = {
|
export const settings: SimpleTranslationEntries = {
|
||||||
"boy": "Ragazzo",
|
"boy": "Ragazzo",
|
||||||
"girl": "Ragazza",
|
"girl": "Ragazza",
|
||||||
"general": "General",
|
"general": "Generale",
|
||||||
"display": "Display",
|
"display": "Display",
|
||||||
"audio": "Audio",
|
"audio": "Audio",
|
||||||
"gamepad": "Gamepad",
|
"gamepad": "Gamepad",
|
||||||
@ -94,6 +94,7 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"alt": " (Alt)",
|
"alt": " (Alt)",
|
||||||
"mute": "Mute",
|
"mute": "Mute",
|
||||||
"controller": "Controller",
|
"controller": "Controller",
|
||||||
"gamepadSupport": "Gamepad Support",
|
"gamepadSupport": "Supporto Gamepad",
|
||||||
"showBgmBar": "Show Music Names",
|
"showBgmBar": "Mostra Nomi Musica",
|
||||||
|
"shopOverlayOpacity": "Opacità Finestra Negozio"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "컨트롤러",
|
"controller": "컨트롤러",
|
||||||
"gamepadSupport": "게임패드 지원",
|
"gamepadSupport": "게임패드 지원",
|
||||||
"showBgmBar": "BGM 제목 보여주기",
|
"showBgmBar": "BGM 제목 보여주기",
|
||||||
|
"shopOverlayOpacity": "상점 오버레이 투명도"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "Controle",
|
"controller": "Controle",
|
||||||
"gamepadSupport": "Suporte para Controle",
|
"gamepadSupport": "Suporte para Controle",
|
||||||
"showBgmBar": "Show Music Names",
|
"showBgmBar": "Show Music Names",
|
||||||
|
"shopOverlayOpacity": "Opacidade da Loja"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "控制器",
|
"controller": "控制器",
|
||||||
"gamepadSupport": "手柄支持",
|
"gamepadSupport": "手柄支持",
|
||||||
"showBgmBar": "显示音乐名称",
|
"showBgmBar": "显示音乐名称",
|
||||||
|
"shopOverlayOpacity": "商店显示不透明度"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
|||||||
"controller": "控制器",
|
"controller": "控制器",
|
||||||
"gamepadSupport": "手柄支持",
|
"gamepadSupport": "手柄支持",
|
||||||
"showBgmBar": "Show Music Names",
|
"showBgmBar": "Show Music Names",
|
||||||
|
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -16,6 +16,13 @@ const VOLUME_OPTIONS: SettingOption[] = new Array(11).fill(null).map((_, i) => i
|
|||||||
value: "Mute",
|
value: "Mute",
|
||||||
label: i18next.t("settings:mute")
|
label: i18next.t("settings:mute")
|
||||||
});
|
});
|
||||||
|
const SHOP_OVERLAY_OPACITY_OPTIONS: SettingOption[] = new Array(9).fill(null).map((_, i) => {
|
||||||
|
const value = ((i + 1) * 10).toString();
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
label: value,
|
||||||
|
};
|
||||||
|
});
|
||||||
const OFF_ON: SettingOption[] = [
|
const OFF_ON: SettingOption[] = [
|
||||||
{
|
{
|
||||||
value: "Off",
|
value: "Off",
|
||||||
@ -98,6 +105,7 @@ export const SettingKeys = {
|
|||||||
SE_Volume: "SE_VOLUME",
|
SE_Volume: "SE_VOLUME",
|
||||||
Music_Preference: "MUSIC_PREFERENCE",
|
Music_Preference: "MUSIC_PREFERENCE",
|
||||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||||
|
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -534,7 +542,14 @@ export const Setting: Array<Setting> = [
|
|||||||
type: SettingType.AUDIO,
|
type: SettingType.AUDIO,
|
||||||
requireReload: true
|
requireReload: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: SettingKeys.Shop_Overlay_Opacity,
|
||||||
|
label: i18next.t("settings:shopOverlayOpacity"),
|
||||||
|
options: SHOP_OVERLAY_OPACITY_OPTIONS,
|
||||||
|
default: 7,
|
||||||
|
type: SettingType.DISPLAY,
|
||||||
|
requireReload: false
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -759,6 +774,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SettingKeys.Shop_Overlay_Opacity:
|
||||||
|
scene.updateShopOverlayOpacity(parseInt(Setting[index].options[value].value) * .01);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user