コード例 #1
0
        /// <summary>
        /// cTor. Instantiates the TileView viewer and its pages/panels.
        /// </summary>
        internal TileView()
        {
            InitializeComponent();

            tcTileTypes.SelectedIndexChanged += OnSelectedIndexChanged;

            _allTiles = new TilePanel(PartType.All);
            var floors     = new TilePanel(PartType.Ground);
            var westwalls  = new TilePanel(PartType.WestWall);
            var northwalls = new TilePanel(PartType.NorthWall);
            var content    = new TilePanel(PartType.Object);

            _panels = new[]
            {
                _allTiles,
                floors,
                westwalls,
                northwalls,
                content
            };

            AddPanel(_allTiles, tpAll);
            AddPanel(floors, tpFloors);
            AddPanel(westwalls, tpWestwalls);
            AddPanel(northwalls, tpNorthwalls);
            AddPanel(content, tpObjects);
        }
コード例 #2
0
ファイル: TileView.cs プロジェクト: ratzlaff/XCom-tools
        public TileView( )
        {
            InitializeComponent();

            tabs.Selected += tabs_Selected;

            all = new TilePanel(TileType.All);
            var ground  = new TilePanel(TileType.Ground);
            var wWalls  = new TilePanel(TileType.WestWall);
            var nWalls  = new TilePanel(TileType.NorthWall);
            var objects = new TilePanel(TileType.Object);

            panels = new[]
            {
                all,
                ground,
                wWalls,
                nWalls,
                objects
            };

            AddPanel(all, allTab);
            AddPanel(ground, groundTab);
            AddPanel(wWalls, wWallsTab);
            AddPanel(nWalls, nWallsTab);
            AddPanel(objects, objectsTab);
        }
コード例 #3
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);
        }
コード例 #4
0
 private void AddPanel(TilePanel panel, Control page)
 {
     panel.TileSelectedEvent += OnTileSelected;
     page.Controls.Add(panel);
 }
コード例 #5
0
ファイル: TileView.cs プロジェクト: ratzlaff/XCom-tools
 private void AddPanel(TilePanel panel, TabPage page)
 {
     panel.Dock = DockStyle.Fill;
     page.Controls.Add(panel);
     panel.TileChanged += TileChanged;
 }