From fa41971516577745df2cee5ac4fe5eeaea67d1d4 Mon Sep 17 00:00:00 2001 From: Tim Bradgate Date: Sun, 20 Apr 2025 22:03:48 +0100 Subject: [PATCH 1/2] Show stage direction overrides on script lines --- client/src/views/show/ShowLiveView.vue | 14 ++++++++++++-- .../vue_components/show/config/cues/CueEditor.vue | 12 ++++++++++-- .../show/config/cues/ScriptLineCueEditor.vue | 8 +++++++- .../show/config/script/ScriptEditor.vue | 13 +++++++++++-- .../show/config/script/ScriptLineViewer.vue | 8 +++++++- .../vue_components/show/live/ScriptLineViewer.vue | 8 +++++++- 6 files changed, 54 insertions(+), 9 deletions(-) diff --git a/client/src/views/show/ShowLiveView.vue b/client/src/views/show/ShowLiveView.vue index eb1a9f0b..7264b76f 100644 --- a/client/src/views/show/ShowLiveView.vue +++ b/client/src/views/show/ShowLiveView.vue @@ -74,6 +74,7 @@ :cues="getCuesForLine(line)" :cuts="SCRIPT_CUTS" :stage-direction-styles="STAGE_DIRECTION_STYLES" + :stage-direction-style-overrides="STAGE_DIRECTION_STYLE_OVERRIDES" @last-line-change="handleLastLineChange" @first-line-change="handleFirstLineChange" /> @@ -143,6 +144,14 @@ export default { this.$toast.warning('No live session started!'); await this.$router.replace('/'); } else { + // Get the current user + await this.GET_CURRENT_USER(); + + // User related stuff + if (this.CURRENT_USER != null) { + await this.GET_STAGE_DIRECTION_STYLE_OVERRIDES(); + } + await this.GET_ACT_LIST(); await this.GET_SCENE_LIST(); await this.GET_CHARACTER_LIST(); @@ -417,7 +426,7 @@ export default { }, ...mapActions(['GET_SHOW_SESSION_DATA', 'LOAD_SCRIPT_PAGE', 'GET_ACT_LIST', 'GET_SCENE_LIST', 'GET_CHARACTER_LIST', 'GET_CHARACTER_GROUP_LIST', 'LOAD_CUES', 'GET_CUE_TYPES', - 'GET_CUTS', 'GET_STAGE_DIRECTION_STYLES']), + 'GET_CUTS', 'GET_STAGE_DIRECTION_STYLES', 'GET_CURRENT_USER', 'GET_STAGE_DIRECTION_STYLE_OVERRIDES']), }, computed: { pageIter() { @@ -442,7 +451,8 @@ export default { }, ...mapGetters(['CURRENT_SHOW_SESSION', 'GET_SCRIPT_PAGE', 'ACT_LIST', 'SCENE_LIST', 'CHARACTER_LIST', 'CHARACTER_GROUP_LIST', 'CURRENT_SHOW', 'CUE_TYPES', 'SCRIPT_CUES', - 'INTERNAL_UUID', 'SESSION_FOLLOW_DATA', 'SCRIPT_CUTS', 'SETTINGS', 'STAGE_DIRECTION_STYLES']), + 'INTERNAL_UUID', 'SESSION_FOLLOW_DATA', 'SCRIPT_CUTS', 'SETTINGS', 'STAGE_DIRECTION_STYLES', + 'CURRENT_USER', 'STAGE_DIRECTION_STYLE_OVERRIDES']), }, watch: { SESSION_FOLLOW_DATA() { diff --git a/client/src/vue_components/show/config/cues/CueEditor.vue b/client/src/vue_components/show/config/cues/CueEditor.vue index 0fd49241..6086fe25 100644 --- a/client/src/vue_components/show/config/cues/CueEditor.vue +++ b/client/src/vue_components/show/config/cues/CueEditor.vue @@ -63,6 +63,7 @@ :cues="getCuesForLine(line)" :line-part-cuts="SCRIPT_CUTS" :stage-direction-styles="STAGE_DIRECTION_STYLES" + :stage-direction-style-overrides="STAGE_DIRECTION_STYLE_OVERRIDES" /> @@ -176,6 +177,8 @@ export default { }, }, async beforeMount() { + // Get the current user + await this.GET_CURRENT_USER(); // Config status await this.GET_SCRIPT_CONFIG_STATUS(); // Show details @@ -188,6 +191,11 @@ export default { await this.GET_CUTS(); await this.GET_STAGE_DIRECTION_STYLES(); + // User related stuff + if (this.CURRENT_USER != null) { + await this.GET_STAGE_DIRECTION_STYLE_OVERRIDES(); + } + // Get the max page of the saved version of the script await this.getMaxScriptPage(); @@ -263,7 +271,7 @@ export default { ...mapActions(['GET_SCENE_LIST', 'GET_ACT_LIST', 'GET_CHARACTER_LIST', 'GET_CHARACTER_GROUP_LIST', 'LOAD_SCRIPT_PAGE', 'ADD_BLANK_PAGE', 'GET_SCRIPT_CONFIG_STATUS', 'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUE_TYPES', 'LOAD_CUES', - 'GET_CUTS', 'GET_STAGE_DIRECTION_STYLES']), + 'GET_CUTS', 'GET_STAGE_DIRECTION_STYLES', 'GET_STAGE_DIRECTION_STYLE_OVERRIDES', 'GET_CURRENT_USER']), }, computed: { currentEditPageKey() { @@ -278,7 +286,7 @@ export default { ...mapGetters(['CURRENT_SHOW', 'ACT_LIST', 'SCENE_LIST', 'CHARACTER_LIST', 'CHARACTER_GROUP_LIST', 'CAN_REQUEST_EDIT', 'CURRENT_EDITOR', 'INTERNAL_UUID', 'GET_SCRIPT_PAGE', 'DEBUG_MODE_ENABLED', 'CUE_TYPES', 'SCRIPT_CUES', 'SCRIPT_CUTS', - 'STAGE_DIRECTION_STYLES']), + 'STAGE_DIRECTION_STYLES', 'STAGE_DIRECTION_STYLE_OVERRIDES', 'CURRENT_USER']), }, watch: { currentEditPage(val) { diff --git a/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue b/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue index aa45e420..d3d56d0d 100644 --- a/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue +++ b/client/src/vue_components/show/config/cues/ScriptLineCueEditor.vue @@ -250,6 +250,10 @@ export default { required: true, type: Array, }, + stageDirectionStyleOverrides: { + required: true, + type: Array, + }, }, data() { return { @@ -431,8 +435,10 @@ export default { const sdStyle = this.stageDirectionStyles.find( (style) => (style.id === this.line.stage_direction_style_id), ); + const override = this.stageDirectionStyleOverrides + .find((elem) => elem.settings.id === sdStyle.id); if (this.line.stage_direction) { - return sdStyle; + return override ? override.settings : sdStyle; } return null; }, diff --git a/client/src/vue_components/show/config/script/ScriptEditor.vue b/client/src/vue_components/show/config/script/ScriptEditor.vue index 8cf433d0..ffaed537 100644 --- a/client/src/vue_components/show/config/script/ScriptEditor.vue +++ b/client/src/vue_components/show/config/script/ScriptEditor.vue @@ -122,6 +122,7 @@ :line-part-cuts="linePartCuts" :insert-mode="insertMode" :stage-direction-styles="STAGE_DIRECTION_STYLES" + :stage-direction-style-overrides="STAGE_DIRECTION_STYLE_OVERRIDES" @editLine="beginEditingLine(currentEditPage, index)" @cutLinePart="cutLinePart" @insertLine="insertLineAt(currentEditPage, index)" @@ -348,6 +349,8 @@ export default { }, }, async beforeMount() { + // Get the current user + await this.GET_CURRENT_USER(); // Config status await this.GET_SCRIPT_CONFIG_STATUS(); // Show details @@ -357,6 +360,10 @@ export default { await this.GET_CHARACTER_GROUP_LIST(); // Stage direction styles await this.GET_STAGE_DIRECTION_STYLES(); + // User related stuff + if (this.CURRENT_USER != null) { + await this.GET_STAGE_DIRECTION_STYLE_OVERRIDES(); + } // Handle script cuts await this.GET_CUTS(); this.resetCutsToSaved(); @@ -790,7 +797,8 @@ export default { 'SET_CUT_MODE', 'INSERT_BLANK_LINE', 'RESET_INSERTED']), ...mapActions(['GET_SCENE_LIST', 'GET_ACT_LIST', 'GET_CHARACTER_LIST', 'GET_CHARACTER_GROUP_LIST', 'LOAD_SCRIPT_PAGE', 'ADD_BLANK_PAGE', 'GET_SCRIPT_CONFIG_STATUS', - 'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUTS', 'SAVE_SCRIPT_CUTS', 'GET_STAGE_DIRECTION_STYLES']), + 'RESET_TO_SAVED', 'SAVE_NEW_PAGE', 'SAVE_CHANGED_PAGE', 'GET_CUTS', 'SAVE_SCRIPT_CUTS', + 'GET_STAGE_DIRECTION_STYLES', 'GET_CURRENT_USER', 'GET_STAGE_DIRECTION_STYLE_OVERRIDES']), }, computed: { canGenerateDebugScript() { @@ -831,7 +839,8 @@ export default { ...mapGetters(['CURRENT_SHOW', 'TMP_SCRIPT', 'ACT_LIST', 'SCENE_LIST', 'CHARACTER_LIST', 'CHARACTER_GROUP_LIST', 'CAN_REQUEST_EDIT', 'CURRENT_EDITOR', 'INTERNAL_UUID', 'GET_SCRIPT_PAGE', 'DEBUG_MODE_ENABLED', 'DELETED_LINES', 'SCENE_BY_ID', 'ACT_BY_ID', - 'IS_CUT_MODE', 'SCRIPT_CUTS', 'INSERTED_LINES', 'STAGE_DIRECTION_STYLES']), + 'IS_CUT_MODE', 'SCRIPT_CUTS', 'INSERTED_LINES', 'STAGE_DIRECTION_STYLES', 'CURRENT_USER', + 'STAGE_DIRECTION_STYLE_OVERRIDES']), }, watch: { currentEditPage(val) { diff --git a/client/src/vue_components/show/config/script/ScriptLineViewer.vue b/client/src/vue_components/show/config/script/ScriptLineViewer.vue index d5f2c6a1..2d52f4b1 100644 --- a/client/src/vue_components/show/config/script/ScriptLineViewer.vue +++ b/client/src/vue_components/show/config/script/ScriptLineViewer.vue @@ -162,6 +162,10 @@ export default { required: true, type: Array, }, + stageDirectionStyleOverrides: { + required: true, + type: Array, + }, }, computed: { needsHeadings() { @@ -216,8 +220,10 @@ export default { const sdStyle = this.stageDirectionStyles.find( (style) => (style.id === this.line.stage_direction_style_id), ); + const override = this.stageDirectionStyleOverrides + .find((elem) => elem.settings.id === sdStyle.id); if (this.line.stage_direction) { - return sdStyle; + return override ? override.settings : sdStyle; } return null; }, diff --git a/client/src/vue_components/show/live/ScriptLineViewer.vue b/client/src/vue_components/show/live/ScriptLineViewer.vue index d72974b3..3a9620de 100644 --- a/client/src/vue_components/show/live/ScriptLineViewer.vue +++ b/client/src/vue_components/show/live/ScriptLineViewer.vue @@ -149,6 +149,10 @@ export default { required: true, type: Array, }, + stageDirectionStyleOverrides: { + required: true, + type: Array, + }, }, data() { return { @@ -267,8 +271,10 @@ export default { const sdStyle = this.stageDirectionStyles.find( (style) => (style.id === this.line.stage_direction_style_id), ); + const override = this.stageDirectionStyleOverrides + .find((elem) => elem.settings.id === sdStyle.id); if (this.line.stage_direction) { - return sdStyle; + return override ? override.settings : sdStyle; } return null; }, From 31a57034b88aa3ffae3785c85d28d47668631af2 Mon Sep 17 00:00:00 2001 From: Tim Bradgate Date: Sun, 20 Apr 2025 22:13:37 +0100 Subject: [PATCH 2/2] Bump version to 0.9.0 --- client/package-lock.json | 4 ++-- client/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 3b2f019d..950720bd 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "client", - "version": "0.8.3", + "version": "0.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "client", - "version": "0.8.3", + "version": "0.9.0", "dependencies": { "bootstrap": "4.6.2", "bootstrap-vue": "2.23.1", diff --git a/client/package.json b/client/package.json index 145d35bf..1b1d3af1 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "client", - "version": "0.8.3", + "version": "0.9.0", "private": true, "scripts": { "build": "vite build",