Spiel erweitert

This commit is contained in:
Torsten Schulz
2025-06-02 11:26:45 +02:00
parent a9e6c82275
commit 5029be81e9
56 changed files with 4549 additions and 436 deletions

View File

@@ -41,6 +41,10 @@
</div>
</td>
</tr>
<tr v-if="relationships[0].relationshipType === 'engaged'" colspan="2">
<button @click="jumpToPartyForm">{{ $t('falukant.family.spouse.jumpToPartyForm')
}}</button>
</tr>
</table>
<ul>
<li v-for="characteristic in relationships[0].character2.characterTrait"
@@ -115,10 +119,12 @@
</thead>
<tbody>
<tr v-for="(child, index) in children" :key="index">
<td>
{{ $t('falukant.titles.' + child.gender + '.' + child.title) }}
<td v-if="child.hasName">
{{ child.name }}
</td>
<td v-else>
<button @click="jumpToChurchForm">{{ $t('falukant.family.children.baptism') }}</button>
</td>
<td>{{ child.age }}</td>
<td>
<button @click="showChildDetails(child)">
@@ -191,6 +197,9 @@ export default {
await this.loadGifts();
await this.loadMoodAffects();
await this.loadCharacterAffects();
if (this.daemonSocket) {
this.daemonSocket.addEventListener('message', this.handleDaemonMessage);
}
},
methods: {
async loadFamilyData() {
@@ -247,10 +256,10 @@ export default {
return;
}
try {
await apiClient.post('/api/falukant/family/gift'
, { giftId: this.selectedGiftId });
this.loadFamilyData();
this.$root.$refs.messageDialog.open('tr:falukant.family.sendgift.success');
await apiClient.post('/api/falukant/family/gift'
, { giftId: this.selectedGiftId });
this.loadFamilyData();
this.$root.$refs.messageDialog.open('tr:falukant.family.sendgift.success');
} catch (error) {
console.log(error.response);
if (error.response.status === 412) {
@@ -285,6 +294,26 @@ export default {
const green = Math.round(255 * pct);
return `rgb(${red}, ${green}, 0)`;
},
jumpToPartyForm() {
this.$router.push({
name: 'ReputationView',
query: { tab: 'party' }
});
},
jumpToChurchForm() {
this.$router.push({
name: 'ChurchView',
});
},
handleDaemonMessage() {
const message = JSON.parse(event.data);
if (message.event === 'children_update') {
this.loadFamilyData();
}
}
}
}
</script>
@@ -369,15 +398,15 @@ h2 {
}
.progress {
width: 100%;
background-color: #e5e7eb;
border-radius: 0.25rem;
overflow: hidden;
height: 1rem;
width: 100%;
background-color: #e5e7eb;
border-radius: 0.25rem;
overflow: hidden;
height: 1rem;
}
.progress-inner {
height: 100%;
transition: width 0.3s ease, background-color 0.3s ease;
height: 100%;
transition: width 0.3s ease, background-color 0.3s ease;
}
</style>