Esempio n. 1
0
        //Optimisation to avoid some copying
        public static void ParseToTable(Dictionary <string, Script> table, string path)
        {
            var anm = new AnmFile();

            anm.Scripts = table;
            foreach (IntermediateNode node in parseFile(path))
            {
                switch (node.Name.ToLowerInvariant())
                {
                case "animation":
                    anm.Load(node, null);
                    break;

                default: throw new Exception("Invalid Node in anm root: " + node.Name);
                }
            }
        }
Esempio n. 2
0
 void SkeletonPanel()
 {
     if (ImGui.Button("Open Anm"))
     {
         var file = FileDialog.Open();
         if (file == null)
         {
             return;
         }
         anmFile = new Anm.AnmFile(file);
     }
     if (anmFile != null)
     {
         ImGui.Separator();
         foreach (var script in anmFile.Scripts)
         {
             if (ImGui.Button(script.Key))
             {
                 skinning.SetPose(script.Value);
             }
         }
     }
 }
Esempio n. 3
0
 void SkeletonPanel()
 {
     ImGui.Checkbox("Draw Skeleton", ref drawSkeleton);
     if (ImGui.Button("Open Anm"))
     {
         var file = FileDialog.Open();
         if (file == null)
         {
             return;
         }
         anmFile = new Anm.AnmFile(file);
     }
     if (anmFile != null)
     {
         ImGui.Separator();
         foreach (var script in anmFile.Scripts)
         {
             var popup = $"{script.Key}Popup";
             if (ImGui.Button(script.Key))
             {
                 skel.StartScript(script.Value, 0, 1, 0);
             }
             if (ImGui.IsItemClicked(1))
             {
                 ImGui.OpenPopup(popup);
             }
             if (ImGui.BeginPopupContextItem(popup))
             {
                 if (ImGui.MenuItem("Copy Nickname"))
                 {
                     _window.SetClipboardText(script.Key);
                 }
                 ImGui.EndPopup();
             }
         }
     }
 }
Esempio n. 4
0
 void SkeletonPanel()
 {
     ImGui.Checkbox("Draw Skeleton", ref drawSkeleton);
     if (ImGui.Button("Open Anm"))
     {
         var file = FileDialog.Open();
         if (file == null)
         {
             return;
         }
         anmFile = new Anm.AnmFile(file);
     }
     if (anmFile != null)
     {
         ImGui.Separator();
         foreach (var script in anmFile.Scripts)
         {
             if (ImGui.Button(script.Key))
             {
                 skel.StartScript(script.Value, 0, 1, 0);
             }
         }
     }
 }