Exemple #1
0
 public override void LoadChildren()
 {
     Nodes.Clear();
     try
     {
         PAKFile f      = new PAKFile(Content);
         var     result = PAKLoader.LoadModels(f);
         foreach (var tuple in result.Models)
         {
             string subgroupName = tuple.Item1;
             Nodes.Add(new ModelTreeNode(subgroupName, ModelFetcher(subgroupName)));
         }
         foreach (var msg in result.Messages)
         {
             Nodes.Add(msg);
             if (!this.Text.EndsWith("!"))
             {
                 this.Text = this.Text + " !";
             }
         }
     }
     catch (Exception e)
     {
         Nodes.Add("!!! " + e.Message);
     }
 }
Exemple #2
0
 private Func <Model> ModelFetcher(string sub)
 {
     //I feel like I've done too much javascript when this is a solution...
     return(() => {
         PAKFile f = new PAKFile(Content);
         var result = PAKLoader.LoadModels(f);
         return result.Models.FirstOrDefault(t => t.Item1 == sub).Item2;
     });
 }