mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +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 shopOverlay: Phaser.GameObjects.Rectangle;
|
||||
private shopOverlayShown: boolean = false;
|
||||
private shopOverlayOpacity: number = .80;
|
||||
|
||||
public modifiers: PersistentModifier[];
|
||||
private enemyModifiers: PersistentModifier[];
|
||||
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> {
|
||||
this.shopOverlayShown = true;
|
||||
return new Promise(resolve => {
|
||||
this.tweens.add({
|
||||
targets: this.shopOverlay,
|
||||
alpha: 0.8,
|
||||
alpha: this.shopOverlayOpacity,
|
||||
ease: "Sine.easeOut",
|
||||
duration: duration,
|
||||
duration,
|
||||
onComplete: () => resolve()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
hideShopOverlay(duration: integer): Promise<void> {
|
||||
this.shopOverlayShown = false;
|
||||
return new Promise(resolve => {
|
||||
this.tweens.add({
|
||||
targets: this.shopOverlay,
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "Controller",
|
||||
"gamepadSupport": "Controllerunterstützung",
|
||||
"showBgmBar": "Musiknamen anzeigen",
|
||||
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "Controller",
|
||||
"gamepadSupport": "Gamepad Support",
|
||||
"showBgmBar": "Show Music Names",
|
||||
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "Controller",
|
||||
"gamepadSupport": "Gamepad Support",
|
||||
"showBgmBar": "Show Music Names",
|
||||
"shopOverlayOpacity": "Opacidad de la fase de compra"
|
||||
} as const;
|
||||
|
@ -95,5 +95,6 @@ export const settings: SimpleTranslationEntries = {
|
||||
"mute": "Muet",
|
||||
"controller": "Controller",
|
||||
"gamepadSupport": "Gamepad Support",
|
||||
"showBgmBar": "Montrer titre de la musique",
|
||||
"showBgmBar": "Titre de la musique",
|
||||
"shopOverlayOpacity": "Opacité boutique"
|
||||
} as const;
|
||||
|
@ -3,7 +3,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales.js";
|
||||
export const settings: SimpleTranslationEntries = {
|
||||
"boy": "Ragazzo",
|
||||
"girl": "Ragazza",
|
||||
"general": "General",
|
||||
"general": "Generale",
|
||||
"display": "Display",
|
||||
"audio": "Audio",
|
||||
"gamepad": "Gamepad",
|
||||
@ -94,6 +94,7 @@ export const settings: SimpleTranslationEntries = {
|
||||
"alt": " (Alt)",
|
||||
"mute": "Mute",
|
||||
"controller": "Controller",
|
||||
"gamepadSupport": "Gamepad Support",
|
||||
"showBgmBar": "Show Music Names",
|
||||
"gamepadSupport": "Supporto Gamepad",
|
||||
"showBgmBar": "Mostra Nomi Musica",
|
||||
"shopOverlayOpacity": "Opacità Finestra Negozio"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "컨트롤러",
|
||||
"gamepadSupport": "게임패드 지원",
|
||||
"showBgmBar": "BGM 제목 보여주기",
|
||||
"shopOverlayOpacity": "상점 오버레이 투명도"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "Controle",
|
||||
"gamepadSupport": "Suporte para Controle",
|
||||
"showBgmBar": "Show Music Names",
|
||||
"shopOverlayOpacity": "Opacidade da Loja"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "控制器",
|
||||
"gamepadSupport": "手柄支持",
|
||||
"showBgmBar": "显示音乐名称",
|
||||
"shopOverlayOpacity": "商店显示不透明度"
|
||||
} as const;
|
||||
|
@ -96,4 +96,5 @@ export const settings: SimpleTranslationEntries = {
|
||||
"controller": "控制器",
|
||||
"gamepadSupport": "手柄支持",
|
||||
"showBgmBar": "Show Music Names",
|
||||
"shopOverlayOpacity": "Shop Overlay Opacity"
|
||||
} as const;
|
||||
|
@ -16,6 +16,13 @@ const VOLUME_OPTIONS: SettingOption[] = new Array(11).fill(null).map((_, i) => i
|
||||
value: "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[] = [
|
||||
{
|
||||
value: "Off",
|
||||
@ -98,6 +105,7 @@ export const SettingKeys = {
|
||||
SE_Volume: "SE_VOLUME",
|
||||
Music_Preference: "MUSIC_PREFERENCE",
|
||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY"
|
||||
};
|
||||
|
||||
/**
|
||||
@ -534,7 +542,14 @@ export const Setting: Array<Setting> = [
|
||||
type: SettingType.AUDIO,
|
||||
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;
|
||||
case SettingKeys.Shop_Overlay_Opacity:
|
||||
scene.updateShopOverlayOpacity(parseInt(Setting[index].options[value].value) * .01);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user