mirror of https://github.com/bra1n/townsquare.git
Merge pull request #18 from bra1n/custom-reminder
custom reminder notes
This commit is contained in:
commit
aed1d7a274
Binary file not shown.
After Width: | Height: | Size: 162 KiB |
|
@ -659,6 +659,19 @@ li.move:not(.from) .player > svg.move {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.custom {
|
||||||
|
padding: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
align-content: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 70%;
|
||||||
|
word-break: break-word;
|
||||||
|
.icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:hover:before {
|
&:hover:before {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
<li
|
<li
|
||||||
v-for="reminder in availableReminders"
|
v-for="reminder in availableReminders"
|
||||||
class="reminder"
|
class="reminder"
|
||||||
v-bind:class="[reminder.role]"
|
:class="[reminder.role]"
|
||||||
v-bind:key="reminder.role + ' ' + reminder.name"
|
:key="reminder.role + ' ' + reminder.name"
|
||||||
@click="addReminder(reminder)"
|
@click="addReminder(reminder)"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="icon"
|
class="icon"
|
||||||
v-bind:style="{
|
:style="{
|
||||||
backgroundImage: `url(${require('../../assets/icons/' +
|
backgroundImage: `url(${require('../../assets/icons/' +
|
||||||
reminder.role +
|
reminder.role +
|
||||||
'.png')})`
|
'.png')})`
|
||||||
|
@ -48,6 +48,7 @@ export default {
|
||||||
});
|
});
|
||||||
reminders.push({ role: "good", name: "Good" });
|
reminders.push({ role: "good", name: "Good" });
|
||||||
reminders.push({ role: "evil", name: "Evil" });
|
reminders.push({ role: "evil", name: "Evil" });
|
||||||
|
reminders.push({ role: "custom", name: "Custom note" });
|
||||||
return reminders;
|
return reminders;
|
||||||
},
|
},
|
||||||
...mapState(["modals"]),
|
...mapState(["modals"]),
|
||||||
|
@ -56,7 +57,14 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
addReminder(reminder) {
|
addReminder(reminder) {
|
||||||
const player = this.$store.state.players.players[this.playerIndex];
|
const player = this.$store.state.players.players[this.playerIndex];
|
||||||
const value = [...player.reminders, reminder];
|
let value;
|
||||||
|
if (reminder.role === "custom") {
|
||||||
|
const name = prompt("Add a custom reminder note");
|
||||||
|
if (!name) return;
|
||||||
|
value = [...player.reminders, { role: "custom", name }];
|
||||||
|
} else {
|
||||||
|
value = [...player.reminders, reminder];
|
||||||
|
}
|
||||||
this.$store.commit("players/update", {
|
this.$store.commit("players/update", {
|
||||||
player,
|
player,
|
||||||
property: "reminders",
|
property: "reminders",
|
||||||
|
|
|
@ -90,7 +90,6 @@ export default new Vuex.Store({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleModal({ modals }, name) {
|
toggleModal({ modals }, name) {
|
||||||
console.log("toggle", name);
|
|
||||||
modals[name] = !modals[name];
|
modals[name] = !modals[name];
|
||||||
},
|
},
|
||||||
updateScreenshot({ grimoire }, status) {
|
updateScreenshot({ grimoire }, status) {
|
||||||
|
|
Loading…
Reference in New Issue