Пример #1
0
        public GraphicsEditor()
        {
            InitializeComponent();
            CompositeTable            = ProjectController.GraphicsManager.BuildPatternTable(0);
            CmbPalettes.DisplayMember = "Name";

            foreach (var p in ProjectController.PaletteManager.Palettes)
            {
                CmbPalettes.Items.Add(p);
            }


            CmbGraphics1.DisplayMember = CmbGraphics2.DisplayMember = CmbGraphics3.DisplayMember = CmbGraphics4.DisplayMember = "Name";
            foreach (var g in ProjectController.GraphicsManager.GraphicsInfo)
            {
                CmbGraphics1.Items.Add(g);
                CmbGraphics2.Items.Add(g);
                CmbGraphics3.Items.Add(g);
                CmbGraphics4.Items.Add(g);
            }

            CmbGraphics1.SelectedIndex = 0;
            CmbGraphics2.SelectedIndex = 1;
            CmbGraphics3.SelectedIndex = 2;
            CmbGraphics4.SelectedIndex = 3;

            CmbPalettes.SelectedIndex = 0;

            PtvTileSelector.CurrentTable = CompositeTable;
            SelectionMode = SelectionMode.Quarter;
            PslView.SelectedIndexChanged     += new EventHandler(PslView_SelectedIndexChanged);
            PslView.SelectedOffsetChanged    += new EventHandler(PslView_SelectedOffsetChanged);
            PtvTileSelector.SelectionChanged += new EventHandler(PtvTileSelector_SelectionChanged);
            PtvTileSelector.UpdateSelection();
        }
Пример #2
0
        private void CmbGraphics4_SelectedIndexChanged(object sender, EventArgs e)
        {
            GraphicsInfo gi = CmbGraphics4.SelectedItem as GraphicsInfo;

            TxtGName4.Text = gi.Name;
            CompositeTable.SetGraphicsbank(3, ProjectController.GraphicsManager.GraphicsBanks[gi.Bank]);
            PtvTileSelector.UpdateSelection();
            LblHexGraphics4.Text = "x" + CmbGraphics4.SelectedIndex.ToHexString();
        }
Пример #3
0
        private void CmbGraphics1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (SelectionMode == SelectionMode.Full)
            {
                if (CmbGraphics1.SelectedIndex > 252)
                {
                    CmbGraphics1.SelectedIndex = 252;
                    return;
                }
            }
            else if (SelectionMode == SelectionMode.Half)
            {
                if (CmbGraphics1.SelectedIndex > 254)
                {
                    CmbGraphics1.SelectedIndex = 254;
                    return;
                }
            }

            GraphicsInfo gi = CmbGraphics1.SelectedItem as GraphicsInfo;

            TxtGName1.Text = gi.Name;
            CompositeTable.SetGraphicsbank(0, ProjectController.GraphicsManager.GraphicsBanks[gi.Bank]);

            if (SelectionMode == SelectionMode.Full)
            {
                CmbGraphics2.SelectedIndex = CmbGraphics1.SelectedIndex + 1;
                CmbGraphics3.SelectedIndex = CmbGraphics1.SelectedIndex + 2;
                CmbGraphics4.SelectedIndex = CmbGraphics1.SelectedIndex + 3;
            }
            else if (SelectionMode == SelectionMode.Half)
            {
                CmbGraphics2.SelectedIndex = CmbGraphics1.SelectedIndex + 1;
            }

            PtvTileSelector.UpdateSelection();
            LblHexGraphics1.Text = "x" + CmbGraphics1.SelectedIndex.ToHexString();
        }
Пример #4
0
 private void RdoSixteen_CheckedChanged(object sender, EventArgs e)
 {
     PtvTileSelector.ArrangementMode = ArrangementMode.Map16;
     PtvTileSelector.UpdateSelection();
 }
Пример #5
0
 private void RdoNormal_CheckedChanged(object sender, EventArgs e)
 {
     PtvTileSelector.ArrangementMode = ArrangementMode.Normal;
     PtvTileSelector.UpdateSelection();
 }