Skip to content

Commit

Permalink
Allow validation bypass from config importing
Browse files Browse the repository at this point in the history
  • Loading branch information
VolcanicArts committed Sep 15, 2024
1 parent 221bae4 commit 393cdf2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions VRCOSC.App/ChatBox/ChatBoxManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows;
using VRCOSC.App.ChatBox.Clips;
using VRCOSC.App.ChatBox.Clips.Variables;
using VRCOSC.App.ChatBox.Clips.Variables.Instances;
Expand Down Expand Up @@ -138,8 +139,25 @@ public void Deserialise(string filePathOverride = "", bool bypassValidation = fa

if (!chatBoxValidationSerialiser.IsValid)
{
Logger.Log("ChatBox could not validate all data");
ExceptionHandler.Handle("ChatBox could not load all data.\nThis is usually the fault of a module not loading correctly or a missing config.\nPlease make sure all your modules are up-to-date and have correct configs.");
if (!string.IsNullOrEmpty(filePathOverride))
{
Logger.Log("ChatBox could not validate all data when importing");

var result = MessageBox.Show("ChatBox could not import all data.\nThis is usually the fault of missing data from a module or module updates.\nPlease make sure all your modules are up-to-date and have correct configs.\n\nPress OK to import anyway", "ChatBox validation failed"
, MessageBoxButton.OKCancel, MessageBoxImage.Error);

if (result == MessageBoxResult.OK)
{
Logger.Log("Force importing the config");
Deserialise(filePathOverride, true);
}
}
else
{
Logger.Log("ChatBox could not validate all data");
ExceptionHandler.Handle("ChatBox could not load all data.\nThis is usually the fault of a module not loading correctly or a missing config.\nPlease make sure all your modules are up-to-date and have correct configs.");
}

return;
}
}
Expand Down

0 comments on commit 393cdf2

Please sign in to comment.