mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(sound): implement SI2::PlayUISound
This commit is contained in:
parent
ff62e37b4b
commit
28095be341
@ -1,4 +1,5 @@
|
|||||||
#include "sound/SI2.hpp"
|
#include "sound/SI2.hpp"
|
||||||
|
#include "SoundKitProperties.hpp"
|
||||||
#include "console/CVar.hpp"
|
#include "console/CVar.hpp"
|
||||||
#include "sound/CVarHandlers.hpp"
|
#include "sound/CVarHandlers.hpp"
|
||||||
#include "sound/SESound.hpp"
|
#include "sound/SESound.hpp"
|
||||||
@ -229,10 +230,28 @@ void SI2::InitSoundKitGroups() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SI2::PlayUISound(int32_t id) {
|
void SI2::PlaySoundKit(int32_t id, int32_t a2, void* handle, const SoundKitProperties& properties, int32_t a5, void* a6, int32_t a7, int32_t a8) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SI2::PlayUISound(int32_t id) {
|
||||||
|
static auto voiceChatOnID = SI2::GetSoundKitID("VoiceChatOn");
|
||||||
|
static auto voiceChatOffID = SI2::GetSoundKitID("VoiceChatOff");
|
||||||
|
|
||||||
|
SoundKitProperties properties;
|
||||||
|
properties.ResetToDefaults();
|
||||||
|
|
||||||
|
if (id == voiceChatOnID || id == voiceChatOffID) {
|
||||||
|
properties.m_type = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
properties.int20 = 128;
|
||||||
|
properties.uint24 = 2;
|
||||||
|
properties.uint3C = 0;
|
||||||
|
|
||||||
|
SI2::PlaySoundKit(id, 0, nullptr, properties, 0, nullptr, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void SI2::RegisterCVars() {
|
void SI2::RegisterCVars() {
|
||||||
CVar::Register(
|
CVar::Register(
|
||||||
"StartTalkingDelay",
|
"StartTalkingDelay",
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
class SOUNDKITDEF;
|
class SOUNDKITDEF;
|
||||||
struct SOUNDKITLOOKUP;
|
struct SOUNDKITLOOKUP;
|
||||||
|
class SoundKitProperties;
|
||||||
|
|
||||||
class SI2 {
|
class SI2 {
|
||||||
public:
|
public:
|
||||||
@ -24,6 +25,7 @@ class SI2 {
|
|||||||
static int32_t Init(int32_t a1);
|
static int32_t Init(int32_t a1);
|
||||||
static void InitSoundKitDefs();
|
static void InitSoundKitDefs();
|
||||||
static void InitSoundKitGroups();
|
static void InitSoundKitGroups();
|
||||||
|
static void PlaySoundKit(int32_t id, int32_t a2, void* handle, const SoundKitProperties& properties, int32_t a5, void* a6, int32_t a7, int32_t a8);
|
||||||
static void PlayUISound(int32_t id);
|
static void PlayUISound(int32_t id);
|
||||||
static void RegisterCVars();
|
static void RegisterCVars();
|
||||||
static void RegisterScriptFunctions();
|
static void RegisterScriptFunctions();
|
||||||
|
|||||||
22
src/sound/SoundKitProperties.cpp
Normal file
22
src/sound/SoundKitProperties.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "sound/SoundKitProperties.hpp"
|
||||||
|
#include "util/SFile.hpp"
|
||||||
|
|
||||||
|
void SoundKitProperties::ResetToDefaults() {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->int20 = -1;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->m_type = 0;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->uint24 = 0;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->m_streaming = SFile::IsStreamingMode() != 0;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
23
src/sound/SoundKitProperties.hpp
Normal file
23
src/sound/SoundKitProperties.hpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef SOUND_SOUND_KIT_PROPERTIES_HPP
|
||||||
|
#define SOUND_SOUND_KIT_PROPERTIES_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class SoundKitProperties {
|
||||||
|
public:
|
||||||
|
// Member variables
|
||||||
|
uint32_t m_type;
|
||||||
|
// TODO
|
||||||
|
int32_t int20;
|
||||||
|
uint32_t uint24;
|
||||||
|
// TODO
|
||||||
|
uint32_t uint3C;
|
||||||
|
// TODO
|
||||||
|
int32_t m_streaming;
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
void ResetToDefaults();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user