protected override void OnQuery_SELECT_ITEM() { if (localInventoryEquipData == null || localInventoryEquipData.Length == 0) { GameSection.StopEvent(); } else { SmithManager.SmithGrowData smithData = MonoBehaviourSingleton<SmithManager>.I.GetSmithData<SmithManager.SmithGrowData>(); if (smithData == null) { GameSection.StopEvent(); } else { EquipItemInfo selectEquipData = smithData.selectEquipData; if (selectEquipData.IsLevelMax()) { if (selectEquipData.tableData.IsEvolve()) { GameSection.ChangeEvent("EVOLVE", null); } else if (selectEquipData.IsExceedMax() && !selectEquipData.tableData.IsShadow()) { GameSection.ChangeEvent("ALREADY_LV_MAX", null); } } } } }
protected void OnQuery_GROW() { if (MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithGrowData>() == null) { MonoBehaviourSingleton <SmithManager> .I.CreateSmithData <SmithManager.SmithGrowData>(); } EquipItemInfo equipItemInfo = detailItemData as EquipItemInfo; MonoBehaviourSingleton <SmithManager> .I.GetSmithData <SmithManager.SmithGrowData>().selectEquipData = equipItemInfo; if (equipItemInfo.IsLevelMax() && equipItemInfo.tableData.IsEvolve()) { GameSection.SetEventData(new object[2] { SmithEquipBase.SmithType.EVOLVE, (detailItemData as EquipItemInfo).tableData.type }); GameSection.ChangeEvent("EVOLVE", null); } else { GameSection.SetEventData(new object[2] { SmithEquipBase.SmithType.GROW, (detailItemData as EquipItemInfo).tableData.type }); } }
public ERR_SMITH_SEND CheckEvolveEquipItem(EquipItemInfo item, uint evolve_id, ulong[] uniqIdList) { if (!item.IsLevelMax()) { return(ERR_SMITH_SEND.NOT_LV_MAX); } EvolveEquipItemTable.EvolveEquipItemData[] evolveTable = item.tableData.GetEvolveTable(); EvolveEquipItemTable.EvolveEquipItemData evolveEquipItemData = null; EvolveEquipItemTable.EvolveEquipItemData[] array = evolveTable; foreach (EvolveEquipItemTable.EvolveEquipItemData evolveEquipItemData2 in array) { if (evolveEquipItemData2.id == evolve_id) { evolveEquipItemData = evolveEquipItemData2; break; } } if (evolveEquipItemData == null) { return(ERR_SMITH_SEND.NOT_FOUND_EVOLVE_DATA); } if (evolveEquipItemData.needEquip != null && !MonoBehaviourSingleton <InventoryManager> .I.IsSetEquipMaterial(uniqIdList)) { return(ERR_SMITH_SEND.NOT_SET_EQUIP_MATERIAL); } if (!MonoBehaviourSingleton <InventoryManager> .I.IsHaveingMaterial(evolveEquipItemData.needMaterial)) { return(ERR_SMITH_SEND.NOT_ENOUGH_MATERIAL); } if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money < (int)evolveEquipItemData.needMoney) { return(ERR_SMITH_SEND.NOT_ENOUGH_MONEY); } return(ERR_SMITH_SEND.NONE); }
public ItemIconDetail.ICON_STATUS GetIconStatus() { bool flag = IsLvMaxAndEnableEvolve(); bool flag2 = IsEnoughMaterial(); if (equipData.IsLevelMax() && !equipData.tableData.IsEvolve() && equipData.IsExceedMax()) { return(ItemIconDetail.ICON_STATUS.GROW_MAX); } if (!flag2) { return(ItemIconDetail.ICON_STATUS.NOT_ENOUGH_MATERIAL); } if (flag) { return(ItemIconDetail.ICON_STATUS.VALID_EVOLVE); } return(ItemIconDetail.ICON_STATUS.NONE); }
public ERR_SMITH_SEND CheckGrowEquipItem(EquipItemInfo item) { if (item.IsLevelMax()) { return(ERR_SMITH_SEND.ALREADY_LV_MAX); } GrowEquipItemTable.GrowEquipItemNeedItemData nextNeedTableData = item.nextNeedTableData; if (!MonoBehaviourSingleton <InventoryManager> .I.IsHaveingMaterial(nextNeedTableData.needMaterial)) { return(ERR_SMITH_SEND.NOT_ENOUGH_MATERIAL); } if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money < nextNeedTableData.needMoney) { return(ERR_SMITH_SEND.NOT_ENOUGH_MONEY); } return(ERR_SMITH_SEND.NONE); }
private void EquipParam(EquipItemInfo item) { EquipItemTable.EquipItemData equipItemData = item?.tableData; if (item != null && equipItemData != null) { bool flag = item.tableData.IsVisual(); SetLabelText(detailBase, UI.LBL_NAME, equipItemData.name); SetActive(detailBase, UI.STR_LV, !flag); SetActive(detailBase, UI.STR_ONLY_VISUAL, flag); SetLabelText(detailBase, UI.LBL_LV_NOW, item.level.ToString()); SetLabelText(detailBase, UI.LBL_LV_MAX, equipItemData.maxLv.ToString()); SetLabelText(detailBase, UI.LBL_ATK, item.atk.ToString()); SetLabelText(detailBase, UI.LBL_ELEM, item.elemAtk.ToString()); SetElementSprite(detailBase, UI.SPR_ELEM, item.GetElemAtkType()); SetLabelText(detailBase, UI.LBL_DEF, item.def.ToString()); int num = item.elemDef; if (equipItemData.isFormer) { num = Mathf.FloorToInt((float)num * 0.1f); } SetLabelText(detailBase, UI.LBL_ELEM_DEF, num.ToString()); SetDefElementSprite(detailBase, UI.SPR_ELEM_DEF, item.GetElemDefType()); SetLabelText(detailBase, UI.LBL_HP, item.hp.ToString()); SetLabelText(detailBase, UI.LBL_SELL, item.sellPrice.ToString()); SetActive(detailBase, UI.OBJ_FAVORITE_ROOT, (callSection & (CURRENT_SECTION.QUEST_RESULT | CURRENT_SECTION.EQUIP_LIST)) == CURRENT_SECTION.NONE); SetActive(detailBase, UI.SPR_IS_EVOLVE, item.tableData.IsEvolve()); SetEquipmentTypeIcon(detailBase, UI.SPR_TYPE_ICON, UI.SPR_TYPE_ICON_BG, UI.SPR_TYPE_ICON_RARITY, item.tableData); SetRenderEquipModel((Enum)UI.TEX_MODEL, equipItemData.id, sex, faceID, 1f); ResetTween(detailBase, UI.TWN_FAVORITE, 0); ResetTween(detailBase, UI.TWN_UNFAVORITE, 0); SetActive(detailBase, UI.TWN_UNFAVORITE, !item.isFavorite); SetActive(detailBase, UI.TWN_FAVORITE, item.isFavorite); bool flag2 = !item.IsLevelMax() || !item.IsExceedMax() || item.tableData.IsEvolve() || item.tableData.IsShadow(); SetActive((Enum)UI.BTN_GROW, flag2 && CanSmithSection(callSection)); SetActive((Enum)UI.BTN_GROW_OFF, !flag2 && CanSmithSection(callSection)); } else { NotDataEquipParam(); } }
private void SetupBottomButton() { switch (smithType) { case SmithType.EVOLVE: { SetActive((Enum)UI.BTN_NEXT, false); SetActive((Enum)UI.BTN_NEXT_GRAY, false); SetActive((Enum)UI.BTN_TO_SELECT, false); SetActive((Enum)UI.BTN_TO_SELECT_CENTER, true); EquipItemInfo equipItemInfo = resultData.itemData as EquipItemInfo; if (equipItemInfo != null && (!equipItemInfo.IsLevelMax() || !equipItemInfo.IsExceedMax() || equipItemInfo.tableData.IsShadow())) { SetActive((Enum)UI.BTN_NEXT, true); SetEvent((Enum)UI.BTN_NEXT, "NEXT_GROW_AUTO", 0); SetActive((Enum)UI.BTN_TO_SELECT, true); SetActive((Enum)UI.BTN_TO_SELECT_CENTER, false); SetLabelText((Enum)UI.LBL_NEXT_BTN, base.sectionData.GetText("CONTINUE")); } break; } case SmithType.GENERATE: SetActive((Enum)UI.BTN_NEXT_GRAY, false); SetActive((Enum)UI.BTN_TO_SELECT, true); SetActive((Enum)UI.BTN_TO_SELECT_CENTER, false); SetLabelText((Enum)UI.LBL_NEXT_BTN, base.sectionData.GetText("CONTINUE")); break; case SmithType.GROW: { SetActive((Enum)UI.BTN_NEXT_GRAY, false); SetActive((Enum)UI.BTN_TO_SELECT, true); SetActive((Enum)UI.BTN_TO_SELECT_CENTER, false); bool flag = false; EquipItemInfo equipItemInfo2 = resultData.itemData as EquipItemInfo; if (equipItemInfo2 != null && equipItemInfo2.IsLevelMax()) { if (equipItemInfo2.tableData.IsEvolve()) { SetActive((Enum)UI.BTN_NEXT, true); SetActive((Enum)UI.BTN_NEXT_GRAY, false); SetEvent((Enum)UI.BTN_NEXT, "NEXT_EVOLVE_AUTO", 0); flag = true; } else if (!equipItemInfo2.IsExceedMax() || equipItemInfo2.tableData.IsShadow()) { SetActive((Enum)UI.BTN_NEXT, true); SetActive((Enum)UI.BTN_NEXT_GRAY, false); } else { SetActive((Enum)UI.BTN_NEXT, false); SetActive((Enum)UI.BTN_NEXT_GRAY, true); } } if (flag) { SetLabelText((Enum)UI.LBL_NEXT_BTN, base.sectionData.GetText("NEXT_EVOLVE")); SetLabelText((Enum)UI.LBL_NEXT_GRAY_BTN, base.sectionData.GetText("NEXT_EVOLVE")); } else { SetLabelText((Enum)UI.LBL_NEXT_BTN, base.sectionData.GetText("CONTINUE")); SetLabelText((Enum)UI.LBL_NEXT_GRAY_BTN, base.sectionData.GetText("CONTINUE")); } break; } case SmithType.SKILL_GROW: { SetActive((Enum)UI.BTN_NEXT_GRAY, false); SetActive((Enum)UI.BTN_TO_SELECT, true); SetActive((Enum)UI.BTN_TO_SELECT_CENTER, false); SkillItemInfo skillItemInfo = resultData.itemData as SkillItemInfo; if (skillItemInfo != null && skillItemInfo.IsLevelMax()) { SetActive((Enum)UI.BTN_NEXT, false); SetActive((Enum)UI.BTN_NEXT_GRAY, true); } SetLabelText((Enum)UI.LBL_NEXT_BTN, base.sectionData.GetText("CONTINUE")); SetLabelText((Enum)UI.LBL_NEXT_GRAY_BTN, base.sectionData.GetText("CONTINUE")); break; } } SetLabelText((Enum)UI.LBL_NEXT_BTN_R, base.GetComponent <UILabel>((Enum)UI.LBL_NEXT_BTN).text); SetLabelText((Enum)UI.LBL_NEXT_GRAY_BTN_R, base.GetComponent <UILabel>((Enum)UI.LBL_NEXT_GRAY_BTN).text); SetLabelText((Enum)UI.LBL_TO_SELECT_CENTER_R, base.GetComponent <UILabel>((Enum)UI.LBL_TO_SELECT_CENTER).text); }