//显示强化信息 void ShowEnhanceInfo(int index) { EnchanceItem = pItem[index]; Enchancebutton.UpdateItem(EnchanceItem.GetID()); int j = EnhancePage[nTheIndex] * 10; for (int i = 0; i < 10; i++) { if (i + j >= pItem.Count) { EnhanceNames[i].Text = ""; EnchanceLevels[i].Text = ""; EnchanceRadios[i].Hide(true); } else { EnhanceNames[i].Text = pItem[i + j].GetName(); EnchanceLevels[i].Text = CDataPool.Instance.GetStrengthLevelDesc(pItem[i + j].GetStrengthLevel()); EnchanceRadios[i].Hide(false); } } EnchancePreLevel.Text = "强化等级:" + CDataPool.Instance.GetStrengthLevelDesc(EnchanceItem.GetStrengthLevel()); EnchanceCurrentLevel.Text = CDataPool.Instance.GetStrengthLevelDesc(EnchanceItem.GetStrengthLevel()); EnchanceNextLevel.Text = CDataPool.Instance.GetStrengthNextLevelDesc(EnchanceItem.GetStrengthLevel()); int selectIndex = (int)EnchanceSelect[nTheIndex]; if (EnhancePage[nTheIndex] == EnhancePageRadio[nTheIndex]) { EnchanceRadios[selectIndex].Value = true; } else { EnchanceRadios[selectIndex].Value = false; } EnchancePageNum.Text = (EnhancePage[nTheIndex] + 1) + "/" + GetPageNum(); Item_Enhance itemEnhance = LifeAbility.Instance.Get_Equip_EnhanceLevel((CObject_Item)EnchanceItem); int NeedMoney = itemEnhance.needMoney; int Property = itemEnhance.addProperty; if (NeedMoney <= 0 || Property < 0) { if (EnchanceItem != null) { EnhanceMoney.Text = "0"; //QiangHuaButton.Disable(); } else { LogManager.LogError("此装备无法强化。"); return; } } else { QiangHuaButton.Enable(); } }
/// <summary> /// 强化 /// </summary> void UpdateEnchance() { ClearEnchanceContext(); mIsEnableEnchance = false; if (mSelectedItem != null) { //属性 mEnchanceSelectedAction.SetActionItem(mSelectedItem.GetID()); string text = mSelectedItem.GetWhiteAttribute(0); mEnchanceSelectedAttri1.Text = UIString.Instance.ParserString_Runtime(text); text = mSelectedItem.GetWhiteAttribute(1); if (text == "") { mEnchanceSelectedAttri2.Hide(true); } else { mEnchanceSelectedAttri2.Hide(false); mEnchanceSelectedAttri2.Text = UIString.Instance.ParserString_Runtime(text); } //效果 int nEnchanceLevel = mSelectedItem.GetStrengthLevel() + 1; CObject_Item_Equip equip = mSelectedItem as CObject_Item_Equip; if (equip != null) { text = equip.GetStrengthAttributeValue(nEnchanceLevel, 0); mEnchanceResultAttri1.Text = UIString.Instance.ParserString_Runtime(text); text = equip.GetStrengthAttributeValue(nEnchanceLevel, 1); if (text == "") { mEnchanceResultAttri2.Hide(true); } else { mEnchanceResultAttri2.Hide(false); mEnchanceResultAttri2.Text = UIString.Instance.ParserString_Runtime(text); } } Item_Enhance itemEnhance = LifeAbility.Instance.Get_Equip_EnhanceLevel(mSelectedItem); mEnchanceMoney.Text = itemEnhance.needMoney + " 金钱"; //是否可强化 if (mSelectedItem.GetStrengthLevel() < CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Level() && itemEnhance.needMoney <= CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Money()) { mEnchanceOK.controlIsEnabled = true; } } }