feat: enhance hidden domains serialization and UI representation
- Updated `serialize_active_domains` to include both active and inactive hidden domains, adding an `is_open` property for each domain. - Modified `StatusBar` and `StatusWidget` components to reflect the new domain state, displaying appropriate labels and colors based on the activation status. - Adjusted localization files for English and Chinese to align with the updated hidden domain features.
This commit is contained in:
@@ -19,14 +19,13 @@ const phenomenonColor = computed(() => {
|
||||
})
|
||||
|
||||
const domainLabel = computed(() => {
|
||||
const count = store.activeDomains.length;
|
||||
return count > 0
|
||||
? t('game.status_bar.hidden_domain.label_active', { count })
|
||||
: t('game.status_bar.hidden_domain.label');
|
||||
return t('game.status_bar.hidden_domain.label');
|
||||
});
|
||||
|
||||
const domainColor = computed(() => {
|
||||
return store.activeDomains.length > 0 ? '#fa8c16' : '#666'; // 有秘境时亮橙色,否则灰色
|
||||
// 如果有任意一个秘境是开启状态,则亮色
|
||||
const anyOpen = store.activeDomains.some(d => d.is_open);
|
||||
return anyOpen ? '#fa8c16' : '#666'; // 有开启亮橙色,全关闭灰色
|
||||
});
|
||||
|
||||
function getRarityColor(rarity: string) {
|
||||
|
||||
@@ -52,9 +52,13 @@ const emit = defineEmits(['trigger-click'])
|
||||
|
||||
<n-list v-if="items.length > 0" hoverable clickable>
|
||||
<n-list-item v-for="item in items" :key="item.id">
|
||||
<div class="domain-item">
|
||||
<div class="domain-item" :class="{ 'is-closed': !item.is_open }">
|
||||
<div class="d-header">
|
||||
<span class="d-name">{{ item.name }}</span>
|
||||
<div class="d-title-group">
|
||||
<span class="d-name">{{ item.name }}</span>
|
||||
<n-tag v-if="!item.is_open" size="small" :bordered="false" class="d-status closed">未开启</n-tag>
|
||||
<n-tag v-else size="small" :bordered="false" type="success" class="d-status open">开启中</n-tag>
|
||||
</div>
|
||||
<n-tag size="small" :bordered="false" type="warning" class="d-tag">
|
||||
{{ item.max_realm }}
|
||||
</n-tag>
|
||||
@@ -92,9 +96,13 @@ const emit = defineEmits(['trigger-click'])
|
||||
}
|
||||
|
||||
.domain-item { padding: 4px 0; }
|
||||
.domain-item.is-closed { opacity: 0.5; filter: grayscale(0.8); }
|
||||
|
||||
.d-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
|
||||
.d-title-group { display: flex; align-items: center; gap: 8px; }
|
||||
.d-name { font-weight: bold; color: #fadb14; font-size: 14px; }
|
||||
.d-tag { font-size: 10px; height: 18px; line-height: 18px; }
|
||||
.d-status { font-size: 10px; height: 18px; line-height: 18px; padding: 0 4px; }
|
||||
.d-desc { font-size: 12px; color: #aaa; margin-bottom: 8px; line-height: 1.4; }
|
||||
.d-stats { display: flex; gap: 12px; font-size: 12px; color: #888; }
|
||||
.empty-state { padding: 20px; }
|
||||
|
||||
@@ -233,9 +233,8 @@
|
||||
"author_github": "Github",
|
||||
"hidden_domain": {
|
||||
"label": "[Hidden Domain]",
|
||||
"label_active": "[Domain Opened: {count}]",
|
||||
"title": "Opened Hidden Domains",
|
||||
"empty": "No hidden domains currently open",
|
||||
"title": "Hidden Domains List",
|
||||
"empty": "No hidden domains data",
|
||||
"danger": "Danger",
|
||||
"drop": "Fortune"
|
||||
}
|
||||
|
||||
@@ -233,9 +233,8 @@
|
||||
"author_github": "Github仓库",
|
||||
"hidden_domain": {
|
||||
"label": "[秘境]",
|
||||
"label_active": "[秘境开启: {count}]",
|
||||
"title": "当前开启秘境",
|
||||
"empty": "当前暂无秘境开启",
|
||||
"title": "秘境列表",
|
||||
"empty": "暂无秘境数据",
|
||||
"danger": "凶险",
|
||||
"drop": "机缘"
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ export interface HiddenDomainInfo {
|
||||
max_realm: string; // 限制境界
|
||||
danger_prob: number; // 凶险度 (0.0 - 1.0)
|
||||
drop_prob: number; // 机缘度 (0.0 - 1.0)
|
||||
is_open: boolean; // 是否开启
|
||||
}
|
||||
|
||||
// --- 事件 (Events) ---
|
||||
|
||||
Reference in New Issue
Block a user