Example mod for audio_res service

This commit is contained in:
PJB3005
2026-07-25 16:02:42 +02:00
parent 98b203fd26
commit de44bbaa26
6 changed files with 66 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#include "mods/service.hpp"
#include "mods/svc/audio_res.h"
#include "mods/svc/log.h"
DEFINE_MOD();
IMPORT_SERVICE(LogService, svc_log);
IMPORT_SERVICE(AudioResService, svc_audio_res);
extern "C" {
MOD_EXPORT ModResult mod_initialize(ModError*) {
svc_log->info(mod_ctx, "template_mod initialized");
AudioWaveHandle handle;
svc_audio_res->replace_wave(
mod_ctx,
SoundEffects,
4238,
"res/go.opus",
nullptr,
&handle);
svc_audio_res->replace_wave(
mod_ctx,
SoundEffects,
4237,
"res/go.opus",
nullptr,
&handle);
return MOD_OK;
}
MOD_EXPORT ModResult mod_update(ModError*) {
return MOD_OK;
}
MOD_EXPORT ModResult mod_shutdown(ModError*) {
svc_log->info(mod_ctx, "template_mod unloaded");
return MOD_OK;
}
}