Ejemplo n.º 1
0
 public void UnloadProject()
 {
     this.m_Project = null;
     this.m_Level = null;
     this.RecheckMenuEligibility();
 }
Ejemplo n.º 2
0
 public void LoadProject(Project project)
 {
     this.m_Project = project;
     this.RecheckMenuEligibility();
 }
Ejemplo n.º 3
0
 public void NewProject(Project project)
 {
 }
Ejemplo n.º 4
0
        /*
         *  Ogmo event Callbacks
         */
        private void onProjectStart(Project project)
        {
            //Enable menu items
            newProjectToolStripMenuItem.Enabled = false;
            openProjectToolStripMenuItem.Enabled = false;
            closeProjectToolStripMenuItem.Enabled = true;
            editProjectToolStripMenuItem.Enabled = true;

            levelToolStripMenuItem.Enabled = true;
            viewToolStripMenuItem.Enabled = true;
        }
Ejemplo n.º 5
0
 public void EditProject(Project project, AddTabCallback addTab)
 {
     TabPage tab = new TabPage("Protogame");
     tab.Controls.Add(new ProjectEditorTab(this, project) { Dock = DockStyle.Fill });
     addTab(tab);
 }
Ejemplo n.º 6
0
        private void onProjectClose(Project project)
        {
            //Disable menu items
            newProjectToolStripMenuItem.Enabled = true;
            openProjectToolStripMenuItem.Enabled = true;
            closeProjectToolStripMenuItem.Enabled = false;
            editProjectToolStripMenuItem.Enabled = false;

            levelToolStripMenuItem.Enabled = false;
            viewToolStripMenuItem.Enabled = false;

            //Clear mouse/grid readouts
            MouseCoordinatesLabel.Text = GridCoordinatesLabel.Text = "";
        }
Ejemplo n.º 7
0
        public void CloneFrom(Project copy)
        {
            //Default project properties
            OgmoVersion = copy.OgmoVersion;
            Name = copy.Name;
            BackgroundColor = copy.BackgroundColor;
            GridColor = copy.GridColor;
            Filename = copy.Filename;
            LevelDefaultSize = copy.LevelDefaultSize;
            LevelMinimumSize = copy.LevelMinimumSize;
            LevelMaximumSize = copy.LevelMaximumSize;
            AngleMode = copy.AngleMode;
            CameraEnabled = copy.CameraEnabled;
            CameraSize = copy.CameraSize;
            ExportCameraPosition = copy.ExportCameraPosition;
            CustomPluginEntries = copy.CustomPluginEntries;

            //Definitions
            CustomPluginEntries = new SerializableDictionary<string, string>();
            foreach (var d in copy.CustomPluginEntries)
                CustomPluginEntries.Add(d.Key, d.Value);

            LevelValueDefinitions = new List<ValueDefinition>();
            foreach (var d in copy.LevelValueDefinitions)
                LevelValueDefinitions.Add(d.Clone());

            LayerDefinitions = new List<LayerDefinition>();
            foreach (var d in copy.LayerDefinitions)
                LayerDefinitions.Add(d.Clone());

            Tilesets = new List<Tileset>();
            foreach (var d in copy.Tilesets)
                Tilesets.Add(d.Clone());

            EntityDefinitions = new List<EntityDefinition>();
            foreach (var d in copy.EntityDefinitions)
                EntityDefinitions.Add(d.Clone());
        }
Ejemplo n.º 8
0
        public static void UpdateRecentProjects(Project project)
        {
            for (int i = 0; i < Properties.Settings.Default.RecentProjects.Count; i++)
            {
                if (Properties.Settings.Default.RecentProjects[i] == project.Filename)
                {
                    Properties.Settings.Default.RecentProjects.RemoveAt(i);
                    Properties.Settings.Default.RecentProjectNames.RemoveAt(i);
                    break;
                }
            }

            Properties.Settings.Default.RecentProjects.Insert(0, project.Filename);
            Properties.Settings.Default.RecentProjectNames.Insert(0, project.Name);
            if (Properties.Settings.Default.RecentProjects.Count > RECENT_PROJECT_LIMIT)
            {
                Properties.Settings.Default.RecentProjects.RemoveAt(RECENT_PROJECT_LIMIT);
                Properties.Settings.Default.RecentProjectNames.RemoveAt(RECENT_PROJECT_LIMIT);
            }
        }
Ejemplo n.º 9
0
        public static void StartProject(Project project)
        {
            Ogmo.MainWindow.RemoveStartPage();

            Project = project;

            //Call the added event
            if (OnProjectStart != null)
                OnProjectStart(project);
        }
Ejemplo n.º 10
0
 /*
  *  Project stuff
  */
 public static void NewProject()
 {
     Project = new Project();
     Project.InitDefault();
     if (Project.SaveAs())
     {
         StartProject(Project);
         EditProject(ProjectEditMode.NewProject);
     }
     PluginLoader.FireNewProject(Project);
 }