using vnxbqy.UI;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
class EquipEvolveSuccessWin : ILWindow
|
{
|
Button closeBtn;
|
Text upgrateName;
|
List<Text> shenPros = new List<Text>();
|
ItemCell itemCell;
|
|
Text Base1Txt_Current;
|
Text Base1Txt_Next;
|
Text Base2Txt_Current;
|
Text Base2Txt_Next;
|
List<Transform> legendPros = new List<Transform>();
|
List<Text> LegendCurrent = new List<Text>();
|
List<Text> LegendNext = new List<Text>();
|
Transform BasePropertyLine_2;
|
float openTime = 0f;
|
|
#region Built-in
|
protected override void BindController()
|
{
|
closeBtn = proxy.GetWidgtEx<Button>("Btn_Close");
|
upgrateName = proxy.GetWidgtEx<Text>("upgratetxt");
|
legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro1"));
|
legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro2"));
|
legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro3"));
|
shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current1"));
|
shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current2"));
|
shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current3"));
|
itemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");
|
|
Base1Txt_Current = proxy.GetWidgtEx<Text>("Base1Txt_Current");
|
Base1Txt_Next = proxy.GetWidgtEx<Text>("Base1Txt_Next");
|
Base2Txt_Current = proxy.GetWidgtEx<Text>("Base2Txt_Current");
|
Base2Txt_Next = proxy.GetWidgtEx<Text>("Base2Txt_Next");
|
LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend1Txt_Current"));
|
LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend2Txt_Current"));
|
LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend3Txt_Current"));
|
LegendNext.Add(proxy.GetWidgtEx<Text>("Legend1Txt_Next"));
|
LegendNext.Add(proxy.GetWidgtEx<Text>("Legend2Txt_Next"));
|
LegendNext.Add(proxy.GetWidgtEx<Text>("Legend3Txt_Next"));
|
BasePropertyLine_2 = proxy.GetWidgtEx<Transform>("BasePropertyLine_2");
|
}
|
|
protected override void AddListeners()
|
{
|
closeBtn.SetListener(() => {
|
//打开1秒内不响应关闭
|
if (Time.time - openTime < 1)
|
{
|
return;
|
}
|
WindowCenter.Instance.CloseIL<EquipEvolveSuccessWin>();
|
});
|
|
}
|
|
protected override void OnPreOpen()
|
{
|
openTime = Time.time;
|
upgrateName.text = Language.Get("ShenEquipText" + EquipEvolveModel.Instance.GetRedEquipQuality(EquipEvolveModel.Instance.resultToEquipID));
|
ShowBasePro();
|
ShowLegendPro();
|
var model = new ItemCellModel(EquipEvolveModel.Instance.resultToEquipID, false, 1);
|
itemCell.Init(model);
|
ShowShenPro();
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
#endregion
|
|
|
void ShowBasePro()
|
{
|
var equipConfig = ItemConfig.Get(EquipEvolveModel.Instance.resultFromEquipID);
|
var nextEquipConfig = ItemConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
|
Base1Txt_Current.text = StringUtility.Contact(PlayerPropertyConfig.Get(equipConfig.Effect1).Name, ":", PlayerPropertyConfig.GetValueDescription(equipConfig.Effect1, equipConfig.EffectValueA1));
|
Base1Txt_Next.text = PlayerPropertyConfig.GetValueDescription(nextEquipConfig.Effect1, nextEquipConfig.EffectValueA1);
|
|
BasePropertyLine_2.SetActiveIL(false);
|
if (equipConfig.Effect2 != 0)
|
{
|
BasePropertyLine_2.SetActiveIL(true);
|
Base2Txt_Current.text = StringUtility.Contact(PlayerPropertyConfig.Get(equipConfig.Effect2).Name, ":", PlayerPropertyConfig.GetValueDescription(equipConfig.Effect2, equipConfig.EffectValueA2));
|
Base2Txt_Next.text = PlayerPropertyConfig.GetValueDescription(nextEquipConfig.Effect2, nextEquipConfig.EffectValueA2);
|
}
|
|
}
|
|
void ShowLegendPro()
|
{
|
for (int i = 0; i < legendPros.Count; i++)
|
{
|
legendPros[i].SetActiveIL(false);
|
}
|
|
var config = EquipShenAttrConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
|
if (config == null)
|
{
|
return;
|
}
|
int index = 0;
|
for (int i = 0; i < config.LegendAttrID.Length; i++)
|
{
|
int curValue = 0;
|
var proValue = config.LegendAttrValue[i];
|
var proID = config.LegendAttrID[i];
|
EquipEvolveModel.Instance.fromEquipLegends.TryGetValue(proID, out curValue);
|
if (curValue == proValue)
|
{
|
continue;
|
}
|
legendPros[index].SetActiveIL(true);
|
LegendCurrent[index].text = StringUtility.Contact(PlayerPropertyConfig.Get(proID).Name, ":", PlayerPropertyConfig.GetValueDescription(proID, curValue));
|
LegendNext[index].text = PlayerPropertyConfig.GetValueDescription(proID, proValue);
|
index++;
|
}
|
}
|
|
void ShowShenPro()
|
{
|
var equipInfo = EquipShenAttrConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
|
int[] proID;
|
int[] proValue;
|
if (equipInfo.ShenAttrID.Length != 0)
|
{
|
proID = equipInfo.ShenAttrID;
|
proValue = equipInfo.ShenAttrValue;
|
}
|
else if (equipInfo.XianAttrID.Length != 0)
|
{
|
proID = equipInfo.XianAttrID;
|
proValue = equipInfo.XianAttrValue;
|
}
|
else
|
{
|
proID = equipInfo.JiAttrID;
|
proValue = equipInfo.JiAttrValue;
|
}
|
for (int i = 0; i < shenPros.Count; i++)
|
{
|
if (i < proID.Length)
|
{
|
shenPros[i].SetActiveIL(true);
|
shenPros[i].text = Language.Get("ShenEquipText" + EquipEvolveModel.Instance.GetRedEquipQuality(EquipEvolveModel.Instance.resultToEquipID)) +
|
PlayerPropertyConfig.GetFullDescription(proID[i], proValue[i]);
|
|
continue;
|
}
|
|
shenPros[i].SetActiveIL(false);
|
}
|
|
|
}
|
}
|