|
@@ -41,6 +41,12 @@ namespace FL.FGUI
|
|
|
VM.MaskBtn.onClick.Add(OnClickMaskBtn);
|
|
|
VM.ConfirmBtn.onClick.Add(OnClickConfirmBtn);
|
|
|
VM.CancelBtn.onClick.Add(OnClickCancelBtn);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.PartnerFinishUpMode, OnFinishUpMode);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.PartnerOpenUpMode, OnOpenUpMode);
|
|
|
+ EventSingle.Instance.AddListener(
|
|
|
+ EventDefine.PartnerUpModeSelect,
|
|
|
+ OnPartnerUpModeSelect
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
private void RemoveUIListenres()
|
|
@@ -53,17 +59,41 @@ namespace FL.FGUI
|
|
|
VM.MaskBtn.onClick.Remove(OnClickMaskBtn);
|
|
|
VM.ConfirmBtn.onClick.Remove(OnClickConfirmBtn);
|
|
|
VM.CancelBtn.onClick.Remove(OnClickCancelBtn);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.PartnerFinishUpMode, OnFinishUpMode);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.PartnerOpenUpMode, OnOpenUpMode);
|
|
|
+ EventSingle.Instance.RemoveListener(
|
|
|
+ EventDefine.PartnerUpModeSelect,
|
|
|
+ OnPartnerUpModeSelect
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
- private void OnClickReplaceBtn(EventContext context) { }
|
|
|
+ private void OnClickReplaceBtn(EventContext context) {
|
|
|
+ Context.UI.OpenAsync(UIKeys.PartnerSbReplacePanel, _sbId);
|
|
|
+ }
|
|
|
|
|
|
- private void OnClickStrengthBtn(EventContext context) { }
|
|
|
+ private void OnClickStrengthBtn(EventContext context)
|
|
|
+ {
|
|
|
+ var slot = PartnersData.Instance.GetPlanSlot(
|
|
|
+ PartnersData.Instance.UsePlanId,
|
|
|
+ _curSelectPos
|
|
|
+ );
|
|
|
+ if (slot == null || slot.SbId == 0)
|
|
|
+ {
|
|
|
+ Context.ShowTips(StringDefine.PartnerEmptyTips);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Context.UI.OpenAsync(UIKeys.PartnerSbStrengthPanel, slot.SbId);
|
|
|
+ }
|
|
|
|
|
|
private void OnClickOneUpBtn(EventContext context) { }
|
|
|
|
|
|
- private void OnClickRecommendBtn(EventContext context) { }
|
|
|
+ private void OnClickRecommendBtn(EventContext context) {
|
|
|
+ Context.UI.OpenAsync(UIKeys.PartnerSbRecommendPanel);
|
|
|
+ }
|
|
|
|
|
|
- private void OnClickBagBtn(EventContext context) { }
|
|
|
+ private void OnClickBagBtn(EventContext context) {
|
|
|
+ Context.UI.OpenAsync(UIKeys.PartnerSbBagPanel);
|
|
|
+ }
|
|
|
|
|
|
private void OnClickMaskBtn(EventContext context) { }
|
|
|
|
|
@@ -71,10 +101,34 @@ namespace FL.FGUI
|
|
|
|
|
|
private void OnClickCancelBtn(EventContext context) { }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 圣兵上阵打开事件
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="eventId"></param>
|
|
|
+ /// <param name="args"></param>
|
|
|
+ private void OnOpenUpMode(int eventId, object args)
|
|
|
+ {
|
|
|
+ ShowUpMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnFinishUpMode(int eventId, object args)
|
|
|
+ {
|
|
|
+ ShowUpMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnPartnerUpModeSelect(int eventId, object args)
|
|
|
+ {
|
|
|
+ var pos = (int)args;
|
|
|
+ if (pos == _curSelectPos)
|
|
|
+ return;
|
|
|
+ _curSelectPos = pos;
|
|
|
+ UpdateDetail();
|
|
|
+ }
|
|
|
#endregion
|
|
|
#region 属性
|
|
|
private bool _initView = false;
|
|
|
private int _curSelectPos = 0;
|
|
|
+ private int _sbId = 0;
|
|
|
#endregion
|
|
|
#region 页面
|
|
|
private void InitView()
|
|
@@ -91,13 +145,29 @@ namespace FL.FGUI
|
|
|
UpdateDetail();
|
|
|
}
|
|
|
|
|
|
+ private void ShowUpMode()
|
|
|
+ {
|
|
|
+ if (PartnersData.Instance.UpModeSelect > 0)
|
|
|
+ {
|
|
|
+ VM.UpPartner.selectedIndex = 1;
|
|
|
+ }
|
|
|
+ else if (EpigraphData.Instance.UpModeSelect > 0)
|
|
|
+ {
|
|
|
+ VM.UpPartner.selectedIndex = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ VM.UpPartner.selectedIndex = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void RefreshGoneUpPartners(bool chooseFirstSb)
|
|
|
{
|
|
|
var plan = PartnersData.Instance.CurUsePlan;
|
|
|
- if(plan == null)
|
|
|
- {
|
|
|
- Log.Error($"圣兵上阵方案不存在,id:{PartnersData.Instance.CurUsePlan}");
|
|
|
- return;
|
|
|
+ if (plan == null)
|
|
|
+ {
|
|
|
+ Log.Error($"圣兵上阵方案不存在,id:{PartnersData.Instance.CurUsePlan}");
|
|
|
+ return;
|
|
|
}
|
|
|
if (chooseFirstSb)
|
|
|
{
|
|
@@ -124,16 +194,26 @@ namespace FL.FGUI
|
|
|
}
|
|
|
VM.SbList.BindDatas(list);
|
|
|
}
|
|
|
- private void UpdateDetail()
|
|
|
- {
|
|
|
+
|
|
|
+ private void UpdateDetail()
|
|
|
+ {
|
|
|
var plan = PartnersData.Instance.CurUsePlan;
|
|
|
- if (plan == null)
|
|
|
- {
|
|
|
- Log.Error($"圣兵上阵方案不存在,id:{PartnersData.Instance.CurUsePlan}");
|
|
|
- return;
|
|
|
- }
|
|
|
- var slot = plan.GetSlot(_curSelectPos);
|
|
|
- VM.SbDetailNested.Ctrl.ShowUI(slot?.SbId ?? 0);
|
|
|
+ if (plan == null)
|
|
|
+ {
|
|
|
+ Log.Error($"圣兵上阵方案不存在,id:{PartnersData.Instance.CurUsePlan}");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var slot = plan.GetSlot(_curSelectPos);
|
|
|
+ _sbId = slot?.SbId ?? 0;
|
|
|
+ VM.SbDetailNested.Ctrl.ShowUI(slot?.SbId ?? 0);
|
|
|
+ if (slot == null || slot.SbId == 0)
|
|
|
+ {
|
|
|
+ VM.IsEmpty.selectedIndex = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ VM.IsEmpty.selectedIndex = 0;
|
|
|
+ }
|
|
|
}
|
|
|
#endregion
|
|
|
}
|