Example #1
0
 public void HighlightDowsedTarget()
 {
     if (this.TargetNpcWho != -1)
     {
         var npc = Main.npc[this.TargetNpcWho];
         if (npc != null && npc.active)
         {
             RodItem.RenderDowseEffect(npc.Center, 4, Color.White);
         }
     }
 }
Example #2
0
 public void CreateRodList(List <RodInfo> rodList, int category, Action <RodInfo> buttonAction)
 {
     rodItemList       = new List <RodItem>();
     parentPrefab      = rodParent.gameObject;
     categoryId        = category;
     categoryName.text = "Category " + categoryId;
     ClearChildren();
     for (int i = 0; i < rodList.Count; i++)
     {
         GameObject item    = Instantiate(rodItemPrefab);
         RodItem    rodItem = item.GetComponent <RodItem>();
         rodItem.SetInfo(rodList[i]);
         rodItem.SetOnClickAction(buttonAction);
         if (rodParent.childCount >= 4)
         {
             CreateNewParent();
         }
         item.transform.SetParent(rodParent);
         item.transform.localScale = Vector3.one;
         rodItemList.Add(rodItem);
     }
 }
Example #3
0
        public void HighlightDowsedTiles()
        {
            foreach (var kv in this.DowsedTiles)
            {
                int block_type = kv.Key;

                foreach (var kv2 in kv.Value.PositionsOfStacks)
                {
                    int tile_x = kv2.Key;

                    foreach (var kv3 in kv2.Value)
                    {
                        int tile_y = kv3.Key;
                        int stack  = kv3.Value;
                        if (stack == 0)
                        {
                            continue;
                        }

                        RodItem.RenderDowseEffect(new Vector2(tile_x * 16, tile_y * 16), stack, Color.White);
                    }
                }
            }
        }