fix(falukant): correct computed block syntax in FamilyView.vue
All checks were successful
Deploy to production / deploy (push) Successful in 1m59s
All checks were successful
Deploy to production / deploy (push) Successful in 1m59s
This commit is contained in:
@@ -568,6 +568,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<p v-else>{{ $t('falukant.family.lovers.candidates.none') }}</p>
|
<p v-else>{{ $t('falukant.family.lovers.candidates.none') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="lovers-overview surface-card">
|
||||||
|
<h4>{{ $t('falukant.family.lovers.overview.title') }}</h4>
|
||||||
|
<p v-if="ownCharacter">
|
||||||
|
{{ $t('falukant.family.lovers.overview.forYourStand', { stand: ownLoverStandLabel }) }}
|
||||||
|
</p>
|
||||||
|
<p class="lovers-overview__effects">{{ ownLoverEffectsText }}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -691,6 +698,18 @@ export default {
|
|||||||
}
|
}
|
||||||
return this.$t('falukant.family.summary.noPartner');
|
return this.$t('falukant.family.summary.noPartner');
|
||||||
},
|
},
|
||||||
|
ownLoverStandLabel() {
|
||||||
|
if (!this.ownCharacter) return '';
|
||||||
|
const t = this.ownCharacter.nobleTitle || this.ownCharacter.titleOfNobility || this.ownCharacter.noble_title || null;
|
||||||
|
const cat = this.getTitleGroup(t);
|
||||||
|
return this.$t('falukant.family.lovers.overview.' + cat + '.label');
|
||||||
|
},
|
||||||
|
ownLoverEffectsText() {
|
||||||
|
if (!this.ownCharacter) return '';
|
||||||
|
const t = this.ownCharacter.nobleTitle || this.ownCharacter.titleOfNobility || this.ownCharacter.noble_title || null;
|
||||||
|
const cat = this.getTitleGroup(t);
|
||||||
|
return this.$t('falukant.family.lovers.overview.' + cat + '.effects');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
socket(newVal, oldVal) {
|
socket(newVal, oldVal) {
|
||||||
@@ -1159,6 +1178,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getTitleGroup(title) {
|
||||||
|
if (!title) return 'mid';
|
||||||
|
const t = String(title).toLowerCase();
|
||||||
|
const low = ['noncivil', 'civil', 'sir'];
|
||||||
|
const mid = ['townlord', 'by', 'landlord'];
|
||||||
|
const high = ['knight', 'baron', 'count', 'palsgrave', 'margrave', 'landgrave', 'ruler', 'elector', 'imperial-prince', 'duke', 'grand-duke', 'prince-regent', 'king'];
|
||||||
|
if (low.includes(t)) return 'low';
|
||||||
|
if (mid.includes(t)) return 'mid';
|
||||||
|
if (high.includes(t)) return 'high';
|
||||||
|
return 'mid';
|
||||||
|
},
|
||||||
|
|
||||||
progressColor(p) {
|
progressColor(p) {
|
||||||
const pct = this.normalizeWooingProgress(p) / 100;
|
const pct = this.normalizeWooingProgress(p) / 100;
|
||||||
const red = Math.round(255 * (1 - pct));
|
const red = Math.round(255 * (1 - pct));
|
||||||
|
|||||||
Reference in New Issue
Block a user