Skip to content

Commit dc26a57

Browse files
committed
Fix default config not loading on init
1 parent 7b7b566 commit dc26a57

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

src/Plugin.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,9 @@ public partial class Plugin : MVRScript
2424
public override void Init()
2525
{
2626
base.Init();
27-
2827
UIManager.Initialize(this);
2928

3029
_recorder = new BinaryDeviceRecorder();
31-
32-
try
33-
{
34-
try
35-
{
36-
var defaultPath = Array.Find(FileManagerSecure.GetFiles(PluginDir, "*.json"), s => s.EndsWith("default.json"));
37-
if (defaultPath != null)
38-
ConfigManager.LoadConfig(defaultPath, this);
39-
} catch { }
40-
}
41-
catch (Exception e)
42-
{
43-
SuperController.LogError("Exception caught: " + e);
44-
}
4530
}
4631

4732
public override void InitUI()
@@ -53,12 +38,14 @@ public override void InitUI()
5338
try
5439
{
5540
CreateUI();
56-
_initialized = true;
41+
ConfigManager.LoadConfig($@"{PluginDir}\default.json", this);
5742
}
5843
catch (Exception e)
5944
{
6045
SuperController.LogError("Exception caught: " + e);
6146
}
47+
48+
_initialized = true;
6249
}
6350

6451
protected void Update()

0 commit comments

Comments
 (0)