Beispiel #1
0
        private void VolutarMcdEditMenuItem_Click(object sender, EventArgs e)
        {
            if ((Map as XCMapFile) != null)
            {
                var pathService = new VolutarSettingService(Settings);

                var path = pathService.GetEditorFilePath();

                if (!string.IsNullOrEmpty(path))
                {
                    Process.Start(new ProcessStartInfo(path));
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Opens MCDEdit.exe or any program or file specified in Settings.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnVolutarMcdEditorClick(object sender, EventArgs e)
        {
            if ((MapBase as MapFileChild) != null)
            {
                var service    = new VolutarSettingService(Options);
                var pfeService = service.FullPath;                      // this will invoke a box for the user to input the
                // executable's path if it doesn't exist in Options.
                if (File.Exists(pfeService))
                {
                    // change to MCDEdit dir so that accessing MCDEdit.txt doesn't cause probls.
                    string dirService = Path.GetDirectoryName(pfeService);
                    Directory.SetCurrentDirectory(dirService);

                    Process.Start(new ProcessStartInfo(pfeService));

                    // change back to app dir
                    Directory.SetCurrentDirectory(SharedSpace.Instance.GetShare(SharedSpace.ApplicationDirectory));
                }
            }
        }
Beispiel #3
0
        public override void LoadDefaultSettings()
        {
            brushes = new Hashtable();

            ValueChangedDelegate bc = BrushChanged;
            var settings            = Settings;

            foreach (string s in Enum.GetNames(typeof(SpecialType)))
            {
                brushes[s] = new SolidBrush(TilePanel.tileTypes[(int)Enum.Parse(typeof(SpecialType), s)]);
                settings.AddSetting(
                    s,
                    ((SolidBrush)brushes[s]).Color,
                    "Color of specified tile type",
                    "TileView",
                    bc,
                    false,
                    null);
            }
            VolutarSettingService.LoadDefaultSettings(settings);

            TilePanel.Colors = brushes;
        }
Beispiel #4
0
        /// <summary>
        /// Loads default options for TileView screen.
        /// </summary>
        protected internal override void LoadControl0Options()
        {
            string desc = String.Empty;

            foreach (string specialType in Enum.GetNames(typeof(SpecialType)))
            {
                int i = (int)Enum.Parse(typeof(SpecialType), specialType);
                _brushesSpecial[specialType] = new SolidBrush(TileColors[i]);

                switch (i)
                {
                case  0: desc = "Color of (standard tile)";
                    break;

                case  1: desc = "Color of (entry point)";
                    break;

                case  2: desc = "Color of UFO Power Source - UFO" + Environment.NewLine
                                + "Color of Ion-beam Accelerators - TFTD";
                    break;

                case  3: desc = "Color of UFO Navigation - UFO" + Environment.NewLine
                                + "Color of (destroy objective) (alias of Magnetic Navigation) - TFTD";
                    break;

                case  4: desc = "Color of UFO Construction - UFO" + Environment.NewLine
                                + "Color of Magnetic Navigation (alias of Alien Sub Construction) - TFTD";
                    break;

                case  5: desc = "Color of Alien Food - UFO" + Environment.NewLine
                                + "Color of Alien Cryogenics - TFTD";
                    break;

                case  6: desc = "Color of Alien Reproduction - UFO" + Environment.NewLine
                                + "Color of Alien Cloning - TFTD";
                    break;

                case  7: desc = "Color of Alien Entertainment - UFO" + Environment.NewLine
                                + "Color of Alien Learning Arrays - TFTD";
                    break;

                case  8: desc = "Color of Alien Surgery - UFO" + Environment.NewLine
                                + "Color of Alien Implanter - TFTD";
                    break;

                case  9: desc = "Color of Examination Room - UFO" + Environment.NewLine
                                + "Color of (unknown) (alias of Examination Room) - TFTD";
                    break;

                case 10: desc = "Color of Alien Alloys - UFO" + Environment.NewLine
                                + "Color of Aqua Plastics - TFTD";
                    break;

                case 11: desc = "Color of Alien Habitat - UFO" + Environment.NewLine
                                + "Color of Examination Room (alias of Alien Re-animation Zone) - TFTD";
                    break;

                case 12: desc = "Color of (dead tile)";
                    break;

                case 13: desc = "Color of (exit point)";
                    break;

                case 14: desc = "Color of (must destroy tile)" + Environment.NewLine
                                + "Alien Brain - UFO" + Environment.NewLine
                                + "T'leth Power Cylinders - TFTD";
                    break;
                }

                // NOTE: The colors of these brushes get overwritten by the
                // Option settings somewhere/how between here and their actual
                // use in TilePanel.OnPaint(). That is, this only sets default
                // colors and might not even be very useful other than as
                // perhaps for placeholder-key(s) for the actual values that
                // are later retrieved from Options ....
                //
                // See OnSpecialPropertyColorChanged() below_
                Options.AddOption(
                    specialType,
                    ((SolidBrush)_brushesSpecial[specialType]).Color,
                    desc,                                                               // appears as a tip at the bottom of the Options screen.
                    "TileBackgroundColors",                                             // this identifies what Option category the setting appears under.
                    OnSpecialPropertyColorChanged);
            }
            TilePanel.SetSpecialPropertyBrushes(_brushesSpecial);

            VolutarSettingService.LoadOptions(Options);
        }