|
@@ -43,6 +43,10 @@ namespace FL.FGUI
|
|
|
private List<MountAttrParam> _mountSpecialAttrList;
|
|
|
private Dictionary<int, zuoqiInfoTable> _mountStepMap; // 坐骑星阶数据
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 通用坐骑每阶的最大升星等级
|
|
|
+ /// </summary>
|
|
|
+ private const int MaxStarLv = 10;
|
|
|
|
|
|
protected override void OnEnable(object intent)
|
|
|
{
|
|
@@ -111,12 +115,9 @@ namespace FL.FGUI
|
|
|
private void OnClickRideBtn(EventContext context)
|
|
|
{
|
|
|
int mountId = _mountModelList[_mountIndex].tableId;
|
|
|
- if (mountId == 0)
|
|
|
- {
|
|
|
- XGame.Framework.Assert.IsNotNull(mountId);
|
|
|
- }
|
|
|
|
|
|
- if (mountId == MountData.Instance.mountModelId)
|
|
|
+
|
|
|
+ if (mountId == MountData.Instance.MountModelId)
|
|
|
{
|
|
|
MountService.Instance.SendToRideDown();
|
|
|
}
|
|
@@ -147,9 +148,13 @@ namespace FL.FGUI
|
|
|
/// </summary>
|
|
|
private void GetMouuntModelData()
|
|
|
{
|
|
|
- _universalId = MountData.Instance.universalId;
|
|
|
- _curMountInfo = zuoqiInfoTableRepo.Get(MountData.Instance.universalId);
|
|
|
- XGame.Framework.Assert.IsNotNull(_curMountInfo, $"坐骑表zuoqiInfo信息不存在,id:{MountData.Instance.universalId}");
|
|
|
+ _universalId = MountData.Instance.UniversalId;
|
|
|
+ _curMountInfo = zuoqiInfoTableRepo.Get(MountData.Instance.UniversalId);
|
|
|
+ if (_curMountInfo == null)
|
|
|
+ {
|
|
|
+ XGame.Log.Error($"坐骑表zuoqiInfo信息不存在,id:{MountData.Instance.UniversalId}");
|
|
|
+ return;
|
|
|
+ }
|
|
|
var mountBaseInfo = zuoqiBaseTableRepo.Get(_curMountInfo.Zqid);
|
|
|
if (mountBaseInfo != null)
|
|
|
{
|
|
@@ -159,39 +164,46 @@ namespace FL.FGUI
|
|
|
_mountModelList.Clear();
|
|
|
int starLv = _curMountInfo.Star;
|
|
|
var cfgInfoList = zuoqiInfoTableRepo.GetAll();
|
|
|
+ var first = cfgInfoList[0];
|
|
|
+ var last = cfgInfoList[cfgInfoList.Length - 1];
|
|
|
+ int mountId = first.Zqid;
|
|
|
string lastModelName = string.Empty;
|
|
|
- foreach (var cfgInfo in cfgInfoList)
|
|
|
+ int paramId = mountId * 10000;
|
|
|
+ for (var step = first.Step; step <= last.Step; step++)
|
|
|
{
|
|
|
- if (cfgInfo.Icon != lastModelName)
|
|
|
+ var mountInfo = zuoqiInfoTableRepo.Get(paramId + step * 100);
|
|
|
+ if (mountInfo != null)
|
|
|
{
|
|
|
- lastModelName = cfgInfo.Icon;
|
|
|
- _mountModelList.Add(new MountModelParam()
|
|
|
+ if (mountInfo.Spine != lastModelName)
|
|
|
{
|
|
|
- tableId = cfgInfo.Id,
|
|
|
- unlockStep = cfgInfo.Step,
|
|
|
- bLock = _curMountInfo.Step < cfgInfo.Step || starLv < cfgInfo.Star,
|
|
|
- spineName = cfgInfo.Spine
|
|
|
- });
|
|
|
- }
|
|
|
- if (cfgInfo.Star == 0 && !_mountStepMap.ContainsKey(cfgInfo.Step))
|
|
|
- {
|
|
|
- _mountStepMap.Add(cfgInfo.Step, cfgInfo);
|
|
|
+ lastModelName = mountInfo.Spine;
|
|
|
+ _mountModelList.Add(new MountModelParam()
|
|
|
+ {
|
|
|
+ tableId = mountInfo.Id,
|
|
|
+ unlockStep = mountInfo.Step,
|
|
|
+ bLock = _curMountInfo.Step < mountInfo.Step || starLv < mountInfo.Star,
|
|
|
+ spineName = mountInfo.Spine
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (mountInfo.Star == 0 && !_mountStepMap.ContainsKey(mountInfo.Step))
|
|
|
+ {
|
|
|
+ _mountStepMap.Add(mountInfo.Step, mountInfo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- ///
|
|
|
+ /// 优先获取骑乘的普通坐骑索引,如果骑乘的不是普通坐骑,则显示当前解锁的最高阶坐骑索引
|
|
|
/// </summary>
|
|
|
-
|
|
|
private void SetMountIndex()
|
|
|
{
|
|
|
_mountIndex = 0;
|
|
|
int showMountModelId = 0;
|
|
|
- var advanceMountInfo = zuoqiBaseTableRepo.Get(MountData.Instance.mountModelId);
|
|
|
+ var advanceMountInfo = zuoqiBaseTableRepo.Get(MountData.Instance.MountModelId);
|
|
|
if (advanceMountInfo == null)
|
|
|
{
|
|
|
- var mountModelInfo = zuoqiInfoTableRepo.Get(MountData.Instance.mountModelId);
|
|
|
+ var mountModelInfo = zuoqiInfoTableRepo.Get(MountData.Instance.MountModelId);
|
|
|
if (mountModelInfo != null)
|
|
|
{
|
|
|
showMountModelId = mountModelInfo.Id;
|
|
@@ -246,7 +258,7 @@ namespace FL.FGUI
|
|
|
/// </summary>
|
|
|
private void ShowExp()
|
|
|
{
|
|
|
- VM.ExpBar.value = VM.MaxUpgradeStep.selectedIndex == 1 ? VM.ExpBar.max : MountData.Instance.exp;
|
|
|
+ VM.ExpBar.value = VM.MaxUpgradeStep.selectedIndex == 1 ? VM.ExpBar.max : MountData.Instance.UniversalExp;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -274,7 +286,7 @@ namespace FL.FGUI
|
|
|
VM.MountStepLvLabel.text = stepLv.ToString();
|
|
|
var nextInfo = _mountStepMap.ContainsKey(_curMountInfo.Step + 1) ? _mountStepMap[_curMountInfo.Step + 1] : null;
|
|
|
bool bMaxStep = nextInfo == null;
|
|
|
- if (bMaxStep && _curMountInfo.Star == 10)
|
|
|
+ if (bMaxStep && _curMountInfo.Star == MaxStarLv)
|
|
|
{
|
|
|
ShowMaxUpgradeStep(true);//满星阶状态
|
|
|
ShowCostItemNestedUI(false);
|
|
@@ -292,7 +304,7 @@ namespace FL.FGUI
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- ///
|
|
|
+ /// 满星阶
|
|
|
/// </summary>
|
|
|
/// <param name="bShow"></param>
|
|
|
private void ShowMaxUpgradeStep(bool bShow)
|
|
@@ -301,7 +313,7 @@ namespace FL.FGUI
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- ///
|
|
|
+ /// 通用坐骑升级消耗
|
|
|
/// </summary>
|
|
|
/// <param name="bShow"></param>
|
|
|
private void ShowCostItemNestedUI(bool bShow)
|
|
@@ -321,7 +333,7 @@ namespace FL.FGUI
|
|
|
VM.BaseStarLvLabel.text = starLv.ToString();
|
|
|
_mountBaseAttrList.Clear();
|
|
|
zuoqiInfoTable nextInfo;
|
|
|
- if (starLv < 10)
|
|
|
+ if (starLv < MaxStarLv)
|
|
|
nextInfo = zuoqiInfoTableRepo.Get(_curMountInfo.Id + 1);
|
|
|
else
|
|
|
{
|
|
@@ -359,7 +371,7 @@ namespace FL.FGUI
|
|
|
VM.UnLockModelLabel.text = string.Format(StringDefine.UnlockMountStep, param.unlockStep);
|
|
|
}
|
|
|
else
|
|
|
- ShowRideUI(true, param.tableId == MountData.Instance.mountModelId);
|
|
|
+ ShowRideUI(true, param.tableId == MountData.Instance.MountModelId);
|
|
|
}
|
|
|
ShowSwitchMountBtnState();
|
|
|
}
|
|
@@ -398,7 +410,7 @@ namespace FL.FGUI
|
|
|
/// <param name="args"></param>
|
|
|
private void FeedMountSucessful(int eventId, object args)
|
|
|
{
|
|
|
- if (_universalId == MountData.Instance.universalId)
|
|
|
+ if (_universalId == MountData.Instance.UniversalId)
|
|
|
{
|
|
|
ShowExp();
|
|
|
return;
|
|
@@ -417,7 +429,7 @@ namespace FL.FGUI
|
|
|
var param = _mountModelList[_mountIndex];
|
|
|
if (param.tableId > 0)
|
|
|
{
|
|
|
- ShowRideUI(!param.bLock, param.tableId == MountData.Instance.mountModelId);
|
|
|
+ ShowRideUI(!param.bLock, param.tableId == MountData.Instance.MountModelId);
|
|
|
}
|
|
|
}
|
|
|
|