diff --git a/Dalamud.Boot/xivfixes.cpp b/Dalamud.Boot/xivfixes.cpp index 3bdf4fe23..bfbca7d8a 100644 --- a/Dalamud.Boot/xivfixes.cpp +++ b/Dalamud.Boot/xivfixes.cpp @@ -197,6 +197,10 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) { } } + // While at it, prevent game from entering restored mode if the game does not have window frames (borderless window/fullscreen.) + if (uMsg == WM_SIZE && wParam == SIZE_RESTORED && (GetWindowLongW(hWnd, GWL_STYLE) & WS_POPUP)) + return ShowWindow(hWnd, SW_MAXIMIZE); + return s_pfnGameWndProc(hWnd, uMsg, wParam, lParam); }); diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index ca9c34c91..9cb0784a1 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -8,7 +8,7 @@ - 7.4.4.0 + 7.4.4.1 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion) diff --git a/Dalamud/Logging/PluginLog.cs b/Dalamud/Logging/PluginLog.cs index a5aad330f..b2f2a5065 100644 --- a/Dalamud/Logging/PluginLog.cs +++ b/Dalamud/Logging/PluginLog.cs @@ -27,7 +27,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Log(Exception exception, string messageTemplate, params object[] values) + public static void Log(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -44,7 +44,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogVerbose(Exception exception, string messageTemplate, params object[] values) + public static void LogVerbose(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Verbose, messageTemplate, exception, values); /// @@ -61,7 +61,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogDebug(Exception exception, string messageTemplate, params object[] values) + public static void LogDebug(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Debug, messageTemplate, exception, values); /// @@ -78,7 +78,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogInformation(Exception exception, string messageTemplate, params object[] values) + public static void LogInformation(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -95,7 +95,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogWarning(Exception exception, string messageTemplate, params object[] values) + public static void LogWarning(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Warning, messageTemplate, exception, values); /// @@ -112,7 +112,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogError(Exception exception, string messageTemplate, params object[] values) + public static void LogError(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Error, messageTemplate, exception, values); /// @@ -129,7 +129,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogFatal(Exception exception, string messageTemplate, params object[] values) + public static void LogFatal(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Fatal, messageTemplate, exception, values); #endregion @@ -150,7 +150,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Verbose(Exception exception, string messageTemplate, params object[] values) + public static void Verbose(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Verbose, messageTemplate, exception, values); /// @@ -167,7 +167,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Debug(Exception exception, string messageTemplate, params object[] values) + public static void Debug(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Debug, messageTemplate, exception, values); /// @@ -184,7 +184,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Information(Exception exception, string messageTemplate, params object[] values) + public static void Information(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -201,7 +201,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Warning(Exception exception, string messageTemplate, params object[] values) + public static void Warning(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Warning, messageTemplate, exception, values); /// @@ -218,7 +218,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Error(Exception exception, string messageTemplate, params object[] values) + public static void Error(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Error, messageTemplate, exception, values); /// @@ -235,11 +235,25 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Fatal(Exception exception, string messageTemplate, params object[] values) + public static void Fatal(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Fatal, messageTemplate, exception, values); #endregion + /// + /// Log a message to the in-game log, setting level at runtime. + /// + /// + /// This method is primarily meant for interoperability with other logging systems that may want to be forwarded to + /// the PluginLog. + /// + /// The log level for this message. + /// An exception (if any) to include in this log message. + /// The message template. + /// Values to log. + public static void LogRaw(LogEventLevel level, Exception? exception, string messageTemplate, params object[] values) + => WriteLog(Assembly.GetCallingAssembly().GetName().Name, level, messageTemplate, exception, values); + private static ILogger GetPluginLogger(string? pluginName) { return Serilog.Log.ForContext("SourceContext", pluginName ?? string.Empty);