FIX: Monster bar
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m38s

This commit is contained in:
2025-07-25 11:30:19 +07:00
parent 13d27bb014
commit a649ec14ac
19 changed files with 159 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
import { listCurrentLanguage } from "@/lib/constant";
import { AvatarHakushiType } from "@/types";
import { AvatarHakushiType, EnemyHakushiType } from "@/types";
export function getNameChar(locale: string, data: AvatarHakushiType | undefined): string {
@@ -22,6 +22,21 @@ export function getNameChar(locale: string, data: AvatarHakushiType | undefined)
return text
}
export function getNameEnemy(locale: string, data: EnemyHakushiType | undefined): string {
if (!data) {
return ""
}
if (!listCurrentLanguage.hasOwnProperty(locale)) {
return ""
}
let text = data.lang.get(listCurrentLanguage[locale as keyof typeof listCurrentLanguage].toLowerCase()) ?? "";
if (!text) {
text = data.lang.get("en") ?? "";
}
return text
}
export function parseRuby(text: string): string {
const rubyRegex = /\{RUBY_B#(.*?)\}(.*?)\{RUBY_E#\}/gs;
return text.replace(rubyRegex, (_match, furigana, kanji) => {