v1.0.3.0: Alliance frames fixes, PvP support, shared hotbar persistence, config save on teleport
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -290,16 +290,26 @@ namespace HSUI.Config.Tree
|
||||
Type type = ConfigObject.GetType();
|
||||
ImportData? importData = ProfilesManager.Instance?.DefaultImportData(type);
|
||||
|
||||
if (importData == null)
|
||||
PluginConfigObject? config = null;
|
||||
if (importData != null)
|
||||
{
|
||||
Plugin.Logger.Error("Error finding default import data for type " + type.ToString());
|
||||
return;
|
||||
config = importData.GetObject();
|
||||
}
|
||||
|
||||
PluginConfigObject? config = importData.GetObject();
|
||||
if (config == null)
|
||||
{
|
||||
Plugin.Logger.Error("Error importing default import data for type " + type.ToString());
|
||||
// Fallback: invoke static DefaultConfig() when no import data (e.g. new config types not yet in Default.HSUI)
|
||||
MethodInfo? defaultConfigMethod = type.GetMethod("DefaultConfig", BindingFlags.Public | BindingFlags.Static);
|
||||
if (defaultConfigMethod != null && defaultConfigMethod.ReturnType != typeof(void))
|
||||
{
|
||||
object? result = defaultConfigMethod.Invoke(null, null);
|
||||
config = result as PluginConfigObject;
|
||||
}
|
||||
}
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
Plugin.Logger.Error("Error resetting config for type " + type.ToString() + " (no import data and no DefaultConfig)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user