- added volume setting for sighting hits
This commit is contained in:
@@ -13,6 +13,9 @@ export const initialState: SoundState = {
|
||||
{ name: "Shutter", soundFile: "shutter" },
|
||||
{ name: "Warning (voice)", soundFile: "warning" },
|
||||
],
|
||||
sightingVolume: 1,
|
||||
NPEDsoundVolume: 1,
|
||||
hotlistSoundVolume: 1,
|
||||
};
|
||||
|
||||
export function reducer(state: SoundState, action: SoundAction): SoundState {
|
||||
@@ -35,6 +38,18 @@ export function reducer(state: SoundState, action: SoundAction): SoundState {
|
||||
soundOptions: [...(state.soundOptions ?? []), action.payload],
|
||||
};
|
||||
}
|
||||
// todo: refactor to use single state coupled with sound name. e.g : {name: <soundname>, volume: <volume>}
|
||||
case "SIGHTINGVOLUME":
|
||||
return {
|
||||
...state,
|
||||
sightingVolume: action.payload,
|
||||
};
|
||||
|
||||
case "NPEDVOLUME":
|
||||
return {
|
||||
...state,
|
||||
NPEDsoundVolume: action.payload,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user