Esempio n. 1
0
        private void mapPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RSN_LayerPropertiesForm  frm1 = new RSN_LayerPropertiesForm(LoadedRSDKver);
            CD12_LayerPropertiesForm frm2 = new CD12_LayerPropertiesForm(LoadedRSDKver);

            frm1.CurLayer = _mapViewer.curlayer;
            frm2.CurLayer = _mapViewer.curlayer;
            ushort[][] OldTiles  = new ushort[0][];
            ushort[][] NewTiles  = new ushort[0][];
            int        OLDwidth  = 0;
            int        OLDheight = 0;

            Console.WriteLine(_mapViewer.curlayer);
            switch (LoadedRSDKver)
            {
            case 3:
                OldTiles   = _RSDK1Background.Layers[curlayer].MapLayout;
                OLDwidth   = _RSDK1Background.Layers[curlayer].width;
                OLDheight  = _RSDK1Background.Layers[curlayer].height;
                frm1.Mapv1 = _RSDK1Background;
                frm1.Setup();
                break;

            case 2:
                OldTiles   = _RSDK2Background.Layers[curlayer].MapLayout;
                OLDwidth   = _RSDK2Background.Layers[curlayer].width;
                OLDheight  = _RSDK2Background.Layers[curlayer].height;
                frm1.Mapv2 = _RSDK2Background;
                frm1.Setup();
                break;

            case 1:
                OldTiles   = _RSDK3Background.Layers[curlayer].MapLayout;
                OLDwidth   = _RSDK3Background.Layers[curlayer].width;
                OLDheight  = _RSDK3Background.Layers[curlayer].height;
                frm2.Mapv3 = _RSDK3Background;
                frm2.Setup();
                break;

            case 0:
                OldTiles   = _RSDK4Background.Layers[curlayer].MapLayout;
                OLDwidth   = _RSDK4Background.Layers[curlayer].width;
                OLDheight  = _RSDK4Background.Layers[curlayer].height;
                frm2.Mapv4 = _RSDK4Background;
                frm2.Setup();
                break;

            default:
                break;
            }

            switch (LoadedRSDKver)
            {
            case 3:
                if (frm1.ShowDialog(this) == DialogResult.OK)
                {
                    _RSDK1Background = frm1.Mapv1;
                    NewTiles         = _RSDK1Background.Layers[curlayer].MapLayout;
                    CheckDimensions(LoadedRSDKver, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case 2:
                if (frm1.ShowDialog(this) == DialogResult.OK)
                {
                    _RSDK2Background = frm1.Mapv2;
                    NewTiles         = _RSDK2Background.Layers[curlayer].MapLayout;
                    CheckDimensions(LoadedRSDKver, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case 1:
                if (frm2.ShowDialog(this) == DialogResult.OK)
                {
                    _RSDK3Background = frm2.Mapv3;
                    NewTiles         = _RSDK3Background.Layers[curlayer].MapLayout;
                    CheckDimensions(LoadedRSDKver, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case 0:
                if (frm2.ShowDialog(this) == DialogResult.OK)
                {
                    _RSDK4Background = frm2.Mapv4;
                    NewTiles         = _RSDK4Background.Layers[curlayer].MapLayout;
                    CheckDimensions(LoadedRSDKver, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;
            }
        }
Esempio n. 2
0
        private void mapPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RSN_LayerPropertiesForm  frm1 = new RSN_LayerPropertiesForm(engineType);
            CD12_LayerPropertiesForm frm2 = new CD12_LayerPropertiesForm(engineType);

            frm1.CurLayer = _mapViewer.curlayer;
            frm2.CurLayer = _mapViewer.curlayer;
            ushort[][] OldTiles  = new ushort[0][];
            ushort[][] NewTiles  = new ushort[0][];
            int        OLDwidth  = 0;
            int        OLDheight = 0;

            switch (engineType)
            {
            case Retro_Formats.EngineType.RSDKvRS:
                OldTiles        = background.Layers[curlayer].MapLayout;
                OLDwidth        = background.Layers[curlayer].width;
                OLDheight       = background.Layers[curlayer].height;
                frm1.Background = background;
                frm1.Setup();
                break;

            case Retro_Formats.EngineType.RSDKv1:
                OldTiles        = background.Layers[curlayer].MapLayout;
                OLDwidth        = background.Layers[curlayer].width;
                OLDheight       = background.Layers[curlayer].height;
                frm1.Background = background;
                frm1.Setup();
                break;

            case Retro_Formats.EngineType.RSDKv2:
                OldTiles        = background.Layers[curlayer].MapLayout;
                OLDwidth        = background.Layers[curlayer].width;
                OLDheight       = background.Layers[curlayer].height;
                frm2.Background = background;
                frm2.Setup();
                break;

            case Retro_Formats.EngineType.RSDKvB:
                OldTiles        = background.Layers[curlayer].MapLayout;
                OLDwidth        = background.Layers[curlayer].width;
                OLDheight       = background.Layers[curlayer].height;
                frm2.Background = background;
                frm2.Setup();
                break;

            default:
                break;
            }

            switch (engineType)
            {
            case Retro_Formats.EngineType.RSDKvRS:
                if (frm1.ShowDialog(this) == DialogResult.OK)
                {
                    background = frm1.Background;
                    NewTiles   = background.Layers[curlayer].MapLayout;
                    CheckDimensions(engineType, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case Retro_Formats.EngineType.RSDKv1:
                if (frm1.ShowDialog(this) == DialogResult.OK)
                {
                    background = frm1.Background;
                    NewTiles   = background.Layers[curlayer].MapLayout;
                    CheckDimensions(engineType, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case Retro_Formats.EngineType.RSDKv2:
                if (frm2.ShowDialog(this) == DialogResult.OK)
                {
                    background = frm2.Background;
                    NewTiles   = background.Layers[curlayer].MapLayout;
                    CheckDimensions(engineType, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;

            case Retro_Formats.EngineType.RSDKvB:
                if (frm2.ShowDialog(this) == DialogResult.OK)
                {
                    background = frm2.Background;
                    NewTiles   = background.Layers[curlayer].MapLayout;
                    CheckDimensions(engineType, OldTiles, NewTiles, OLDwidth, OLDheight);
                    _mapViewer.DrawLevel();
                }
                break;
            }
        }