Update script warnings

This commit is contained in:
Agent X 2024-06-24 23:40:49 -04:00
parent 21ca523d04
commit 16d403c254
2 changed files with 11 additions and 10 deletions

View File

@ -22,6 +22,7 @@
#define LOG_LUA(...) { if (!gSmLuaSuppressErrors) { printf("[LUA] "), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(), snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR); } }
#define LOG_LUA_LINE(...) { if (!gSmLuaSuppressErrors) { printf("[LUA] "), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(); snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR), smlua_logline(); } }
#define LOG_LUA_LINE_WARNING(...) { smlua_mod_warning(); snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_WARNING); }
#ifdef DEVELOPMENT
#define LUA_STACK_CHECK_BEGIN() int __LUA_STACK_TOP = lua_gettop(gLuaState)

View File

@ -8,7 +8,7 @@
#include "game/object_list_processor.h"
char* network_discord_id_from_local_index(UNUSED u8 localIndex) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] network_discord_id_from_local_index() is deprecated! Please use get_local_discord_id() instead.");
#ifdef DISCORD_SDK
static char sDiscordId[64] = "";
if (localIndex == 0) {
@ -20,31 +20,31 @@ char* network_discord_id_from_local_index(UNUSED u8 localIndex) {
}
void djui_hud_set_render_behind_hud(bool enable) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] djui_hud_set_render_behind_hud() is deprecated! Please use HOOK_ON_HUD_RENDER_BEHIND instead.");
if (!gLuaActiveMod) { return; }
gLuaActiveMod->renderBehindHud = enable;
}
struct ModAudio* audio_stream_load_url(UNUSED const char* url) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] audio_stream_load_url() is deprecated! There is no replacement for this function.");
return NULL;
}
f32 audio_stream_get_tempo(UNUSED struct ModAudio* audio) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] audio_stream_get_tempo() is deprecated! There may be a replacement for this function in the future.");
return 1;
}
void audio_stream_set_tempo(UNUSED struct ModAudio* audio, UNUSED f32 tempo) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] audio_stream_set_tempo() is deprecated! There may be a replacement for this function in the future.");
}
void audio_stream_set_speed(UNUSED struct ModAudio* audio, UNUSED f32 initial_freq, UNUSED f32 speed, UNUSED bool pitch) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] audio_stream_set_speed() is deprecated! There may be a replacement for this function in the future.");
}
f32 get_environment_region(u8 index) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] get_environment_region() is deprecated! Use get_water_level() instead.");
s32 idx = 6 * index;
if (gEnvironmentRegions != NULL && index > 0 && index <= gEnvironmentRegions[0] && gEnvironmentRegionsLength > idx) {
return gEnvironmentRegions[idx];
@ -53,7 +53,7 @@ f32 get_environment_region(u8 index) {
}
void set_environment_region(u8 index, s32 value) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] get_environment_region() is deprecated! Use set_water_level() instead.");
s32 idx = 6 * index;
if (gEnvironmentRegions != NULL && index > 0 && index <= gEnvironmentRegions[0] && gEnvironmentRegionsLength > idx) {
gEnvironmentRegions[idx] = value;
@ -61,7 +61,7 @@ void set_environment_region(u8 index, s32 value) {
}
void network_player_color_to_palette(struct NetworkPlayer *np, enum PlayerPart part, Color color) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] network_player_color_to_palette() is deprecated! Use network_player_set_override_palette_color() instead.");
if (np == NULL || !(part < PLAYER_PART_MAX && part >= 0)) { return; }
np->palette.parts[part][0] = color[0];
@ -71,7 +71,7 @@ void network_player_color_to_palette(struct NetworkPlayer *np, enum PlayerPart p
}
void network_player_palette_to_color(struct NetworkPlayer *np, enum PlayerPart part, Color out) {
smlua_mod_warning();
LOG_LUA_LINE_WARNING("[LUA] network_player_palette_to_color() is deprecated! Use network_player_get_palette_color() or network_player_get_override_palette_color() instead.");
if (np == NULL || !(part < PLAYER_PART_MAX && part >= 0)) {
if (np == NULL) { // output config palette instead if np is NULL
out[0] = configPlayerPalette.parts[part][0];