TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ MessageBoxShow()

static void Terraria.ModLoader.Engine.ErrorReporting.MessageBoxShow ( string message,
bool fatal = false )
inlinestaticpackage

Definition at line 14 of file ErrorReporting.cs.

15 {
16 string title = ModLoader.versionedName + (fatal ? " Error" : " Fatal Error");
17 string logDir = Path.GetFullPath(Logging.LogDir);
18 string logFileName = ((Logging.LogPath == null) ? "Natives.log" : Path.GetFileName(Logging.LogPath));
19 string logHint = Language.GetTextValue("tModLoader.LogPathHint", logFileName, logDir);
20 if (Language.ActiveCulture == null)
21 {
22 logHint = $"A {logFileName} file containing error information has been generated in\n{logDir}\n(You will need to share this file if asking for help)";
23 }
24 message = message + "\n\n" + logHint;
25 try
26 {
27 Console.ForegroundColor = ConsoleColor.Red;
28 Console.Out.WriteLine(title + "\n" + message);
29 SDL.SDL_ShowSimpleMessageBox((SDL_MessageBoxFlags)16, title, message, IntPtr.Zero);
30 }
31 catch
32 {
33 }
34 }
static GameCulture ActiveCulture
The language the game is currently using.
Definition Language.cs:16
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
@ Console
Command can be used in server console during MP.

References Terraria.Localization.Language.ActiveCulture, Terraria.ModLoader.Console, Terraria.Localization.Language.GetTextValue(), Terraria.ModLoader.Logging.LogDir, and Terraria.ModLoader.Logging.LogPath.

Referenced by Terraria.ModLoader.Engine.ErrorReporting.FatalExit(), Terraria.UI.FancyErrorPrinter.ShowDirectoryCreationFailError(), Terraria.UI.FancyErrorPrinter.ShowFailedToLoadAssetError(), and Terraria.UI.FancyErrorPrinter.ShowFileSavingFailError().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: