Skip to content

Commit

Permalink
Remove NineMode siren configuration fixes #175
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinRijsdijk committed Dec 3, 2023
1 parent a9715d2 commit fd61400
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 29 deletions.
11 changes: 1 addition & 10 deletions docs/vcf.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Alternatively, you can use [this convenient graphical interface](https://matsn0w
<!-- SOUNDS & SIREN CONFIG -->
<SOUNDS>
<MainHorn />
<NineMode />
<SrnTone1 />
<SrnTone2 />
<SrnTone3 />
Expand Down Expand Up @@ -108,7 +107,7 @@ Options:

## Sounds: `SOUNDS`

This section defines the sound for each siren on your vehicle. You can enable up to 4 different sirens for each vehicle. Also, you can optionally set a custom horn sound for the vehicle. This can be used to enable an airhorn for example. Enabling the NineMode setting will activate a '999 mode actived!' sound effect when you press Q (by default, or DPAD_LEFT on controllers).
This section defines the sound for each siren on your vehicle. You can enable up to 4 different sirens for each vehicle. Also, you can optionally set a custom horn sound for the vehicle. This can be used to enable an airhorn for example.

If you are using [WMServerSirens](https://github.com/Walsheyy/WMServerSirens), you can specify the sound set too. ELS will use the game's native sound effects otherwise. Make sure to include the sound set under `Config.AudioBanks` in order for it to load.

Expand All @@ -121,7 +120,6 @@ Example with WMServerSirens:
```xml
<SOUNDS>
<MainHorn AllowUse="false" />
<NineMode AllowUse="false" />
<SrnTone1 AllowUse="true" AudioString="SIREN_ALPHA" SoundSet="DLC_WMSIRENS_SOUNDSET" />
<SrnTone2 AllowUse="true" AudioString="SIREN_BRAVO" SoundSet="DLC_WMSIRENS_SOUNDSET" />
<SrnTone3 AllowUse="true" AudioString="VEHICLES_HORNS_SIREN_1" />
Expand All @@ -134,7 +132,6 @@ Example with native game sounds:
```xml
<SOUNDS>
<MainHorn AllowUse="true" AudioString="SIRENS_AIRHORN" />
<NineMode AllowUse="true" />
<SrnTone1 AllowUse="true" AudioString="VEHICLES_HORNS_SIREN_1" />
<SrnTone2 AllowUse="true" AudioString="VEHICLES_HORNS_SIREN_2" />
<SrnTone3 AllowUse="true" AudioString="VEHICLES_HORNS_POLICE_WARNING" />
Expand All @@ -151,12 +148,6 @@ Options:
| AudioString | string | name hash of sound to use | `SIRENS_AIRHORN` | The name of an audio to play. Must be compatible with the [`PLAY_SOUND_FROM_ENTITY`](https://docs.fivem.net/natives/?_0xE65F427EB70AB1ED) native. |
| SoundSet | string | name of sound bank to use | - | The name of the sound set if using WMServerSirens. |

**NineMode**:

| Name | Type | Values | Default | Description |
| -------- | ------- | --------------- | ------- | -------------------------------------------- |
| AllowUse | boolean | `true`, `false` | `false` | Enables a '999 mode activated' sound effect. |

**SrnTone1-4**:

| Name | Type | Values | Default | Description |
Expand Down
Binary file removed resource/html/sounds/999mode.ogg
Binary file not shown.
6 changes: 0 additions & 6 deletions resource/server/parseVCF.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ function ParseVCF(xml, fileName)
end

if rootElement.name == 'SOUNDS' then
vcf.sounds.nineMode = false

for sid = 1, #rootElement.kids do
local elem = rootElement.kids[sid]

Expand All @@ -123,10 +121,6 @@ function ParseVCF(xml, fileName)
vcf.sounds.mainHorn.soundSet = elem.attr['SoundSet']
end

if elem.name == 'NineMode' then
vcf.sounds.nineMode = elem.attr['AllowUse'] == 'true'
end

if string.upper(string.sub(elem.name, 1, -2)) == 'SRNTONE' then
local tone = string.sub(elem.name, -1)

Expand Down
4 changes: 2 additions & 2 deletions web/components/sounds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ watch(
if (VCF.value.configuration.useServerSirens) {
let iterations = 0
VCF.value.configuration.sounds.forEach((sound) => {
if (!['MainHorn', 'NineMode'].includes(sound.name)) {
if (!['MainHorn'].includes(sound.name)) {
sound.audioString = `SIREN_${natoAlphabet[iterations]}`;
iterations++;
}
})
} else {
VCF.value.configuration.sounds.forEach((sound) => {
if (!['MainHorn', 'NineMode'].includes(sound.name)) {
if (!['MainHorn'].includes(sound.name)) {
sound.audioString = defaultVcfConfig().configuration.sounds.find((defaultSound) => defaultSound.name === sound.name).audioString;
}
})
Expand Down
4 changes: 0 additions & 4 deletions web/composables/vcfConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ export const defaultVcfConfig = () => {
audioString: "SIRENS_AIRHORN",
soundSet: null,
},
{
name: "NineMode",
allowUse: false,
},
{
name: "SrnTone1",
allowUse: true,
Expand Down
7 changes: 0 additions & 7 deletions web/utils/transformImportedVCF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,11 @@ export const generateStoreAttributesFromExistingVCF = (data: any) => {
const sounds = soundsObject?.querySelectorAll("*");

sounds?.forEach((sound) => {
const isNineMode = sound.nodeName === "NineMode";

let fields: Partial<soundType> = {
name: sound.nodeName,
allowUse: sound.getAttribute("AllowUse") === "true",
}

if (!isNineMode) {
fields.audioString = sound.getAttribute("AudioString")
fields.soundSet = sound.getAttribute("SoundSet")
}

vcf.configuration.sounds.push(fields as soundType);
});

Expand Down

0 comments on commit fd61400

Please sign in to comment.