Example #1
0
 public static void Reload(TileInfo objToReload)
 {
     objToReload = Load((WzCanvasProperty)objToReload.ParentObject, objToReload.tS,objToReload.u,objToReload.no);
 }
Example #2
0
 public void SetRandomTilesMode(TileInfo[] tileList)
 {
     Clear();
     tileRandomList = tileList;
     SetHeldInfo(tileRandomList[NextInt32(tileRandomList.Length)]);
     state = MouseState.RandomTiles;
 }
Example #3
0
 public static TileInfo Load(WzCanvasProperty parentObject, string tS, string u, string no)
 {
     TileInfo result = new TileInfo(parentObject.PngProperty.GetPNG(false), WzInfoTools.VectorToSystemPoint((WzVectorProperty)parentObject["origin"]), tS,u,no, parentObject);
     WzConvexProperty footholds = (WzConvexProperty)parentObject["foothold"];
     if (footholds != null)
         foreach (WzVectorProperty foothold in footholds.WzProperties)
             result.footholdOffsets.Add(WzInfoTools.VectorToXNAPoint(foothold));
     return result;
 }
Example #4
0
 public TileInstance(TileInfo baseInfo, Layer layer, Board board, int x, int y, int z, bool beforeAdding, string realName = "")
     : base(board, layer, x, y, z, beforeAdding)
 {
     this.baseInfo = baseInfo;
     if (realName != "") this.realName = realName;
     AttachToLayer(layer);
     //baseInfo.ParseOffsets(this, Board, Layer, X, Y);
 }
Example #5
0
 private void LoadTileSetList()
 {
     if (tileSetList.SelectedItem == null) return;
     tileImagesContainer.Controls.Clear();
     WzImage tileSetImage = Program.InfoManager.TileSets[(string)tileSetList.SelectedItem];
     if (tileSetImage == null) return;
     foreach (WzSubProperty tCat in tileSetImage.WzProperties)
     {
         if (tCat.Name == "info") continue;
         if (ApplicationSettings.randomTiles)
         {
             WzCanvasProperty canvasProp = (WzCanvasProperty)tCat["0"];
             if (canvasProp == null) continue;
             KoolkLVItem item = tileImagesContainer.createItem(canvasProp.PngProperty.GetPNG(false), tCat.Name, true);
             TileInfo[] randomInfos = new TileInfo[tCat.WzProperties.Count];
             for (int i = 0; i < randomInfos.Length; i++)
             {
                 WzCanvasProperty tile = (WzCanvasProperty)tCat.WzProperties[i];
                 if (tile.HCTag == null)
                     tile.HCTag = TileInfo.Load(tile, (string)tileSetList.SelectedItem, tCat.Name, tile.Name);
                 randomInfos[i] = (TileInfo)tile.HCTag;
             }
             item.Tag = randomInfos;
             item.MouseDown += new MouseEventHandler(tileItem_Click);
             item.MouseUp += new MouseEventHandler(item_MouseUp);
         }
         else
         {
             foreach (WzCanvasProperty tile in tCat.WzProperties)
             {
                 if (tile.HCTag == null)
                     tile.HCTag = TileInfo.Load(tile, (string)tileSetList.SelectedItem, tCat.Name, tile.Name);
                 KoolkLVItem item = tileImagesContainer.createItem(tile.PngProperty.GetPNG(false), tCat.Name + "/" + tile.Name, true);
                 item.Tag = tile.HCTag;
                 item.MouseDown += new MouseEventHandler(tileItem_Click);
                 item.MouseUp += new MouseEventHandler(item_MouseUp);
             }
         }
     }
 }
Example #6
0
 public static void Reload(TileInfo objToReload)
 {
     objToReload = Load((WzCanvasProperty)objToReload.ParentObject, objToReload.tS, objToReload.u, objToReload.no);
 }
Example #7
0
 public TileInstance(TileInfo baseInfo, Layer layer, Board board, int x, int y, int z, bool beforeAdding)
     : base(board, layer, x, y, z, beforeAdding)
 {
     this.baseInfo = baseInfo;
     AttachToLayer(layer);
     //baseInfo.ParseOffsets(this, Board, Layer, X, Y);
 }