예제 #1
0
        internal override void Deserialize(ModelBase model)
        {
            var parentProjectModel = (GMProjectParentModel)model;

            HiddenResources = parentProjectModel.hiddenResources;
            //AlteredResources.Deserialize(parentProjectModel.alteredResources);

            if (!string.IsNullOrEmpty(parentProjectModel.projectPath))
            {
                Reference = GMProject.Load(parentProjectModel.projectPath);
            }
        }
예제 #2
0
        private static void LoadSaveProject()
        {
            var rootDirectory = GetInput("Drag your project folder here");
            var project       = GMProject.Load(rootDirectory);

            var script0 = project.Resources.Get <GMScript>("script0");

            script0.Contents += "\r\n// Modified by YYP";

            var object0 = project.Resources.Get <GMObject>("object0");

            foreach (var @event in object0.Events)
            {
                @event.Contents += "\r\n// Modified by YYP";
            }

            project.Save();

            Console.WriteLine("Done!");
        }
예제 #3
0
        private static void LoadProject()
        {
            //var rootDirectory = @"${base_project}";
            var rootDirectory = GetInput("Drag your project folder here");
            var project       = GMProject.Load(rootDirectory);

            /*** Objects ***/
            //{
            //    foreach (var @object in project.Resources.GetAllOfType<GMObject>())
            //    {
            //        Console.WriteLine("OBJ {0}; Sprite = {1}", @object.Name, @object.Sprite?.Name ?? "<None>");
            //        foreach (var @event in @object.Events)
            //        {
            //            Console.WriteLine("EVNT {0} {1}", @event.EventType, @event.EventNumber);
            //            Console.WriteLine(@event.Contents);
            //        }
            //    }
            //}

            /*** Scripts ***/
            //{
            //    foreach (var script in project.Resources.GetAllOfType<GMScript>())
            //    {
            //        Console.WriteLine("SCR {0}", script.Name);
            //        Console.WriteLine(script.Contents);
            //    }
            //}

            /*** Sprites ***/
            //{
            //    foreach(var sprite in project.Resources.GetAllOfType<GMSprite>())
            //        Console.WriteLine("SPR {0} - {1}x{2}", sprite.Name, sprite.Width, sprite.Height);
            //}

            /*** Main Options ***/
            {
                var mainOptions = project.Resources.Get <GMMainOptions>();
                Console.WriteLine(mainOptions.ToJson());
                Console.WriteLine("GameGuid  = {0}", mainOptions.GameGuid);
                Console.WriteLine("GameSpeed = {0}", mainOptions.GameSpeed);

                Console.WriteLine("Texture Groups");
                foreach (var group in mainOptions.Graphics.TextureGroups)
                {
                    Console.WriteLine("{0}; Targets = {1}; Parent = {2}", group.Name, group.Targets, group.Parent?.Name ?? "<none>");
                }

                Console.WriteLine("Audio Group");
                foreach (var group in mainOptions.Audio.AudioGroups)
                {
                    Console.WriteLine("{0}; Targets = {1}", group.Name, group.Targets);
                }
            }

            /*** Windows Options ***/
            {
                var windowsOptions = project.Resources.Get <GMWindowsOptions>();
                if (windowsOptions != null)
                {
                    Console.WriteLine("Windows.DisplayName = {0}", windowsOptions.DisplayName);
                }
                else
                {
                    Console.WriteLine("Cannot find Windows options!");
                }
            }

            Console.WriteLine("Done");
        }
예제 #4
0
 public void SetAsBaseProject()
 {
     Reference = GMProject.Load("${base_project}");
 }