diff --git a/FUI_UserData/CTT/assets/Bag/ComboBox.xml b/FUI_UserData/CTT/assets/Bag/ComboBox.xml
index 92d59c5e..470e477f 100644
--- a/FUI_UserData/CTT/assets/Bag/ComboBox.xml
+++ b/FUI_UserData/CTT/assets/Bag/ComboBox.xml
@@ -6,10 +6,10 @@
-
+
-
+
diff --git a/FUI_UserData/CTT/assets/Bag/StarSoulBagUI.xml b/FUI_UserData/CTT/assets/Bag/StarSoulBagUI.xml
index 246ac5a7..50d20a36 100644
--- a/FUI_UserData/CTT/assets/Bag/StarSoulBagUI.xml
+++ b/FUI_UserData/CTT/assets/Bag/StarSoulBagUI.xml
@@ -72,22 +72,22 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -95,6 +95,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Proto/OuterMessage.proto b/Proto/OuterMessage.proto
index 2562cea6..9f7d6d9c 100644
--- a/Proto/OuterMessage.proto
+++ b/Proto/OuterMessage.proto
@@ -2952,6 +2952,15 @@ message M2C_GetStarSoulBag // IActorLocationResponse
repeated int64 usedIdMap =2;
repeated KV_int32_int32 suitKVs =5;
}
+message M2C_SyncStarSoulBagInfo // IActorMessage
+{
+ int32 RpcId = 90;
+ int64 ActorId = 93;
+ repeated StarSoulNetItem itemList=1;
+ repeated int64 usedIdMap =2;
+ repeated KV_int32_int32 suitKVs =5;
+ int64 UnitId=3;
+}
message M2C_SyncStarSoulBag // IActorMessage
{
int32 RpcId = 90;
diff --git a/Server/Hotfix/Game/Handler/UI/Bag/C2M_GetStarSoulBagHandler.cs b/Server/Hotfix/Game/Handler/UI/Bag/C2M_GetStarSoulBagHandler.cs
index 45c46c7c..1e3d90e1 100644
--- a/Server/Hotfix/Game/Handler/UI/Bag/C2M_GetStarSoulBagHandler.cs
+++ b/Server/Hotfix/Game/Handler/UI/Bag/C2M_GetStarSoulBagHandler.cs
@@ -10,44 +10,8 @@ namespace ET
protected override async ETTask Run(Unit unit, C2M_GetStarSoulBag request, M2C_GetStarSoulBag response, Action reply)
{
StarSoulBag bag = unit.GetComponent();
- foreach (var kv in bag.itemDic)
- {
- try
- {
- StarSoulNetItem netItem = new();
- StarSoulItem item = kv.Value;
- netItem.Id = item.Id;
- netItem.level = item.level;
- netItem.exp = item.exp;
- netItem.quality = (int) item.quality;
- netItem.posType = (int) item.posType;
- netItem.typeId = item.typeId;
- netItem.isUsed = item.isUsed;
- netItem.main = item.mainId;
- netItem.isLocked = item.isLocked;
- foreach (int id in item.viceIds)
- {
- netItem.vice.Add(id);
- }foreach (float id in item.viceAdd)
- {
- netItem.viceAdd.Add(id);
- }
- response.itemList.Add(netItem);
- }
- catch (Exception e)
- {
- Log.Error(e);
- }
- }
- response.usedIdMap.AddRange(bag.usedStarSoulDic.Values);
- foreach (StarSoulSuit starSoulSuit in bag.Suits)
- {
- response.suitKVs.Add(new KV_int32_int32()
- {
- key = starSoulSuit.Id,
- value = (int) starSoulSuit.type
- });
- }
+ bag.GetBagInfo(response.itemList,response.usedIdMap,response.suitKVs);
+
reply();
await ETTask.CompletedTask;
}
diff --git a/Server/Hotfix/Game/Handler/UI/Character/C2M_GetCharacterHandler.cs b/Server/Hotfix/Game/Handler/UI/Character/C2M_GetCharacterHandler.cs
index 9018e91b..d976cf27 100644
--- a/Server/Hotfix/Game/Handler/UI/Character/C2M_GetCharacterHandler.cs
+++ b/Server/Hotfix/Game/Handler/UI/Character/C2M_GetCharacterHandler.cs
@@ -20,9 +20,7 @@ namespace ET
}
if (request.Id != unit.Id)
{
- M2C_SyncUnitAttributeList message = CharacterHelper.GetSyncUnitAttributeList(unitGet);
- message.UnitId = request.Id;
- MessageHelper.SendActor(unit, message);
+ await CharacterHelper.SyncUnitInfo(unit,unitGet);
}
response.UnitCharacter =await CharacterHelper.GetUnitCharacter(unitGet);
BagHelper.GetWornEquipInfo(unitGet, response.WornBagMapList);
diff --git a/Server/Hotfix/Game/Helper/CharacterHelper.cs b/Server/Hotfix/Game/Helper/CharacterHelper.cs
index c9789614..11fafbd2 100644
--- a/Server/Hotfix/Game/Helper/CharacterHelper.cs
+++ b/Server/Hotfix/Game/Helper/CharacterHelper.cs
@@ -619,5 +619,28 @@ namespace ET
unitSkillComponent.TransferJob(jobType);
await UserComponent.Instance.Save(user);
}
+
+ public static async ETTask SyncUnitInfo(Unit unit, Unit target)
+ {
+ await ETTask.CompletedTask;
+ //同步num
+ SyncTargetNumInfo(unit,target);
+ SyncTargetStarSoulInfo(unit,target);
+ }
+
+ private static void SyncTargetNumInfo(Unit unit, Unit target)
+ {
+ M2C_SyncUnitAttributeList message = CharacterHelper.GetSyncUnitAttributeList(target);
+ message.UnitId = target.Id;
+ MessageHelper.SendActor(unit, message);
+ }
+
+ private static void SyncTargetStarSoulInfo(Unit unit, Unit target)
+ {
+ M2C_SyncStarSoulBagInfo message = new M2C_SyncStarSoulBagInfo() { UnitId = target.Id};
+ StarSoulBag bag = target.GetComponent();
+ bag.GetBagInfo(message.itemList,message.usedIdMap,message.suitKVs);
+ MessageHelper.SendActor(unit, message);
+ }
}
}
diff --git a/Server/Hotfix/Game/System/Bag/StarSoulBagSystem.cs b/Server/Hotfix/Game/System/Bag/StarSoulBagSystem.cs
index e8b2ae6c..4fd62771 100644
--- a/Server/Hotfix/Game/System/Bag/StarSoulBagSystem.cs
+++ b/Server/Hotfix/Game/System/Bag/StarSoulBagSystem.cs
@@ -131,6 +131,11 @@ namespace ET
return itemBase;
}
+ ///
+ /// 同步已经使用的星魂
+ ///
+ ///
+ ///
private static void Sync(this StarSoulBag self,byte key)
{
self.usedStarSoulDic.TryGetValue(key, out long value);
@@ -147,10 +152,16 @@ namespace ET
}
MessageHelper.SendActor(self.GetParent(), proto);
}
+ ///
+ /// 同步背包
+ ///
+ ///
+ ///
+ ///
private static void Sync(this StarSoulBag self, long Id, StarSoulItem item)
{
M2C_SyncStarSoulBag proto = new();
- StarSoulNetItem netItem = new StarSoulNetItem();
+ StarSoulNetItem netItem = new();
if (item == null)
{
netItem.Id = 0;
@@ -182,6 +193,47 @@ namespace ET
MessageHelper.SendActor(self.GetParent(), proto);
}
+ public static void GetBagInfo(this StarSoulBag self, List itemList, List usedIdMap, List suitKVs)
+ {
+ foreach (var kv in self.itemDic)
+ {
+ try
+ {
+ StarSoulNetItem netItem = new();
+ StarSoulItem item = kv.Value;
+ netItem.Id = item.Id;
+ netItem.level = item.level;
+ netItem.exp = item.exp;
+ netItem.quality = (int) item.quality;
+ netItem.posType = (int) item.posType;
+ netItem.typeId = item.typeId;
+ netItem.isUsed = item.isUsed;
+ netItem.main = item.mainId;
+ netItem.isLocked = item.isLocked;
+ foreach (int id in item.viceIds)
+ {
+ netItem.vice.Add(id);
+ }foreach (float id in item.viceAdd)
+ {
+ netItem.viceAdd.Add(id);
+ }
+ itemList.Add(netItem);
+ }
+ catch (Exception e)
+ {
+ Log.Error(e);
+ }
+ }
+ usedIdMap.AddRange(self.usedStarSoulDic.Values);
+ foreach (StarSoulSuit starSoulSuit in self.Suits)
+ {
+ suitKVs.Add(new KV_int32_int32()
+ {
+ key = starSoulSuit.Id,
+ value = (int) starSoulSuit.type
+ });
+ }
+ }
private static string AddExp(this StarSoulBag self, StarSoulItem item, List<(int, int)> expList, ref int needCount)
{
if (item == null)
diff --git a/Server/Hotfix/Game/System/Other/DelaySendSyncAttributeComponentSystem.cs b/Server/Hotfix/Game/System/Other/DelaySendSyncAttributeComponentSystem.cs
index cb6456b7..95d0c817 100644
--- a/Server/Hotfix/Game/System/Other/DelaySendSyncAttributeComponentSystem.cs
+++ b/Server/Hotfix/Game/System/Other/DelaySendSyncAttributeComponentSystem.cs
@@ -3,78 +3,87 @@ using System.Collections.Generic;
namespace ET
{
- public class DelaySendSyncAttributeComponentAwakeSystem : AwakeSystem
+ public class DelaySendSyncAttributeComponentAwakeSystem: AwakeSystem
{
public override void Awake(DelaySendSyncAttributeComponent self)
{
DelaySendSyncAttributeComponent.instance = self;
}
}
- public class DelaySendSyncAttributeComponentUpdateSystem : UpdateSystem
+
+ public class DelaySendSyncAttributeComponentUpdateSystem: UpdateSystem
{
private HashSet needRemoveSet = new HashSet();
+
public override void Update(DelaySendSyncAttributeComponent self)
{
foreach (KeyValuePair>> item in self.dic.GetDictionary())
{
- needRemoveSet.Add(item.Key);
- List> list = item.Value;
- Unit unit = MapUnitComponent.Instance.Get(item.Key);
- if (!unit)
+ try
{
- if (unit!=null && Math.Abs(unit.Id) < 100000)
+ needRemoveSet.Add(item.Key);
+ List> list = item.Value;
+ Unit unit = MapUnitComponent.Instance.Get(item.Key);
+ if (!unit)
{
- Log.Error($"unit is invalid where id = {item.Key} ");
- foreach (KeyValuePair kv in item.Value)
+ if (unit != null && Math.Abs(unit.Id) < 100000)
{
- Log.Error($"k = {(NumericType)kv.Key}, v ={kv.Value}");
+ Log.Error($"unit is invalid where id = {item.Key} ");
+ foreach (KeyValuePair kv in item.Value)
+ {
+ Log.Error($"k = {(NumericType) kv.Key}, v ={kv.Value}");
+ }
+ }
+
+ continue;
+ }
+
+ if (list.Count == 0) continue;
+ IActorMessage message = null;
+ switch (list.Count)
+ {
+ case > 1:
+ {
+ M2C_SyncUnitAttributeList newMessage = new() { UnitId = unit.Id };
+ foreach (KeyValuePair kv in list)
+ {
+ newMessage.NumericMap.Add(new AttributeMap { Key = kv.Key, Value = kv.Value });
+ }
+
+ message = newMessage;
+ break;
+ }
+ case 1:
+ {
+ KeyValuePair kv = list[0];
+ message = new M2C_SyncUnitAttribute { UnitId = unit.Id, NumericType = kv.Key, Value = kv.Value };
+ break;
}
}
- continue;
- }
- IActorMessage message = null;
- if (list.Count > 1)
- {
- M2C_SyncUnitAttributeList newMessage = new M2C_SyncUnitAttributeList
- {
- UnitId = unit.Id
- };
- foreach (KeyValuePair kv in list)
- {
- newMessage.NumericMap.Add(new AttributeMap
- {
- Key = kv.Key,
- Value = kv.Value
- });
- }
- message = newMessage;
- }
- else if (list.Count == 1)
- {
- KeyValuePair kv = list[0];
- message = new M2C_SyncUnitAttribute
- {
- UnitId = unit.Id,
- NumericType = kv.Key,
- Value = kv.Value
- };
- }
- if (message != null)
- unit.GetComponent().BrocastInterval(message);
+ if (message != null)
+ unit.GetComponent().BrocastInterval(message);
+ }
+ catch (Exception e)
+ {
+ Log.Error(e);
+ }
}
+
foreach (long item in needRemoveSet)
{
self.dic.Remove(item);
}
+
needRemoveSet.Clear();
}
}
+
public static class DelaySendSyncAttributeComponentSystem
{
public static void Add(this DelaySendSyncAttributeComponent self, Unit unit, NumericType numericType, float value)
{
- self.dic.Add(unit.Id, KeyValuePair.Create((int)numericType, value));
+ self.dic.Add(unit.Id, KeyValuePair.Create((int) numericType, value));
}
}
-}
+}
\ No newline at end of file
diff --git a/Server/Model/Game/Entity/Bag/StarSoulBag.cs b/Server/Model/Game/Entity/Bag/StarSoulBag.cs
index 027dc06a..6fff3bec 100644
--- a/Server/Model/Game/Entity/Bag/StarSoulBag.cs
+++ b/Server/Model/Game/Entity/Bag/StarSoulBag.cs
@@ -93,5 +93,6 @@ namespace ET
[BsonIgnore]
public Func getAttributeFunc { get; set; }
+
}
}
\ No newline at end of file
diff --git a/Server/Model/Generate/Message/OuterMessage.cs b/Server/Model/Generate/Message/OuterMessage.cs
index d791e0c9..5c9d92ea 100644
--- a/Server/Model/Generate/Message/OuterMessage.cs
+++ b/Server/Model/Generate/Message/OuterMessage.cs
@@ -7073,6 +7073,33 @@ namespace ET
[ProtoMember(5)]
public List suitKVs = new List();
+ [ProtoMember(3)]
+ public long UnitId { get; set; }
+
+ }
+
+ [Message(OuterOpcode.M2C_SyncStarSoulBagInfo)]
+ [ProtoContract]
+ public partial class M2C_SyncStarSoulBagInfo:IActorMessage
+ {
+ [ProtoMember(90)]
+ public int RpcId { get; set; }
+
+ [ProtoMember(93)]
+ public long ActorId { get; set; }
+
+ [ProtoMember(1)]
+ public List itemList = new List();
+
+ [ProtoMember(2)]
+ public List usedIdMap = new List();
+
+ [ProtoMember(5)]
+ public List suitKVs = new List();
+
+ [ProtoMember(3)]
+ public long UnitId { get; set; }
+
}
[Message(OuterOpcode.M2C_SyncStarSoulBag)]
diff --git a/Server/Model/Generate/Message/OuterOpcode.cs b/Server/Model/Generate/Message/OuterOpcode.cs
index dffea01d..4a34e4ed 100644
--- a/Server/Model/Generate/Message/OuterOpcode.cs
+++ b/Server/Model/Generate/Message/OuterOpcode.cs
@@ -402,16 +402,17 @@ namespace ET
public const ushort KV_int32_int32 = 20398;
public const ushort KV_string_int32 = 20399;
public const ushort M2C_GetStarSoulBag = 20400;
- public const ushort M2C_SyncStarSoulBag = 20401;
- public const ushort M2C_SyncStarSoulBagItemUsed = 20402;
- public const ushort C2M_UpgradeStarSoulItem = 20403;
- public const ushort M2C_UpgradeStarSoulItem = 20404;
- public const ushort C2M_PutonStarSoulItem = 20405;
- public const ushort M2C_PutonStarSoulItem = 20406;
- public const ushort C2M_LockStarSoulItem = 20407;
- public const ushort C2M_StartActive = 20408;
- public const ushort M2C_StartActive = 20409;
- public const ushort C2M_GetUIDByName = 20410;
- public const ushort M2C_GetUIDByName = 20411;
+ public const ushort M2C_SyncStarSoulBagInfo = 20401;
+ public const ushort M2C_SyncStarSoulBag = 20402;
+ public const ushort M2C_SyncStarSoulBagItemUsed = 20403;
+ public const ushort C2M_UpgradeStarSoulItem = 20404;
+ public const ushort M2C_UpgradeStarSoulItem = 20405;
+ public const ushort C2M_PutonStarSoulItem = 20406;
+ public const ushort M2C_PutonStarSoulItem = 20407;
+ public const ushort C2M_LockStarSoulItem = 20408;
+ public const ushort C2M_StartActive = 20409;
+ public const ushort M2C_StartActive = 20410;
+ public const ushort C2M_GetUIDByName = 20411;
+ public const ushort M2C_GetUIDByName = 20412;
}
}
diff --git a/Unity/Assets/Download/Config/Hotfix.dll.bytes b/Unity/Assets/Download/Config/Hotfix.dll.bytes
index e5b7e89f..2f0968c2 100644
Binary files a/Unity/Assets/Download/Config/Hotfix.dll.bytes and b/Unity/Assets/Download/Config/Hotfix.dll.bytes differ
diff --git a/Unity/Assets/Download/Config/Hotfix.pdb.bytes b/Unity/Assets/Download/Config/Hotfix.pdb.bytes
index 97d28791..6af1c541 100644
Binary files a/Unity/Assets/Download/Config/Hotfix.pdb.bytes and b/Unity/Assets/Download/Config/Hotfix.pdb.bytes differ
diff --git a/Unity/Assets/Download/Config/HotfixView.dll.bytes b/Unity/Assets/Download/Config/HotfixView.dll.bytes
index d39bb701..86bdb0d5 100644
Binary files a/Unity/Assets/Download/Config/HotfixView.dll.bytes and b/Unity/Assets/Download/Config/HotfixView.dll.bytes differ
diff --git a/Unity/Assets/Download/Config/HotfixView.pdb.bytes b/Unity/Assets/Download/Config/HotfixView.pdb.bytes
index 8bc7f6cd..6fdabfaf 100644
Binary files a/Unity/Assets/Download/Config/HotfixView.pdb.bytes and b/Unity/Assets/Download/Config/HotfixView.pdb.bytes differ
diff --git a/Unity/Assets/Download/FGUI/Bag/Bag_fui.bytes b/Unity/Assets/Download/FGUI/Bag/Bag_fui.bytes
index 080e3faf..aa45f171 100644
Binary files a/Unity/Assets/Download/FGUI/Bag/Bag_fui.bytes and b/Unity/Assets/Download/FGUI/Bag/Bag_fui.bytes differ
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagHandler.cs b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagHandler.cs
index 85086d16..f4353921 100644
--- a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagHandler.cs
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagHandler.cs
@@ -10,7 +10,8 @@ namespace ET
protected override async ETVoid Run(ET.Session session, M2C_SyncStarSoulBag message)
{
var zoneScene = session.ZoneScene();
- StarSoulBag bag = zoneScene.GetComponent();
+ var unit = zoneScene.GetComponent().MyUnit;
+ StarSoulBag bag = unit.GetComponent();
var item = message.item;
if (item.Id == 0)
{
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs
new file mode 100644
index 00000000..b92c43cd
--- /dev/null
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs
@@ -0,0 +1,25 @@
+using System;
+using UnityEngine;
+
+namespace ET
+{
+ [MessageHandler]
+ public class M2C_SyncStarSoulBagInfoHandler:AMHandler
+ {
+ protected override async ETVoid Run(Session session, M2C_SyncStarSoulBagInfo message)
+ {
+ try
+ {
+ var zoneScene = session.ZoneScene();
+ var unit = zoneScene.GetComponent().Get(message.UnitId);
+ StarSoulBag bag = unit.GetComponent();
+ bag.FillData(message.itemList,message.usedIdMap,message.suitKVs);
+ }
+ catch (Exception e)
+ {
+ Log.Error(e);
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs.meta b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs.meta
new file mode 100644
index 00000000..66dda311
--- /dev/null
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagInfoHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2eb6b18206aa99f44ae2b754acbf9d4a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagItemUsedHandler.cs b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagItemUsedHandler.cs
index f5344d64..a8a5027c 100644
--- a/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagItemUsedHandler.cs
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/Handler/UI/M2C_SyncStarSoulBagItemUsedHandler.cs
@@ -10,7 +10,8 @@ namespace ET
protected override async ETVoid Run(ET.Session session, M2C_SyncStarSoulBagItemUsed message)
{
var zoneScene = session.ZoneScene();
- StarSoulBag bag = zoneScene.GetComponent();
+ var unit = zoneScene.GetComponent().MyUnit;
+ StarSoulBag bag = unit.GetComponent();
bag.usedStarSoulDic[(byte) message.key] = message.value;
bag.Suits.Clear();
foreach (KV_int32_int32 kv in message.suitKVs)
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/GetInfoComponentSystem.cs b/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/GetInfoComponentSystem.cs
index 0a62f466..47abe228 100644
--- a/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/GetInfoComponentSystem.cs
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/GetInfoComponentSystem.cs
@@ -5,7 +5,10 @@
public static async ETTask Start(this GetInfoComponent self)
{
await TimerComponent.Instance.WaitAsync(1000);
- self.ZoneScene().GetComponent().InitData();
+ // var unit = self.ZoneScene().GetComponent().MyUnit;
+ var unit = self.ZoneScene().GetComponent().MyUnit;
+ StarSoulBag bag = unit.GetComponent();
+ unit.GetComponent().InitData();
}
}
}
\ No newline at end of file
diff --git a/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/StarSoulBagSystem.cs b/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/StarSoulBagSystem.cs
index 2f48c392..229d7654 100644
--- a/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/StarSoulBagSystem.cs
+++ b/Unity/Assets/Hotfix/Logic/Behaviour/Game/System/StarSoulBagSystem.cs
@@ -10,7 +10,6 @@ namespace ET
{
public override void Awake(StarSoulBag self)
{
-
}
}
@@ -34,7 +33,7 @@ namespace ET
{
public static void InitData(this StarSoulBag self)
{
- #if UNITY
+#if UNITY
GetDataFromServer(self).Coroutine();
#endif
}
@@ -47,16 +46,25 @@ namespace ET
Game.EventSystem.Publish(new ShowTipUI() { tip = ret.Message, tipType = TipType.Single, isClearIpt = true, });
return;
}
- for (var i = 0; i < ret.usedIdMap.Count; i++)
+
+ self.FillData(ret.itemList, ret.usedIdMap, ret.suitKVs);
+
+ }
+
+ public static void FillData(this StarSoulBag self, List itemList, List usedIdMap, List suitKVs)
+ {
+ for (var i = 0; i < usedIdMap.Count; i++)
{
- self.usedStarSoulDic[(byte) i] = ret.usedIdMap[i];
+ self.usedStarSoulDic[(byte) i] = usedIdMap[i];
}
+
self.Suits.Clear();
- foreach (KV_int32_int32 kv in ret.suitKVs)
+ foreach (KV_int32_int32 kv in suitKVs)
{
- self.Suits.Add(new StarSoulSuit(){Id = kv.key,type = (StarSoulSuit.StarSoulSuitType) kv.value});
+ self.Suits.Add(new StarSoulSuit() { Id = kv.key, type = (StarSoulSuit.StarSoulSuitType) kv.value });
}
- foreach (StarSoulNetItem starSoulNetItem in ret.itemList)
+
+ foreach (StarSoulNetItem starSoulNetItem in itemList)
{
try
{
@@ -75,20 +83,21 @@ namespace ET
for (var i = 0; i < starSoulNetItem.vice.Count; i++)
{
item.viceAttribute[i] = starSoulNetItem.vice[i];
- }
+ }
+
for (var i = 0; i < starSoulNetItem.viceAdd.Count; i++)
{
item.viceAdd[i] = starSoulNetItem.viceAdd[i];
}
+
self.Add(item);
}
catch (Exception e)
{
- Debug.Log(e);
+ Log.Error(e);
}
}
}
-
public static bool CanAdd(this StarSoulBag self)
{
return self.ItemCount < StarSoulBag.MaxCount;
@@ -99,7 +108,7 @@ namespace ET
if (!self.CanAdd()) return "星魂背包已满";
if (self.itemDic.ContainsKey(item.Id))
{
- #if SERVER
+#if SERVER
Log.Error($"{self.Id.GetPlayerFormatName()} serverId 重复 :{item.Id}");
#endif
return "系统错误";
@@ -109,19 +118,21 @@ namespace ET
self.ItemCount++;
return null;
}
- public static string Update(this StarSoulBag self,StarSoulItem item)
+
+ public static string Update(this StarSoulBag self, StarSoulItem item)
{
if (!self.itemDic.ContainsKey(item.Id))
{
- return Add(self,item);
+ return Add(self, item);
}
+
self.itemDic[item.Id] = item;
return null;
}
public static bool Remove(this StarSoulBag self, long Id)
{
- if(! self.itemDic.Remove(Id))
+ if (!self.itemDic.Remove(Id))
{
return false;
}
@@ -136,6 +147,7 @@ namespace ET
{
return null;
}
+
return itemBase;
}
}
diff --git a/Unity/Assets/Hotfix/Logic/Model/Game/Entity/User/UnitFactory.cs b/Unity/Assets/Hotfix/Logic/Model/Game/Entity/User/UnitFactory.cs
index 45a2cd83..50b7a71d 100644
--- a/Unity/Assets/Hotfix/Logic/Model/Game/Entity/User/UnitFactory.cs
+++ b/Unity/Assets/Hotfix/Logic/Model/Game/Entity/User/UnitFactory.cs
@@ -29,6 +29,7 @@ namespace ET
unit.AddComponent();
unit.AddComponent();
unit.AddComponent();
+ unit.AddComponent();
#if ROBOT
unit.AddComponent();
#endif
@@ -53,7 +54,8 @@ namespace ET
await Game.EventSystem.Publish(new ET.EventType.OnCreateUnit { zoneScene = zoneScene, unit = unit, prefabId = prefabId });
return unit;
- } public static async ETTask Create(Scene zoneScene, long id, int prefabId, UnitType unitType)
+ }
+ public static async ETTask Create(Scene zoneScene, long id, int prefabId, UnitType unitType)
{
UnitComponent unitComponent = zoneScene.GetComponent();
Unit unit = EntityFactory.CreateWithParentAndId(unitComponent, id);
diff --git a/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterMessage.cs b/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterMessage.cs
index d791e0c9..5c9d92ea 100644
--- a/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterMessage.cs
+++ b/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterMessage.cs
@@ -7073,6 +7073,33 @@ namespace ET
[ProtoMember(5)]
public List suitKVs = new List();
+ [ProtoMember(3)]
+ public long UnitId { get; set; }
+
+ }
+
+ [Message(OuterOpcode.M2C_SyncStarSoulBagInfo)]
+ [ProtoContract]
+ public partial class M2C_SyncStarSoulBagInfo:IActorMessage
+ {
+ [ProtoMember(90)]
+ public int RpcId { get; set; }
+
+ [ProtoMember(93)]
+ public long ActorId { get; set; }
+
+ [ProtoMember(1)]
+ public List itemList = new List();
+
+ [ProtoMember(2)]
+ public List usedIdMap = new List();
+
+ [ProtoMember(5)]
+ public List suitKVs = new List();
+
+ [ProtoMember(3)]
+ public long UnitId { get; set; }
+
}
[Message(OuterOpcode.M2C_SyncStarSoulBag)]
diff --git a/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterOpcode.cs b/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterOpcode.cs
index dffea01d..4a34e4ed 100644
--- a/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterOpcode.cs
+++ b/Unity/Assets/Hotfix/Logic/Model/Generate/Message/OuterOpcode.cs
@@ -402,16 +402,17 @@ namespace ET
public const ushort KV_int32_int32 = 20398;
public const ushort KV_string_int32 = 20399;
public const ushort M2C_GetStarSoulBag = 20400;
- public const ushort M2C_SyncStarSoulBag = 20401;
- public const ushort M2C_SyncStarSoulBagItemUsed = 20402;
- public const ushort C2M_UpgradeStarSoulItem = 20403;
- public const ushort M2C_UpgradeStarSoulItem = 20404;
- public const ushort C2M_PutonStarSoulItem = 20405;
- public const ushort M2C_PutonStarSoulItem = 20406;
- public const ushort C2M_LockStarSoulItem = 20407;
- public const ushort C2M_StartActive = 20408;
- public const ushort M2C_StartActive = 20409;
- public const ushort C2M_GetUIDByName = 20410;
- public const ushort M2C_GetUIDByName = 20411;
+ public const ushort M2C_SyncStarSoulBagInfo = 20401;
+ public const ushort M2C_SyncStarSoulBag = 20402;
+ public const ushort M2C_SyncStarSoulBagItemUsed = 20403;
+ public const ushort C2M_UpgradeStarSoulItem = 20404;
+ public const ushort M2C_UpgradeStarSoulItem = 20405;
+ public const ushort C2M_PutonStarSoulItem = 20406;
+ public const ushort M2C_PutonStarSoulItem = 20407;
+ public const ushort C2M_LockStarSoulItem = 20408;
+ public const ushort C2M_StartActive = 20409;
+ public const ushort M2C_StartActive = 20410;
+ public const ushort C2M_GetUIDByName = 20411;
+ public const ushort M2C_GetUIDByName = 20412;
}
}
diff --git a/Unity/Assets/Hotfix/Scene/SceneFactory.cs b/Unity/Assets/Hotfix/Scene/SceneFactory.cs
index 9646a58d..d462a463 100644
--- a/Unity/Assets/Hotfix/Scene/SceneFactory.cs
+++ b/Unity/Assets/Hotfix/Scene/SceneFactory.cs
@@ -21,7 +21,6 @@ namespace ET
zoneScene.AddComponent();
zoneScene.AddComponent();
zoneScene.AddComponent();
- zoneScene.AddComponent();
// UI层的初始化
//await Game.EventSystem.Publish(new EventType.AfterCreateZoneScene() { zoneScene = zoneScene });
diff --git a/Unity/Assets/HotfixView/Event/UI/UpdateCharacterUIEvent.cs b/Unity/Assets/HotfixView/Event/UI/UpdateCharacterUIEvent.cs
index f7585567..c884aa2d 100644
--- a/Unity/Assets/HotfixView/Event/UI/UpdateCharacterUIEvent.cs
+++ b/Unity/Assets/HotfixView/Event/UI/UpdateCharacterUIEvent.cs
@@ -25,32 +25,32 @@ namespace ET
_attributeDic["职业"].text = unitCharacter.Job;
_attributeDic["家族"].text = unitCharacter.Family;
_attributeDic["等级"].text = CharacterHelper.GetLevelString(unit);
- _attributeDic["经验"].text = MathHelper.FloatToIntString(num.Get(NumericType.Exp));
+ _attributeDic["经验"].text = num.Get(NumericType.Exp).FloatToIntString();
- _attributeDic["力量"].text = MathHelper.FloatToIntString(num.Get(NumericType.Str));
- _attributeDic["智慧"].text = MathHelper.FloatToIntString(num.Get(NumericType.Wim));
- _attributeDic["体质"].text = MathHelper.FloatToIntString(num.Get(NumericType.Phy));
- _attributeDic["耐力"].text = MathHelper.FloatToIntString(num.Get(NumericType.Sta));
- _attributeDic["敏捷"].text = MathHelper.FloatToIntString(num.Get(NumericType.Quk));
- _attributeDic["精神"].text = MathHelper.FloatToIntString(num.Get(NumericType.Spi));
+ _attributeDic["力量"].text = num.Get(NumericType.Str).FloatToIntString();
+ _attributeDic["智慧"].text = num.Get(NumericType.Wim).FloatToIntString();
+ _attributeDic["体质"].text = num.Get(NumericType.Phy).FloatToIntString();
+ _attributeDic["耐力"].text = num.Get(NumericType.Sta).FloatToIntString();
+ _attributeDic["敏捷"].text = num.Get(NumericType.Quk).FloatToIntString();
+ _attributeDic["精神"].text = num.Get(NumericType.Spi).FloatToIntString();
- _attributeDic["生命"].text = $"{MathHelper.FloatToIntString(num.Get(NumericType.Hp))}/{ MathHelper.FloatToIntString(num.Get(NumericType.MaxHp))}";
- _attributeDic["精力"].text = $"{MathHelper.FloatToIntString(num.Get(NumericType.Mp))}/{MathHelper.FloatToIntString(num.Get(NumericType.MaxMp))}";
- _attributeDic["物理攻击"].text = MathHelper.FloatToIntString(num.Get(NumericType.PhyAtk));
- _attributeDic["精神攻击"].text = MathHelper.FloatToIntString(num.Get(NumericType.SpiAtk));
- _attributeDic["物理防御"].text = MathHelper.FloatToIntString(num.Get(NumericType.PhyDef));
- _attributeDic["精神防御"].text = MathHelper.FloatToIntString(num.Get(NumericType.SpiDef));
- _attributeDic["物理暴击率"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Pcrir));
- _attributeDic["精神暴击率"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Mcrir));
- _attributeDic["物理暴击值"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Pcri));
- _attributeDic["精神暴击值"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Mcri));
- _attributeDic["抗物理暴击率"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Rpcrir));
- _attributeDic["抗精神暴击率"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Rmcrir));
- _attributeDic["抗物理暴击值"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Rpcri));
- _attributeDic["抗精神暴击值"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Rmcri));
- _attributeDic["物理免伤"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Nphyi));
- _attributeDic["精神免伤"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Nmeni));
- _attributeDic["辅助值"].text = MathHelper.FloatToPercentString(num.Get(NumericType.Dvo));
+ _attributeDic["生命"].text = $"{num.Get(NumericType.Hp).FloatToIntString()}/{ num.Get(NumericType.MaxHp).FloatToIntString()}";
+ _attributeDic["精力"].text = $"{num.Get(NumericType.Mp).FloatToIntString()}/{num.Get(NumericType.MaxMp).FloatToIntString()}";
+ _attributeDic["物理攻击"].text = num.Get(NumericType.PhyAtk).FloatToIntString();
+ _attributeDic["精神攻击"].text = num.Get(NumericType.SpiAtk).FloatToIntString();
+ _attributeDic["物理防御"].text = num.Get(NumericType.PhyDef).FloatToIntString();
+ _attributeDic["精神防御"].text = num.Get(NumericType.SpiDef).FloatToIntString();
+ _attributeDic["物理暴击率"].text = num.Get(NumericType.Pcrir).FloatToPercentString();
+ _attributeDic["精神暴击率"].text = num.Get(NumericType.Mcrir).FloatToPercentString();
+ _attributeDic["物理暴击值"].text = num.Get(NumericType.Pcri).FloatToPercentString();
+ _attributeDic["精神暴击值"].text = num.Get(NumericType.Mcri).FloatToPercentString();
+ _attributeDic["抗物理暴击率"].text = num.Get(NumericType.Rpcrir).FloatToPercentString();
+ _attributeDic["抗精神暴击率"].text = num.Get(NumericType.Rmcrir).FloatToPercentString();
+ _attributeDic["抗物理暴击值"].text = num.Get(NumericType.Rpcri).FloatToPercentString();
+ _attributeDic["抗精神暴击值"].text = num.Get(NumericType.Rmcri).FloatToPercentString();
+ _attributeDic["物理免伤"].text = num.Get(NumericType.Nphyi).FloatToPercentString();
+ _attributeDic["精神免伤"].text = num.Get(NumericType.Nmeni).FloatToPercentString();
+ _attributeDic["辅助值"].text = num.Get(NumericType.Dvo).FloatToPercentString();
//!更新属性点
FUI_CharacterUI characterUI = FUIComponent.Instance.Get(FUIPackage.Character_CharacterUI)?.As();
diff --git a/Unity/Assets/HotfixView/Helper/TabHelper.cs b/Unity/Assets/HotfixView/Helper/TabHelper.cs
index 6ac1b3aa..8e1a3544 100644
--- a/Unity/Assets/HotfixView/Helper/TabHelper.cs
+++ b/Unity/Assets/HotfixView/Helper/TabHelper.cs
@@ -145,15 +145,18 @@ namespace ET
action = context.sender.As().data as EventCallback0;
token?.Cancel();
token = new ETCancellationToken();
- bool ret = await TimerComponent.Instance.WaitAsync(350, token);
+ var ret = await TimerComponent.Instance.WaitAsync(350, token);
if (ret)
action?.Invoke();
}
private static readonly List itemDescList = new List();
+ private static readonly string SpaceLine3 = "[size=3] [/size]";
- public static void OpenUI(ClientItemData data, bool isComprasion = true)
+ public static void OpenUI(Scene zoneScene, ClientItemData data, bool isComprasion = true, long unitId = 0)
{
+ bool isMine = unitId == 0;
+ Unit unit = unitId == 0? zoneScene.GetComponent().MyUnit : zoneScene.GetComponent().Get(unitId);
ClientItemData wornEquipData = null;
sb.Length = 0;
itemDescList.Clear();
@@ -205,7 +208,7 @@ namespace ET
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipSpecialAtrribute(data.Equip, itemDescList);
foreach (string item in itemDescList)
@@ -213,7 +216,7 @@ namespace ET
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipBaseAtrribute(data.Equip, equipBase, itemDescList);
foreach (string item in itemDescList)
@@ -221,7 +224,7 @@ namespace ET
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipAdditionalAtrribute(data.Equip, itemDescList);
foreach (string item in itemDescList)
@@ -259,11 +262,12 @@ namespace ET
}
}
- StarSoulBag bag = FUI_TabUI.ZoneScene().GetComponent();
+ StarSoulBag bag = unit.GetComponent();
+
long starSoulId = bag.usedStarSoulDic[(byte) index];
if (starSoulId != 0)
{
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.AppendLine("----星魂----");
starSoulString = GenerateStarSoulString(sb, bag, starSoulId, needReturn: true);
}
@@ -341,7 +345,7 @@ namespace ET
sb.AppendFormat($"[color=#ff99cc]已绑定[/color]\n");
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipSpecialAtrribute(wornEquipData.Equip, itemDescList);
foreach (string item in itemDescList)
@@ -349,7 +353,7 @@ namespace ET
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipBaseAtrribute(wornEquipData.Equip, equipBase, itemDescList);
foreach (string item in itemDescList)
@@ -357,7 +361,7 @@ namespace ET
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipAdditionalAtrribute(wornEquipData.Equip, itemDescList);
foreach (string item in itemDescList)
@@ -383,9 +387,10 @@ namespace ET
sb.AppendLine($"来源:[color=#ffff00][i]{wornEquipData.getSource}[/i][/color]");
}
+
if (starSoulString != null)
{
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.AppendLine("----星魂----");
sb.Append(starSoulString);
}
@@ -419,12 +424,12 @@ namespace ET
}
StarSoulAttributeConfig soulAttributeConfig = StarSoulAttributeConfigCategory.Instance.Get(starSoulItem.mainAttribute);
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.AppendLine("固定属性:");
sb.AppendLine(
$"[color=#99bf88]{GetAttributeString((Cal.AttributeType) soulAttributeConfig.Key, ItemHelper.GetRealMainValue(soulAttributeConfig.Value, starSoulItem.level))}[/color]");
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.AppendLine("随机属性:");
for (var i = 0; i < starSoulItem.viceAttribute.Length; i++)
{
@@ -436,15 +441,15 @@ namespace ET
$"[color=#99bf88]{GetAttributeString((Cal.AttributeType) soulAttributeConfig.Key, ItemHelper.GetRealViceValue(soulAttributeConfig.Value * (1 + starSoulItem.viceAdd[i]), starSoulItem.quality))}[/color]");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.AppendLine("套装属性:");
StarSoulSuit suit = bag.Suits.Find(t => t.Id == starSoulItem.typeId);
string color = "#999999";
- if (suit!=null&&suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit4))
+ if (suit != null && suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit4))
color = "#ccee00";
sb.AppendLine($"[color={color}]4件套:\n {starSoulTypeConfig.Suit4}[/color]");
color = "#999999";
- if (suit!=null&&suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit8))
+ if (suit != null && suit.type.HasFlag(StarSoulSuit.StarSoulSuitType.Suit8))
color = "#cc9900";
if (!starSoulTypeConfig.Suit8.IsNullOrEmpty())
{
@@ -763,7 +768,7 @@ namespace ET
sb.AppendFormat($"[color=#ff99cc]{isLock}[/color]\n");
sb.AppendFormat($"需要等级:{equipBase.UseLevel}\n");
sb.AppendFormat($"需要职业: {GetStrJob(equipBase.JobId, equipBase.Transmigration)}\n");
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquipSpecialAtrribute(equipBase, itemDescList);
foreach (string item in itemDescList)
@@ -771,7 +776,7 @@ namespace ET
sb.AppendFormat($"[color=#99bf88]{item}[/color]\n");
}
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
itemDescList.Clear();
GetEquiBaseAtrribute(equipBase, itemDescList);
foreach (string item in itemDescList)
@@ -979,7 +984,7 @@ namespace ET
GenerateStarSoulString(sb, bag, id, true);
StarSoulItem data = bag.Get(id);
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.Append("[color=#ffff99]星魂可以通过消耗其他星魂进行升级,升级会提升固定属性;每升级4级产生或者强化某一个随机属性[/color]");
FUI_TabUI ui = OpenUI();
ui.m_title.text = sb.ToString();
@@ -1003,7 +1008,7 @@ namespace ET
sb.Length = 0;
GenerateStarSoulString(sb, bag, usedId);
- sb.AppendLine("[size=3] [/size]");
+ sb.AppendLine(SpaceLine3);
sb.Append("[color=#ffff99]星魂可以通过消耗其他星魂进行升级,升级会提升固定属性;每升级4级产生或者强化某一个随机属性[/color]");
comUI.m_title.text = sb.ToString();
}
diff --git a/Unity/Assets/HotfixView/Model/FGUI/AutoCode/Bag/FUI_StarSoulBagUI.cs b/Unity/Assets/HotfixView/Model/FGUI/AutoCode/Bag/FUI_StarSoulBagUI.cs
index 5f1f12e5..2ce8a41e 100644
--- a/Unity/Assets/HotfixView/Model/FGUI/AutoCode/Bag/FUI_StarSoulBagUI.cs
+++ b/Unity/Assets/HotfixView/Model/FGUI/AutoCode/Bag/FUI_StarSoulBagUI.cs
@@ -34,6 +34,7 @@ namespace ET
public FUI_ButtonSingle m_btnType;
public FUI_ButtonSingle m_btnPosType;
public FUI_ButtonSingle m_btnTime;
+ public FUI_ComboBox m_comBoxPos;
public Transition m_Effect;
public const string URL = "ui://71ktouo7f0oatmn";
@@ -118,6 +119,7 @@ namespace ET
m_btnType = FUI_ButtonSingle.Create(domain,com.GetChildAt(4));
m_btnPosType = FUI_ButtonSingle.Create(domain,com.GetChildAt(6));
m_btnTime = FUI_ButtonSingle.Create(domain,com.GetChildAt(14));
+ m_comBoxPos = FUI_ComboBox.Create(domain,com.GetChildAt(16));
m_Effect = com.GetTransitionAt(0);
}
}
@@ -143,6 +145,8 @@ public override void Dispose()
m_btnType = null;
m_btnPosType = null;
m_btnTime = null;
+ m_comBoxPos.Dispose();
+ m_comBoxPos = null;
m_Effect = null;
}
}
diff --git a/Unity/Assets/HotfixView/UI/BagUI/BagUI.cs b/Unity/Assets/HotfixView/UI/BagUI/BagUI.cs
index a81814d5..cb025129 100644
--- a/Unity/Assets/HotfixView/UI/BagUI/BagUI.cs
+++ b/Unity/Assets/HotfixView/UI/BagUI/BagUI.cs
@@ -74,7 +74,7 @@ namespace ET
{
if (ClientItemDataComponent.Instance.ItemDic.TryGetValueByKey1(temp, out ClientItemData data))
{
- TabHelper.OpenUI(data);
+ TabHelper.OpenUI(zoneScene,data);
}
});
//!隐藏页签
diff --git a/Unity/Assets/HotfixView/UI/CharacterUI/CharacterUI.cs b/Unity/Assets/HotfixView/UI/CharacterUI/CharacterUI.cs
index 922d6b87..42a417e1 100644
--- a/Unity/Assets/HotfixView/UI/CharacterUI/CharacterUI.cs
+++ b/Unity/Assets/HotfixView/UI/CharacterUI/CharacterUI.cs
@@ -228,7 +228,9 @@ namespace ET
{
if (ClientItemDataComponent.Instance.WornEquipDic.TryGetValue(index, out ClientItemData data))
{
- TabHelper.OpenUI(data, false);
+ var gv = zoneScene.GetComponent();
+ long selectUnitId=gv.IsMineCharacter?0:gv.SelectUnitId;
+ TabHelper.OpenUI(zoneScene,data, false,selectUnitId);
}
});
}
diff --git a/Unity/Assets/HotfixView/UI/ConsignmentUI/ConsignmentUI.cs b/Unity/Assets/HotfixView/UI/ConsignmentUI/ConsignmentUI.cs
index 41e96c8b..b0736e09 100644
--- a/Unity/Assets/HotfixView/UI/ConsignmentUI/ConsignmentUI.cs
+++ b/Unity/Assets/HotfixView/UI/ConsignmentUI/ConsignmentUI.cs
@@ -245,7 +245,7 @@ namespace ET
{
if (ClientItemDataComponent.Instance.ConsignmentDic.TryGetValue(temp, out ConsignmentItemData __data))
{
- TabHelper.OpenUI(__data);
+ TabHelper.OpenUI(zoneScene,__data);
}
});
//!隐藏页签
diff --git a/Unity/Assets/HotfixView/UI/StarSoulBagUI/StarSoulBagUI.cs b/Unity/Assets/HotfixView/UI/StarSoulBagUI/StarSoulBagUI.cs
index 0bdcaa92..77839097 100644
--- a/Unity/Assets/HotfixView/UI/StarSoulBagUI/StarSoulBagUI.cs
+++ b/Unity/Assets/HotfixView/UI/StarSoulBagUI/StarSoulBagUI.cs
@@ -38,6 +38,7 @@ namespace ET
private bool isInit;
private SortType sortType = SortType.Time;
private Quality sortQuality = Quality.Common;
+ private EquipType equipType = EquipType.武器;
private List list = new List();
private LinkedList tempList = new LinkedList();
@@ -61,7 +62,7 @@ namespace ET
private async ETVoid AwakeAsync()
{
- bag ??= this.zoneScene.GetComponent();
+ bag ??= this.zoneScene.GetComponent().MyUnit.GetComponent();
ShowSlots();
await ETTask.CompletedTask;
}
@@ -95,10 +96,10 @@ namespace ET
long id = list[index];
clickEvent?.Invoke(id);
});
- #else
+#else
btn.self.onRollOver.Set(() =>EquipStarSoul(data, id));
#endif
- btn.self.onRightClick.Set(() =>EquipStarSoul(data, id));
+ btn.self.onRightClick.Set(() => EquipStarSoul(data, id));
btn.m_btnLock.self.onClick.Set1(context =>
{
context.StopPropagation();
@@ -161,6 +162,13 @@ namespace ET
{
this.ui.m_sortType.onChanged.Set(SortTypeChanged);
this.ui.m_quality.onChanged.Set(QualityTypeChanged);
+ ui.m_comBoxPos.self.onChanged.Set(ChangeEquipPos);
+ }
+
+ private void ChangeEquipPos()
+ {
+ this.equipType = (EquipType) this.ui.m_comBoxPos.self.selectedIndex;
+ ReFresh();
}
private void SortTypeChanged()
@@ -184,6 +192,7 @@ namespace ET
if (item.quality == this.sortQuality)
this.list.Add(item.Id);
}
+
if (this.sortType == SortType.Time)
{
return;
@@ -199,6 +208,13 @@ namespace ET
continue;
}
+ if (this.sortType == SortType.PosType)
+ {
+ //排除
+ if (item.posType != this.equipType)
+ continue;
+ }
+
var curr = this.tempList.First;
if (curr == null)
{
diff --git a/Unity/Assets/HotfixView/UI/StartSoulUpgradeUI/StartSoulUpgradeUI.cs b/Unity/Assets/HotfixView/UI/StartSoulUpgradeUI/StartSoulUpgradeUI.cs
index fde001f7..8294ff4f 100644
--- a/Unity/Assets/HotfixView/UI/StartSoulUpgradeUI/StartSoulUpgradeUI.cs
+++ b/Unity/Assets/HotfixView/UI/StartSoulUpgradeUI/StartSoulUpgradeUI.cs
@@ -65,7 +65,8 @@ namespace ET
RegisterEvent();
}
StarSoulBagUI.clickEvent += OnBagUIClick;
- this.bag ??= this.zoneScene.GetComponent();
+ var gv = this.zoneScene.GetComponent();
+ bag ??= this.zoneScene.GetComponent().MyUnit.GetComponent();
selectedId.Clear();
await ETTask.CompletedTask;
}
@@ -127,7 +128,8 @@ namespace ET
else
{
int index = selectedId.IndexOf(id);
- bag ??= this.zoneScene.GetComponent();
+ var gv = this.zoneScene.GetComponent();
+ bag ??= this.zoneScene.GetComponent().MyUnit.GetComponent();
if (index != -1)
{
this.selectedId.RemoveAt(index);
@@ -164,7 +166,6 @@ namespace ET
}
private void ShowBefore()
{
- StarSoulBag bag = this.zoneScene.GetComponent();
var data = bag.Get(id);
if (data == null)
{
@@ -179,7 +180,6 @@ namespace ET
private void ShowAfter()
{
- StarSoulBag bag = this.zoneScene.GetComponent();
var data = bag.Get(id);
if (data == null)
{
diff --git a/Unity/Assets/HotfixView/UI/StoreUI/StoreUI.cs b/Unity/Assets/HotfixView/UI/StoreUI/StoreUI.cs
index b2e2b31d..4287e70b 100644
--- a/Unity/Assets/HotfixView/UI/StoreUI/StoreUI.cs
+++ b/Unity/Assets/HotfixView/UI/StoreUI/StoreUI.cs
@@ -115,35 +115,29 @@ namespace ET
{
if (ClientItemDataComponent.Instance.StoreItemDic.TryGetValue(temp, out ClientItemData data))
{
- TabHelper.OpenUI(data);
+ TabHelper.OpenUI(zoneScene,data);
}
});
#if UNITY_STANDALONE
//!右键
btn.onRightClick.Set1(async context =>
{
- if (context.inputEvent.isDoubleClick)
+ if (!context.inputEvent.isDoubleClick) return;
+ if (zoneScene.GetComponent().MyUnit.IsFight)
{
- if (zoneScene.GetComponent().MyUnit.IsFight)
- {
- TipHelper.OpenUI("战斗中,不能使用!");
- return;
- }
- if (ClientItemDataComponent.Instance.StoreItemDic.TryGetValue(temp, out ClientItemData data))
- {
- if (data.ItemType != ItemType.NoneItem)
- {
- BagUI bagUI = FUIComponent.Instance.Get(FUIPackage.Bag_BagUI)?.GetComponent();
- if (bagUI != null)
- {
- if (BagUI.isMulti)
- await SendPutOutProto(temp, data.Count);
- else
- await SendPutOutProto(temp, 1);
- }
- }
- }
+ TipHelper.OpenUI("战斗中,不能使用!");
+ return;
}
+
+ if (!ClientItemDataComponent.Instance.StoreItemDic.TryGetValue(temp, out ClientItemData data))
+ return;
+ if (data.ItemType == ItemType.NoneItem) return;
+ var bagUI = FUIComponent.Instance.Get(FUIPackage.Bag_BagUI)?.GetComponent();
+ if (bagUI == null) return;
+ if (BagUI.isMulti)
+ await SendPutOutProto(temp, data.Count);
+ else
+ await SendPutOutProto(temp, 1);
});
#endif
//!拖拽
@@ -184,11 +178,9 @@ namespace ET
async void TipYesCallBack()
{
- if (long.TryParse(tipUI.m_IptTxt.text, out long count))
- {
- if (count <= 0) return;
- await SendPutProto(count);
- }
+ if (!long.TryParse(tipUI.m_IptTxt.text, out long count)) return;
+ if (count <= 0) return;
+ await SendPutProto(count);
}
async ETTask SendPutProto(long count)
{
@@ -210,11 +202,9 @@ namespace ET
async void TipYesCallBack()
{
- if (long.TryParse(tipUI.m_IptTxt.text, out long count))
- {
- if (count <= 0) return;
- await SendPutProto(count);
- }
+ if (!long.TryParse(tipUI.m_IptTxt.text, out long count)) return;
+ if (count <= 0) return;
+ await SendPutProto(count);
}
async ETTask SendPutProto(long count)
{
@@ -238,10 +228,7 @@ namespace ET
return;
}
string str = null;
- if (query.Coin != 0)
- str = $"是否花费{query.Coin / 10000}金币扩展仓库!";
- else
- str = $"是否花费{query.Voucher}代金券扩展仓库!";
+ str = query.Coin != 0 ? $"是否花费{query.Coin / 10000}金币扩展仓库!" : $"是否花费{query.Voucher}代金券扩展仓库!";
FUI_TipUI tipUI = TipHelper.OpenUI(str, tipType: TipType.Double);
tipUI.m_btnYes.self.onClick.Clear();
tipUI.m_btnYes.self.onClick.Add(async () =>