Esempio n. 1
0
 public void SetItem(ItemDefinition item)
 {
     nameoverload  = null;
     unloaded      = false;
     this.itemType = item?.GetID() ?? 0;
     if (item?.IsUnloaded ?? false)
     {
         unloaded     = true;
         nameoverload = $"{item.name} [{item.mod}] ({Language.GetTextValue("tModLoader.UnloadedItemItemName")})";
     }
     this.item = new Item();
     this.item.SetDefaults(itemType);
 }
Esempio n. 2
0
 public ItemDefinitionOptionElement(ItemDefinition item, float scale = .75f)
 {
     this.itemType = item?.GetID() ?? 0;
     if (item?.IsUnloaded ?? false)
     {
         nameoverload = $"{item.name} [{item.mod}] ({Language.GetTextValue("tModLoader.UnloadedItemItemName")})";
         unloaded     = true;
     }
     this.item = new Item();
     this.item.SetDefaults(itemType);
     this.scale = scale;
     this.Width.Set(defaultBackgroundTexture.Width * scale, 0f);
     this.Height.Set(defaultBackgroundTexture.Height * scale, 0f);
 }