mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Code refactor
This commit is contained in:
parent
5ca7e486f8
commit
e14a12f2ab
310 changed files with 4875 additions and 4102 deletions
|
@ -16,9 +16,10 @@ namespace RimWorldAnimationStudio
|
|||
public DialogBox newAnimationDialog;
|
||||
public SelectAnimationDialog selectAnimationDialog;
|
||||
|
||||
public void Start()
|
||||
public void Awake()
|
||||
{
|
||||
LoadPawnRaceDefs();
|
||||
LoadActorAddonDefs();
|
||||
LoadCustomArrays();
|
||||
}
|
||||
|
||||
|
@ -40,7 +41,7 @@ namespace RimWorldAnimationStudio
|
|||
if (paths == null || paths.Any() == false)
|
||||
{ Debug.LogWarning("Selected file was null or invalid"); return; }
|
||||
|
||||
AnimationDefs defs = null;
|
||||
AnimationDefs defs = XmlUtility.ReadXML<AnimationDefs>(paths[0]);
|
||||
|
||||
try
|
||||
{ defs = XmlUtility.ReadXML<AnimationDefs>(paths[0]); }
|
||||
|
@ -248,10 +249,9 @@ namespace RimWorldAnimationStudio
|
|||
else
|
||||
{ path = Path.Combine(Application.streamingAssetsPath, "pawnRaceDefs.xml"); }
|
||||
|
||||
if (File.Exists(path) == false)
|
||||
{ SavePawnRaceDefs(); return; }
|
||||
|
||||
PawnRaceDefs.allDefs = XmlUtility.ReadXML<List<PawnRaceDef>>(path);
|
||||
SavePawnRaceDefs();
|
||||
|
||||
PawnRaceDefs.OnLoad();
|
||||
}
|
||||
|
||||
|
@ -261,5 +261,26 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
XmlUtility.WriteXML(PawnRaceDefs.allDefs, path);
|
||||
}
|
||||
|
||||
public void LoadActorAddonDefs()
|
||||
{
|
||||
string path;
|
||||
|
||||
if (File.Exists(Path.Combine(Application.persistentDataPath, "actorAddonDefs.xml")))
|
||||
{ path = Path.Combine(Application.persistentDataPath, "actorAddonDefs.xml"); }
|
||||
|
||||
else
|
||||
{ path = Path.Combine(Application.streamingAssetsPath, "actorAddonDefs.xml"); }
|
||||
|
||||
ActorAddonDefs.allDefs = XmlUtility.ReadXML<List<ActorAddonDef>>(path);
|
||||
SaveActorAddonDefs();
|
||||
|
||||
ActorAddonDefs.OnLoad();
|
||||
}
|
||||
|
||||
public void SaveActorAddonDefs()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue