mirror of https://github.com/bra1n/townsquare.git
first draft of gamestate modal
improved general modal performance
This commit is contained in:
parent
812d7d8c04
commit
e0958ac129
|
@ -27,6 +27,7 @@
|
||||||
<ReferenceModal />
|
<ReferenceModal />
|
||||||
<NightOrderModal />
|
<NightOrderModal />
|
||||||
<VoteHistoryModal />
|
<VoteHistoryModal />
|
||||||
|
<GameStateModal />
|
||||||
<Gradients />
|
<Gradients />
|
||||||
<span id="version">v{{ version }}</span>
|
<span id="version">v{{ version }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,9 +48,11 @@ import Gradients from "./components/Gradients";
|
||||||
import NightOrderModal from "./components/modals/NightOrderModal";
|
import NightOrderModal from "./components/modals/NightOrderModal";
|
||||||
import FabledModal from "@/components/modals/FabledModal";
|
import FabledModal from "@/components/modals/FabledModal";
|
||||||
import VoteHistoryModal from "@/components/modals/VoteHistoryModal";
|
import VoteHistoryModal from "@/components/modals/VoteHistoryModal";
|
||||||
|
import GameStateModal from "@/components/modals/GameStateModal";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
GameStateModal,
|
||||||
VoteHistoryModal,
|
VoteHistoryModal,
|
||||||
FabledModal,
|
FabledModal,
|
||||||
NightOrderModal,
|
NightOrderModal,
|
||||||
|
|
|
@ -170,6 +170,10 @@
|
||||||
Night Order Sheet
|
Night Order Sheet
|
||||||
<em>[N]</em>
|
<em>[N]</em>
|
||||||
</li>
|
</li>
|
||||||
|
<li @click="toggleModal('gameState')">
|
||||||
|
Game State JSON
|
||||||
|
<em>G</em>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://discord.gg/Gd7ybwWbFk" target="_blank">
|
<a href="https://discord.gg/Gd7ybwWbFk" target="_blank">
|
||||||
Join Discord
|
Join Discord
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal class="editions" v-if="modals.edition" @close="toggleModal('edition')">
|
||||||
class="editions"
|
|
||||||
v-show="modals.edition"
|
|
||||||
@close="toggleModal('edition')"
|
|
||||||
>
|
|
||||||
<div v-if="!isCustom">
|
<div v-if="!isCustom">
|
||||||
<h3>Select an edition:</h3>
|
<h3>Select an edition:</h3>
|
||||||
<ul class="editions">
|
<ul class="editions">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal v-show="modals.fabled && fabled.length" @close="toggleModal('fabled')">
|
<Modal v-if="modals.fabled && fabled.length" @close="toggleModal('fabled')">
|
||||||
<h3>
|
<h3>
|
||||||
Choose a fabled character to add to the game
|
Choose a fabled character to add to the game
|
||||||
</h3>
|
</h3>
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
<template>
|
||||||
|
<Modal
|
||||||
|
class="game-state"
|
||||||
|
v-if="modals.gameState"
|
||||||
|
@close="toggleModal('gameState')"
|
||||||
|
>
|
||||||
|
<h3>Current Game State</h3>
|
||||||
|
<textarea v-model="gamestate"></textarea>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Modal from "./Modal";
|
||||||
|
import { mapMutations, mapState } from "vuex";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Modal
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
gamestate: function() {
|
||||||
|
return JSON.stringify({
|
||||||
|
bluffs: "",
|
||||||
|
edition: "",
|
||||||
|
roles: "",
|
||||||
|
fabled: "",
|
||||||
|
players: ""
|
||||||
|
});
|
||||||
|
},
|
||||||
|
...mapState(["modals"])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations(["toggleModal"])
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "../../vars.scss";
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin: 0 40px;
|
||||||
|
svg {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -48,12 +48,9 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
|
|
||||||
.characters & {
|
.characters &,
|
||||||
max-height: 80%;
|
.vote-history &,
|
||||||
max-width: 80%;
|
.night-reference & {
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.vote-history & {
|
|
||||||
max-height: 80%;
|
max-height: 80%;
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
class="characters"
|
class="night-reference"
|
||||||
v-show="modals.nightOrder"
|
|
||||||
@close="toggleModal('nightOrder')"
|
@close="toggleModal('nightOrder')"
|
||||||
v-if="roles.size"
|
v-if="modals.nightOrder && roles.size"
|
||||||
>
|
>
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@click="toggleModal('reference')"
|
@click="toggleModal('reference')"
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
class="characters"
|
class="characters"
|
||||||
v-show="modals.reference"
|
|
||||||
@close="toggleModal('reference')"
|
@close="toggleModal('reference')"
|
||||||
v-if="roles.size"
|
v-if="modals.reference && roles.size"
|
||||||
>
|
>
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@click="toggleModal('nightOrder')"
|
@click="toggleModal('nightOrder')"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
v-show="modals.reminder && availableReminders.length"
|
v-if="modals.reminder && availableReminders.length && players[playerIndex]"
|
||||||
v-if="players[playerIndex]"
|
|
||||||
@close="toggleModal('reminder')"
|
@close="toggleModal('reminder')"
|
||||||
>
|
>
|
||||||
<h3>Choose a reminder token:</h3>
|
<h3>Choose a reminder token:</h3>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
v-show="modals.role && availableRoles.length"
|
v-if="modals.role && availableRoles.length"
|
||||||
@close="toggleModal('role')"
|
@close="toggleModal('role')"
|
||||||
>
|
>
|
||||||
<h3>
|
<h3>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
class="roles"
|
class="roles"
|
||||||
v-show="modals.roles"
|
v-if="modals.roles && nonTravelers >= 5"
|
||||||
@close="toggleModal('roles')"
|
@close="toggleModal('roles')"
|
||||||
v-if="nonTravelers >= 5"
|
|
||||||
>
|
>
|
||||||
<h3>Select the characters for {{ nonTravelers }} players:</h3>
|
<h3>Select the characters for {{ nonTravelers }} players:</h3>
|
||||||
<ul
|
<ul
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal
|
||||||
class="vote-history"
|
class="vote-history"
|
||||||
v-show="modals.voteHistory"
|
v-show="modals.voteHistory && session.voteHistory"
|
||||||
@close="toggleModal('voteHistory')"
|
@close="toggleModal('voteHistory')"
|
||||||
v-if="session.voteHistory"
|
|
||||||
>
|
>
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@click="clearHistory"
|
@click="clearHistory"
|
||||||
|
|
|
@ -62,6 +62,7 @@ export default new Vuex.Store({
|
||||||
modals: {
|
modals: {
|
||||||
edition: false,
|
edition: false,
|
||||||
fabled: false,
|
fabled: false,
|
||||||
|
gameState: false,
|
||||||
nightOrder: false,
|
nightOrder: false,
|
||||||
reference: false,
|
reference: false,
|
||||||
reminder: false,
|
reminder: false,
|
||||||
|
|
Loading…
Reference in New Issue