public void ShowReceipe(Receipe receipe, HudGui.InventoryItemInfo iii) { if (iii != null) { this._icon.mainTexture = iii._icon; this._icon.enabled = true; } else { this._icon.enabled = false; } if (receipe._type == Receipe.Types.Craft) { this._title.text = ((iii == null) ? ItemDatabase.ItemById(receipe._productItemID)._name : iii._titleText); if (receipe._productItemAmount > 1) { UILabel expr_82 = this._title; expr_82.text = expr_82.text + " x" + receipe._productItemAmount; } } else { string name = ItemDatabase.ItemById(receipe._ingredients[1]._itemID)._name; string text = name; switch (text) { case "Feather": this._title.text = "+Speed "; goto IL_29B; case "Tooth": this._title.text = "+Damage -Speed "; goto IL_29B; case "Booze": if (!this.CheckUpgradeBonus(receipe)) { this._title.text = "+Damage "; } goto IL_29B; case "Treesap": this._title.text = "Sticky "; goto IL_29B; case "Cloth": this._title.text = "Burning "; goto IL_29B; case "OrangePaint": this._title.text = "Orange "; goto IL_29B; case "BluePaint": this._title.text = "Blue "; goto IL_29B; case "Battery": this._title.text = "Recharged "; goto IL_29B; case "Cassette 1": case "Cassette 2": case "Cassette 3": case "Cassette 4": case "Cassette 5": this._title.text = name + " "; goto IL_29B; } this._title.text = string.Empty; IL_29B: UILabel expr_2A1 = this._title; expr_2A1.text += ((iii == null) ? ItemDatabase.ItemById(receipe._productItemID)._name : iii._titleText); } }
public bool ShowReceipe(Receipe recipe, HudGui.InventoryItemInfo iii) { if (recipe._type == Receipe.Types.Craft) { this._title.text = ((iii == null) ? ItemDatabase.ItemById(recipe._productItemID)._name : UiTranslationDatabase.TranslateKey(iii._titleTextTranslationKey, iii._titleText, true)); if (recipe._productItemAmount > 1) { UILabel title = this._title; title.text = title.text + " x" + recipe._productItemAmount; } } else { bool flag; if (!this.CheckUpgradeBonus(recipe, out flag)) { int itemID = recipe._ingredients[1]._itemID; string name = ItemDatabase.ItemById(itemID)._name; switch (name) { case "Feather": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_SPEED_", "+Speed {0}", true); iii = this._weaponFakeInfo; goto IL_3AA; case "Tooth": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_DAMAGE_SPEED_", "+Damage -Speed {0}", true); iii = this._weaponFakeInfo; goto IL_3AA; case "Booze": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_DAMAGE_", "+Damage {0}", true); iii = this._weaponFakeInfo; goto IL_3AA; case "TreeSap": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_STICKY_", "Sticky {0}", true); goto IL_3AA; case "Cloth": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_BURNING_", "Burning {0}", true); iii = this._weaponFakeInfo; goto IL_3AA; case "OrangePaint": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_ORANGE_", "Orange {0}", true); goto IL_3AA; case "BluePaint": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_BLUE_", "Blue {0}", true); goto IL_3AA; case "Battery": this._title.text = UiTranslationDatabase.TranslateKey("UPGRADE_RECHARGED_", "Recharged {0}", true); goto IL_3AA; case "PlasticTorch": this._title.text = UiTranslationDatabase.TranslateKey("EXTENSION_LIGHT", "{0} with light", true); goto IL_3AA; case "Cassette 1": case "Cassette 2": case "Cassette 3": case "Cassette 4": case "Cassette 5": this._title.text = UiTranslationDatabase.TranslateKey(Scene.HudGui.InventoryItemsInfoCache[itemID]._titleTextTranslationKey, Scene.HudGui.InventoryItemsInfoCache[itemID]._titleText, true) + " {0}"; goto IL_3AA; case "CamcorderTape1": case "CamcorderTape2": case "CamcorderTape3": case "CamcorderTape4": case "CamcorderTape5": case "CamcorderTape6": return(false); } this._title.text = "{0}"; IL_3AA :; } else if (flag) { iii = this._weaponFakeInfo; } this._title.text = string.Format(this._title.text, (iii == null) ? ItemDatabase.ItemById(recipe._productItemID)._name : UiTranslationDatabase.TranslateKey(iii._titleTextTranslationKey, iii._titleText, true)); } int i = this._ingredientTextures.Length - 1; foreach (ReceipeIngredient receipeIngredient in recipe._ingredients) { HudGui.InventoryItemInfo itemInfo = Scene.HudGui.GetItemInfo(receipeIngredient._itemID); if (itemInfo != null) { this._ingredientTextures[i].mainTexture = itemInfo._icon; if (receipeIngredient._amount > 1) { this._ingredientCountLabels[i].text = receipeIngredient._amount.ToString(); this._ingredientCountLabels[i].enabled = true; } else { this._ingredientCountLabels[i].enabled = false; } if (!this._ingredientTextures[i].gameObject.activeSelf) { this._ingredientTextures[i].gameObject.SetActive(true); } i--; } } if (iii == this._weaponFakeInfo) { this._ingredientTextures[this._ingredientTextures.Length - 1].mainTexture = this._weaponFakeInfo._icon; this._ingredientCountLabels[this._ingredientTextures.Length - 1].enabled = false; } while (i >= 0) { if (this._ingredientTextures[i].gameObject.activeSelf) { this._ingredientTextures[i].gameObject.SetActive(false); } i--; } this._iconCantCarry.enabled = !recipe.CanCarryProduct; this.ShowCrossOff(!recipe.CanCarryProduct, ReceipeProductView._cantCarryProductColor); this._ingredientGrid.repositionNow = true; return(true); }