a big bunch of other bugfixes

This commit is contained in:
Steffen 2021-03-14 20:42:39 +01:00
parent f0c09cf497
commit a90ca50f7a
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
7 changed files with 27 additions and 12 deletions

View File

@ -1,5 +1,16 @@
# Release Notes
### Version 2.9.1
- fix gamestate JSON not showing (custom) roles and failing to load states with custom scripts properly
- fix gamestate not stripping out special characters from role.id on load
- made character assignment modal a bit prettier
- got rid of the extra pixels on the Soldier icon
- fixed lengthy live session channel names not being correctly cut off
- hide player names in night order / character reference popup when town square is public
- fix (pre-)vote calculation being off by one if the nominee votes
---
### Version 2.9.0
- added support for assigning pronouns to players and display of the pronouns in a tooltip on the player name.
- added button to modals that allows the user to maximize them

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -163,19 +163,15 @@ export default {
if (metaIndex > -1) {
meta = roles.splice(metaIndex, 1).pop();
}
const customRoles = roles.map(role => {
role.id = role.id.toLocaleLowerCase().replace(/[^a-z0-9]/g, "");
return role;
});
this.$store.commit("setCustomRoles", customRoles);
this.$store.commit("setCustomRoles", roles);
this.$store.commit(
"setEdition",
Object.assign({}, meta, { id: "custom" })
);
// check for fabled and set those too, if present
if (customRoles.some(({ id }) => this.$store.state.fabled.has(id))) {
if (roles.some(({ id }) => this.$store.state.fabled.has(id))) {
const fabled = [];
customRoles.forEach(({ id }) => {
roles.forEach(({ id }) => {
if (this.$store.state.fabled.has(id)) {
fabled.push(this.$store.state.fabled.get(id));
}

View File

@ -37,7 +37,9 @@ export default {
edition: this.edition.isOfficial
? { id: this.edition.id }
: this.edition,
roles: this.edition.isOfficial ? "" : this.$store.getters.customRoles,
roles: this.edition.isOfficial
? ""
: this.$store.getters.customRolesStripped,
fabled: this.players.fabled.map(({ id }) => id),
players: this.players.players.map(player => ({
...player,

View File

@ -76,6 +76,7 @@ export default {
.roles & {
max-height: 100%;
max-width: 60%;
}
ul {

View File

@ -179,6 +179,11 @@ export default new Vuex.Store({
return role;
}
})
// clean up role.id
.map(role => {
role.id = role.id.toLocaleLowerCase().replace(/[^a-z0-9]/g, "");
return role;
})
// map existing roles to base definition or pre-populate custom roles to ensure all properties
.map(
role =>

View File

@ -791,11 +791,11 @@ export default store => {
const session = new LiveSession(store);
// listen to mutations
store.subscribe(({ type, payload }) => {
store.subscribe(({ type, payload }, state) => {
switch (type) {
case "session/setSessionId":
if (payload) {
session.connect(payload);
if (state.session.sessionId) {
session.connect(state.session.sessionId);
} else {
window.location.hash = "";
session.disconnect();