From c59513fb7d174500340f798afb2f32685dd33e78 Mon Sep 17 00:00:00 2001 From: Joao Paulo Oliveira Fernandes Date: Sun, 21 Jan 2024 13:31:27 -0300 Subject: [PATCH] text format order fix --- base/utils/DialogManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/utils/DialogManager.ts b/base/utils/DialogManager.ts index 32c579cc27..c543178af8 100644 --- a/base/utils/DialogManager.ts +++ b/base/utils/DialogManager.ts @@ -374,9 +374,6 @@ export class DialogManager { * @returns Returns the text formetted. */ private format_text(text: string) { - text = text.replace(/\${HERO}/g, this.data.info.main_char_list[this.data.hero.key_name].name); - text = text.replace(/( )?\${BREAK}( )?/g, " ${BREAK} "); - text = text.replace(/( )?\${BREAK_LINE}( )?/g, " ${BREAK_LINE} "); let storage_match = /(?: )?\${STORAGE:(\w+)}(?: )?/g.exec(text); while (storage_match !== null) { const storage_key = storage_match[1]; @@ -384,6 +381,9 @@ export class DialogManager { text = text.replace(re, `$1${this.data.storage.get(storage_key)}$2`); storage_match = /(?: )?\${STORAGE:(\w+)}(?: )?/g.exec(text); } + text = text.replace(/\${HERO}/g, this.data.info.main_char_list[this.data.hero.key_name].name); + text = text.replace(/( )?\${BREAK}( )?/g, " ${BREAK} "); + text = text.replace(/( )?\${BREAK_LINE}( )?/g, " ${BREAK_LINE} "); return text; }