mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Reset script error timeout on network shutdown
This commit is contained in:
parent
6eae0e28d1
commit
26d979ae0a
3 changed files with 8 additions and 6 deletions
|
@ -21,7 +21,7 @@ static Gfx* sSavedDisplayListHead = NULL;
|
|||
struct DjuiRoot* gDjuiRoot = NULL;
|
||||
static struct DjuiText* sDjuiPauseOptions = NULL;
|
||||
static struct DjuiText* sDjuiLuaError = NULL;
|
||||
static u32 sDjuiLuaErrorTimeout = 0;
|
||||
u32 gDjuiLuaErrorTimeout = 0;
|
||||
bool gDjuiInMainMenu = true;
|
||||
bool gDjuiDisabled = false;
|
||||
bool gDjuiShuttingDown = false;
|
||||
|
@ -38,7 +38,7 @@ void djui_shutdown(void) {
|
|||
if (sDjuiLuaError) djui_base_destroy(&sDjuiLuaError->base);
|
||||
sDjuiPauseOptions = NULL;
|
||||
sDjuiLuaError = NULL;
|
||||
sDjuiLuaErrorTimeout = 0;
|
||||
gDjuiLuaErrorTimeout = 0;
|
||||
|
||||
if (gDjuiConsole) {
|
||||
djui_base_destroy(&gDjuiConsole->base);
|
||||
|
@ -129,7 +129,7 @@ void djui_lua_error(char* text, struct DjuiColor color) {
|
|||
djui_base_set_color(&sDjuiLuaError->base, color.r, color.g, color.b, color.a);
|
||||
djui_text_set_text(sDjuiLuaError, text);
|
||||
djui_base_set_visible(&sDjuiLuaError->base, true);
|
||||
sDjuiLuaErrorTimeout = 30 * 5;
|
||||
gDjuiLuaErrorTimeout = 30 * 5;
|
||||
}
|
||||
|
||||
void djui_reset_hud_params(void) {
|
||||
|
@ -163,9 +163,9 @@ void djui_render(void) {
|
|||
|
||||
djui_fps_display_render();
|
||||
|
||||
if (sDjuiLuaErrorTimeout > 0) {
|
||||
sDjuiLuaErrorTimeout--;
|
||||
if (sDjuiLuaErrorTimeout == 0) {
|
||||
if (gDjuiLuaErrorTimeout > 0) {
|
||||
gDjuiLuaErrorTimeout--;
|
||||
if (gDjuiLuaErrorTimeout == 0) {
|
||||
djui_base_set_visible(&sDjuiLuaError->base, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
extern struct DjuiRoot* gDjuiRoot;
|
||||
extern bool gDjuiInMainMenu;
|
||||
extern bool gDjuiDisabled;
|
||||
extern u32 gDjuiLuaErrorTimeout;
|
||||
|
||||
void djui_init(void);
|
||||
void djui_init_late(void);
|
||||
|
|
|
@ -730,6 +730,7 @@ void network_shutdown(bool sendLeaving, bool exiting, bool popup, bool reconnect
|
|||
|
||||
reset_window_title();
|
||||
|
||||
gDjuiLuaErrorTimeout = 0;
|
||||
djui_panel_shutdown();
|
||||
extern bool gDjuiInMainMenu;
|
||||
if (!gDjuiInMainMenu) {
|
||||
|
|
Loading…
Reference in a new issue