From ff06985fbce9194805a2a93f66f8038a3ebc394b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 3 Apr 2023 23:26:20 +0200 Subject: [PATCH 1/5] adding soundcube --- SCED.wiki | 1 + config.json | 3 +- objects/SoundCube.3c988f.json | 52 +++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 160000 SCED.wiki create mode 100644 objects/SoundCube.3c988f.json diff --git a/SCED.wiki b/SCED.wiki new file mode 160000 index 00000000..01065bfc --- /dev/null +++ b/SCED.wiki @@ -0,0 +1 @@ +Subproject commit 01065bfc202457c2c2edc4e8fa9a2385a4e3ecd5 diff --git a/config.json b/config.json index f27c3d86..37fa92dd 100644 --- a/config.json +++ b/config.json @@ -189,7 +189,8 @@ "Decoration-Ammo.d35ee9", "ArkhamSCE300-1272023-Page1.f873a8", "VictoryDisplay.6ccd6d", - "OptionPanelSource.830bd0" + "OptionPanelSource.830bd0", + "SoundCube.3c988f" ], "PlayArea": 1, "PlayerCounts": [ diff --git a/objects/SoundCube.3c988f.json b/objects/SoundCube.3c988f.json new file mode 100644 index 00000000..798afb48 --- /dev/null +++ b/objects/SoundCube.3c988f.json @@ -0,0 +1,52 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0, + "g": 0.86837, + "r": 1 + }, + "CustomAssetbundle": { + "AssetbundleSecondaryURL": "", + "AssetbundleURL": "http://cloud-3.steamusercontent.com/ugc/2037356539985116869/074BA1008AF1BF68A54B7DD269F50733C050BF45/", + "LoopingEffectIndex": 0, + "MaterialIndex": 2, + "TypeIndex": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "3c988f", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Assetbundle", + "Nickname": "SoundCube", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.645, + "posZ": -27, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} From 3879c8ed27e9f37102ca5455219543e31a421d58 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 3 Apr 2023 23:54:44 +0200 Subject: [PATCH 2/5] implemented vacuum and bell sound --- objects/SoundCube.3c988f.json | 5 ++++- src/accessories/CleanUpHelper.ttslua | 8 ++++++++ src/core/Global.ttslua | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/objects/SoundCube.3c988f.json b/objects/SoundCube.3c988f.json index 798afb48..3c9fdf6f 100644 --- a/objects/SoundCube.3c988f.json +++ b/objects/SoundCube.3c988f.json @@ -12,7 +12,7 @@ }, "CustomAssetbundle": { "AssetbundleSecondaryURL": "", - "AssetbundleURL": "http://cloud-3.steamusercontent.com/ugc/2037356539985116869/074BA1008AF1BF68A54B7DD269F50733C050BF45/", + "AssetbundleURL": "http://cloud-3.steamusercontent.com/ugc/2037356539985233174/FB2785745105BDFB2903346BEA6D090B7A4609AC/", "LoopingEffectIndex": 0, "MaterialIndex": 2, "TypeIndex": 0 @@ -35,6 +35,9 @@ "Nickname": "SoundCube", "Snap": true, "Sticky": true, + "Tags": [ + "SoundCube" + ], "Tooltip": true, "Transform": { "posX": 78, diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index d0b8f3f4..d5aa9d01 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -165,6 +165,7 @@ function cleanUp(_, color) printToAll("Clean up started!", "Orange") printToAll("Resetting counters...", "White") + triggerSoundCube() ignoreCustomDataHelper() getTrauma() updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror") @@ -185,6 +186,13 @@ end -- modular functions, called by other functions --------------------------------------------------------- +function triggerSoundCube() + local soundCube = getObjectsWithTag("SoundCube")[1] + if soundCube then + soundCube.AssetBundle.playTriggerEffect(0) + end +end + function updateCounters(tableOfGUIDs, tableOfNewValues, info) if tonumber(tableOfNewValues) then local value = tableOfNewValues diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 57792a9c..1a099b0a 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -1020,5 +1020,11 @@ function titleSplash(scenarioName) UI.hide('title_splash') hideTitleSplashWaitFunctionId = nil end, 4) + + -- play bell sound from soundCube + local soundCube = getObjectsWithTag("SoundCube")[1] + if soundCube then + soundCube.AssetBundle.playTriggerEffect(1) + end end end From 108bdfc2811e3a7119cdbc314434d283373d8275 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 4 Apr 2023 00:46:29 +0200 Subject: [PATCH 3/5] introducing soundcubeapi --- src/accessories/CleanUpHelper.ttslua | 11 ++--------- src/core/Global.ttslua | 7 ++----- src/core/SoundCubeApi.ttslua | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 src/core/SoundCubeApi.ttslua diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index d5aa9d01..4f8c3e5a 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -6,6 +6,7 @@ Cleans up the table for the next scenario in a campaign: --]] local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") +local soundCubeApi = require("core/SoundCubeApi") -- enable this for debugging local SHOW_RAYS = false @@ -165,7 +166,7 @@ function cleanUp(_, color) printToAll("Clean up started!", "Orange") printToAll("Resetting counters...", "White") - triggerSoundCube() + soundCubeApi.playSoundByName("Vacuum") ignoreCustomDataHelper() getTrauma() updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror") @@ -185,14 +186,6 @@ end --------------------------------------------------------- -- modular functions, called by other functions --------------------------------------------------------- - -function triggerSoundCube() - local soundCube = getObjectsWithTag("SoundCube")[1] - if soundCube then - soundCube.AssetBundle.playTriggerEffect(0) - end -end - function updateCounters(tableOfGUIDs, tableOfNewValues, info) if tonumber(tableOfNewValues) then local value = tableOfNewValues diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 1a099b0a..e27ea4db 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -34,6 +34,7 @@ local hideTitleSplashWaitFunctionId = nil local playmatApi = require("playermat/PlaymatApi") local tokenManager = require("core/token/TokenManager") local playAreaAPI = require("core/PlayAreaApi") +local soundCubeApi = require("core/SoundCubeApi") --------------------------------------------------------- -- data for tokens @@ -1021,10 +1022,6 @@ function titleSplash(scenarioName) hideTitleSplashWaitFunctionId = nil end, 4) - -- play bell sound from soundCube - local soundCube = getObjectsWithTag("SoundCube")[1] - if soundCube then - soundCube.AssetBundle.playTriggerEffect(1) - end + soundCubeApi.playSoundByName("Deep Bell") end end diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua new file mode 100644 index 00000000..06273524 --- /dev/null +++ b/src/core/SoundCubeApi.ttslua @@ -0,0 +1,17 @@ +do + local SoundCubeApi = {} + + -- this table links the name of a trigger effect to its index + local soundIndices = { + ["Vacuum"] = 0, + ["Deep Bell"] = 1 + } + + -- plays the by name requested sound + ---@param soundName String Name of the sound to play + SoundCubeApi.playSoundByName = function(soundName) + getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(soundIndices[soundName]) + end + + return SoundCubeApi +end From cdbec62924f913b04709a26cf458d905a1237028 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 4 Apr 2023 13:00:40 +0200 Subject: [PATCH 4/5] adding option to disable sounds --- src/core/Global.ttslua | 5 +++++ src/core/SoundCubeApi.ttslua | 8 +++++++- xml/OptionPanel.xml | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index e27ea4db..71cf63bf 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -843,6 +843,10 @@ function applyOptionPanelChange(id, state) elseif id == "showTitleSplash" then optionPanel[id] = state + -- option: Disable sound effects + elseif id == "disableSoundEffects" then + optionPanel[id] = state + -- option: Show token arranger elseif id == "showTokenArranger" then optionPanel[id] = spawnOrRemoveHelper(state, "Token Arranger", {-42.3, 1.6, -46.5}) @@ -981,6 +985,7 @@ function onClick_defaultSettings() -- clean reset of variable optionPanel = { + disableSoundEffects = false, playAreaSnapTags = true, showAttachmentHelper = false, showCleanUpHelper = false, diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua index 06273524..4133b190 100644 --- a/src/core/SoundCubeApi.ttslua +++ b/src/core/SoundCubeApi.ttslua @@ -7,10 +7,16 @@ do ["Deep Bell"] = 1 } + function playTriggerEffect(index) + if Global.getTable("optionPanel").disableSoundEffects ~= true then + getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index) + end + end + -- plays the by name requested sound ---@param soundName String Name of the sound to play SoundCubeApi.playSoundByName = function(soundName) - getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(soundIndices[soundName]) + playTriggerEffect(soundIndices[soundName]) end return SoundCubeApi diff --git a/xml/OptionPanel.xml b/xml/OptionPanel.xml index 267fb8b4..2ce05cc1 100644 --- a/xml/OptionPanel.xml +++ b/xml/OptionPanel.xml @@ -129,6 +129,20 @@ + + + + + Disable sound effects + This disables additional soundeffects, e.g. on scenario placement. + + + + + + + From ff580abf1a3e07d338eb3e054603c16df95f5296 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 10 Apr 2023 11:08:12 +0200 Subject: [PATCH 5/5] removed option panel entry --- src/core/Global.ttslua | 5 ----- src/core/SoundCubeApi.ttslua | 4 +--- xml/OptionPanel.xml | 14 -------------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 71cf63bf..e27ea4db 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -843,10 +843,6 @@ function applyOptionPanelChange(id, state) elseif id == "showTitleSplash" then optionPanel[id] = state - -- option: Disable sound effects - elseif id == "disableSoundEffects" then - optionPanel[id] = state - -- option: Show token arranger elseif id == "showTokenArranger" then optionPanel[id] = spawnOrRemoveHelper(state, "Token Arranger", {-42.3, 1.6, -46.5}) @@ -985,7 +981,6 @@ function onClick_defaultSettings() -- clean reset of variable optionPanel = { - disableSoundEffects = false, playAreaSnapTags = true, showAttachmentHelper = false, showCleanUpHelper = false, diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua index 4133b190..61883ac7 100644 --- a/src/core/SoundCubeApi.ttslua +++ b/src/core/SoundCubeApi.ttslua @@ -8,9 +8,7 @@ do } function playTriggerEffect(index) - if Global.getTable("optionPanel").disableSoundEffects ~= true then - getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index) - end + getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index) end -- plays the by name requested sound diff --git a/xml/OptionPanel.xml b/xml/OptionPanel.xml index 2ce05cc1..267fb8b4 100644 --- a/xml/OptionPanel.xml +++ b/xml/OptionPanel.xml @@ -129,20 +129,6 @@ - - - - - Disable sound effects - This disables additional soundeffects, e.g. on scenario placement. - - - - - - -