From 5d04959fe2f322095cef25a19f2d854b3b93dcc9 Mon Sep 17 00:00:00 2001 From: Marko Koprivanac <73706747+Kopraa@users.noreply.github.com> Date: Fri, 2 Dec 2022 23:36:04 +0100 Subject: [PATCH 1/2] moved voice functions from misc to player where it belongs --- packages/client/game/misc.d.ts | 123 --------------------------------- packages/client/index.d.ts | 123 ++++++++++++++++++++++++++++++++- 2 files changed, 122 insertions(+), 124 deletions(-) diff --git a/packages/client/game/misc.d.ts b/packages/client/game/misc.d.ts index 1e48dae..d99a97a 100644 --- a/packages/client/game/misc.d.ts +++ b/packages/client/game/misc.d.ts @@ -186,110 +186,6 @@ interface CopyMemoryResult { src: number; } -interface VoiceFxChorus { - fWetDryMix: number; - fDepth: number; - fFeedback: number; - fFrequency: number; - lWaveform: number; - fDelay: number; - lPhase: RageEnums.Voice.BASSFXPhase; -} - -interface VoiceFxCompressor { - fGain: number; - fAttack: number; - fRelease: number; - fThreshold: number; - fRatio: number; - fPredelay: number; -} - -interface VoiceFxDistortion { - fGain: number; - fEdge: number; - fPostEQCenterFrequency: number; - fPostEQBandwidth: number; - fPreLowpassCutoff: number; -} - -interface VoiceFxEcho { - fWetDryMix: number; - fFeedback: number; - fLeftDelay: number; - fRightDelay: number; - lPanDelay: number; -} - -interface VoiceFxFlanger { - fWetDryMix: number; - fDepth: number; - fFeedback: number; - fFrequency: number; - lWaveform: number; - fDelay: number; - lPhase: RageEnums.Voice.BASSFXPhase; -} - -interface VoiceFxGargle { - dwRateHz: number; - dwWaveShape: number; -} - -interface VoiceFxI3DL2Reverb { - lRoom: number; - lRoomHF: number; - flRoomRolloffFactor: number; - flDecayTime: number; - flDecayHFRatio: number; - lReflections: number; - flReflectionsDelay: number; - lReverb: number; - flReverbDelay: number; - flDiffusion: number; - flDensity: number; - flHFReference: number; -} - -interface VoiceFxParamEq { - fCenter: number; - fBandwidth: number; - fGain: number; -} - -interface VoiceFxReverb { - fInGain: number; - fReverbMix: number; - fReverbTime: number; - fHighFreqRTRatio: number; -} - -interface VoiceFxVolume { - fTarget: number; - fCurrent: number; - fTime: number; - lCurve: number; -} - -interface VoiceFxPeakEq { - lBand: number; - fBandwidth: number; - fQ: number; - fCenter: number; - fGain: number; - lChannel: RageEnums.Voice.BASSFXChan; -} - -interface VoiceFxBQF { - lFilter: number; - fCenter: number; - fGain: number; - fBandwidth: number; - fQ: number; - fS: number; - lChannel: RageEnums.Voice.BASSFXChan; -} - interface GameMisc extends GameMiscLegacy { getAllocatedStackSize(): number; getNumberOfFreeStacksOfThisSize(stackSize: number): number; @@ -781,25 +677,6 @@ interface GameMisc extends GameMiscLegacy { getIsPlayerInAnimalForm(): boolean; setPlayerRockstarEditorDisabled(toggle: boolean): void; - /** - * https://wiki.rage.mp/index.php?title=Player::setVoiceFx - */ - setVoiceFx(fxType: RageEnums.Voice.BASSFXType, priority: number): void; - removeVoiceFx(fxHandle: VoiceHandle): void; - resetVoiceFx(fxHandle: VoiceHandle): void; - setVoiceFxChorus(fxHandle: VoiceHandle, { fWetDryMix, fDepth, fFeedback, fFrequency, lWaveform, fDelay, lPhase }: VoiceFxChorus): void; - setVoiceFxCompressor(fxHandle: VoiceHandle, { fGain, fAttack, fRelease, fThreshold, fRatio, fPredelay }: VoiceFxCompressor): void; - setVoiceFxDistortion(fxHandle: VoiceHandle, { fGain, fEdge, fPostEQCenterFrequency, fPostEQBandwidth, fPreLowpassCutoff }: VoiceFxDistortion): void; - setVoiceFxEcho(fxHandle: VoiceHandle, { fWetDryMix, fFeedback, fLeftDelay, fRightDelay, lPanDelay }: VoiceFxEcho): void; - setVoiceFxFlanger(fxHandle: VoiceHandle, { fWetDryMix, fDepth, fFeedback, fFrequency, lWaveform, fDelay, lPhase }: VoiceFxFlanger): void; - setVoiceFxGargle(fxHandle: VoiceHandle, { dwRateHz, dwWaveShape }: VoiceFxGargle): void; - setVoiceFxI3DL2Reverb(fxHandle: VoiceHandle, { lRoom, lRoomHF, flRoomRolloffFactor, flDecayTime, flDecayHFRatio, lReflections, flReflectionsDelay, lReverb, flReverbDelay, flDiffusion, flDensity, flHFReference }: VoiceFxI3DL2Reverb): void; - setVoiceFxParamEq(fxHandle: VoiceHandle, { fCenter, fBandwidth, fGain }: VoiceFxParamEq): void; - setVoiceFxReverb(fxHandle: VoiceHandle, { fInGain, fReverbMix, fReverbTime, fHighFreqRTRatio }: VoiceFxReverb): void; - setVoiceFxVolume(fxHandle: VoiceHandle, { fTarget, fCurrent, fTime, lCurve }: VoiceFxVolume): void; - setVoiceFxPeakEq(fxHandle: VoiceHandle, { lBand, fBandwidth, fQ, fCenter, fGain, lChannel }: VoiceFxPeakEq): void; - setVoiceFxBQF(fxHandle: VoiceHandle, { lFilter, fCenter, fGain, fBandwidth, fQ, fS, lChannel }: VoiceFxBQF): void; - /** * Overrides snow value set by server setter * - ⚠️ mp.game1.gameplay.enableSnow is a temporary workaround, "game" setter to be fixed later diff --git a/packages/client/index.d.ts b/packages/client/index.d.ts index 04376c8..277e3a5 100644 --- a/packages/client/index.d.ts +++ b/packages/client/index.d.ts @@ -12,6 +12,110 @@ declare type RGB = Array3d; declare type RGBA = Array4d; declare type VoiceHandle = number; +interface VoiceFxChorus { + fWetDryMix: number; + fDepth: number; + fFeedback: number; + fFrequency: number; + lWaveform: number; + fDelay: number; + lPhase: RageEnums.Voice.BASSFXPhase; +} + +interface VoiceFxCompressor { + fGain: number; + fAttack: number; + fRelease: number; + fThreshold: number; + fRatio: number; + fPredelay: number; +} + +interface VoiceFxDistortion { + fGain: number; + fEdge: number; + fPostEQCenterFrequency: number; + fPostEQBandwidth: number; + fPreLowpassCutoff: number; +} + +interface VoiceFxEcho { + fWetDryMix: number; + fFeedback: number; + fLeftDelay: number; + fRightDelay: number; + lPanDelay: number; +} + +interface VoiceFxFlanger { + fWetDryMix: number; + fDepth: number; + fFeedback: number; + fFrequency: number; + lWaveform: number; + fDelay: number; + lPhase: RageEnums.Voice.BASSFXPhase; +} + +interface VoiceFxGargle { + dwRateHz: number; + dwWaveShape: number; +} + +interface VoiceFxI3DL2Reverb { + lRoom: number; + lRoomHF: number; + flRoomRolloffFactor: number; + flDecayTime: number; + flDecayHFRatio: number; + lReflections: number; + flReflectionsDelay: number; + lReverb: number; + flReverbDelay: number; + flDiffusion: number; + flDensity: number; + flHFReference: number; +} + +interface VoiceFxParamEq { + fCenter: number; + fBandwidth: number; + fGain: number; +} + +interface VoiceFxReverb { + fInGain: number; + fReverbMix: number; + fReverbTime: number; + fHighFreqRTRatio: number; +} + +interface VoiceFxVolume { + fTarget: number; + fCurrent: number; + fTime: number; + lCurve: number; +} + +interface VoiceFxPeakEq { + lBand: number; + fBandwidth: number; + fQ: number; + fCenter: number; + fGain: number; + lChannel: RageEnums.Voice.BASSFXChan; +} + +interface VoiceFxBQF { + lFilter: number; + fCenter: number; + fGain: number; + fBandwidth: number; + fQ: number; + fS: number; + lChannel: RageEnums.Voice.BASSFXChan; +} + declare interface IVector3 { x: number; y: number; @@ -2326,7 +2430,24 @@ declare interface PlayerMp extends PedMpBase { */ isPositionFrozen: boolean; - + /** + * https://wiki.rage.mp/index.php?title=Player::setVoiceFx + */ + setVoiceFx(fxType: RageEnums.Voice.BASSFXType, priority: number): void; + removeVoiceFx(fxHandle: VoiceHandle): void; + resetVoiceFx(fxHandle: VoiceHandle): void; + setVoiceFxChorus(fxHandle: VoiceHandle, { fWetDryMix, fDepth, fFeedback, fFrequency, lWaveform, fDelay, lPhase }: VoiceFxChorus): void; + setVoiceFxCompressor(fxHandle: VoiceHandle, { fGain, fAttack, fRelease, fThreshold, fRatio, fPredelay }: VoiceFxCompressor): void; + setVoiceFxDistortion(fxHandle: VoiceHandle, { fGain, fEdge, fPostEQCenterFrequency, fPostEQBandwidth, fPreLowpassCutoff }: VoiceFxDistortion): void; + setVoiceFxEcho(fxHandle: VoiceHandle, { fWetDryMix, fFeedback, fLeftDelay, fRightDelay, lPanDelay }: VoiceFxEcho): void; + setVoiceFxFlanger(fxHandle: VoiceHandle, { fWetDryMix, fDepth, fFeedback, fFrequency, lWaveform, fDelay, lPhase }: VoiceFxFlanger): void; + setVoiceFxGargle(fxHandle: VoiceHandle, { dwRateHz, dwWaveShape }: VoiceFxGargle): void; + setVoiceFxI3DL2Reverb(fxHandle: VoiceHandle, { lRoom, lRoomHF, flRoomRolloffFactor, flDecayTime, flDecayHFRatio, lReflections, flReflectionsDelay, lReverb, flReverbDelay, flDiffusion, flDensity, flHFReference }: VoiceFxI3DL2Reverb): void; + setVoiceFxParamEq(fxHandle: VoiceHandle, { fCenter, fBandwidth, fGain }: VoiceFxParamEq): void; + setVoiceFxReverb(fxHandle: VoiceHandle, { fInGain, fReverbMix, fReverbTime, fHighFreqRTRatio }: VoiceFxReverb): void; + setVoiceFxVolume(fxHandle: VoiceHandle, { fTarget, fCurrent, fTime, lCurve }: VoiceFxVolume): void; + setVoiceFxPeakEq(fxHandle: VoiceHandle, { lBand, fBandwidth, fQ, fCenter, fGain, lChannel }: VoiceFxPeakEq): void; + setVoiceFxBQF(fxHandle: VoiceHandle, { lFilter, fCenter, fGain, fBandwidth, fQ, fS, lChannel }: VoiceFxBQF): void; } declare interface PlayerMpPool extends EntityMpPool { From 666d706a7d55499c2e69c5f79f0ba067d4aa618c Mon Sep 17 00:00:00 2001 From: Marko Koprivanac <73706747+Kopraa@users.noreply.github.com> Date: Sat, 3 Dec 2022 08:37:40 +0100 Subject: [PATCH 2/2] Fixed: changed enableSnow to property instead of method --- packages/client/game/misc.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/game/misc.d.ts b/packages/client/game/misc.d.ts index d99a97a..f18c0bb 100644 --- a/packages/client/game/misc.d.ts +++ b/packages/client/game/misc.d.ts @@ -681,7 +681,7 @@ interface GameMisc extends GameMiscLegacy { * Overrides snow value set by server setter * - ⚠️ mp.game1.gameplay.enableSnow is a temporary workaround, "game" setter to be fixed later */ - enableSnow(toggle: boolean): void; + enableSnow: boolean; unk: GameMiscUnk; }