public TilesetPreset(BinaryReader BR, int TileSizeX, int TileSizeY, int Index) { TilesetName = BR.ReadString(); ArrayTerrain = new Terrain[BR.ReadInt32(), BR.ReadInt32()]; ArrayTiles = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)]; //Tiles for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++) { for (int X = 0; X < ArrayTerrain.GetLength(0); X++) { Terrain NewTerrain = new Terrain(BR, X, Y); DrawableTile NewTile = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index); ArrayTerrain[X, Y] = NewTerrain; ArrayTiles[X, Y] = NewTile; } } ListBattleBackgroundAnimationPath = new List <string>(); int ListBattleBackgroundAnimationPathCount = BR.ReadInt32(); for (int B = 0; B < ListBattleBackgroundAnimationPathCount; B++) { ListBattleBackgroundAnimationPath.Add(BR.ReadString()); } }
public TilesetPreset(string TilesetName, int TilesetWidth, int TilesetHeight, int TileSizeX, int TileSizeY, int Index) { this.TilesetName = TilesetName; ArrayTerrain = new Terrain[TilesetWidth / TileSizeX, TilesetHeight / TileSizeY]; ArrayTiles = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)]; //Tiles for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++) { for (int X = 0; X < ArrayTerrain.GetLength(0); X++) { Terrain NewTerrain = new Terrain(X, Y); DrawableTile NewTile = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index); NewTerrain.TerrainTypeIndex = 0; NewTerrain.MVEnterCost = 1; NewTerrain.MVMoveCost = 1; NewTerrain.ListBonus = new TerrainBonus[0]; NewTerrain.ListActivation = new TerrainActivation[0]; NewTerrain.ListBonusValue = new int[0]; ArrayTerrain[X, Y] = NewTerrain; ArrayTiles[X, Y] = NewTile; } } }
public DrawableTile(DrawableTile TilePreset) : this() { this.Origin = TilePreset.Origin; this.TilesetIndex = TilePreset.TilesetIndex; if (TilePreset.Terrain3DInfo != null) { this.Terrain3DInfo = new Terrain3D(TilePreset.Terrain3DInfo); } }
public void Load(BinaryReader BR) { ArrayTile = new DrawableTile[MapSize.X, MapSize.Y]; for (int X = MapSize.X - 1; X >= 0; --X) { for (int Y = MapSize.Y - 1; Y >= 0; --Y) { ArrayTile[X, Y] = new DrawableTile(BR, TileSize.X, TileSize.Y); } } }
public Terrain3D(BinaryReader BR, int TileWidth, int TileHeight) { TerrainStyle = (TerrainStyles)BR.ReadByte(); switch (TerrainStyle) { case TerrainStyles.Flat: break; default: FrontFace = new DrawableTile(BR, TileWidth, TileHeight); BackFace = new DrawableTile(BR, TileWidth, TileHeight); LeftFace = new DrawableTile(BR, TileWidth, TileHeight); RightFace = new DrawableTile(BR, TileWidth, TileHeight); break; } }
public Terrain3D(Terrain3D Other) { TerrainStyle = Other.TerrainStyle; Transparancy = Other.Transparancy; switch (TerrainStyle) { case TerrainStyles.Flat: break; default: FrontFace = new DrawableTile(Other.FrontFace); BackFace = new DrawableTile(Other.BackFace); LeftFace = new DrawableTile(Other.LeftFace); RightFace = new DrawableTile(Other.RightFace); break; } }
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(); }
public TilesetPreset(BinaryReader BR, int TileSizeX, int TileSizeY, int Index) { TilesetName = BR.ReadString(); ArrayTerrain = new Terrain[BR.ReadInt32(), BR.ReadInt32()]; ArrayTiles = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)]; //Tiles for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++) { for (int X = 0; X < ArrayTerrain.GetLength(0); X++) { Terrain NewTerrain = new Terrain(BR, X, Y); DrawableTile NewTile = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index); ArrayTerrain[X, Y] = NewTerrain; ArrayTiles[X, Y] = NewTile; } } }
public void ReplaceTile(int X, int Y, DrawableTile ReplacementTile) { this.ArrayTile[X, Y] = ReplacementTile; }
public DrawableTile(DrawableTile TilePreset) : this() { this.Origin = TilePreset.Origin; this.Tileset = TilePreset.Tileset; }