moves logic to PlayerView, adds simple notifications when debugging

This commit is contained in:
2019-07-31 15:37:35 +02:00
parent e07b236313
commit dae7633c11
5 changed files with 35 additions and 12 deletions

View File

@@ -1,16 +1,20 @@
<template>
<main id="app" class="container">
<PlayerView :id="state.player_id" v-slot="{ player, updateWealth }">
<PlayerView :id="state.player_id"
v-slot="{ player, notifications, actions }">
<section class="section">
<HeaderBar :app_state="state">
<template v-slot:title>{{ player.name }}</template>
</HeaderBar>
<p v-if="notifications">{{ notifications }}</p>
<Wealth
:wealth="[player.cp, player.sp, player.gp, player.pp]"
:debt="player.debt"
@update="updateWealth">
@update="actions.updateWealth">
</wealth>
<Chest :player="state.show_player_chest ? player.id : 0"></Chest>
<Chest :player="state.show_player_chest ? player.id : 0"
@claim="actions.putClaim"
@unclaim="actions.withdrawClaim"></Chest>
</section>
</PlayerView>
</main>