| @@ -26,7 +26,6 @@ | |||||
| <i class="action-label fas fa-user" v-if="left.validActions(left).length > 0"></i> | <i class="action-label fas fa-user" v-if="left.validActions(left).length > 0"></i> | ||||
| <ActionButton @described="described" @executed="executedLeft" v-for="(action, index) in left.validActions(left)" :key="'left-' + action.name + '-' + index" :action="action" :user="left" :target="left" :combatants="combatants" /> | <ActionButton @described="described" @executed="executedLeft" v-for="(action, index) in left.validActions(left)" :key="'left-' + action.name + '-' + index" :action="action" :user="left" :target="left" :combatants="combatants" /> | ||||
| </div> | </div> | ||||
| <div>{{actionDescription}}</div> | |||||
| </div> | </div> | ||||
| <div class="right-fader"> | <div class="right-fader"> | ||||
| @@ -41,7 +40,7 @@ | |||||
| <ActionButton @described="described" @executed="executedRight" v-for="(action, index) in right.validActions(right)" :key="'right-' + action.name + '-' + index" :action="action" :user="right" :target="right" :combatants="combatants" /> | <ActionButton @described="described" @executed="executedRight" v-for="(action, index) in right.validActions(right)" :key="'right-' + action.name + '-' + index" :action="action" :user="right" :target="right" :combatants="combatants" /> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div v-if="encounter.winner === null" class="action-description"> | |||||
| <div v-if="actionDescVisible && encounter.winner === null" class="action-description"> | |||||
| </div> | </div> | ||||
| <button @click="$emit('leave-combat')" v-if="encounter.winner !== null" class="exit-combat"> | <button @click="$emit('leave-combat')" v-if="encounter.winner !== null" class="exit-combat"> | ||||
| Exit Combat | Exit Combat | ||||
| @@ -56,7 +55,7 @@ | |||||
| import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' | import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' | ||||
| import { Creature } from '@/game/creature' | import { Creature } from '@/game/creature' | ||||
| import { POV } from '@/game/language' | import { POV } from '@/game/language' | ||||
| import { LogEntry, LogLine } from '@/game/interface' | |||||
| import { LogEntry, LogLine, nilLog } from '@/game/interface' | |||||
| import Statblock from './Statblock.vue' | import Statblock from './Statblock.vue' | ||||
| import ActionButton from './ActionButton.vue' | import ActionButton from './ActionButton.vue' | ||||
| import { Side, Encounter } from '@/game/combat' | import { Side, Encounter } from '@/game/combat' | ||||
| @@ -73,7 +72,8 @@ import { World } from '@/game/world' | |||||
| combatants: null, | combatants: null, | ||||
| won: false, | won: false, | ||||
| continuing: false, | continuing: false, | ||||
| totalWon: false | |||||
| totalWon: false, | |||||
| actionDescVisible: false | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -88,8 +88,6 @@ export default class Combat extends Vue { | |||||
| Side = Side | Side = Side | ||||
| actionDescription = '' | |||||
| get running () { | get running () { | ||||
| if (this.encounter.winner === null || (this.$data.continuing === true && this.encounter.totalWinner === null)) { | if (this.encounter.winner === null || (this.$data.continuing === true && this.encounter.totalWinner === null)) { | ||||
| return true | return true | ||||
| @@ -101,7 +99,7 @@ export default class Combat extends Vue { | |||||
| @Emit("described") | @Emit("described") | ||||
| described (entry: LogEntry) { | described (entry: LogEntry) { | ||||
| const actionDesc = this.$el.querySelector(".action-description") | const actionDesc = this.$el.querySelector(".action-description") | ||||
| this.$data.actionDescVisible = entry !== nilLog | |||||
| if (actionDesc !== null) { | if (actionDesc !== null) { | ||||
| const holder = document.createElement("div") | const holder = document.createElement("div") | ||||
| entry.render().forEach(element => { | entry.render().forEach(element => { | ||||
| @@ -337,7 +335,7 @@ export default class Combat extends Vue { | |||||
| .combat-layout { | .combat-layout { | ||||
| position: relative; | position: relative; | ||||
| display: grid; | display: grid; | ||||
| grid-template-rows: fit-content(50%) 10% [main-row-start] 1fr 20% [main-row-end] ; | |||||
| grid-template-rows: fit-content(50%) 3% [main-row-start] 1fr 20% [main-row-end] ; | |||||
| grid-template-columns: 1fr [main-col-start] fit-content(25%) fit-content(25%) [main-col-end] 1fr; | grid-template-columns: 1fr [main-col-start] fit-content(25%) fit-content(25%) [main-col-end] 1fr; | ||||
| width: 100%; | width: 100%; | ||||
| height: 100%; | height: 100%; | ||||
| @@ -454,11 +452,15 @@ export default class Combat extends Vue { | |||||
| } | } | ||||
| .action-description { | .action-description { | ||||
| grid-area: 2 / main-col-start / main-row-start / main-col-end; | |||||
| padding: 8pt; | |||||
| position: absolute; | |||||
| grid-area: 2 / main-col-start / main-row-end / main-col-end; | |||||
| text-align: center; | text-align: center; | ||||
| font-size: 16px; | font-size: 16px; | ||||
| padding-bottom: 48px; | |||||
| max-width: 1000px; | max-width: 1000px; | ||||
| text-align: center; | |||||
| width: 100%; | |||||
| background: linear-gradient(0deg, transparent, black 48px, black) | |||||
| } | } | ||||
| h3 { | h3 { | ||||