public static bool DrawStorageGUI()
        {
            Player        player        = Main.player[Main.myPlayer];
            StoragePlayer modPlayer     = player.GetModPlayer <StoragePlayer>(MagicStorage.Instance);
            Point16       storageAccess = modPlayer.ViewingStorage();

            if (!Main.playerInventory || storageAccess.X < 0 || storageAccess.Y < 0)
            {
                return(true);
            }
            ModTile modTile = TileLoader.GetTile(Main.tile[storageAccess.X, storageAccess.Y].type);

            if (modTile == null || !(modTile is StorageAccess))
            {
                return(true);
            }
            TEStorageHeart heart = ((StorageAccess)modTile).GetHeart(storageAccess.X, storageAccess.Y);

            if (heart == null)
            {
                return(true);
            }
            if (modTile is CraftingAccess)
            {
                CraftingGUI.Draw(heart);
            }
            else
            {
                StorageGUI.Draw(heart);
            }
            return(true);
        }
Beispiel #2
0
 public override bool RecipeAvailable(Recipe recipe)
 {
     if (!active)
     {
         return(true);
     }
     try
     {
         Player        player        = Main.player[Main.myPlayer];
         StoragePlayer modPlayer     = player.GetModPlayer <StoragePlayer>(mod);
         Point16       storageAccess = modPlayer.ViewingStorage();
         return(storageAccess.X < 0 || storageAccess.Y < 0);
     }
     catch
     {
         return(true);
     }
 }