Beispiel #1
0
        private void cboTilesFront_SelectedIndexChanged(object sender, EventArgs e)
        {
            int SelectedIndex = cboTilesFront.SelectedIndex;

            if (SelectedIndex < 0)
            {
                return;
            }

            TilesetViewerFront.InitTileset(Owner.ListTileSet[SelectedIndex], Owner.TileSize);
            TilesetViewerFront.Size = new System.Drawing.Size(Owner.ListTileSet[SelectedIndex].Width, Owner.ListTileSet[SelectedIndex].Height);
            TileInfo.Terrain3DInfo.FrontFace.TilesetIndex = SelectedIndex;
            UpdatePreview();
        }
Beispiel #2
0
        public TileAttributesEditor3D(DrawableTile TileInfo, BattleMap Owner)
        {
            InitializeComponent();

            this.TileInfo = TileInfo;
            this.Owner    = Owner;

            cbo3DStyle.SelectedIndex = (int)TileInfo.Terrain3DInfo.TerrainStyle;

            for (int T = 0; T < Owner.ListTilesetPreset.Count; T++)
            {
                cboTilesFront.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesBack.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesLeft.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesRight.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
            }

            if (Owner.ListTilesetPreset.Count > 0)
            {
                cboTilesFront.SelectedIndex = TileInfo.Terrain3DInfo.FrontFace.TilesetIndex;
                cboTilesBack.SelectedIndex  = TileInfo.Terrain3DInfo.BackFace.TilesetIndex;
                cboTilesLeft.SelectedIndex  = TileInfo.Terrain3DInfo.LeftFace.TilesetIndex;
                cboTilesRight.SelectedIndex = TileInfo.Terrain3DInfo.RightFace.TilesetIndex;
                TilesetViewerFront.InitTileset(Owner.ListTileSet[cboTilesFront.SelectedIndex], Owner.TileSize);
                TilesetViewerBack.InitTileset(Owner.ListTileSet[cboTilesBack.SelectedIndex], Owner.TileSize);
                TilesetViewerLeft.InitTileset(Owner.ListTileSet[cboTilesLeft.SelectedIndex], Owner.TileSize);
                TilesetViewerRight.InitTileset(Owner.ListTileSet[cboTilesRight.SelectedIndex], Owner.TileSize);

                TilesetViewerBack.ActiveTile  = TileInfo.Terrain3DInfo.FrontFace.Origin.Location;
                TilesetViewerFront.ActiveTile = TileInfo.Terrain3DInfo.BackFace.Origin.Location;
                TilesetViewerLeft.ActiveTile  = TileInfo.Terrain3DInfo.LeftFace.Origin.Location;
                TilesetViewerRight.ActiveTile = TileInfo.Terrain3DInfo.RightFace.Origin.Location;
            }
            else
            {
                TilesetViewerFront.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerBack.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerLeft.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerRight.InitTileset(string.Empty, Owner.TileSize);
            }

            TileViewer3D.ListTileSet = Owner.ListTileSet;
            UpdatePreview();
        }