From e4ae9d9d7cb244bc13ff3bd7135f1fa9c263ad87 Mon Sep 17 00:00:00 2001 From: "Such Meme, Many Skill" Date: Sat, 21 Mar 2020 20:31:22 +0100 Subject: [PATCH] (untested) should hide errors in scripts --- source/tegraexplorer/gfx/gfxutils.c | 4 ++++ source/tegraexplorer/gfx/gfxutils.h | 4 +++- source/tegraexplorer/utils/script.c | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/tegraexplorer/gfx/gfxutils.c b/source/tegraexplorer/gfx/gfxutils.c index 146f72f..8d27e5e 100644 --- a/source/tegraexplorer/gfx/gfxutils.c +++ b/source/tegraexplorer/gfx/gfxutils.c @@ -9,6 +9,7 @@ #include "../../mem/heap.h" #include "../common/common.h" +int printerrors = true; void gfx_clearscreen(){ int battery = 0; @@ -43,6 +44,9 @@ int gfx_message(u32 color, const char* message, ...){ } int gfx_errDisplay(char *src_func, int err, int loc){ + if (!printerrors) + return 0; + gfx_clearscreen(); SWAPCOLOR(COLOR_ORANGE); gfx_printf("\nAn error occured:\n\n"); diff --git a/source/tegraexplorer/gfx/gfxutils.h b/source/tegraexplorer/gfx/gfxutils.h index 9689d08..64e8fa2 100644 --- a/source/tegraexplorer/gfx/gfxutils.h +++ b/source/tegraexplorer/gfx/gfxutils.h @@ -12,4 +12,6 @@ int gfx_errDisplay(char *src_func, int err, int loc); int gfx_makewaitmenu(char *hiddenmessage, int timer); void gfx_printlength(int size, char *toprint); void gfx_printandclear(char *in, int length); -void gfx_printfilesize(int size, char *type); \ No newline at end of file +void gfx_printfilesize(int size, char *type); + +extern int printerrors; \ No newline at end of file diff --git a/source/tegraexplorer/utils/script.c b/source/tegraexplorer/utils/script.c index 1fb3b5f..6caa565 100644 --- a/source/tegraexplorer/utils/script.c +++ b/source/tegraexplorer/utils/script.c @@ -158,6 +158,7 @@ int ParsePart(){ gfx_printf("Parsing error...\nPress any key to continue"); btn_wait(); forceExit = true; + printerrors = true; return -1; } @@ -189,6 +190,8 @@ void ParseScript(char* path){ return; } + printerrors = false; + while (!forceExit){ currentchar = GetNextByte(); @@ -279,5 +282,6 @@ void ParseScript(char* path){ } } + printerrors = true; f_close(&in); } \ No newline at end of file