Пример #1
0
        private void hexTextBox_Validated(object sender, EventArgs e)
        {
            OgmoColor col = color;

            OgmoParse.Parse(ref col, hexTextBox);
            Color = col;
        }
Пример #2
0
 public ColorChooser()
 {
     InitializeComponent();
     color                 = new OgmoColor(255, 255, 255);
     hexTextBox.Text       = color.ToString();
     colorButton.BackColor = color;
 }
Пример #3
0
 public ColorChooser()
 {
     InitializeComponent();
     color = new OgmoColor(255, 255, 255);
     hexTextBox.Text = color.ToString();
     colorButton.BackColor = color;
 }
Пример #4
0
 static public void Parse(ref OgmoColor to, TextBox box)
 {
     try
     {
         to = new OgmoColor(box.Text);
     }
     catch
     {
         box.Text = to.ToString();
     }
 }
Пример #5
0
        private void colorButton_Click(object sender, EventArgs e)
        {
            //Show the dialog
            ColorDialog dialog = new ColorDialog();
            dialog.Color = color;
            dialog.AllowFullOpen = true;

            //Handle cancel
            if (dialog.ShowDialog() == DialogResult.Cancel)
                return;

            //Get the new color
            Color = (OgmoColor)dialog.Color;
        }
Пример #6
0
        private void colorButton_Click(object sender, EventArgs e)
        {
            //Show the dialog
            ColorDialog dialog = new ColorDialog();

            dialog.Color         = color;
            dialog.AllowFullOpen = true;

            //Handle cancel
            if (dialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            //Get the new color
            Color = (OgmoColor)dialog.Color;
        }
Пример #7
0
        public Project()
        {
            //Default project properties
            Name                 = Ogmo.NEW_PROJECT_NAME;
            BackgroundColor      = OgmoColor.DefaultBackgroundColor;
            GridColor            = OgmoColor.DefaultGridColor;
            Filename             = "";
            LevelDefaultSize     = LevelMinimumSize = LevelMaximumSize = new Size(640, 480);
            CameraEnabled        = false;
            CameraSize           = new Size(640, 480);
            ExportCameraPosition = false;

            //Definitions
            LevelValueDefinitions = new List <ValueDefinition>();
            LayerDefinitions      = new List <LayerDefinition>();
            Tilesets          = new List <Tileset>();
            EntityDefinitions = new List <EntityDefinition>();
        }
Пример #8
0
        public Project()
        {
            //Default project properties
            Name = Ogmo.NEW_PROJECT_NAME;
            BackgroundColor = OgmoColor.DefaultBackgroundColor;
            GridColor = OgmoColor.DefaultGridColor;
            Filename = "";
            LevelDefaultSize = LevelMinimumSize = LevelMaximumSize = new Size(640, 480);
            CameraEnabled = false;
            CameraSize = new Size(640, 480);
            ExportCameraPosition = false;
            CustomPluginEntries = new SerializableDictionary<string, string>();

            //Definitions
            LevelValueDefinitions = new List<ValueDefinition>();
            LayerDefinitions = new List<LayerDefinition>();
            Tilesets = new List<Tileset>();
            EntityDefinitions = new List<EntityDefinition>();
        }
Пример #9
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;

            //Definitions
            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());
            }
        }
Пример #10
0
 public static void Parse(ref OgmoColor to, TextBox box)
 {
     try
     {
         to = new OgmoColor(box.Text);
     }
     catch
     {
         box.Text = to.ToString();
     }
 }
Пример #11
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());
        }
Пример #12
0
 private void hexTextBox_Validated(object sender, EventArgs e)
 {
     OgmoColor col = color;
     OgmoParse.Parse(ref col, hexTextBox);
     Color = col;
 }