|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
/// #pkgName FGUI包名
|
|
|
/// #panelName UIPanel名字
|
|
|
/// #UIName = $"{#pkgName}{#panelName}" UIKey名字
|
|
@@ -7,6 +6,7 @@
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
using FairyGUI;
|
|
|
+using FL.Data;
|
|
|
using XGame.Database;
|
|
|
using XGame.Framework.UI;
|
|
|
|
|
@@ -19,10 +19,6 @@ namespace FL.FGUI
|
|
|
public partial class PartnerPartnerBookDetailPanelCtrl
|
|
|
: UIController<PartnerPartnerBookDetailPanelVM>
|
|
|
{
|
|
|
- private bool _initView = false;
|
|
|
- private int _curId;
|
|
|
- private List<int> _list;
|
|
|
-
|
|
|
protected override void OnEnable(object intent)
|
|
|
{
|
|
|
_curId = (int)intent;
|
|
@@ -42,6 +38,8 @@ namespace FL.FGUI
|
|
|
VM.LeftBtn.onClick.Add(OnClickLeftBtn);
|
|
|
VM.RightBtn.onClick.Add(OnClickRightBtn);
|
|
|
VM.GetBtn.onClick.Add(OnClickGetBtn);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.PartnerJibanRwdGet, OnRwdGet);
|
|
|
+ EventSingle.Instance.AddListener(EventDefine.PartnerJibanRwdGetAll, OnRwdGet);
|
|
|
}
|
|
|
|
|
|
private void RemoveUIListenres()
|
|
@@ -49,6 +47,13 @@ namespace FL.FGUI
|
|
|
VM.LeftBtn.onClick.Remove(OnClickLeftBtn);
|
|
|
VM.RightBtn.onClick.Remove(OnClickRightBtn);
|
|
|
VM.GetBtn.onClick.Remove(OnClickGetBtn);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.PartnerJibanRwdGet, OnRwdGet);
|
|
|
+ EventSingle.Instance.RemoveListener(EventDefine.PartnerJibanRwdGetAll, OnRwdGet);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnRwdGet(int eventId, object args)
|
|
|
+ {
|
|
|
+ UpdateList();
|
|
|
}
|
|
|
|
|
|
private void OnClickLeftBtn(EventContext context)
|
|
@@ -61,9 +66,51 @@ namespace FL.FGUI
|
|
|
SelectOffset(1);
|
|
|
}
|
|
|
|
|
|
- private void OnClickGetBtn(EventContext context) { }
|
|
|
+ private void OnClickGetBtn(EventContext context)
|
|
|
+ {
|
|
|
+ var collectTable = collectTableRepo.Get(_curId);
|
|
|
+ var starLv = 0;
|
|
|
+ foreach (var id in collectTable.Param)
|
|
|
+ {
|
|
|
+ if (
|
|
|
+ collectTable.Type == 1
|
|
|
+ && PartnersData.Instance.TryGetPartnerAttrByTableId(id, out var attr)
|
|
|
+ )
|
|
|
+ {
|
|
|
+ starLv += attr.RisingStarLv;
|
|
|
+ }
|
|
|
+ else if (
|
|
|
+ collectTable.Type == 2
|
|
|
+ && EpigraphData.Instance.TryGetEpigraphAttrByTableId(id, out var epi)
|
|
|
+ )
|
|
|
+ {
|
|
|
+ starLv += epi.StarLv;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var rwdList = collect_rewardTableRepo.GetCollectRwdList(_curId);
|
|
|
+ var canGet = false;
|
|
|
+ foreach (var item in rwdList)
|
|
|
+ {
|
|
|
+ if (
|
|
|
+ starLv > item.Unlock
|
|
|
+ && !PartnersData.Instance.GetJibaIsActive(item.CollectId, item.Level)
|
|
|
+ )
|
|
|
+ {
|
|
|
+ canGet = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (canGet)
|
|
|
+ {
|
|
|
+ PartnersService.Instance.RequestJibanRwdGetAll(_curId);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
+ private bool _initView = false;
|
|
|
+ private int _curId;
|
|
|
+ private List<int> _list;
|
|
|
+
|
|
|
private void InitView()
|
|
|
{
|
|
|
if (_initView)
|
|
@@ -71,7 +118,7 @@ namespace FL.FGUI
|
|
|
_initView = true;
|
|
|
VM.List.ListType = EGListType.None;
|
|
|
VM.RwdList.ListType = EGListType.Virtual;
|
|
|
- var tableList = collectTableRepo.GetAllPartnerCollectList();
|
|
|
+ var tableList = collectTableRepo.GetAllEpiCollectList();
|
|
|
var list = new List<int>();
|
|
|
foreach (var item in tableList)
|
|
|
{
|
|
@@ -86,6 +133,11 @@ namespace FL.FGUI
|
|
|
XGame.Framework.Assert.IsNotNull(table, $"羁绊表不存在,id:{_curId}");
|
|
|
VM.List.BindDatas(table.Param);
|
|
|
VM.NameLabel.text = table.Name;
|
|
|
+ UpdateList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpdateList()
|
|
|
+ {
|
|
|
var list = collect_rewardTableRepo.GetCollectRwdList(_curId);
|
|
|
VM.RwdList.BindDatas(list);
|
|
|
}
|