|
@@ -118,6 +118,12 @@ namespace FL.FGUI
|
|
|
}
|
|
|
private void OnClickResetBtn(EventContext context)
|
|
|
{
|
|
|
+ ConfirmationBoxParam dialogParam = new ConfirmationBoxParam()
|
|
|
+ {
|
|
|
+ cnt = StringDefine.resetCurrentPlan,
|
|
|
+ onPromiseCallback = PlayerService.Instance.SendToResetPlan
|
|
|
+ };
|
|
|
+ Context.UI.OpenAsync(UIKeys.CommonConfirmationBox, dialogParam);
|
|
|
}
|
|
|
private void OnClickChangeImprintBtn(EventContext context)
|
|
|
{
|
|
@@ -136,7 +142,7 @@ namespace FL.FGUI
|
|
|
if (!ItemService.Instance.IsEnough(_upgradeItemId, _upgradeCostVal, true))
|
|
|
return;
|
|
|
|
|
|
- PlayerService.Instance.SendToUpgradeRune(_selectImprint,1);
|
|
|
+ PlayerService.Instance.SendToUpgradeRune(_selectImprint+1,1);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 升级10次印记
|
|
@@ -147,7 +153,7 @@ namespace FL.FGUI
|
|
|
if (!ItemService.Instance.IsEnough(_upgradeItemId, _upgradeCostVal*10, true))
|
|
|
return;
|
|
|
|
|
|
- PlayerService.Instance.SendToUpgradeRune(_selectImprint, 10);
|
|
|
+ PlayerService.Instance.SendToUpgradeRune(_selectImprint+1, 10);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -157,12 +163,20 @@ namespace FL.FGUI
|
|
|
EventSingle.Instance.AddListener(EventDefine.UpdataItemData, UpdataItemData);
|
|
|
EventSingle.Instance.AddListener(EventDefine.WakeUpRuneSucess, WakeUpRuneSucess);
|
|
|
EventSingle.Instance.AddListener(EventDefine.UpgradeRuneLvSucess, UpgradeRuneLvSucess);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.ChangePlanIndexSucess, ChangePlanIndexSucess);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.ResetCurrentPlanSucess,ResetCurrentPlanSucess);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.ChangePlanNameSucess, ChangePlanNameSucess);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.ChangeRuneTypeSucess, ChangeRuneTypeSucess);
|
|
|
}
|
|
|
private void RemoveEventListner()
|
|
|
{
|
|
|
EventSingle.Instance.RemoveListener(EventDefine.UpdataItemData, UpdataItemData);
|
|
|
EventSingle.Instance.RemoveListener(EventDefine.WakeUpRuneSucess, WakeUpRuneSucess);
|
|
|
EventSingle.Instance.RemoveListener(EventDefine.UpgradeRuneLvSucess, UpgradeRuneLvSucess);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.ChangePlanIndexSucess, ChangePlanIndexSucess);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.ResetCurrentPlanSucess,ResetCurrentPlanSucess);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.ChangePlanNameSucess, ChangePlanNameSucess);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.ChangeRuneTypeSucess, ChangeRuneTypeSucess);
|
|
|
}
|
|
|
|
|
|
private void InitUI()
|
|
@@ -193,7 +207,7 @@ namespace FL.FGUI
|
|
|
private void ShowUI()
|
|
|
{
|
|
|
ShowPlayerSpine("info_job_1001_1_SkeletonData");
|
|
|
- ShowImprintUI();
|
|
|
+ ShowImprintUI(true);
|
|
|
ShowAwakeCostUI(1);
|
|
|
}
|
|
|
|
|
@@ -207,22 +221,22 @@ namespace FL.FGUI
|
|
|
VM.JobSpine.LoadSpine(spineName, "stand", true);
|
|
|
}
|
|
|
|
|
|
- private void ShowImprintUI()
|
|
|
+ private void ShowImprintUI(bool bInit = false)
|
|
|
{
|
|
|
RunePlan runePlanData = PlayerData.Instance.RunePlanMap[_selectPlanIndex];
|
|
|
bool bAllLock = true;
|
|
|
bool bMaxLv = true;
|
|
|
bool bWaitAwake = false;
|
|
|
int index = 0;
|
|
|
- foreach (var rune in runePlanData.slot)
|
|
|
+ foreach (var rune in runePlanData.slot)
|
|
|
{
|
|
|
_runeIdArray[index] = rune.runeId;
|
|
|
index++;
|
|
|
- if (bAllLock && rune.runeId > 0)
|
|
|
+ if (bAllLock && rune.runeId > 0)
|
|
|
{
|
|
|
bAllLock = false;
|
|
|
}
|
|
|
- if (bWaitAwake && rune.runeId == 0)
|
|
|
+ if (!bWaitAwake && rune.runeId == 0)
|
|
|
{
|
|
|
bWaitAwake = true;
|
|
|
}
|
|
@@ -246,6 +260,18 @@ namespace FL.FGUI
|
|
|
}
|
|
|
VM.LockCtrl.selectedIndex = bAllLock ? 1 : 0;
|
|
|
VM.AwakeCtrl.selectedIndex = bMaxLv ? 2 : (bWaitAwake ? 0 : 1);
|
|
|
+ if (bInit && _runeIdArray[_selectImprint] == 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < _runeIdArray.Length; i++)
|
|
|
+ {
|
|
|
+ if (_runeIdArray[i] > 0)
|
|
|
+ {
|
|
|
+ _selectImprint = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ShowImprintRuneUI();
|
|
|
}
|
|
|
|
|
@@ -292,7 +318,11 @@ namespace FL.FGUI
|
|
|
{
|
|
|
_upgradeItemId = runeExpInfo.Cost[0];
|
|
|
_upgradeCostVal = runeExpInfo.Cost[1];
|
|
|
- VM.UpgradeCostItem.Ctrl.ShowCostUI(_upgradeItemId, _upgradeCostVal, 0);
|
|
|
+ RunePlan runePlanData = PlayerData.Instance.RunePlanMap[_selectPlanIndex];
|
|
|
+ // allPoint - 当前方案的subPoint) + 玩家的道具
|
|
|
+ int upgradePoint = PlayerData.Instance.AllPoint - runePlanData.subPoint + (int)ItemData.Instance.GetItemNum(_upgradeItemId);
|
|
|
+ VM.UpgradeCostItem.Ctrl.ShowCostUI(_upgradeItemId, _upgradeCostVal, upgradePoint);
|
|
|
+ VM.TenCostItem.Ctrl.ShowCostUI(_upgradeItemId, _upgradeCostVal*10, upgradePoint);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -302,6 +332,7 @@ namespace FL.FGUI
|
|
|
/// <param name="imprintIndex"></param>
|
|
|
private void OnclcickImprintItem(int imprintIndex)
|
|
|
{
|
|
|
+ _selectImprint = imprintIndex;
|
|
|
ShowImprintItemUI(imprintIndex);
|
|
|
for (int i = 0; i < _imprintItemList.Count; i++)
|
|
|
{
|
|
@@ -334,16 +365,27 @@ namespace FL.FGUI
|
|
|
{
|
|
|
int runeId = GetRuneId(index+1);
|
|
|
bool bShowChangeImprintBtn = true;
|
|
|
+ int lvCtrlIndex = 0;
|
|
|
if (runeId == 0)
|
|
|
{
|
|
|
// 展示信息 槽位id * 10000 + 符文类型 * 1000
|
|
|
- runeId = index * 10000 + 1001;
|
|
|
+ runeId = (index+1) * 10000 + 1001;
|
|
|
bShowChangeImprintBtn = false;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var runeLevelInfo = rune_levelTableRepo.Get(runeId);
|
|
|
+ if (runeLevelInfo == null)
|
|
|
+ lvCtrlIndex = 2;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var runeExpInfo = rune_expTableRepo.Get(runeLevelInfo.Level +1);
|
|
|
+ lvCtrlIndex = runeExpInfo == null ? 2 : 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
var imprintInfo = _runeTableList[index];
|
|
|
if (imprintInfo != null)
|
|
|
{
|
|
|
- int a = (runeId - (index + 1) * 10000);
|
|
|
int runeType = (runeId - (index+1) * 10000) / 1000 - 1;
|
|
|
VM.ImprintNameLabel.text = imprintInfo.Name[runeType];
|
|
|
if (bShowChangeImprintBtn && imprintInfo.Handoff.Length == 1) bShowChangeImprintBtn = false;
|
|
@@ -351,6 +393,7 @@ namespace FL.FGUI
|
|
|
ShowRuneAttrUI(runeId);
|
|
|
ShowUpgradeCostUI(runeId);
|
|
|
VM.ChangeImprintBtn.visible = bShowChangeImprintBtn;
|
|
|
+ VM.LevelCtrl.selectedIndex = lvCtrlIndex;
|
|
|
}
|
|
|
|
|
|
private void ShowRuneAttrUI(int runeId)
|
|
@@ -364,9 +407,11 @@ namespace FL.FGUI
|
|
|
var attributeInfo = AttrDescTableRepo.Get(runeInfo.Value_plus[i]);
|
|
|
if (attributeInfo != null)
|
|
|
{
|
|
|
- sb.Append(attributeInfo.Name);
|
|
|
+ sb.Append(attributeInfo.ShowName);
|
|
|
+ sb.Append("[color=#1EF369]+");
|
|
|
sb.Append(attributeInfo.Num_type == 1 ? TableUtils.ToRealDouble(runeInfo.Value_plus[i+1]).ToString("F3") + "%" :
|
|
|
(attributeInfo.Id == (int)EAttributeType.AtkSpeed ? TableUtils.ToRealDouble(runeInfo.Value_plus[i + 1]).ToString("F1") : runeInfo.Value_plus[i + 1].ToString()));
|
|
|
+ sb.Append("[/color]");
|
|
|
}
|
|
|
}
|
|
|
VM.ImprintDescLabel.text = sb.ToString();
|
|
@@ -419,10 +464,51 @@ namespace FL.FGUI
|
|
|
/// <param name="args"></param>
|
|
|
private void UpgradeRuneLvSucess(int eventId, object args)
|
|
|
{
|
|
|
+ ShowImprintUI();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 切换符文方案
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="eventId"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private void ChangePlanIndexSucess(int eventId, object args)
|
|
|
+ {
|
|
|
+ _selectImprint = PlayerData.Instance.CurPlanIndex;
|
|
|
+ ShowImprintUI();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 成功重置当前方案
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="eventId"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private void ResetCurrentPlanSucess(int eventId, object args)
|
|
|
+ {
|
|
|
+ ShowImprintUI();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 成功更换印记类型
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="eventId"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private void ChangeRuneTypeSucess(int eventId, object args)
|
|
|
+ {
|
|
|
ShowImprintItemUI(_selectImprint);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 成功修改符文方案名字
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="eventId"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private void ChangePlanNameSucess(int eventId, object args)
|
|
|
+ {
|
|
|
+ SelectPlanNameItem(_selectPlanIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 修改方案名
|
|
|
/// </summary>
|
|
|
/// <param name="rename">要修改的名称</param>
|
|
@@ -431,7 +517,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
if (bChange)
|
|
|
{
|
|
|
-
|
|
|
+ PlayerService.Instance.SendToAlterPlanName(changeName,_selectPlanIndex);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -453,11 +539,17 @@ namespace FL.FGUI
|
|
|
VM.PlansNameNestedItem.Disable();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 选择(符文升级)方案
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="index"></param>
|
|
|
+
|
|
|
private void SelectPlanNameItem(int index)
|
|
|
{
|
|
|
- if (index >= 0 && PlayerData.Instance.RunePlanNamesArray.Length > 0)
|
|
|
+ if (index > 0 && PlayerData.Instance.RunePlanNamesArray.Count > 0)
|
|
|
{
|
|
|
- VM.PlansNameBtn.title = PlayerData.Instance.RunePlanNamesArray[index].name;
|
|
|
+ VM.PlansNameBtn.title = PlayerData.Instance.RunePlanNamesArray[index-1];
|
|
|
}
|
|
|
ShowPlansNameNestedItem(false);
|
|
|
}
|