Inheritance: TileGridSelector
Exemplo n.º 1
0
        public AreaEditor(Area a)
        {
            this.Build();

            subTileGfxViewer = new GfxViewer();
            subTileGfxViewer.TileSelectedEvent += delegate(object sender) {
                if (subTileEditor != null)
                    subTileEditor.SubTileIndex = (byte)(subTileGfxViewer.SelectedIndex^0x80);
            };
            subTileGfxContainer.Add(subTileGfxViewer);

            subTileEditor = new SubTileEditor(this);
            subTileContainer.Add(subTileEditor);

            SetArea(a);

            areaSpinButton.Adjustment.Upper = 0x66;
            uniqueGfxComboBox.SetConstantsMapping(Project.UniqueGfxMapping);
            mainGfxComboBox.SetConstantsMapping(Project.MainGfxMapping);
            palettesComboBox.SetConstantsMapping(Project.PaletteHeaderMapping);
            tilesetSpinButton.Adjustment.Upper = 0x32;
            layoutGroupSpinButton.Adjustment.Upper = 5;
            animationsSpinButton.Adjustment.Upper = 0x15;
            animationsSpinButton.Adjustment.Lower = -1;

            SetArea(a);
        }
Exemplo n.º 2
0
        public AreaEditor(Area a)
        {
            this.Build();

            subTileGfxViewer = new GfxViewer();
            subTileGfxViewer.TileSelectedEvent += delegate(object sender) {
                if (subTileEditor != null)
                {
                    subTileEditor.SubTileIndex = (byte)(subTileGfxViewer.SelectedIndex ^ 0x80);
                }
            };
            subTileGfxContainer.Add(subTileGfxViewer);

            subTileEditor = new SubTileEditor(this);
            subTileContainer.Add(subTileEditor);

            SetArea(a);

            areaSpinButton.Adjustment.Upper = 0x66;
            uniqueGfxComboBox.SetConstantsMapping(Project.UniqueGfxMapping);
            mainGfxComboBox.SetConstantsMapping(Project.MainGfxMapping);
            palettesComboBox.SetConstantsMapping(Project.PaletteHeaderMapping);
            tilesetSpinButton.Adjustment.Upper     = 0x32;
            layoutGroupSpinButton.Adjustment.Upper = 5;
            animationsSpinButton.Adjustment.Upper  = 0x15;
            animationsSpinButton.Adjustment.Lower  = -1;

            SetArea(a);
        }
Exemplo n.º 3
0
        public TilesetEditor(Tileset t)
        {
            Gtk.Builder builder = new Builder();
            builder.AddFromString(Helper.ReadResourceFile("LynnaLab.Glade.TilesetEditor.ui"));
            builder.Autoconnect(this);

            tilesetSpinButtonContainer = (Gtk.Box)builder.GetObject("tilesetSpinButtonContainer");
            tilesetVreContainer        = (Gtk.Box)builder.GetObject("tilesetVreContainer");
            tilesetViewerContainer     = (Gtk.Box)builder.GetObject("tilesetViewerContainer");
            subTileContainer           = (Gtk.Box)builder.GetObject("subTileContainer");
            subTileGfxContainer        = (Gtk.Box)builder.GetObject("subTileGfxContainer");
            paletteEditorContainer     = (Gtk.Box)builder.GetObject("paletteEditorContainer");
            paletteFrameLabel          = (Gtk.Label)builder.GetObject("paletteFrameLabel");

            base.Child = (Gtk.Widget)builder.GetObject("TilesetEditor");


            tilesetviewer1 = new TilesetViewer();
            tilesetviewer1.AddTileSelectedHandler(delegate(object sender, int index) {
                subTileEditor.SetTileIndex(index);
            });
            tilesetViewerContainer.Add(tilesetviewer1);

            subTileGfxViewer = new GfxViewer();
            subTileGfxViewer.SelectionColor = CairoHelper.ConvertColor(0, 256, 0);
            subTileGfxViewer.AddTileSelectedHandler(delegate(object sender, int index) {
                if (subTileEditor != null)
                {
                    subTileEditor.SubTileIndex = (byte)(index ^ 0x80);
                }
            });
            subTileGfxContainer.Add(subTileGfxViewer);

            subTileEditor = new SubTileEditor(this);
            subTileContainer.Add(subTileEditor);

            paletteEditor = new PaletteEditor();
            paletteEditorContainer.Add(paletteEditor);

            tilesetSpinButton = new SpinButtonHexadecimal();
            tilesetSpinButtonContainer.Add(tilesetSpinButton);

            SetTileset(t);

            tilesetSpinButton.ValueChanged += TilesetSpinButtonChanged;

            tilesetEventWrapper.Bind <int>("TileModifiedEvent", OnTileModified);
            tilesetEventWrapper.Bind <EventArgs>("PaletteHeaderGroupModifiedEvent", OnPalettesChanged);
        }