feat. [SWV-807] 게임 폰트 기능 추가

This commit is contained in:
clkim
2026-01-16 14:52:14 +09:00
parent ea5f31acff
commit c8cd7f780e
5 changed files with 113 additions and 53 deletions

View File

@@ -12,16 +12,32 @@ const props = withDefaults(defineProps<Props>(), {
objectFit: 'contain',
})
const gameDataStore = useGameDataStore()
const { fontFamily } = storeToRefs(gameDataStore)
const imagePaths = computed(() => getResourceSrc(props.resourcesData))
const displayText = computed(() => props.resourcesData?.display?.text)
const displayColor = computed(() =>
getColorCodeFromData(props.resourcesData?.display, 'none')
)
// HTML 콘텐츠 정리 (줄바꿈 처리)
// HTML 콘텐츠 줄바꿈 처리
const sanitizedContent = computed(() => {
return displayText.value?.replace(/\n/g, '<br/>') || ''
})
// 텍스트 스타일
const textStyle = computed(() => {
const style: Record<string, string> = {
color: displayColor.value,
}
if (props.resourcesData?.display?.use_game_font === 1) {
style.fontFamily = fontFamily.value
}
return style
})
</script>
<template>
@@ -35,7 +51,7 @@ const sanitizedContent = computed(() => {
<span
v-else-if="isTypeText(resourcesData?.resource_type)"
v-dompurify-html="sanitizedContent"
:style="{ color: displayColor }"
:style="textStyle"
class="block"
/>
</template>