Esempio n. 1
0
        public TileOptions(Level aLevel)
        {
            mLevel = aLevel;

            InitializeComponent();
            mCurrentSel = colorSelection1;
        }
Esempio n. 2
0
 public TileOptions()
 {
     mLevel = new Level();
     InitializeComponent();
     mCurrentSel = colorSelection1;
 }
Esempio n. 3
0
        private void ColorSelected(object sender, EventArgs e)
        {
            mCurrentSel.Selected = false;
            mCurrentSel = sender as ColorSelection;

            switch (mOption)
            {
                case ColorOption.Block:
                    if (mSelection != null)
                        foreach (GridEntry entry in mSelection)
                            entry.BlockPaletteIndex = mCurrentSel.PaletteIndex;

                    blockColor.PaletteIndex = mCurrentSel.PaletteIndex;
                    blockGraphic1.BlockColor = mLevel.Palette[mCurrentSel.PaletteIndex];
                    blockColor.Invalidate();
                    if (EntryUpdated != null) EntryUpdated();
                    break;

                case ColorOption.Tile:
                    if (mSelection != null)
                        foreach (GridEntry entry in mSelection)
                            entry.TilePaletteIndex = mCurrentSel.PaletteIndex;

                    tileColor.PaletteIndex = mCurrentSel.PaletteIndex;
                    blockGraphic1.TileColor = mLevel.Palette[mCurrentSel.PaletteIndex];
                    tileColor.Invalidate();
                    if (EntryUpdated != null) EntryUpdated();
                    break;

                default:
                    break;
            }

        }