Inheritance: ProjectIndexedDataType
Beispiel #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);
        }
Beispiel #2
0
        public void SetArea(Area a)
        {
            Area.TileModifiedHandler handler = new Area.TileModifiedHandler(ModifiedTileCallback);
            if (area != null)
                area.TileModifiedEvent -= handler;
            a.TileModifiedEvent += handler;

            area = a;

            area.DrawAllTiles();

            this.QueueDraw();
        }
Beispiel #3
0
 public void SetArea(Area a)
 {
     area = a;
 }
Beispiel #4
0
 public void SetArea(Area a)
 {
     subTileViewer.SetArea(a);
     subTileCollisionEditor.SetArea(a);
     PullEverything();
 }
Beispiel #5
0
        void SetArea(Area a)
        {
            Area.TileModifiedHandler handler = delegate(int tile) {
                if (tile == subTileEditor.subTileViewer.TileIndex) {
                    subTileEditor.subTileViewer.QueueDraw();
                }
            };

            if (area != null)
                area.TileModifiedEvent -= handler;
            a.TileModifiedEvent += handler;

            area = a;
            subTileEditor.SetArea(area);
            if (area != null) {
                subTileGfxViewer.SetGraphicsState(area.GraphicsState, 0x2000, 0x3000);
            }

            area.DrawInvalidatedTiles = true;

            areaviewer1.SetArea(area);

            areaviewer1.TileSelectedEvent += delegate(object sender) {
                subTileEditor.SetTileIndex(areaviewer1.SelectedIndex);
            };

            areaSpinButton.Value = area.Index;
            SetFlags1(a.Flags1);
            SetFlags2(a.Flags2);
            SetUniqueGfx(a.UniqueGfxString);
            SetMainGfx(a.MainGfxString);
            SetPaletteHeader(a.PaletteHeaderString);
            SetTileset(a.TilesetIndex);
            SetLayoutGroup(a.LayoutGroup);
            SetAnimation(a.AnimationIndex);
        }
Beispiel #6
0
        public void SetArea(Area a)
        {
            if (area == null || a.Index != area.Index) {
                Stream groupAreasFile = Project.GetBinaryFile("rooms/group" + (Index>>8) + "Areas.bin");
                groupAreasFile.Position = Index&0xff;
                int lastValue = groupAreasFile.ReadByte() & 0x80;
                groupAreasFile.Position = Index&0xff;
                groupAreasFile.WriteByte((byte)((a.Index&0x7f) | lastValue));

                var handler = new Area.TileModifiedHandler(ModifiedTileCallback);
                var layoutHandler = new Area.LayoutGroupModifiedHandler(ModifiedLayoutGroupCallback);
                if (area != null) {
                    area.TileModifiedEvent -= handler;
                    area.LayoutGroupModifiedEvent -= layoutHandler;
                }
                a.TileModifiedEvent += handler;
                a.LayoutGroupModifiedEvent += layoutHandler;

                cachedImage = null;

                area = a;

                UpdateRoomData();
            }
        }
Beispiel #7
0
 public void SetArea(Area a)
 {
     subTileViewer.SetArea(a);
     subTileCollisionEditor.SetArea(a);
     PullEverything();
 }
Beispiel #8
0
 public void SetArea(Area a)
 {
     area = a;
 }