Preventing filter texts from showing gibberish

This commit is contained in:
Wlowscha 2025-02-12 22:03:44 +01:00
parent 2730a36d00
commit fa5232a704
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 3 additions and 2 deletions

View File

@ -133,7 +133,7 @@ export class FilterText extends Phaser.GameObjects.Container {
const handler = ui.getHandler() as AwaitableUiHandler;
handler.tutorialActive = true;
// Switch to the dialog test window
this.selections[index].setText(String(i18next.t(dialogueName)));
this.selections[index].setText( dialogueName === "" ? this.defaultText : String(i18next.t(dialogueName)));
ui.revertMode();
this.onChange();
},

View File

@ -169,7 +169,8 @@ export default class PokedexScanUiHandler extends FormModalUiHandler {
this.submitAction = (_) => {
if (ui.getMode() === Mode.POKEDEX_SCAN) {
this.sanitizeInputs();
const sanitizedName = btoa(unescape(encodeURIComponent(this.inputs[0].text)));
const outputName = this.reducedKeys.includes(this.inputs[0].text) ? this.inputs[0].text : "";
const sanitizedName = btoa(unescape(encodeURIComponent(outputName)));
config.buttonActions[0](sanitizedName);
return true;
}