Exemplo n.º 1
0
 private void InitBlocksSelector()
 {
     blocksSelector.Clear();
     for (int i = 0; i < Usable.nbUsables; i++)
     {
         Usable.Type type = (Usable.Type)i;
         if (Usable.category[(int)type] == Usable.Category.Block)
         {
             blocksSelector.AddItem(type.ToString(), Usable.textures[(int)type]);
         }
     }
 }
Exemplo n.º 2
0
 private void SetDescription(Usable.Type type)
 {
     imageDesc.Texture    = Usable.textures[(int)type];
     titleDesc.Text       = type.ToString();
     energyDesc.Text      = "-> " + Usable.energyToCreat[type] + "e";
     descriptionDesc.Text = "Health : " + Block.durabilities[Usable.blocks[type]];
     ClearItemsList();
     foreach (var loot in Usable.crafts[type].loots)
     {
         Control it = (Control)itemBox.Instance();
         it.GetNode <TextureRect>("img").Texture = Item.textures[(int)loot.type];
         it.GetNode <Label>("texte").Text        = Player.inventoryItems.GetItemCount(loot.type) + "/" + loot.amount;
         itemListDesc.AddChild(it);
     }
 }