|
@@ -285,18 +285,23 @@ namespace GFGGame
|
|
|
/// <summary>
|
|
|
/// 尝试穿戴配置套装
|
|
|
/// </summary>
|
|
|
- /// <param name="id">套装id</param>
|
|
|
+ /// <param name="suitId">套装id</param>
|
|
|
/// <param name="tryShowAction">尝试穿上动作</param>
|
|
|
/// <param name="excludeType">排除类型列表</param>
|
|
|
/// <param name="showOptional">是否显示可选部件</param>
|
|
|
/// <param name="CheckOwn">是否只显示主角拥有的部件</param>
|
|
|
- public void PutOnSuitCfg(int id, bool tryShowAction, int[] excludeType = null, bool showOptional = true, bool CheckOwn = true)
|
|
|
+ public void PutOnSuitCfg(int suitId, bool tryShowAction, int[] excludeType = null, bool showOptional = true, bool CheckOwn = true)
|
|
|
{
|
|
|
+ SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
|
|
|
+ if(suitCfg == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
bool oldIsAction = IsAction;
|
|
|
- _dressUpData.suitId = id;
|
|
|
+ _dressUpData.suitId = suitId;
|
|
|
bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(_dressUpData.suitId);
|
|
|
- _dressUpData.actionId = (hasSuitActionRes && tryShowAction) ? id : 0;
|
|
|
- SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_dressUpData.suitId);
|
|
|
+ _dressUpData.actionId = (hasSuitActionRes && tryShowAction) ? suitId : 0;
|
|
|
+
|
|
|
List<int> items = new List<int>(suitCfg.partsArr);
|
|
|
if (showOptional)
|
|
|
{
|
|
@@ -403,17 +408,25 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
//穿戴一组换装数据
|
|
|
- public void PutOnDressUpData(DressUpData targetDressUpData)
|
|
|
+ public void PutOnDressUpData(DressUpData targetDressUpData, int[] excludeType = null)
|
|
|
{
|
|
|
bool oldIsAction = IsAction;
|
|
|
_dressUpData.suitId = targetDressUpData.suitId;
|
|
|
_dressUpData.actionId = targetDressUpData.actionId;
|
|
|
var targetItemList = new List<int>();
|
|
|
- targetItemList.AddRange(targetDressUpData.itemList);
|
|
|
- if (targetDressUpData.bgId > 0)
|
|
|
+ foreach(var itemId in targetDressUpData.itemList)
|
|
|
+ {
|
|
|
+ int subType = ItemUtilCS.GetItemSubType(itemId);
|
|
|
+ if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
|
|
|
+ {
|
|
|
+ targetItemList.Add(itemId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (targetDressUpData.bgId > 0 && (excludeType == null || Array.IndexOf(excludeType, ConstDressUpItemType.BEI_JING) < 0))
|
|
|
{
|
|
|
targetItemList.Add(targetDressUpData.bgId);
|
|
|
}
|
|
|
+
|
|
|
CompareAndAddItemList(oldIsAction, IsAction, targetItemList);
|
|
|
checkDefaultItem();
|
|
|
|