Misc fixes and cleanup

This commit is contained in:
Agent X 2023-11-10 19:12:21 -05:00
parent 8e5ffe9467
commit 140d50ebb2
15 changed files with 79 additions and 99 deletions

View file

@ -62,7 +62,7 @@ override_field_names = {
override_field_types = {
"Surface": { "normal": "Vec3f" },
"Object": { "oAnimations": "ObjectAnimPointer*"},
"Object": { "oAnimations": "ObjectAnimPointer*" },
}
override_field_mutable = {

View file

@ -374,6 +374,3 @@ REFRESHING = "Obnovování..."
ENTER_PASSWORD = "Zadejte heslo soukromé hry:"
SEARCH = "Hledat"
NONE_FOUND = "Nebyly nalezeny žádné hry."
[LOADING_SCREEN]
LOADING = "Načítání"

View file

@ -374,6 +374,3 @@ REFRESHING = "herladen..."
ENTER_PASSWORD = "Typ het wachtwoord van de privé lobby:"
SEARCH = "Zoek"
NONE_FOUND = "Er zijn geen lobby's gevonden."
[LOADING_SCREEN]
LOADING = "Bezig met laden"

View file

@ -374,6 +374,3 @@ REFRESHING = "Refreshing..."
ENTER_PASSWORD = "Enter the private lobby's password:"
SEARCH = "Search"
NONE_FOUND = "No lobbies were found."
[LOADING_SCREEN]
LOADING = "Loading"

View file

@ -374,6 +374,3 @@ REFRESHING = "Actualisation..."
ENTER_PASSWORD = "Entrez le mot de passe de la partie:"
SEARCH = "Rechercher"
NONE_FOUND = "Aucune partie n'a été trouvée."
[LOADING_SCREEN]
LOADING = "Chargement"

View file

@ -374,6 +374,3 @@ REFRESHING = "Aktualisiere..."
ENTER_PASSWORD = "Gib das Passwort für die Lobby ein:"
SEARCH = "Suchen"
NONE_FOUND = "Keine Lobbys gefunden."
[LOADING_SCREEN]
LOADING = "Wird geladen"

View file

@ -371,6 +371,3 @@ REFRESHING = "Refreshing..."
ENTER_PASSWORD = "Enter the private lobby's password:"
SEARCH = "Search"
NONE_FOUND = "No lobbies were found."
[LOADING_SCREEN]
LOADING = "Caricamento"

View file

@ -374,6 +374,3 @@ REFRESHING = "Recarregando..."
ENTER_PASSWORD = "Coloque a senha para a partida privada:"
SEARCH = "Pesquisar"
NONE_FOUND = "Nenhuma partida foi encontrada."
[LOADING_SCREEN]
LOADING = "Carregando"

View file

@ -373,6 +373,3 @@ REFRESHING = "Обновление..."
ENTER_PASSWORD = "Введите пароль закрытой группы:"
SEARCH = "Поиск"
NONE_FOUND = "Группы не найдены."
[LOADING_SCREEN]
LOADING = "Загрузка"

View file

@ -52,10 +52,11 @@ static void fish_spawner_act_spawn(void) {
* Mario is more than 2000 units higher.
*/
void fish_spawner_act_idle(void) {
struct Object *player = nearest_player_to_object(o);
if ((gCurrLevelNum != LEVEL_SA) && (player->oPosY - o->oPosY > 2000.0f)) {
o->oAction = FISH_SPAWNER_ACT_RESPAWN;
}
// due to the lack of draw distance, you can see fish flickering to random positions from higher up, therefore it would be better to disable this.
// struct Object *player = nearest_player_to_object(o);
// if ((gCurrLevelNum != LEVEL_SA) && (player->oPosY - o->oPosY > 2000.0f)) {
// o->oAction = FISH_SPAWNER_ACT_RESPAWN;
// }
}
/**

View file

@ -358,17 +358,18 @@ static void newcam_rotate_button(void) {
}
newcam_framessincec[1] = 0;
}
if ((gPlayer1Controller->buttonPressed & U_CBUTTONS) && !(gPlayer1Controller->buttonPressed & (L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)) && newcam_modeflags & NC_FLAG_YTURN && !(newcam_modeflags & NC_FLAG_8D) && newcam_analogue == 0) {
if (newcam_framessincec[1] < 3 && gMarioState->action & ACT_FLAG_ALLOW_FIRST_PERSON) {
gCameraMovementFlags |= CAM_MOVE_C_UP_MODE;
#ifndef nosound
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
#endif
newcam_init_settings();
return;
}
newcam_framessincec[1] = 0;
}
// TODO: find a better way to do this
// if ((gPlayer1Controller->buttonPressed & U_CBUTTONS) && newcam_modeflags & NC_FLAG_YTURN && !(newcam_modeflags & NC_FLAG_8D) && newcam_analogue == 0) {
// if (newcam_framessincec[1] < 3 && gMarioState->action & ACT_FLAG_ALLOW_FIRST_PERSON) {
// gCameraMovementFlags |= CAM_MOVE_C_UP_MODE;
// #ifndef nosound
// play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
// #endif
// newcam_init_settings();
// return;
// }
// newcam_framessincec[1] = 0;
// }
//There's not much point in keeping this behind a check, but it wouldn't hurt, just incase any 2player shenanigans ever happen, it makes it easy to disable.

View file

@ -73,7 +73,7 @@ static bool loading_screen_on_render(struct DjuiBase* base) {
{
// Loading... text
char* loadingStr = DLANG(LOADING_SCREEN, LOADING);
char* loadingStr = "Loading";
char tmp[20] = "";
switch ((u8) floor(clock_elapsed()) % 3) {
case 0: snprintf(tmp, 20, "%s...", loadingStr); break;
@ -153,7 +153,7 @@ void render_loading_screen(void) {
djui_base_set_color(&text->base, 200, 200, 200, 255);
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);
djui_text_set_font(text, gDjuiFonts[0]);
djui_text_set_font_scale(text, gDjuiFonts[0]->defaultFontScale * 2);
djui_text_set_font_scale(text, gDjuiFonts[0]->defaultFontScale * 1.5f);
load->loadingDesc = text;
}

View file

@ -81,22 +81,15 @@ void djui_reset_popup_disabled_override(void) {
///
void hud_hide(void) {
gOverrideHideHud = TRUE;
}
void hud_show(void) {
gOverrideHideHud = FALSE;
}
bool hud_is_hidden(void) {
return gOverrideHideHud;
void log_to_console(const char* message) {
djui_console_message_create(message);
}
///
void log_to_console(const char* message) {
djui_console_message_create((char*)message);
extern s8 gDialogBoxState;
s8 get_dialog_box_state(void) {
return gDialogBoxState;
}
///
@ -148,12 +141,17 @@ void set_save_file_modified(bool value) {
///
extern s8 gDialogBoxState;
s8 get_dialog_box_state(void) {
return gDialogBoxState;
void hud_hide(void) {
gOverrideHideHud = TRUE;
}
///
void hud_show(void) {
gOverrideHideHud = FALSE;
}
bool hud_is_hidden(void) {
return gOverrideHideHud;
}
s32 hud_get_value(enum HudDisplayValue type) {
switch (type) {
@ -192,16 +190,16 @@ void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height) {
extern const u8 texture_power_meter_two_segments[];
extern const u8 texture_power_meter_one_segments[];
static struct TextureInfo sPowerMeterTexturesInfo[] = {
{ (u8*)texture_power_meter_left_side, 8, 32, 64 },
{ (u8*)texture_power_meter_right_side, 8, 32, 64 },
{ (u8*)texture_power_meter_one_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_two_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_three_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_four_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_five_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_six_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_seven_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_full, 8, 32, 32 },
{ (u8*)texture_power_meter_left_side, 8, 32, 64, "texture_power_meter_left_side" },
{ (u8*)texture_power_meter_right_side, 8, 32, 64, "texture_power_meter_right_side" },
{ (u8*)texture_power_meter_one_segments, 8, 32, 32, "texture_power_meter_one_segments" },
{ (u8*)texture_power_meter_two_segments, 8, 32, 32, "texture_power_meter_two_segments" },
{ (u8*)texture_power_meter_three_segments, 8, 32, 32, "texture_power_meter_three_segments" },
{ (u8*)texture_power_meter_four_segments, 8, 32, 32, "texture_power_meter_four_segments" },
{ (u8*)texture_power_meter_five_segments, 8, 32, 32, "texture_power_meter_five_segments" },
{ (u8*)texture_power_meter_six_segments, 8, 32, 32, "texture_power_meter_six_segments" },
{ (u8*)texture_power_meter_seven_segments, 8, 32, 32, "texture_power_meter_seven_segments" },
{ (u8*)texture_power_meter_full, 8, 32, 32, "texture_power_meter_full" },
};
djui_hud_render_texture(&sPowerMeterTexturesInfo[0], x, y, width / 64, height / 64);
djui_hud_render_texture(&sPowerMeterTexturesInfo[1], x + (width - 2) / 2, y, width / 64, height / 64);
@ -210,6 +208,7 @@ void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height) {
djui_hud_render_texture(&sPowerMeterTexturesInfo[numWedges + 1], x + (width - 4) / 4, y + height / 4, width / 64, height / 64);
}
}
void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height) {
extern const u8 texture_power_meter_left_side[];
extern const u8 texture_power_meter_right_side[];
@ -222,16 +221,16 @@ void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 p
extern const u8 texture_power_meter_two_segments[];
extern const u8 texture_power_meter_one_segments[];
static struct TextureInfo sPowerMeterTexturesInfo[] = {
{ (u8*)texture_power_meter_left_side, 8, 32, 64 },
{ (u8*)texture_power_meter_right_side, 8, 32, 64 },
{ (u8*)texture_power_meter_one_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_two_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_three_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_four_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_five_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_six_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_seven_segments, 8, 32, 32 },
{ (u8*)texture_power_meter_full, 8, 32, 32 },
{ (u8*)texture_power_meter_left_side, 8, 32, 64, "texture_power_meter_left_side" },
{ (u8*)texture_power_meter_right_side, 8, 32, 64, "texture_power_meter_right_side" },
{ (u8*)texture_power_meter_one_segments, 8, 32, 32, "texture_power_meter_one_segments" },
{ (u8*)texture_power_meter_two_segments, 8, 32, 32, "texture_power_meter_two_segments" },
{ (u8*)texture_power_meter_three_segments, 8, 32, 32, "texture_power_meter_three_segments" },
{ (u8*)texture_power_meter_four_segments, 8, 32, 32, "texture_power_meter_four_segments" },
{ (u8*)texture_power_meter_five_segments, 8, 32, 32, "texture_power_meter_five_segments" },
{ (u8*)texture_power_meter_six_segments, 8, 32, 32, "texture_power_meter_six_segments" },
{ (u8*)texture_power_meter_seven_segments, 8, 32, 32, "texture_power_meter_seven_segments" },
{ (u8*)texture_power_meter_full, 8, 32, 32, "texture_power_meter_full" },
};
djui_hud_render_texture_interpolated(&sPowerMeterTexturesInfo[0],

View file

@ -4,11 +4,6 @@
#include "dialog_ids.h"
#include "game/camera.h"
u32 get_network_area_timer(void);
s32* get_temp_s32_pointer(s32 initialValue);
s32 deref_s32_pointer(s32* pointer);
enum HudDisplayValue {
HUD_DISPLAY_LIVES,
HUD_DISPLAY_COINS,
@ -42,11 +37,32 @@ struct DateTime {
s32 second;
};
u32 get_network_area_timer(void);
s32* get_temp_s32_pointer(s32 initialValue);
s32 deref_s32_pointer(s32* pointer);
void djui_popup_create_global(const char* message, int lines);
void log_to_console(const char* message);
bool djui_is_popup_disabled(void);
void djui_set_popup_disabled_override(bool value);
void djui_reset_popup_disabled_override(void);
void log_to_console(const char* message);
s8 get_dialog_box_state(void);
s16 get_dialog_id(void);
s32 get_last_star_or_key(void);
void set_last_star_or_key(u8 value);
u8 get_last_completed_course_num(void);
void set_last_completed_course_num(u8 courseNum);
u8 get_last_completed_star_num(void);
void set_last_completed_star_num(u8 starNum);
bool get_got_file_coin_hi_score(void);
void set_got_file_coin_hi_score(bool value);
bool get_save_file_modified(void);
void set_save_file_modified(bool value);
void hud_hide(void);
void hud_show(void);
bool hud_is_hidden(void);
@ -89,19 +105,6 @@ void camera_config_set_deceleration(u32 value);
bool is_game_paused(void);
bool is_transition_playing(void);
s8 get_dialog_box_state(void);
s16 get_dialog_id(void);
s32 get_last_star_or_key(void);
void set_last_star_or_key(u8 value);
u8 get_last_completed_course_num(void);
void set_last_completed_course_num(u8 courseNum);
u8 get_last_completed_star_num(void);
void set_last_completed_star_num(u8 starNum);
bool get_got_file_coin_hi_score(void);
void set_got_file_coin_hi_score(bool value);
bool get_save_file_modified(void);
void set_save_file_modified(bool value);
u32 allocate_mario_action(u32 actFlags);
f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);

View file

@ -157,7 +157,7 @@ static u32 mods_count_directory(char* modsBasePath) {
}
static void mods_load(struct Mods* mods, char* modsBasePath, bool isUserModPath) {
if (gIsThreaded) { REFRESH_MUTEX(snprintf(gCurrLoadingSegment.str, 256, "Generating DynOS Packs In %s Path (%s)", isUserModPath ? "User" : "Local", modsBasePath)); }
if (gIsThreaded) { REFRESH_MUTEX(snprintf(gCurrLoadingSegment.str, 256, "Generating DynOS Packs In %s Path", isUserModPath ? "User" : "Local")); }
// generate bins
dynos_generate_packs(modsBasePath);
@ -186,7 +186,7 @@ static void mods_load(struct Mods* mods, char* modsBasePath, bool isUserModPath)
return;
}
f32 count = (f32) mods_count_directory(modsBasePath);
if (gIsThreaded) { REFRESH_MUTEX(snprintf(gCurrLoadingSegment.str, 256, "Loading Mods In %s Mod Path (%s)", isUserModPath ? "User" : "Local", modsBasePath)); }
if (gIsThreaded) { REFRESH_MUTEX(snprintf(gCurrLoadingSegment.str, 256, "Loading Mods In %s Mod Path", isUserModPath ? "User" : "Local")); }
// iterate
char path[SYS_MAX_PATH] = { 0 };