From 69fdc58cb97714f856df268f08451f2ba7e5ecf2 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 21 一月 2026 10:40:56 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/Hero/HeroInfo.Fetter.cs | 2
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCHeroPresetInfo.cs | 2
Main/System/Main/EquipRecordManager.cs | 237 +++++---
Main/System/Arena/ArenaRecordCell.cs | 2
Main/System/Arena/ArenaPlayerRankCell.cs | 4
Main/System/Battle/BattleField/StoryBattleField.cs | 8
Main/System/Main/AutoFightWin.cs | 9
Main/System/FuncPreset/FuncPresetManager.cs | 176 +++++++
Main/System/Hero/HeroInfo.Lineup.cs | 8
Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs | 13
Main/System/Main/PlayerMainDate.cs | 2
Main/Config/Configs/PresetUnlockConfig.cs | 50 ++
Main/System/Mingge/MinggeEquipCell.cs | 60 ++
Main/System/Main/EquipRecordWin.cs | 40 +
Main/System/Message/SysNotifyMgr.cs | 2
Main/System/WarlordPavilion/WarlordPavilionWin.cs | 13
Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs | 14
Main/System/HeroUI/HeroGiftRoleListWin.cs | 2
Main/System/HeroUI/HeroDeleteWin.cs | 2
Main/System/Mingge/MinggeEquipCell.cs.meta | 2
Main/System/Arena/ArenaPlayerTop3Cell.cs | 2
Main/Utility/EnumHelper.cs | 14
Main/System/Mingge/MinggeWin.cs | 7
Main/Config/PartialConfigs/PresetUnlockConfig.cs.meta | 2
Main/System/Message/GMNotify.cs.meta | 2
Main/System/Main/FightPowerManager.cs | 10
Main/System/Arena/ArenaBattleVictoryWin.cs | 2
Main/System/Arena/ArenaManager.cs | 4
Main/Config/Configs/PresetUnlockConfig.cs.meta | 2
Main/System/Arena/ArenaWin.cs | 2
Main/System/Hero/HeroInfo.cs | 18
Main/System/PhantasmPavilion/AvatarHelper.cs | 2
Main/System/UIBase/UIBase.cs | 8
Main/System/Battle/WarlordPavilionBattleWin.cs | 10
Main/System/Guild/GuildHallWin.cs | 2
Main/Config/PartialConfigs/PresetUnlockConfig.cs | 24
Main/System/Equip/EquipCell.cs | 2
Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroPresetSave.cs | 2
Main/System/LineupRecommend/LineupRecommendManager.cs | 2
Main/System/Main/EquipRecordCell.cs | 48 +
Main/System/HeroUI/HeroListWin.cs | 2
Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs | 27 +
Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs.meta | 2
Main/System/Equip/EquipModel.cs | 21
Main/System/Mingge/MinggeCaseCell.cs.meta | 2
Main/Config/Configs/FBDJGLevelConfig.cs | 20
Main/System/HeroUI/HeroUIManager.OnTeam.cs | 29
Main/Config/ConfigManager.cs | 3
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB161_tagSCFuncPresetInfoList.cs | 7
Main/System/FuncPreset/FuncPresetManager.cs.meta | 2
Main/System/HeroUI/HeroCardCell.cs | 4
Main/System/Arena/ArenaChallengeCell.cs | 2
Main/System/Arena/ArenaBattleFailWin.cs | 2
Main/System/Team/TeamManager.cs | 42 +
Main/System/Main/HomeWin.cs | 14
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB162_tagSCFuncPresetSwitchInfo.cs | 7
Main/System/Mingge/MinggeManager.cs | 18
Main/Main.cs | 2
Main/System/Mingge/MinggeCaseCell.cs | 18
Main/System/PhantasmPavilion/AvatarCell.cs | 2
Main/System/Team/TeamBase.cs | 24
Main/System/FuncPreset.meta | 8
Main/System/Message/GMNotify.cs | 118 ++++
Main/System/HeroUI/HeroTrainWin.cs | 6
Main/System/Guild/GuildManager.cs | 9
Main/System/Main/AutoFightModel.cs | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB163_tagSCBatPresetSwitchInfo.cs | 7
Main/System/Battle/BattleManager.cs | 2
Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs | 50 +
/dev/null | 12
Main/System/Guild/GuildChangeBroadcastWin.cs | 88 +++
Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs.meta | 2
Main/System/HeroUI/HeroPosWin.cs | 35 -
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 4
Main/System/Guild/GuildChangeBroadcastWin.cs.meta | 2
Main/System/Main/MainWin.cs | 6
Main/System/Tip/ServerTipDetails.cs | 25
Main/System/Main/EquipRecordItem.cs | 14
Main/System/WarlordPavilion/WarlordPavilionManager.cs | 16
Main/System/Battle/ArenaBattleWin.cs | 2
Main/System/HeroUI/HeroUIManager.cs | 12
81 files changed, 1,129 insertions(+), 354 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 14c766d..dfac8d5 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -90,6 +90,7 @@
typeof(OrderInfoConfig),
typeof(PlayerAttrConfig),
typeof(PlayerFaceConfig),
+ typeof(PresetUnlockConfig),
typeof(PriorBundleConfig),
typeof(RandomNameConfig),
typeof(SignInConfig),
@@ -359,6 +360,8 @@
ClearConfigDictionary<PlayerAttrConfig>();
// 娓呯┖ PlayerFaceConfig 瀛楀吀
ClearConfigDictionary<PlayerFaceConfig>();
+ // 娓呯┖ PresetUnlockConfig 瀛楀吀
+ ClearConfigDictionary<PresetUnlockConfig>();
// 娓呯┖ PriorBundleConfig 瀛楀吀
ClearConfigDictionary<PriorBundleConfig>();
// 娓呯┖ RandomNameConfig 瀛楀吀
diff --git a/Main/Config/Configs/FBDJGLevelConfig.cs b/Main/Config/Configs/FBDJGLevelConfig.cs
index c47f867..1c68374 100644
--- a/Main/Config/Configs/FBDJGLevelConfig.cs
+++ b/Main/Config/Configs/FBDJGLevelConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Thursday, January 8, 2026
+// [ Date ]: Tuesday, January 20, 2026
//--------------------------------------------------------
using System.Collections.Generic;
@@ -23,6 +23,8 @@
public int[][] AwardList;
public int[] LineupIDList;
public long FightPower;
+ public int NPCID;
+ public int[] SkillIDExList;
public override int LoadKey(string _key)
{
@@ -59,6 +61,22 @@
}
long.TryParse(tables[6],out FightPower);
+
+ int.TryParse(tables[7],out NPCID);
+
+ if (tables[8].Contains("["))
+ {
+ SkillIDExList = JsonMapper.ToObject<int[]>(tables[8]);
+ }
+ else
+ {
+ string[] SkillIDExListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ SkillIDExList = new int[SkillIDExListStringArray.Length];
+ for (int i=0;i<SkillIDExListStringArray.Length;i++)
+ {
+ int.TryParse(SkillIDExListStringArray[i],out SkillIDExList[i]);
+ }
+ }
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/PresetUnlockConfig.cs b/Main/Config/Configs/PresetUnlockConfig.cs
new file mode 100644
index 0000000..cb34f10
--- /dev/null
+++ b/Main/Config/Configs/PresetUnlockConfig.cs
@@ -0,0 +1,50 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2026骞�1鏈�19鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class PresetUnlockConfig : ConfigBase<int, PresetUnlockConfig>
+{
+ static PresetUnlockConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int ID;
+ public int PresetType;
+ public int PresetID;
+ public int UnlockType;
+ public int UnlockValue;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out ID);
+
+ int.TryParse(tables[1],out PresetType);
+
+ int.TryParse(tables[2],out PresetID);
+
+ int.TryParse(tables[3],out UnlockType);
+
+ int.TryParse(tables[4],out UnlockValue);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/Config/Configs/PresetUnlockConfig.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Config/Configs/PresetUnlockConfig.cs.meta
index b21ce1a..bbc5fb5 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/Config/Configs/PresetUnlockConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: 8ecdeb51d01330b43960aae797dd7d53
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Config/PartialConfigs/PresetUnlockConfig.cs b/Main/Config/PartialConfigs/PresetUnlockConfig.cs
new file mode 100644
index 0000000..80208b7
--- /dev/null
+++ b/Main/Config/PartialConfigs/PresetUnlockConfig.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+public partial class PresetUnlockConfig : ConfigBase<int, PresetUnlockConfig>
+{
+ static Dictionary<int, Dictionary<int, PresetUnlockConfig>> m_PresetUnlockDict = new Dictionary<int, Dictionary<int, PresetUnlockConfig>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ if (!m_PresetUnlockDict.ContainsKey(PresetType))
+ {
+ m_PresetUnlockDict[PresetType] = new Dictionary<int, PresetUnlockConfig>();
+ }
+ m_PresetUnlockDict[PresetType][PresetID] = this;
+ }
+
+ public static PresetUnlockConfig GetPresetUnlockConfig(int presetType, int presetID)
+ {
+ if (m_PresetUnlockDict.ContainsKey(presetType) && m_PresetUnlockDict[presetType].ContainsKey(presetID))
+ {
+ return m_PresetUnlockDict[presetType][presetID];
+ }
+ return null;
+ }
+
+}
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/Config/PartialConfigs/PresetUnlockConfig.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Config/PartialConfigs/PresetUnlockConfig.cs.meta
index b21ce1a..107a6b7 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/Config/PartialConfigs/PresetUnlockConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: 25d58f7d8e96c334aa6041e24810a2d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroPresetSave.cs b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroPresetSave.cs
index 76fd22e..33be7b2 100644
--- a/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroPresetSave.cs
+++ b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB412_tagCSHeroPresetSave.cs
@@ -5,7 +5,6 @@
public class CB412_tagCSHeroPresetSave : GameNetPackBasic {
public byte PresetID; //闃靛鏂规棰勮ID
- public byte ShapeType; //鏈樀瀹归樀鍨嬶紝0涓洪粯璁ら樀鍨嬶紝鍙墿灞曚笉鍚岀殑闃靛瀷
public byte PosCnt;
public tagCSHeroPresetPos[] HeroPosList; // 淇濆瓨鐨勯樀瀹癸紝鍙彂閫佹渶缁堢殑闃靛姝﹀皢浣嶇疆鍗冲彲
@@ -16,7 +15,6 @@
public override void WriteToBytes () {
WriteBytes (PresetID, NetDataType.BYTE);
- WriteBytes (ShapeType, NetDataType.BYTE);
WriteBytes (PosCnt, NetDataType.BYTE);
for (int i = 0; i < PosCnt; i ++) {
WriteBytes (HeroPosList[i].ItemIndex, NetDataType.WORD);
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs
new file mode 100644
index 0000000..6bc84f7
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+using System.Collections;
+
+//A0 01 Gm骞挎挱娑堟伅#tagBroadCastInfo
+
+public class DTCA001_tagBroadCastInfo : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA001_tagBroadCastInfo vNetData = vNetPack as HA001_tagBroadCastInfo;
+ GMNotifyManager.Instance.Notify(vNetData);
+ }
+}
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs.meta
index b21ce1a..198c9ed 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: 42dceab20a12bc14da587223f4d76510
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB161_tagSCFuncPresetInfoList.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB161_tagSCFuncPresetInfoList.cs
index c76f31c..0b1e48a 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB161_tagSCFuncPresetInfoList.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB161_tagSCFuncPresetInfoList.cs
@@ -1,11 +1,12 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
// B1 61 鍔熻兘棰勮淇℃伅 #tagSCFuncPresetInfoList
public class DTCB161_tagSCFuncPresetInfoList : DtcBasic {
public override void Done(GameNetPackBasic vNetPack) {
base.Done(vNetPack);
HB161_tagSCFuncPresetInfoList vNetData = vNetPack as HB161_tagSCFuncPresetInfoList;
+ FuncPresetManager.Instance.UpdateFuncPresetInfoList(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB162_tagSCFuncPresetSwitchInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB162_tagSCFuncPresetSwitchInfo.cs
index c2167d8..2f2917a 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB162_tagSCFuncPresetSwitchInfo.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB162_tagSCFuncPresetSwitchInfo.cs
@@ -1,11 +1,12 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
// B1 62 鍔熻兘棰勮鍒囨崲淇℃伅 #tagSCFuncPresetSwitchInfo
public class DTCB162_tagSCFuncPresetSwitchInfo : DtcBasic {
public override void Done(GameNetPackBasic vNetPack) {
base.Done(vNetPack);
HB162_tagSCFuncPresetSwitchInfo vNetData = vNetPack as HB162_tagSCFuncPresetSwitchInfo;
+ FuncPresetManager.Instance.UpdateFuncPresetUseData(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB163_tagSCBatPresetSwitchInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB163_tagSCBatPresetSwitchInfo.cs
index 8d7bbf4..ede9dd2 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB163_tagSCBatPresetSwitchInfo.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB163_tagSCBatPresetSwitchInfo.cs
@@ -1,11 +1,12 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
// B1 63 鎴樻枟棰勮鍒囨崲淇℃伅 #tagSCBatPresetSwitchInfo
public class DTCB163_tagSCBatPresetSwitchInfo : DtcBasic {
public override void Done(GameNetPackBasic vNetPack) {
base.Done(vNetPack);
HB163_tagSCBatPresetSwitchInfo vNetData = vNetPack as HB163_tagSCBatPresetSwitchInfo;
+ FuncPresetManager.Instance.UpdateBatPresetNowUseInfo(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index deeb8f3..8228824 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -144,6 +144,10 @@
Register(typeof(HA503_tagSCFamilyTaofaInfo), typeof(DTCA503_tagSCFamilyTaofaInfo));
Register(typeof(HA504_tagSCFamilyTaofaAtkRet), typeof(DTCA504_tagSCFamilyTaofaAtkRet));
Register(typeof(HB132_tagSCMinggeInfo), typeof(DTCB132_tagSCMinggeInfo));
+ Register(typeof(HB161_tagSCFuncPresetInfoList), typeof(DTCB161_tagSCFuncPresetInfoList));
+ Register(typeof(HB162_tagSCFuncPresetSwitchInfo), typeof(DTCB162_tagSCFuncPresetSwitchInfo));
+ Register(typeof(HB163_tagSCBatPresetSwitchInfo), typeof(DTCB163_tagSCBatPresetSwitchInfo));
+ Register(typeof(HA001_tagBroadCastInfo), typeof(DTCA001_tagBroadCastInfo));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs b/Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs
new file mode 100644
index 0000000..084257c
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+using System.Collections;
+
+//A0 01 Gm骞挎挱娑堟伅#tagBroadCastInfo
+
+public class HA001_tagBroadCastInfo : GameNetPackBasic {
+ public uint StartTime;
+ public uint EndTime;
+ public ushort Interval; //鏃堕棿闂撮殧
+ public ushort MsgLen;
+ public string Msg; //size = MsgLen
+ public byte IsDelOthers; //鏄惁鍒犻櫎鍏朵粬鐨�
+
+ public HA001_tagBroadCastInfo () {
+ _cmd = (ushort)0xA001;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out StartTime, vBytes, NetDataType.DWORD);
+ TransBytes (out EndTime, vBytes, NetDataType.DWORD);
+ TransBytes (out Interval, vBytes, NetDataType.WORD);
+ TransBytes (out MsgLen, vBytes, NetDataType.WORD);
+ TransBytes (out Msg, vBytes, NetDataType.Chars, MsgLen);
+ TransBytes (out IsDelOthers, vBytes, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs.meta
index b21ce1a..f9120ed 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: 8a5084f76f1b2d9469bcaebf5c3dbc79
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCHeroPresetInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCHeroPresetInfo.cs
index 1ad57e8..924acf1 100644
--- a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCHeroPresetInfo.cs
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB124_tagSCHeroPresetInfo.cs
@@ -17,7 +17,6 @@
for (int i = 0; i < PresetCnt; i ++) {
PresetList[i] = new tagSCHeroPreset();
TransBytes (out PresetList[i].PresetID, vBytes, NetDataType.BYTE);
- TransBytes (out PresetList[i].ShapeType, vBytes, NetDataType.BYTE);
TransBytes (out PresetList[i].HeroCnt, vBytes, NetDataType.BYTE);
TransBytes (out PresetList[i].HeroItemIndexList, vBytes, NetDataType.WORD, PresetList[i].HeroCnt);
}
@@ -25,7 +24,6 @@
public class tagSCHeroPreset {
public byte PresetID; //闃靛鏂规棰勮ID
- public byte ShapeType; // 闃靛瀷
public byte HeroCnt;
public ushort[] HeroItemIndexList; // 鎵�鍦ㄦ灏嗚儗鍖呯储寮�+1鍒楄〃 [绔欎綅1鐗╁搧绱㈠紩+1, 绔欎綅2, ...]锛岀珯浣嶆棤姝﹀皢鏃朵负0
}
diff --git a/Main/Main.cs b/Main/Main.cs
index e5de4d6..35335b9 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -102,6 +102,8 @@
managers.Add(ViewNPCManager.Instance);
managers.Add(EquipRecordManager.Instance);
managers.Add(MinggeManager.Instance);
+ managers.Add(FuncPresetManager.Instance);
+ managers.Add(GMNotifyManager.Instance);
foreach (var manager in managers)
{
diff --git a/Main/System/Arena/ArenaBattleFailWin.cs b/Main/System/Arena/ArenaBattleFailWin.cs
index 422ac1c..1ddaa6a 100644
--- a/Main/System/Arena/ArenaBattleFailWin.cs
+++ b/Main/System/Arena/ArenaBattleFailWin.cs
@@ -73,7 +73,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic));
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtMyName.text = PlayerDatas.Instance.baseData.PlayerName;
diff --git a/Main/System/Arena/ArenaBattleVictoryWin.cs b/Main/System/Arena/ArenaBattleVictoryWin.cs
index b17d72b..50311df 100644
--- a/Main/System/Arena/ArenaBattleVictoryWin.cs
+++ b/Main/System/Arena/ArenaBattleVictoryWin.cs
@@ -67,7 +67,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic));
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtMyName.text = PlayerDatas.Instance.baseData.PlayerName;
diff --git a/Main/System/Arena/ArenaChallengeCell.cs b/Main/System/Arena/ArenaChallengeCell.cs
index 5cb891e..5ba1544 100644
--- a/Main/System/Arena/ArenaChallengeCell.cs
+++ b/Main/System/Arena/ArenaChallengeCell.cs
@@ -35,7 +35,7 @@
avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaMatchInfo.PlayerID, (int)arenaMatchInfo.Face, (int)arenaMatchInfo.FacePic));
avatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtName.text = UIHelper.ServerStringTrim(arenaMatchInfo.PlayerName);
diff --git a/Main/System/Arena/ArenaManager.cs b/Main/System/Arena/ArenaManager.cs
index b4aec02..6dcbc73 100644
--- a/Main/System/Arena/ArenaManager.cs
+++ b/Main/System/Arena/ArenaManager.cs
@@ -308,10 +308,10 @@
//浼樺厛鍙栬繘鏀婚槦浼嶇殑鎴樺姏锛屾病鏈夎繘鏀婚槦浼嶏紝鍙栦富绾挎垬鍔�
public long GetMyFightPower()
{
- var arenaDefenseTeam = TeamManager.Instance.GetTeam(TeamType.Arena);
+ var arenaDefenseTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Arena);
return arenaDefenseTeam.IsEmpty() || arenaDefenseTeam.GetTeamHeroCount() <= 0 ?
PlayerDatas.Instance.baseData.FightPower :
- FightPowerManager.Instance.GetTeamFightPower(TeamType.Arena, false);
+ FightPowerManager.Instance.GetTeamFightPower(TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena), false);
}
}
diff --git a/Main/System/Arena/ArenaPlayerRankCell.cs b/Main/System/Arena/ArenaPlayerRankCell.cs
index ef759af..d4f1d64 100644
--- a/Main/System/Arena/ArenaPlayerRankCell.cs
+++ b/Main/System/Arena/ArenaPlayerRankCell.cs
@@ -53,7 +53,7 @@
avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4));
avatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
nameText.text = rankData.name1;
rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue));
@@ -64,7 +64,7 @@
{
queryPlayerBtn.AddListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
}
}
diff --git a/Main/System/Arena/ArenaPlayerTop3Cell.cs b/Main/System/Arena/ArenaPlayerTop3Cell.cs
index 4b14abd..3df9027 100644
--- a/Main/System/Arena/ArenaPlayerTop3Cell.cs
+++ b/Main/System/Arena/ArenaPlayerTop3Cell.cs
@@ -27,7 +27,7 @@
model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, 1);
queryPlayerBtn.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
}
diff --git a/Main/System/Arena/ArenaRecordCell.cs b/Main/System/Arena/ArenaRecordCell.cs
index 5dceb8f..36decc3 100644
--- a/Main/System/Arena/ArenaRecordCell.cs
+++ b/Main/System/Arena/ArenaRecordCell.cs
@@ -67,7 +67,7 @@
avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaGameRec.Value3, (int)arenaGameRec.Value5, (int)arenaGameRec.Value6));
avatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtName.text = arenaGameRec.Name;
txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaGameRec.FightPower);
diff --git a/Main/System/Arena/ArenaWin.cs b/Main/System/Arena/ArenaWin.cs
index 4ab33ed..1b3e140 100644
--- a/Main/System/Arena/ArenaWin.cs
+++ b/Main/System/Arena/ArenaWin.cs
@@ -33,7 +33,7 @@
});
btnDeployTroops.SetListener(() =>
{
- HeroUIManager.Instance.selectTeamType = TeamType.ArenaDefense;
+ HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena);
UIManager.Instance.OpenWindow<HeroPosWin>(1); // 绔炴妧鍦烘爣绛鹃〉
});
}
diff --git a/Main/System/Battle/ArenaBattleWin.cs b/Main/System/Battle/ArenaBattleWin.cs
index 9b0f8b3..610f251 100644
--- a/Main/System/Battle/ArenaBattleWin.cs
+++ b/Main/System/Battle/ArenaBattleWin.cs
@@ -206,7 +206,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)info.PlayerID, (int)info.Face, (int)info.FacePic));
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense);
+ AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
var team = GetTeamHeroList(enemyTeam);
enemyCountry.RefreshOnTeamCountry(team, true);
diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index cf12d91..ea24d09 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -138,9 +138,9 @@
base.OnTurnFightState(turnNum, State, FuncLineID, extendData);
}
- protected void OnTeamChange(TeamType teamType)
+ protected void OnTeamChange(int teamType)
{
- if (teamType == TeamType.Story)
+ if (teamType == TeamManager.Instance.GetMainTeamID())
{
if (battleState == StoryBattleState.Break)
{
@@ -171,8 +171,8 @@
protected void ReloadTeam()
{
- PreloadResources(new List<TeamBase>() { TeamManager.Instance.GetTeam(TeamType.Story) }, null);
- battleObjMgr.ReloadTeam(TeamManager.Instance.GetTeam(TeamType.Story), BattleCamp.Red);
+ PreloadResources(new List<TeamBase>() { TeamManager.Instance.GetTeam(BattlePreSetType.Story) }, null);
+ battleObjMgr.ReloadTeam(TeamManager.Instance.GetTeam(BattlePreSetType.Story), BattleCamp.Red);
}
// public override void OnBattleEnd(JsonData turnFightStateData)
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 597c6f8..14bd87d 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -109,7 +109,7 @@
{
var redTeamList = new List<TeamBase>();
- TeamBase storyTeam = TeamManager.Instance.GetTeam(TeamType.Story);
+ TeamBase storyTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Story);
redTeamList.Add(storyTeam);
diff --git a/Main/System/Battle/WarlordPavilionBattleWin.cs b/Main/System/Battle/WarlordPavilionBattleWin.cs
index 691adde..96a4b03 100644
--- a/Main/System/Battle/WarlordPavilionBattleWin.cs
+++ b/Main/System/Battle/WarlordPavilionBattleWin.cs
@@ -143,7 +143,7 @@
bossHeadCell.SetTeamHero(teamHero);
txtBossName.text = teamHero.name;
NPCConfig npcConfig = NPCConfig.Get(teamHero.NPCID);
- bossLifeBar.SetBaseInfo(Mathf.Max(1, npcConfig.LifeBarCount), (ulong)teamHero.curHp, (ulong)teamHero.maxHp);
+ //bossLifeBar.SetBaseInfo(Mathf.Max(1, npcConfig.LifeBarCount), (ulong)teamHero.curHp, (ulong)teamHero.maxHp);
bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged;
bossBattleObject.buffMgr.onBuffChanged += OnBuffChanged;
}
@@ -151,7 +151,7 @@
{
bossHeadCell.SetTeamHero(null);
txtBossName.text = string.Empty;
- bossLifeBar.SetBaseInfo(2, 2, 2);
+ //bossLifeBar.SetBaseInfo(2, 2, 2);
Debug.LogError("鎵句笉鍒癰oss");
}
@@ -182,7 +182,7 @@
if (null != bossBattleObject)
{
TeamHero teamHero = bossBattleObject.teamHero;
- bossLifeBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp);
+ //bossLifeBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp);
}
}
@@ -200,11 +200,11 @@
// 鈽呪槄鈽� 瀹屽叏浣跨敤 StoryBossBattleWin 鐨勯�昏緫 鈽呪槄鈽�
if (info.battleHurtParam.hurter.hurtObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.hurter.hurtObj.teamHero.ObjID)
{
- bossLifeBar.Show((ulong)info.battleHurtParam.hurter.toHp, (ulong)bossBattleObject.teamHero.maxHp);
+ //bossLifeBar.Show((ulong)info.battleHurtParam.hurter.toHp, (ulong)bossBattleObject.teamHero.maxHp);
}
else if (info.battleHurtParam.caster.casterObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.caster.casterObj.teamHero.ObjID)
{
- bossLifeBar.Show((ulong)info.battleHurtParam.caster.toHp, (ulong)bossBattleObject.teamHero.maxHp);
+ //bossLifeBar.Show((ulong)info.battleHurtParam.caster.toHp, (ulong)bossBattleObject.teamHero.maxHp);
}
}
diff --git a/Main/System/Equip/EquipCell.cs b/Main/System/Equip/EquipCell.cs
index af8ffd6..c38125b 100644
--- a/Main/System/Equip/EquipCell.cs
+++ b/Main/System/Equip/EquipCell.cs
@@ -64,7 +64,7 @@
{
uieff.effectId = 1026;
- uieff.PlayByArrIndex(equip.config.ItemColor - 7, true, true);
+ uieff.PlayByArrIndex(equip.config.ItemColor - 7, true);
}
else
{
diff --git a/Main/System/Equip/EquipModel.cs b/Main/System/Equip/EquipModel.cs
index ab0c807..10ca09d 100644
--- a/Main/System/Equip/EquipModel.cs
+++ b/Main/System/Equip/EquipModel.cs
@@ -305,18 +305,20 @@
Debug.LogWarning("绌挎埓瑁呭锛屽悜鏈嶅姟鍣ㄨ姹�");
}
- //鍦ㄨ褰曢攢姣佹垨鏇挎崲鍓嶇殑瑁呭
+ //璁板綍閿�姣佹垨鏇挎崲鍓嶇殑瑁呭
if ((opType == 1 || opType == 2) && !itemIndexList.IsNullOrEmpty())
{
foreach (var index in itemIndexList)
{
- var oldEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, index);
- EquipRecordManager.Instance.oldEquipDic[index] = oldEquip;
+ ItemModel newEquip = PackManager.Instance.GetItemByIndex(PackType.DropItem, index);
+ if (newEquip == null)
+ continue;
+ int equipPlace = newEquip.config.EquipPlace - 1;
+ ItemModel oldEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, equipPlace);
+ EquipRecordManager.Instance.AddRecord(opType, newEquip, oldEquip);
}
}
-
GameNetSystem.Instance.SendInfo(pack);
-
}
/// <summary>
@@ -493,6 +495,15 @@
return equip.GetUseData(19);
}
+ //鎶�鑳絀D鍒楄〃
+ public List<int> GetEquipSkillIDs(ItemModel equip)
+ {
+ if (equip == null)
+ {
+ return new List<int>();
+ }
+ return equip.GetUseData(37);
+ }
//寰楀埌瑁呭浣嶅搴旂殑閮ㄤ綅鍚嶇О
public string GetEquipPlaceName(int place)
diff --git a/Main/System/FuncPreset.meta b/Main/System/FuncPreset.meta
new file mode 100644
index 0000000..cdebb84
--- /dev/null
+++ b/Main/System/FuncPreset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: aa86b940defc60440ac6c5e73d67dc70
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FuncPreset/FuncPresetManager.cs b/Main/System/FuncPreset/FuncPresetManager.cs
new file mode 100644
index 0000000..f689ee0
--- /dev/null
+++ b/Main/System/FuncPreset/FuncPresetManager.cs
@@ -0,0 +1,176 @@
+using System.Collections.Generic;
+using UnityEngine;
+using LitJson;
+using System;
+
+//鏂规棰勮锛氭祦娲捐瀹�
+// 杩欓噷瀛樺偍鐨勬槸娴佹淳id璁惧畾; 鍔熻兘棰勮鍦ㄥ悇涓姛鑳介噷濡傚懡鏍肩殑鏄瓨鍦ㄥ懡鏍艰儗鍖呭搴旓紝姝﹀皢鏄彟澶栭�氱煡浣跨敤鐨勬牸瀛愮储寮�
+public class FuncPresetManager : GameSystemManager<FuncPresetManager>
+{
+ //棰勮鏂规锛氬姛鑳界被鍨嬶紙鍚叏灞�鍜屽瓙鍔熻兘锛岄厤琛級-瀛愭柟妗圛D-棰勮鏂规瑙i攣鍚嶇О淇℃伅
+ Dictionary<int, Dictionary<int, FuncPreset>> m_FuncPresetDict = new Dictionary<int, Dictionary<int, FuncPreset>>();
+ public event Action OnFuncPresetInfoListChanged; //娴佹淳璁剧疆鎬讳俊鎭�
+
+ //瀵瑰簲 BattlePreSetType 鎴樻枟绫诲瀷 锛� 鍏ㄥ眬鏂规ID
+ Dictionary<int, int> battlePreSetDict = new Dictionary<int, int>();
+ public event Action OnBattelePresetEvent;
+
+ //鎵�鏈夐璁炬柟妗堢殑淇濆瓨淇℃伅 鍏ㄥ眬鏂规ID 锛氬瓙鍔熻兘绫诲瀷锛堥厤琛級锛氬瓙鏂规ID
+ Dictionary<int, Dictionary<int, int>> m_FuncPresetSaveDict = new Dictionary<int, Dictionary<int, int>>();
+ public event Action OnFuncPresetUseDataEvent;
+
+ public const int GlobalDefaultPresetID = 1; //榛樿鍏ㄥ眬鏂规ID
+ public const int FuncDefaultPresetID = 1; //榛樿瀛愬姛鑳芥柟妗圛D
+
+ public int teamPresetMaxID = 1; //闃靛棰勮鏈�澶D, 榛樿1鎸夎В閿佸紑鏀�
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize;
+ ParseConfig();
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize;
+ }
+
+
+ void ParseConfig()
+ {
+
+ }
+
+ private void OnBeforePlayerDataInitialize()
+ {
+ battlePreSetDict.Clear();
+ InitFuncPreset();
+ }
+
+ void InitFuncPreset()
+ {
+ m_FuncPresetDict.Clear();
+ // if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mingge))
+ // {
+ // return;
+ // }
+ var keys = PresetUnlockConfig.GetKeys();
+ for (int i = 0; i < keys.Count; i++)
+ {
+ var config = PresetUnlockConfig.Get(keys[i]);
+ if (!m_FuncPresetDict.ContainsKey(config.PresetType))
+ {
+ m_FuncPresetDict[config.PresetType] = new Dictionary<int, FuncPreset>();
+ }
+ m_FuncPresetDict[config.PresetType][config.PresetID] = new FuncPreset()
+ {
+ PresetID = config.PresetID,
+ unLock = config.UnlockType == 0,
+ PresetName = Language.Get("Mingge13") + config.PresetID,
+ };
+
+ }
+
+ }
+
+ public void UpdateFuncPresetInfoList(HB161_tagSCFuncPresetInfoList vNetData)
+ {
+ for (int i = 0; i < vNetData.FuncCnt; i++)
+ {
+ var funcPresetInfo = vNetData.FuncPresetList[i];
+ if (!m_FuncPresetDict.ContainsKey(funcPresetInfo.FuncPresetType))
+ {
+ m_FuncPresetDict[funcPresetInfo.FuncPresetType] = new Dictionary<int, FuncPreset>();
+ }
+ for (int j = 0; j < funcPresetInfo.PresetCnt; j++)
+ {
+ var preset = funcPresetInfo.PresetList[j];
+ //璇ュ姛鑳介璁捐В閿佺姸鎬侊紝鎸夐璁綢D浜岃繘鍒朵綅杩愮畻璁板綍鏄惁宸茶В閿�
+ m_FuncPresetDict[funcPresetInfo.FuncPresetType][preset.PresetID] = new FuncPreset()
+ {
+ PresetID = preset.PresetID,
+ unLock = (funcPresetInfo.UnlockState & (1 << preset.PresetID)) != 0,
+ PresetName = string.IsNullOrEmpty(preset.PresetName) ? Language.Get("Mingge13") + preset.PresetID : preset.PresetName,
+ };
+ }
+ }
+
+ OnFuncPresetInfoListChanged?.Invoke();
+ }
+
+ //姣忎釜鍏ㄥ眬鏂规鐨勫瓨鍌ㄤ俊鎭�
+ public void UpdateFuncPresetUseData(HB162_tagSCFuncPresetSwitchInfo vNetData)
+ {
+ for (int i = 0; i < vNetData.BatPresetCnt; i++)
+ {
+ var batPreset = vNetData.BatPresetList[i];
+ if (!m_FuncPresetSaveDict.ContainsKey(batPreset.BatPresetID))
+ {
+ m_FuncPresetSaveDict[batPreset.BatPresetID] = new Dictionary<int, int>();
+ }
+ for (int j = 0; j < batPreset.FuncCnt; j++)
+ {
+ var funcPreset = batPreset.FuncPresetList[j];
+ m_FuncPresetSaveDict[batPreset.BatPresetID][funcPreset.FuncPresetType] = funcPreset.FuncPresetID;
+ }
+ }
+ OnFuncPresetUseDataEvent?.Invoke();
+ }
+
+ //褰撳墠鎴樻枟鍔熻兘鐨勫叏灞�鏂规ID浣跨敤鎯呭喌
+ public void UpdateBatPresetNowUseInfo(HB163_tagSCBatPresetSwitchInfo netPack)
+ {
+ for (int i = 0; i < netPack.BatFuncCnt; i++)
+ {
+ battlePreSetDict[netPack.BatPresetList[i].BatPresetType] = netPack.BatPresetList[i].BatPresetID;
+ }
+ OnBattelePresetEvent?.Invoke();
+ }
+
+ //鑾峰彇鍏ㄥ眬鏂规ID锛屽鏋滃彇涓嶅埌榛樿鏂规1
+ public int GetGlobalPresetID(int type)
+ {
+ if (battlePreSetDict.ContainsKey(type))
+ {
+ return battlePreSetDict[type];
+ }
+ return 1;
+ }
+
+ //鑾峰彇瀛愬姛鑳芥柟妗圛D锛屽鏋滃彇涓嶅埌榛樿鏂规1
+ public int GetFuncPresetID(int type, int presetID)
+ {
+ if (m_FuncPresetSaveDict.ContainsKey(presetID) && m_FuncPresetSaveDict[presetID].ContainsKey(type))
+ {
+ return m_FuncPresetSaveDict[presetID][type];
+ }
+ return 1;
+ }
+}
+
+
+public class FuncPreset
+{
+ public int PresetID; //棰勮鏂规ID
+ public bool unLock; //鏄惁瑙i攣
+ public string PresetName; //棰勮鍚嶇О
+}
+
+
+
+//鎴樻枟鍔熻兘鍖哄垎瀵瑰簲瀛樺偍鍏ㄥ眬鏂规ID锛屽婕旀鍦洪槻瀹堢敤鍝釜鍏ㄥ眬鏂规ID鐨勫垎绫�
+public enum BattlePreSetType
+{
+ None = 0,
+ Story = 1, //涓荤嚎
+ Arena = 2, //婕旀鍦洪槻瀹�
+
+}
+
+//鍔熻兘棰勮绫诲瀷 1-鍏ㄥ眬鎴樻枟锛�2-闃靛锛�3-鍛芥牸锛�
+public enum FuncPresetType
+{
+ Global = 1,
+ Team = 2,
+ Mingge = 3,
+}
\ No newline at end of file
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/System/FuncPreset/FuncPresetManager.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/FuncPreset/FuncPresetManager.cs.meta
index b21ce1a..c2ca8b3 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/System/FuncPreset/FuncPresetManager.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: a8f801f20f111f944bcd09b9bfa9c1b0
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/Guild/GuildChangeBroadcastWin.cs b/Main/System/Guild/GuildChangeBroadcastWin.cs
new file mode 100644
index 0000000..dde5d6c
--- /dev/null
+++ b/Main/System/Guild/GuildChangeBroadcastWin.cs
@@ -0,0 +1,88 @@
+using System.Text;
+using UnityEngine;
+using UnityEngine.UI;
+
+/// <summary>
+/// 淇敼鍏憡鐣岄潰
+/// </summary>
+public class GuildChangeBroadcastWin : UIBase
+{
+ [SerializeField] InputField inputField;
+ [SerializeField] Button okBtn;
+
+ protected override void InitComponent()
+ {
+ okBtn.SetListener(() =>
+ {
+ string msg = inputField.text;
+ if (!CheckLimit(msg, out int errorCode))
+ {
+ ShowErrorTip(errorCode);
+ return;
+ }
+ SendPack(msg);
+ CloseWindow();
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ inputField.text = string.Empty;
+ }
+
+ private void SendPack(string msg)
+ {
+ CA623_tagCMChangeFamilyBroadcast pack = new CA623_tagCMChangeFamilyBroadcast();
+ pack.Msg = msg;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ private bool CheckLimit(string info, out int errorCode)
+ {
+ errorCode = 0;
+ if (string.IsNullOrEmpty(info))
+ {
+ errorCode = 0;
+ return false;
+ }
+
+ if (SatisfyLength(info))
+ {
+ errorCode = 1;
+ return false;
+ }
+
+ if (DirtyWordConfig.IsDirtWord(info) || UIHelper.HasSpecCheckChat(info) || DirtyNameConfig.IsDirtName(info))
+ {
+ errorCode = 3;
+ return false;
+ }
+ return true;
+ }
+
+ private bool SatisfyLength(string name)
+ {
+ int length = Encoding.Default.GetBytes(name).Length;
+ int maxlength = inputField.characterLimit * 3; //绾腑鏂囧瓧鏁�
+ return length > maxlength;
+ }
+
+ private void ShowErrorTip(int _errorCode)
+ {
+ switch (_errorCode)
+ {
+ case 0:
+ //绌�
+ SysNotifyMgr.Instance.ShowTip("ChatInfoNoNull");
+ break;
+ case 1:
+ // 闀垮害杩囬暱
+ SysNotifyMgr.Instance.ShowTip("NameError2", inputField.characterLimit);
+ break;
+ case 3:
+ // 鑴忓瓧
+ SysNotifyMgr.Instance.ShowTip("NameSensitive");
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/System/Guild/GuildChangeBroadcastWin.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Guild/GuildChangeBroadcastWin.cs.meta
index b21ce1a..1815a27 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/System/Guild/GuildChangeBroadcastWin.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: 2d13203d3d3b7204cb8063a9e13f605d
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/Guild/GuildHallWin.cs b/Main/System/Guild/GuildHallWin.cs
index fd1a187..51bdf38 100644
--- a/Main/System/Guild/GuildHallWin.cs
+++ b/Main/System/Guild/GuildHallWin.cs
@@ -50,7 +50,7 @@
var needLV = GuildManager.Instance.GetNeedGuildJobLV((int)GuildFuncType.PublishNotice);
if (PlayerDatas.Instance.fairyData.mine.FmLV >= needLV)
{
- // UIManager.Instance.OpenWindow<GuildNoticeWin>();
+ UIManager.Instance.OpenWindow<GuildChangeBroadcastWin>();
}
});
diff --git a/Main/System/Guild/GuildManager.cs b/Main/System/Guild/GuildManager.cs
index 2770d30..d7fc442 100644
--- a/Main/System/Guild/GuildManager.cs
+++ b/Main/System/Guild/GuildManager.cs
@@ -76,7 +76,7 @@
void OnPlayerLoginOk()
{
UpdateDonateRedPoint();
-
+ QueryZBGFamilyInfo();
}
void PlayerDataRefreshEvent(PlayerDataType type)
@@ -121,7 +121,7 @@
EnterOrQuitGuildEvent?.Invoke(false);
}
- //娉ㄦ剰涓婄嚎閫氱煡鍏細鏁版嵁鏃朵篃浼氳Е鍙�
+ //娉ㄦ剰涓婄嚎閫氱煡鍏細鏁版嵁鏃朵篃浼氳Е鍙�; 浣嗘柇绾块噸杩炰笉浼氳Е鍙�
public async UniTask AfterEnterGuild()
{
//杩欓噷杩樻病鏈夊叕浼氭暟鎹�, 鍚庣画鐨勫寘浼氭洿鏂板叕浼氭暟鎹�
@@ -842,9 +842,14 @@
//鐧诲綍鍚庨娆℃墦寮�鏌ヨ锛屾崲鏂颁粰鐩熸煡璇�
public void QueryZBGFamilyInfo()
{
+ if (PlayerDatas.Instance.baseData.FamilyId == 0)
+ {
+ return;
+ }
if (isQueryZBGYet)
return;
+
QueryFamilyAction((int)PlayerDatas.Instance.baseData.FamilyId, ZBGFamilyActionType);
isQueryZBGYet = true;
diff --git a/Main/System/Hero/HeroInfo.Fetter.cs b/Main/System/Hero/HeroInfo.Fetter.cs
index 3a0c695..cd93c3e 100644
--- a/Main/System/Hero/HeroInfo.Fetter.cs
+++ b/Main/System/Hero/HeroInfo.Fetter.cs
@@ -8,7 +8,7 @@
//涓嶅悓闃靛缇佺粖灞炴�т笉鍚岋紝瀹炴椂璁$畻锛屼笌鍏朵粬缂撳瓨鐨勪笉鍚�
- public void RefreshFetterAttrsWhenCalcPower(TeamType teamType)
+ public void RefreshFetterAttrsWhenCalcPower(int teamType)
{
fetterAttrs.Clear();
var list = GetActiveFetter(heroConfig, TeamManager.Instance.GetTeam(teamType));
diff --git a/Main/System/Hero/HeroInfo.Lineup.cs b/Main/System/Hero/HeroInfo.Lineup.cs
index 7c23aa8..21c35d8 100644
--- a/Main/System/Hero/HeroInfo.Lineup.cs
+++ b/Main/System/Hero/HeroInfo.Lineup.cs
@@ -5,12 +5,12 @@
//闃靛甯冮樀
public partial class HeroInfo
{
- public Dictionary<TeamType, KeyValuePair<int, int>> GetTeamTypeShapeTypePositionDict()
+ public Dictionary<int, KeyValuePair<int, int>> GetTeamTypeShapeTypePositionDict()
{
// 鑻遍泟褰撳墠鎵�鏈夊湪鐨勯槦浼�
List<int> heroTeams = itemHero.GetUseData(81);
- Dictionary<TeamType, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<TeamType, KeyValuePair<int, int>>();
+ Dictionary<int, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<int, KeyValuePair<int, int>>();
foreach (var teamMsg in heroTeams)
{
// 鎵�鍦ㄩ樀瀹逛俊鎭垪琛� [闃靛绫诲瀷*10000+闃靛瀷绫诲瀷*100+浣嶇疆缂栧彿, ...]
@@ -18,7 +18,7 @@
int shapeType = (teamMsg % 10000) / 100;
int positionIndex = teamMsg % 100;
- if (teamTypeShapeTypePositionDict.ContainsKey((TeamType)teamType))
+ if (teamTypeShapeTypePositionDict.ContainsKey(teamType))
{
// 闃熶紞绫诲瀷鐩稿悓锛屾洿鏂伴樀鍨嬪拰浣嶇疆
Debug.LogError("褰撳墠鑻遍泟鎷ユ湁涓や釜鐩稿悓鐨勯槦浼嶄俊鎭�: " + teamType + " " + shapeType + " " + positionIndex + ", hero guid is " + itemHero.guid);
@@ -27,7 +27,7 @@
{
// 闃熶紞绫诲瀷涓嶅悓锛屾坊鍔犳柊鐨�
KeyValuePair<int, int> shapeTypePosition = new KeyValuePair<int, int>(shapeType, positionIndex);
- teamTypeShapeTypePositionDict.Add((TeamType)teamType, shapeTypePosition);
+ teamTypeShapeTypePositionDict.Add(teamType, shapeTypePosition);
}
}
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index 0646590..842b847 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -112,17 +112,17 @@
//鏄惁涓妜闃� 鏈嶅姟绔槦浼�
- public bool IsInTeamByTeamType(TeamType teamType)
+ public bool IsInTeamByTeamType(BattlePreSetType battleType)
{
- return TeamManager.Instance.GetTeam(teamType).HasHeroInServer(itemHero.guid);
+ return TeamManager.Instance.GetTeam(battleType).HasHeroInServer(itemHero.guid);
}
//鏄惁涓婁换浣曢樀瀹�
public bool IsInAnyTeam()
{
- for (int i = 1; i < (int)TeamType.Max; i++)
+ for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++)
{
- if (TeamManager.Instance.GetTeam((TeamType)i).HasHeroInServer(itemHero.guid))
+ if (TeamManager.Instance.GetTeam(i).HasHeroInServer(itemHero.guid))
{
return true;
}
@@ -133,9 +133,9 @@
//鏄惁涓婁换浣曢樀瀹癸紝涓斿彧鏈変竴鍙�
public bool IsInAnyTeamJustOne()
{
- for (int i = 1; i < (int)TeamType.Max; i++)
+ for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++)
{
- var team = TeamManager.Instance.GetTeam((TeamType)i);
+ var team = TeamManager.Instance.GetTeam(i);
if (team.HasHeroInServer(itemHero.guid))
{
if (team.GetTeamHeroCount() == 1)
@@ -148,11 +148,11 @@
//涓嬮樀鎵�鏈夐樀瀹�
public void LeaveAllTeam()
{
- for (int i = 1; i < (int)TeamType.Max; i++)
+ for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++)
{
int pos;
- var team = TeamManager.Instance.GetTeam((TeamType)i);
- if (TeamManager.Instance.GetTeam((TeamType)i).RemoveHero(this, out pos))
+ var team = TeamManager.Instance.GetTeam(i);
+ if (TeamManager.Instance.GetTeam(i).RemoveHero(this, out pos))
{
//濡傛灉鏄渶鍚庝竴涓灏嗭紝鍒欓粯璁や笂闃典竴涓�
team.SaveTeam();
diff --git a/Main/System/HeroUI/HeroCardCell.cs b/Main/System/HeroUI/HeroCardCell.cs
index 15c209e..e59a19f 100644
--- a/Main/System/HeroUI/HeroCardCell.cs
+++ b/Main/System/HeroUI/HeroCardCell.cs
@@ -39,9 +39,9 @@
countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
- onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
+ onStateImg.SetActive(hero.IsInTeamByTeamType(BattlePreSetType.Story));
- int teamPos = TeamManager.Instance.GetTeam(TeamType.Story).GetPosition(hero.itemHero.guid);
+ int teamPos = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetPosition(hero.itemHero.guid);
if (teamPos >= 0)
{
redpoint.redpointId = MainRedDot.HeroCardRedpoint * 10 + teamPos;
diff --git a/Main/System/HeroUI/HeroDeleteWin.cs b/Main/System/HeroUI/HeroDeleteWin.cs
index cf9c829..737c79b 100644
--- a/Main/System/HeroUI/HeroDeleteWin.cs
+++ b/Main/System/HeroUI/HeroDeleteWin.cs
@@ -103,7 +103,7 @@
}
}
- void OnTeamChange(TeamType type)
+ void OnTeamChange(int type)
{
scroller.m_Scorller.RefreshActiveCellViews();
}
diff --git a/Main/System/HeroUI/HeroGiftRoleListWin.cs b/Main/System/HeroUI/HeroGiftRoleListWin.cs
index 4fc4beb..8d7881f 100644
--- a/Main/System/HeroUI/HeroGiftRoleListWin.cs
+++ b/Main/System/HeroUI/HeroGiftRoleListWin.cs
@@ -60,7 +60,7 @@
HeroGiftRoleListCell heroGiftRoleListCell = cellView as HeroGiftRoleListCell;
heroGiftRoleListCell.Display(cellView.index);
}
- void OnTeamChange(TeamType type)
+ void OnTeamChange(int type)
{
scroller.m_Scorller.RefreshActiveCellViews();
}
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index 73ebc3b..e31e90e 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -34,7 +34,7 @@
});
changeHeroPosBtn.AddListener(() =>
{
- HeroUIManager.Instance.selectTeamType = TeamType.Story;
+ HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID();
UIManager.Instance.OpenWindow<HeroPosWin>();
});
attrOnTipBtn.AddListener(() =>
diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index f305634..e0c3eb5 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -66,23 +66,15 @@
protected override void InitComponent()
{
- attackTeamBtn.AddListener(() =>
- {
- SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(0));
- });
- defendTeamBtn.AddListener(() =>
- {
- SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(1));
- });
mainFBBtn.AddListener(() =>
{
- SelectTeamFunc(TeamType.Story);
+ SelectTeamFunc(TeamManager.Instance.GetMainTeamID());
});
jjcBtn.AddListener(() =>
{
- SelectTeamFunc(TeamType.Arena);
+ SelectTeamFunc(TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena));
});
// tttBtn.AddListener(() =>
// {
@@ -320,25 +312,6 @@
//绠$悊甯冮樀鍏ュ彛鎸夐挳锛氬绔炴妧鍦烘槸鍚︽牴鎹姛鑳芥樉闅愶紝閫氬ぉ濉斿拰涓荤嚎鍙湁杩涙敾鏂瑰竷闃甸粯璁や笉鏄剧ず
void RefreshOnTeamBtn()
{
- if (HeroUIManager.Instance.selectTeamType == TeamType.Arena ||
- HeroUIManager.Instance.selectTeamType == TeamType.ArenaDefense)
- {
- attackTeamBtn.SetActive(true);
- defendTeamBtn.SetActive(true);
- if (HeroUIManager.Instance.selectTeamType == TeamType.Arena)
- {
- attackTeamBtn.SelectBtn(true);
- }
- else
- {
- defendTeamBtn.SelectBtn(true);
- }
- }
- else
- {
- attackTeamBtn.SetActive(false);
- defendTeamBtn.SetActive(false);
- }
}
@@ -528,7 +501,7 @@
team.SaveTeam();
}
- void SelectTeamFunc(TeamType type)
+ void SelectTeamFunc(int type)
{
if (HeroUIManager.Instance.selectTeamType == type)
{
@@ -541,7 +514,7 @@
heroListScroller.m_Scorller.RefreshActiveCellViews();
}
- protected void OnTeamChange(TeamType teamType)
+ protected void OnTeamChange(int teamType)
{
if (HeroUIManager.Instance.selectTeamType == teamType)
{
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 05880ba..741a254 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -823,9 +823,9 @@
}
}
- void TeamPosChangeEvent(TeamType teamType)
+ void TeamPosChangeEvent(int teamType)
{
- if (teamType != TeamType.Story)
+ if (teamType != TeamManager.Instance.GetMainTeamID())
return;
fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculateFightPower());
}
@@ -895,7 +895,7 @@
}
- if (!hero.IsInTeamByTeamType(TeamType.Story))
+ if (!hero.IsInTeamByTeamType(BattlePreSetType.Story))
{
return;
}
diff --git a/Main/System/HeroUI/HeroUIManager.OnTeam.cs b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
index 6fb8cb2..397450c 100644
--- a/Main/System/HeroUI/HeroUIManager.OnTeam.cs
+++ b/Main/System/HeroUI/HeroUIManager.OnTeam.cs
@@ -11,8 +11,8 @@
#region 甯冮樀鐣岄潰
public List<string> heroOnTeamSortList { get; private set; } = new List<string>(); //涓嶅悓涓婇樀鐨勫垪琛ㄦ帓搴�
- private TeamType m_SelectTeamType = TeamType.Story; //褰撳墠閫変腑鐨勬槸鍝釜闃靛, 甯冮樀鐩稿叧閫昏緫浣跨敤
- public TeamType selectTeamType
+ private int m_SelectTeamType = 1; //褰撳墠閫変腑鐨勬槸鍝釜鍏ㄥ眬鏂规ID, 甯冮樀鐩稿叧閫昏緫浣跨敤
+ public int selectTeamType
{
get { return m_SelectTeamType; }
set
@@ -20,7 +20,7 @@
if (m_SelectTeamType == value)
return;
//涓婁竴涓樀瀹归渶瑕佹仮澶嶅埌鍘熺姸鎬�
- if (m_SelectTeamType != TeamType.None)
+ if (m_SelectTeamType != 0)
{
TeamManager.Instance.GetTeam(m_SelectTeamType).RestoreTeam();
}
@@ -28,6 +28,8 @@
m_SelectTeamType = value;
}
}
+
+ public int setlectTabIndex = 0; //鎴樻枟鎬绘爣绛� 瀵瑰簲 BattlePreSetType
public List<int> selectListTeamPos = new List<int>(); //甯冮樀鐣岄潰 绛涢�夋潯浠�
@@ -88,10 +90,9 @@
/// <summary>
/// 鎸夐槦浼嶈幏寰楅樀鍨嬶紙鍥藉鍏夌幆锛夊睘鎬�
/// </summary>
- /// <param name="teamType"></param>
/// <param name="isPreview">true 瀹㈡埛绔瑙堥樀瀹癸紝榛樿false 鏈嶅姟鍣ㄩ樀瀹�</param>
/// <returns></returns>
- public Dictionary<int, int> GetCountryAttrs(TeamType teamType, bool isPreview = false)
+ public Dictionary<int, int> GetCountryAttrs(int teamType, bool isPreview = false)
{
Dictionary<int, int> countryAttrs = new Dictionary<int, int>();
Int2 result = GetMaxCountHeroCountry(teamType, isPreview);
@@ -164,7 +165,7 @@
/// <param name="teamType"></param>
/// <param name="isPreview">true 瀹㈡埛绔瑙堥樀瀹癸紝榛樿false 鏈嶅姟鍣ㄩ樀瀹�</param>
/// <returns></returns>
- public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamType(TeamType teamType, bool isPreview = false)
+ public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamType(int teamType, bool isPreview = false)
{
Dictionary<HeroCountry, int> heroCountryCount = new Dictionary<HeroCountry, int>();
@@ -233,7 +234,7 @@
/// <param name="teamType"></param>
/// <param name="isPreview">true 瀹㈡埛绔瑙堥樀瀹癸紝榛樿false 鏈嶅姟鍣ㄩ樀瀹�</param>
/// <returns></returns>
- public Int2 GetMaxCountHeroCountry(TeamType teamType, bool isPreview = false)
+ public Int2 GetMaxCountHeroCountry(int teamType, bool isPreview = false)
{
var countryCountDict = GetCountryHeroCountByTeamType(teamType, isPreview);
//鎵惧埌鏈�澶х殑鍥藉鍜屾暟閲�
@@ -268,18 +269,6 @@
}
}
return new Int2((int)country, maxValue);
- }
-
- //鍦ㄤ笉鍚岄〉绛句笅閫堿ttackType 0 鏀诲嚮闃靛 1 闃插畧闃靛
- public int GetSelectTeamTypeByAttackType(int AttackType)
- {
- if (selectTeamType == TeamType.Arena || selectTeamType == TeamType.ArenaDefense)
- {
- return AttackType == 0 ? (int)TeamType.Arena : (int)TeamType.ArenaDefense;
- }
-
-
- return (int)TeamType.Story;
}
@@ -534,7 +523,7 @@
{
int minLV = int.MaxValue;
int minID = -1;
- var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ var team = TeamManager.Instance.GetTeam(TeamManager.Instance.GetMainTeamID());
for (int i = 0; i < team.serverHeroes.Length; i++)
{
if (team.serverHeroes[i] != null)
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index fae06d9..aa03f11 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -304,8 +304,8 @@
}
// 鎺掑簭瑙勫垯锛氫笂闃�>姝﹀皢绛夌骇锛炵獊鐮寸瓑绾э紴姝﹀皢瑙夐啋闃剁骇锛炴灏嗗搧璐紴姝﹀皢鍚炲櫖鏄熺骇锛炴灏咺D
- bool isInTeamA = heroA.IsInTeamByTeamType(TeamType.Story);
- bool isInTeamB = heroB.IsInTeamByTeamType(TeamType.Story);
+ bool isInTeamA = heroA.IsInTeamByTeamType(BattlePreSetType.Story);
+ bool isInTeamB = heroB.IsInTeamByTeamType(BattlePreSetType.Story);
if (isInTeamA != isInTeamB)
{
return isInTeamA ? -1 : 1;
@@ -499,7 +499,7 @@
return 0;
var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId);
- if (!hero.IsInTeamByTeamType(TeamType.Story))
+ if (!hero.IsInTeamByTeamType(BattlePreSetType.Story))
{
if (hero.heroStar < hero.GetCurMaxStar() && heroCnt > 1)
{
@@ -579,7 +579,7 @@
if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
return;
- var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ var team = TeamManager.Instance.GetTeam(BattlePreSetType.Story);
for (int i = 0; i < heroOnTeamRedpointList.Count; i++)
{
var redpoint = heroOnTeamRedpointList[i];
@@ -712,9 +712,9 @@
}
}
- void OnTeamChangeEvent(TeamType teamType)
+ void OnTeamChangeEvent(int teamType)
{
- if (teamType == TeamType.Story)
+ if (teamType == TeamManager.Instance.GetMainTeamID())
{
refreshRedPoint = true;
}
diff --git a/Main/System/LineupRecommend/LineupRecommendManager.cs b/Main/System/LineupRecommend/LineupRecommendManager.cs
index dcdf40a..b325678 100644
--- a/Main/System/LineupRecommend/LineupRecommendManager.cs
+++ b/Main/System/LineupRecommend/LineupRecommendManager.cs
@@ -192,7 +192,7 @@
return;
}
- TeamBase storyTeam = TeamManager.Instance.GetTeam(TeamType.Story);
+ TeamBase storyTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Story);
storyTeam.RemoveAllHeroes();
int currentMaxLineupCount = TeamConst.MaxTeamHeroCount - HeroUIManager.Instance.lockIndexList.Count;
diff --git a/Main/System/Main/AutoFightModel.cs b/Main/System/Main/AutoFightModel.cs
index 2fecc9e..183d973 100644
--- a/Main/System/Main/AutoFightModel.cs
+++ b/Main/System/Main/AutoFightModel.cs
@@ -410,7 +410,7 @@
fightingHeroSkinID = teamHero.SkinID;
//鎴樻枟鏃舵病鏈塆UID 锛岄�氳繃heroid鏌ユ壘
- var hero = TeamManager.Instance.GetTeam(TeamType.Story).GetHeroByHeroID(teamHero.heroId);
+ var hero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetHeroByHeroID(teamHero.heroId);
if (hero != null)
{
heroGuid = hero.guid;
diff --git a/Main/System/Main/AutoFightWin.cs b/Main/System/Main/AutoFightWin.cs
index f9472f8..f16f046 100644
--- a/Main/System/Main/AutoFightWin.cs
+++ b/Main/System/Main/AutoFightWin.cs
@@ -32,7 +32,7 @@
[SerializeField] Toggle autoFinishTaskToggle;
[SerializeField] Button autoFinishTaskTipBtn;
-
+ [SerializeField] Button recordBtn;
bool isOpenCostScroll = false;
bool isOpenSpeedScroll = false;
bool isOpenTryChallengeScroll = false;
@@ -49,7 +49,7 @@
autoFinishTaskTipBtn.AddListener(() =>
{
- DislayTip("AutoFight16",autoFinishTaskTipBtn.transform.position);
+ DislayTip("AutoFight16", autoFinishTaskTipBtn.transform.position);
});
changeCostBtn.AddListener(() =>
@@ -119,6 +119,11 @@
isOpenTryChallengeScroll = false;
tryChallengeArrow.transform.localRotation = Quaternion.Euler(0, 0, 0);
});
+
+ recordBtn.SetListener(() =>
+ {
+ UIManager.Instance.OpenWindow<EquipRecordWin>();
+ });
}
protected override void OnPreOpen()
diff --git a/Main/System/Main/EquipRecordCell.cs b/Main/System/Main/EquipRecordCell.cs
index 4270e19..e7d2ee7 100644
--- a/Main/System/Main/EquipRecordCell.cs
+++ b/Main/System/Main/EquipRecordCell.cs
@@ -1,13 +1,57 @@
+using System.Collections.Generic;
using UnityEngine;
-
+using System;
public class EquipRecordCell : MonoBehaviour
{
[SerializeField] EquipRecordItem fromEquip;
[SerializeField] EquipRecordItem toEquip;
[SerializeField] ImageEx imgWear;
[SerializeField] ImageEx imgDecompose;
- public void Display(int index)
+ [SerializeField] TextEx txtFightPoint;
+ [SerializeField] TextEx txtTime;
+ public void Display(int index, List<EquipRecordManager.EquipRecordData> list)
{
+ if (list == null || index >= list.Count || index < 0)
+ return;
+ var data = list[index];
+ int state = GetState(data);
+ if (state == 0)
+ {
+ fromEquip.SetActive(false);
+ toEquip.SetActive(false);
+ imgWear.SetActive(false);
+ imgDecompose.SetActive(false);
+ }
+ else
+ {
+ fromEquip.SetActive(state == 1 || state == 2 || state == 3);
+ toEquip.SetActive(state == 1);
+ imgDecompose.SetActive(state == 2);
+ imgWear.SetActive(state == 3);
+ fromEquip.Display(state == 1 ? data.oldEquip : data.newEquip);
+ toEquip.Display(data.newEquip);
+ }
+ txtFightPoint.text = StringUtility.Concat("+", UIHelper.ReplaceLargeNum(data.fightPower));
+ txtTime.text = GetTime(data.timestamp);
+ }
+ // 0-涓嶆樉绀� 1-浜ゆ崲 2-鍒嗚В 3-棣栨绌胯澶�
+ private int GetState(EquipRecordManager.EquipRecordData data)
+ {
+ if (data == null || data.newEquip == null)
+ return 0;
+ if (data.oldEquip == null)
+ return 3;
+ if (data.recordType == (int)EquipRecordManager.EquipOPType.Equip)
+ return 1;
+ if (data.recordType == (int)EquipRecordManager.EquipOPType.Decompose)
+ return 2;
+ return 0;
+ }
+
+ private string GetTime(int timestamp)
+ {
+ DateTime dateTime = TimeUtility.GetTime((uint)timestamp);
+ return dateTime.ToString("MM-dd HH:mm:ss");
}
}
\ No newline at end of file
diff --git a/Main/System/Main/EquipRecordItem.cs b/Main/System/Main/EquipRecordItem.cs
index 0438d5a..3aacc9d 100644
--- a/Main/System/Main/EquipRecordItem.cs
+++ b/Main/System/Main/EquipRecordItem.cs
@@ -11,6 +11,20 @@
[SerializeField] TextEx txtLV;
public void Display(EquipRecordManager.EquipDetail detail)
{
+ if (detail == null || !ItemConfig.HasKey(detail.itemId))
+ return;
+ var config = ItemConfig.Get(detail.itemId);
+ string name = config.ItemName;
+ int quality = config.ItemColor;
+ string IconKey = config.IconKey;
+ imgEquip.SetOrgSprite(IconKey);
+ txtName.text = UIHelper.AppendColor(quality, name, true, 1);
+ txtQualityName.text = UIHelper.GetQualityNameWithColor(quality, Language.Get("L1039"));
+ itemNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality);
+ qualityNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality);
+ txtLV.text = Language.Get("L1113", detail.lv);
+ imgQuality.SetSprite("equipQuality" + quality);
}
+
}
\ No newline at end of file
diff --git a/Main/System/Main/EquipRecordManager.cs b/Main/System/Main/EquipRecordManager.cs
index 4451e85..1098e08 100644
--- a/Main/System/Main/EquipRecordManager.cs
+++ b/Main/System/Main/EquipRecordManager.cs
@@ -6,64 +6,11 @@
public class EquipRecordManager : GameSystemManager<EquipRecordManager>
{
private List<EquipRecordData> recordList = new List<EquipRecordData>();
- public Dictionary<int, ItemModel> oldEquipDic = new Dictionary<int, ItemModel>();
-
- /// <summary>
- /// 璋冭瘯鐢細閬嶅巻杈撳嚭鎵�鏈夎澶囪褰曠殑璇︾粏淇℃伅锛堝崟鏉og锛�
- /// </summary>
- public void DebugLogAllRecords()
- {
- var sb = new System.Text.StringBuilder();
- sb.AppendLine($"=== 瑁呭璁板綍鎬绘暟: {recordList.Count} | 鏃ц澶囧瓧鍏告潯鐩暟: {oldEquipDic.Count} ===");
-
- for (int i = 0; i < recordList.Count; i++)
- {
- var record = recordList[i];
- sb.AppendLine($"--- 璁板綍 {i + 1} ---");
- sb.AppendLine($"璁板綍ID: {record.recordId} | 鏃堕棿: {TimeUtility.GetTime((uint)record.timestamp)} | 绫诲瀷: {record.recordType}");
-
- // 鏂拌澶囪鎯�
- if (record.newEquip != null)
- {
- sb.AppendLine($"[鏂拌澶嘳 ID:{record.newEquip.itemId} | 鍚嶇О:{record.newEquip.itemName} | 寮哄寲:{record.newEquip.level} | 璇勫垎:{record.newEquip.score} | 閮ㄤ綅:{record.newEquip.equipPlace} | 鎴樺姏:{record.newEquip.fightPower} | GUID:{record.newEquip.guid}");
- }
- else
- {
- sb.AppendLine($"[鏂拌澶嘳 鏃犳暟鎹�");
- }
-
- // 鏃ц澶囪鎯�
- if (record.oldEquip != null)
- {
- sb.AppendLine($"[鏃ц澶嘳 ID:{record.oldEquip.itemId} | 鍚嶇О:{record.oldEquip.itemName} | 寮哄寲:{record.oldEquip.level} | 璇勫垎:{record.oldEquip.score} | 閮ㄤ綅:{record.oldEquip.equipPlace} | 鎴樺姏:{record.oldEquip.fightPower} | GUID:{record.oldEquip.guid}");
- }
- else
- {
- sb.AppendLine($"[鏃ц澶嘳 鏃犳暟鎹�");
- }
-
- sb.AppendLine(); // 绌鸿鍒嗛殧
- }
-
- // 鏃ц澶囧瓧鍏�
- sb.AppendLine("=== 鏃ц澶囧瓧鍏歌鎯� ===");
- foreach (var kvp in oldEquipDic)
- {
- sb.AppendLine($"Key:{kvp.Key} | Value:ItemModel(itemId={kvp.Value?.itemId}, guid={kvp.Value?.guid})");
- }
-
- UnityEngine.Debug.Log(sb.ToString());
- }
-
-
-
- private int maxCnt;
+ public int maxCnt;
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
- // 鐩戝惉瑁呭鎿嶄綔缁撴灉
- EquipModel.Instance.OnEquipOPResultAction += OnEquipOPResult;
var config = FuncConfigConfig.Get("AutoGuaji1");
maxCnt = int.Parse(config.Numerical5);
@@ -73,14 +20,12 @@
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
- EquipModel.Instance.OnEquipOPResultAction -= OnEquipOPResult;
}
private void OnBeforePlayerDataInitializeEventOnRelogin()
{
-
}
private void OnPlayerLoginOk()
@@ -99,28 +44,29 @@
private void LoadRecords()
{
var json = LocalSave.GetString(Key);
- if (!string.IsNullOrEmpty(json))
+ if (string.IsNullOrEmpty(json))
+ {
+ recordList = new List<EquipRecordData>();
+ return;
+ }
+
+ try
{
recordList = JsonMapper.ToObject<List<EquipRecordData>>(json);
+ // 鎺掑簭瑙勫垯锛氭椂闂存埑灏忕殑闈犲墠锛屾椂闂存埑鐩稿悓鍒欑储寮曞皬鐨勯潬鍓�
+ recordList.Sort((a, b) =>
+ {
+ int timeCompare = a.timestamp.CompareTo(b.timestamp);
+ if (timeCompare != 0)
+ return timeCompare;
+ return 0;
+ });
}
- }
-
- /// <summary>
- /// 瑁呭鎿嶄綔缁撴灉鍥炶皟 - 璁板綍瑁呭鍙樺寲
- /// </summary>
- /// <param name="isDone">鏄惁鎴愬姛鏇存崲</param>
- /// <param name="equipIndex">瑁呭鏍忕储寮�</param>
- private void OnEquipOPResult(bool isDone, int equipIndex)
- {
- if (equipIndex < 0) return;
-
- // 鑾峰彇鏂拌澶囧拰鏃ц澶囦俊鎭�
- var newEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, equipIndex);
- if (newEquip == null) return;
-
- // 鑾峰彇琚浛鎹㈢殑瑁呭锛堥渶瑕佷粠鍏朵粬鍦版柟璁板綍锛�
- // 杩欓噷闇�瑕侀厤鍚� EquipModel 鐨� OnEquipResult 璁板綍琚浛鎹㈢殑瑁呭
- // ...
+ catch (Exception ex)
+ {
+ Debug.LogError($"鍔犺浇瑁呭璁板綍澶辫触: {ex.Message}");
+ recordList = new List<EquipRecordData>();
+ }
}
/// <summary>
@@ -133,43 +79,152 @@
var detail = new EquipDetail
{
itemId = item.itemId,
- level = item.GetUseDataFirstValue(22),
- equipPlace = item.config.EquipPlace,
+ lv = item.GetUseDataFirstValue(22),
guid = item.guid,
};
return detail;
}
+ public List<EquipRecordData> GetRecordList(bool isSort = false)
+ {
+ if (recordList == null)
+ {
+ return null;
+ }
+ if (isSort)
+ {
+ // 鎺掑簭瑙勫垯锛氭椂闂存埑灏忕殑闈犲墠锛屾椂闂存埑鐩稿悓鍒欑储寮曞皬鐨勯潬鍓�
+ recordList.Sort((a, b) =>
+ {
+ int timeCompare = a.timestamp.CompareTo(b.timestamp);
+ if (timeCompare != 0)
+ return timeCompare;
+ return 0;
+ });
+ }
+ return recordList;
+ }
+ public event Action OnUpdateRecordListEvent;
+ public void AddRecord(int recordType, ItemModel newEquip, ItemModel oldEquip)
+ {
+ if (newEquip == null)
+ return;
+ long showFightPower = FightPowerManager.Instance.GetFightPowerChange(newEquip);
+ // 鏂拌澶囨垬鍔涗綆浜庢棫瑁呭鎴樺姏锛屼笉鍏佽娣诲姞
+ if (showFightPower <= 0)
+ return;
+ var newDetail = GetEquipDetail(newEquip);
+ var oldDetail = GetEquipDetail(oldEquip);
+ if (recordList == null)
+ return;
+
+ // 閬嶅巻鐜版湁璁板綍锛屾鏌ユ槸鍚﹀瓨鍦ㄥ尮閰嶇殑璁板綍锛堜笉闄愬埗椤哄簭锛�
+ foreach (var existingRecord in recordList)
+ {
+ if (IsSameRecord(existingRecord, newDetail, oldDetail))
+ {
+ // 鎵惧埌鍖归厤鐨勮褰曪紝涓嶆坊鍔�
+ return;
+ }
+ }
+
+ var record = new EquipRecordData
+ {
+ recordType = (int)recordType,
+ newEquip = GetEquipDetail(newEquip),
+ oldEquip = GetEquipDetail(oldEquip),
+ fightPower = showFightPower,
+ timestamp = TimeUtility.AllSeconds,
+ };
+
+ if (recordList.Count >= maxCnt)
+ {
+ // 绉婚櫎鏈�鏃╁姞鍏ョ殑璁板綍锛堟帓搴忓悗绗竴涓級
+ recordList.RemoveAt(0);
+ }
+
+ recordList.Add(record);
+ SaveRecords();
+ OnUpdateRecordListEvent?.Invoke();
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇涓ゆ潯璁板綍鏄惁涓�鑷达紙涓嶉檺鍒� new/old 椤哄簭锛�
+ /// </summary>
+ private bool IsSameRecord(EquipRecordData existingRecord, EquipDetail newDetail, EquipDetail oldDetail)
+ {
+ // 鍙傛暟鏍¢獙
+ if (newDetail == null && oldDetail == null)
+ return true;
+ if (existingRecord == null)
+ return true;
+
+ // 璁$畻鍚勫瓧娈垫槸鍚︿负 null
+ bool newIsNull = IsNullOrEmptyGuid(newDetail);
+ bool oldIsNull = IsNullOrEmptyGuid(oldDetail);
+ bool recordNewIsNull = IsNullOrEmptyGuid(existingRecord.newEquip);
+ bool recordOldIsNull = IsNullOrEmptyGuid(existingRecord.oldEquip);
+
+ // 濡傛灉涓よ竟閮戒负绌猴紝鍒欒涓虹浉鍚�
+ if (newIsNull && oldIsNull && recordNewIsNull && recordOldIsNull)
+ return true;
+
+ // 濡傛灉鍙湁涓�杈逛负绌猴紝鍒欎笉鍚�
+ if (newIsNull != recordNewIsNull || oldIsNull != recordOldIsNull)
+ return false;
+
+ // 妫�鏌ラ『搴忔槸鍚﹀尮閰�
+ bool orderMatch = IsGuidMatch(existingRecord.newEquip, newDetail) &&
+ IsGuidMatch(existingRecord.oldEquip, oldDetail);
+
+ // 妫�鏌ラ『搴忔槸鍚︾浉鍙�
+ bool reverseMatch = IsGuidMatch(existingRecord.newEquip, oldDetail) &&
+ IsGuidMatch(existingRecord.oldEquip, newDetail);
+
+ return orderMatch || reverseMatch;
+ }
+
+ // 鍒ゆ柇瑁呭璇︽儏鏄惁涓� null 鎴� guid 涓虹┖
+ private bool IsNullOrEmptyGuid(EquipDetail detail)
+ {
+ return detail == null || string.IsNullOrEmpty(detail.guid);
+ }
+
+ // 姣旇緝涓や釜瑁呭璇︽儏鐨� guid 鏄惁鐩哥瓑锛堝畨鍏ㄦ瘮杈冿紝閬垮厤 null 寮傚父锛�
+ private bool IsGuidMatch(EquipDetail a, EquipDetail b)
+ {
+ // 浠讳竴瀵硅薄涓� null 鍒欎笉鍖归厤
+ if (a == null || b == null)
+ return false;
+
+ return a.guid == b.guid;
+ }
// 瑁呭璁板綍鏁版嵁绫诲瀷
public class EquipRecordData
{
- public string recordId; // 璁板綍鍞竴ID
- public long timestamp; // 鏃堕棿鎴�
- public RecordType recordType; // 璁板綍绫诲瀷
+ public int recordType; // 璁板綍绫诲瀷
public EquipDetail newEquip; // 鏂拌澶囪鎯�
public EquipDetail oldEquip; // 鏃ц澶囪鎯�
-
+ public long fightPower; // 鎴樺姏宸�
+ public int timestamp; // 鏃堕棿鎴�
}
public class EquipDetail
{
- public int itemId; // 鐗╁搧閰嶇疆ID
- public string itemName; // 鐗╁搧鍚嶇О
- public int level; // 寮哄寲绛夌骇
- public int score; // 瑁呭璇勫垎
- public int equipPlace; // 瑁呭閮ㄤ綅
- public long fightPower; // 鎴樺姏
- public string guid; // 瑁呭鍞竴ID
+ public string guid; // 瑁呭鍞竴ID
+ public int itemId; // 鐗╁搧ID
+ public int lv; // 绛夌骇
}
- public enum RecordType
+
+ public enum EquipOPType
{
- Equip = 0, // 瑁呭
- Decompose = 1 // 鍒嗚В
+ Decompose = 1, // 鍒嗚В
+ Equip = 2, // 瑁呭
}
}
\ No newline at end of file
diff --git a/Main/System/Main/EquipRecordWin.cs b/Main/System/Main/EquipRecordWin.cs
index 32efaa3..eb7cacb 100644
--- a/Main/System/Main/EquipRecordWin.cs
+++ b/Main/System/Main/EquipRecordWin.cs
@@ -1,33 +1,59 @@
+using System;
+using System.Collections.Generic;
using UnityEngine;
public class EquipRecordWin : UIBase
{
[SerializeField] ScrollerController scroller;
-
+ [SerializeField] Transform transNo;
+ [SerializeField] TextEx txtTip;
+ EquipRecordManager manager { get { return EquipRecordManager.Instance; } }
protected override void OnPreOpen()
{
+
scroller.OnRefreshCell += OnRefreshCell;
- CreateScroller();
+ manager.OnUpdateRecordListEvent += OnUpdateRecordListEvent;
+ txtTip.text = Language.Get("AutoFight17", manager.maxCnt);
+ scroller.lockType = EnhanceLockType.KeepVertical;
+ CreateScroller(isSort: true, isjump: true);
}
protected override void OnPreClose()
{
scroller.OnRefreshCell -= OnRefreshCell;
+ manager.OnUpdateRecordListEvent -= OnUpdateRecordListEvent;
+ }
+
+ private void OnUpdateRecordListEvent()
+ {
+ CreateScroller();
}
private void OnRefreshCell(ScrollerDataType type, CellView cell)
{
var _cell = cell.GetComponent<EquipRecordCell>();
- _cell?.Display(cell.index);
+ _cell?.Display(cell.index, list);
}
- private void CreateScroller()
+ List<EquipRecordManager.EquipRecordData> list;
+
+ private void CreateScroller(bool isSort = false, bool isjump = false)
{
scroller.Refresh();
-
- for (int i = 0; i < 20; i++)
+ list = manager.GetRecordList(isSort);
+ bool isNullOrEmpty = list.IsNullOrEmpty();
+ transNo.SetActive(isNullOrEmpty);
+ if (!isNullOrEmpty)
{
- scroller.AddCell(ScrollerDataType.Header, i);
+ for (int i = list.Count - 1; i >= 0; i--)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
}
scroller.Restart();
+ if (isjump)
+ {
+ scroller.JumpIndex(0);
+ }
+
}
}
\ No newline at end of file
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index a7b6065..a408d50 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -120,7 +120,7 @@
}
#region 鍒濆鍖栨垬鍔涜绠楃殑淇℃伅
- TeamType teamTypeCalc = TeamType.Story; //涓嶅悓闃靛鎴樺姏涓嶅悓
+ int teamTypeCalc = 1; //涓嶅悓闃靛鎴樺姏涓嶅悓
bool isPreviewTeamPower; //棰勮闃靛锛堥槦浼嶏級鎴樺姏
int dropIndexCalc = -1; //鎺夎惤瑁呭鍦ㄩ樀瀹圭殑绱㈠紩锛岀敤浜庨瑙堟垬鍔涘姣�
@@ -131,7 +131,7 @@
/// <param name="teamType">闃靛绫诲瀷</param>
/// <param name="dropindex">鎺夎惤瑁呭鐨勭储寮曪紝-1浠h〃涓嶆浛鎹㈣绠�</param>
/// <param name="ispreview">棰勮闃靛鎴樺姏</param>
- public void InitFightPowerParam(TeamType teamType = TeamType.Story, int dropindex = -1, bool ispreview = false)
+ public void InitFightPowerParam(int teamType = 1, int dropindex = -1, bool ispreview = false)
{
#if !UNITY_EDITOR
openLog = false;
@@ -608,7 +608,7 @@
public long GetHeroFightPower(HeroInfo heroInfo)
{
bool ispreview = false;
- var team = TeamManager.Instance.GetTeam(TeamType.Story);
+ var team = TeamManager.Instance.GetTeam(TeamManager.Instance.GetMainTeamID());
if (!team.HasHero(heroInfo.itemHero.guid))
{
//鏇挎崲涓婇樀浣嶇疆
@@ -640,7 +640,7 @@
//鏌ョ湅闃靛鎴樺姏
- public long GetTeamFightPower(TeamType team, bool isPreview)
+ public long GetTeamFightPower(int team, bool isPreview)
{
InitFightPowerParam(team, -1, isPreview);
return CalculatePower();
@@ -652,7 +652,7 @@
{
Dictionary<int, long> tmpAttrs = new Dictionary<int, long>();
- hero.RefreshFetterAttrsWhenCalcPower(TeamType.Story); //缇佺粖灞炴�ц瀹炴椂绠�
+ hero.RefreshFetterAttrsWhenCalcPower(TeamManager.Instance.GetMainTeamID()); //缇佺粖灞炴�ц瀹炴椂绠�
#if UNITY_EDITOR
propertyStrForDebug = "";
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 276f012..dbb0079 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -108,7 +108,7 @@
changeHeroPosBtn.AddListener(() =>
{
- HeroUIManager.Instance.selectTeamType = TeamType.Story;
+ HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID();
UIManager.Instance.OpenWindow<HeroPosWin>();
});
@@ -226,7 +226,7 @@
RefreshRecharge();
ShowBlessLV();
DisplayAutoFight();
- DisplayCard(TeamType.Story);
+ DisplayCard(TeamManager.Instance.GetMainTeamID());
DisplayLevel();
DisplayRestState();
@@ -607,11 +607,11 @@
TaskManager.Instance.ClickTask();
}
- void DisplayCard(TeamType teamType)
+ void DisplayCard(int presetID)
{
- if (teamType != TeamType.Story)
+ if (presetID != TeamManager.Instance.GetMainTeamID())
return;
- var team = TeamManager.Instance.GetTeam(teamType);
+ var team = TeamManager.Instance.GetTeam(presetID);
var heros = team.GetHerosOnTeam();
//鏄剧ず鍗$墝
for (int i = 0; i < heroFightingCardCells.Length; i++)
@@ -625,7 +625,7 @@
//鍏朵粬姝﹀皢鍔熻兘浜х敓鏁版嵁鍙樺寲锛岄渶瑕佸埛鏂版灏嗗垪琛�
if (closeUI is HeroTrainWin)
{
- DisplayCard(TeamType.Story);
+ DisplayCard(TeamManager.Instance.GetMainTeamID());
}
if (closeUI is ChatWin)
@@ -782,7 +782,7 @@
void OnUnLockHeroCountEvent()
{
- DisplayCard(TeamType.Story);
+ DisplayCard(TeamManager.Instance.GetMainTeamID());
}
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 926d3a4..27c94bb 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -384,7 +384,7 @@
{
if (string.IsNullOrEmpty(guid))
{
- var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero("");
+ var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero("");
if (tmpHero != null)
{
AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID;
@@ -409,7 +409,7 @@
cdTween.SetStartState();
cdTween.Play(() =>
{
- var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
+ var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
if (tmpHero != null)
{
AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID;
@@ -430,7 +430,7 @@
if (AutoFightModel.Instance.fightingHeroSkinID == 0)
{
- var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
+ var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid);
if (tmpHero != null)
{
AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID;
diff --git a/Main/System/Main/PlayerMainDate.cs b/Main/System/Main/PlayerMainDate.cs
index 274bb09..76fb4cb 100644
--- a/Main/System/Main/PlayerMainDate.cs
+++ b/Main/System/Main/PlayerMainDate.cs
@@ -112,7 +112,7 @@
return;
}
- if (hero.IsInTeamByTeamType(TeamType.Story))
+ if (hero.IsInTeamByTeamType(BattlePreSetType.Story))
{
return;
}
diff --git a/Main/System/Message/GMNotify.cs b/Main/System/Message/GMNotify.cs
new file mode 100644
index 0000000..e541c2e
--- /dev/null
+++ b/Main/System/Message/GMNotify.cs
@@ -0,0 +1,118 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+
+
+public class GMNotifyManager : GameSystemManager<GMNotifyManager>
+{
+ public override void Init()
+ {
+ GlobalTimeEvent.Instance.secondEvent += SecondEvent;
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
+ }
+
+ public override void Release()
+ {
+ GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
+ }
+
+ public void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ gmNotifies.Clear();
+ serverInited = false;
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ serverInited = true;
+ }
+
+ private List<GMNotifyMessgae> gmNotifies = new List<GMNotifyMessgae>();
+
+ private ArrayList infoArray = new ArrayList();
+
+ private bool serverInited = false;
+
+ private void SecondEvent()
+ {
+ if (!serverInited)
+ {
+ return;
+ }
+ for (int i = 0; i < gmNotifies.Count; i++)
+ {
+ var _notify = gmNotifies[i];
+ if (!CheckNotify(_notify))
+ {
+ gmNotifies.RemoveAt(i);
+ _notify = null;
+ i--;
+ continue;
+ }
+ if (CheckSend())
+ {
+ if ((TimeUtility.ServerNow - _notify.nextNotifyTime).TotalSeconds >= 0)
+ {
+ var _totalMinutes = (int)(TimeUtility.ServerNow - _notify.start).TotalMinutes;
+ var _detalMinutes = (_totalMinutes / _notify.interval + 1) * _notify.interval;
+ _notify.nextNotifyTime = _notify.start.AddTicks(_detalMinutes * TimeSpan.TicksPerMinute);
+ Notify(_notify);
+ }
+ }
+ }
+ }
+
+ public void Notify(HA001_tagBroadCastInfo package)
+ {
+ if (package.IsDelOthers == 1)
+ {
+ gmNotifies.Clear();
+ }
+ gmNotifies.Add(new GMNotifyMessgae()
+ {
+ start = TimeUtility.GetTime(package.StartTime),
+ end = TimeUtility.GetTime(package.EndTime),
+ message = UIHelper.ServerStringTrim(package.Msg).Replace(@"\", string.Empty),
+ interval = package.Interval,
+ nextNotifyTime = TimeUtility.GetTime(package.StartTime),
+ });
+ }
+
+ private void Notify(GMNotifyMessgae _notify)
+ {
+ ServerTipDetails.ShowMarquee(_notify.message, null, 10);
+ ChatManager.Instance.AddSysData(_notify.message, infoArray, ChatChannel.World, false);
+ }
+
+ private bool CheckNotify(GMNotifyMessgae _notify)
+ {
+ if ((TimeUtility.ServerNow - _notify.end).TotalSeconds > 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private bool CheckSend()
+ {
+ if (StageManager.Instance.currentStage == StageName.Login)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public class GMNotifyMessgae
+ {
+ public DateTime start;
+ public DateTime end;
+ public DateTime nextNotifyTime;
+ public int interval;//鍒嗛挓
+ public string message = string.Empty;
+ }
+}
+
+
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/System/Message/GMNotify.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Message/GMNotify.cs.meta
index b21ce1a..d880cc3 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/System/Message/GMNotify.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: f42b6a1b0c4602c47a26401533a82716
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/Message/SysNotifyMgr.cs b/Main/System/Message/SysNotifyMgr.cs
index 40f281b..f9aa613 100644
--- a/Main/System/Message/SysNotifyMgr.cs
+++ b/Main/System/Message/SysNotifyMgr.cs
@@ -31,6 +31,7 @@
private void Awake()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
+ StageManager.Instance.AfterLoadingGameScene += OnStageLoadFinish;
// StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
Co_Instance().Forget();
}
@@ -56,6 +57,7 @@
{
base.OnDestroy();
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
+ StageManager.Instance.AfterLoadingGameScene -= OnStageLoadFinish;
// StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
}
diff --git a/Main/System/Mingge/MinggeCaseCell.cs b/Main/System/Mingge/MinggeCaseCell.cs
new file mode 100644
index 0000000..7126763
--- /dev/null
+++ b/Main/System/Mingge/MinggeCaseCell.cs
@@ -0,0 +1,18 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+
+//鍛芥牸鏂规
+public class MinggeCaseCell : MonoBehaviour
+{
+ [SerializeField] Text caseNameText;
+ [SerializeField] Transform selectObj;
+ [SerializeField] Transform unSelectObj;
+
+ public void Display(int index)
+ {
+
+ }
+
+}
+
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/System/Mingge/MinggeCaseCell.cs.meta
similarity index 83%
rename from Main/System/Team/TeamType.cs.meta
rename to Main/System/Mingge/MinggeCaseCell.cs.meta
index b21ce1a..7a776d9 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/System/Mingge/MinggeCaseCell.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: d82ac7d0e4493ee4fb4fe720c72564fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/Mingge/MinggeEquipCell.cs b/Main/System/Mingge/MinggeEquipCell.cs
new file mode 100644
index 0000000..8b6c761
--- /dev/null
+++ b/Main/System/Mingge/MinggeEquipCell.cs
@@ -0,0 +1,60 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+
+
+public class MinggeEquipCell : MonoBehaviour
+{
+ [SerializeField] UIEffectPlayer loopEffect;
+ [SerializeField] Text posNameText;
+ [SerializeField] Text lvText;
+ [SerializeField] Image iconImage;
+ [SerializeField] Image skillImage; //鍙湁甯︽剰璞℃妧鑳芥墠鏄剧ず
+ [SerializeField] UIEffectPlayer activeEffect;
+ [SerializeField] Button button;
+
+ [Header("鍛芥牸瑁呭浣�")]
+ public int equipIndex;
+
+ public void Display()
+ {
+ var packIndex = equipIndex - 1; //瀵瑰簲鍗︾帀鑳屽寘绱㈠紩 = (濂楃紪鍙�-1)*12+瑁呭浣�-1
+ var item = PackManager.Instance.GetItemByIndex(PackType.Mingge, packIndex);
+ if (item == null)
+ {
+ loopEffect?.Stop();
+ posNameText.text = Language.Get($"MinggeGird{packIndex}");
+ iconImage.SetActive(false);
+ button.RemoveAllListeners();
+ return;
+ }
+ posNameText.text = "";
+ iconImage.SetActive(true);
+ int itemID = item.config.ID;
+ iconImage.SetItemSprite(itemID);
+ if (packIndex <= 4 && skillImage != null)
+ {
+ skillImage.SetActive(true);
+ skillImage.SetSprite($"MinggeSkill_{itemID}");
+ loopEffect.Play();
+ }
+ else
+ {
+ skillImage.SetActive(false);
+ }
+
+ lvText.text = EquipModel.Instance.GetEquipLV(item).ToString();
+
+ button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemID);
+ });
+ }
+
+ public void PlayEffect()
+ {
+ activeEffect.Play();
+ }
+
+}
+
diff --git a/Main/System/Team/TeamType.cs.meta b/Main/System/Mingge/MinggeEquipCell.cs.meta
similarity index 83%
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Mingge/MinggeEquipCell.cs.meta
index b21ce1a..3142f03 100644
--- a/Main/System/Team/TeamType.cs.meta
+++ b/Main/System/Mingge/MinggeEquipCell.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 097080eb83a42b54bbc2b10bc100993b
+guid: df66a8f8775cbdb4bbbc68542b32bbc9
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/Mingge/MinggeManager.cs b/Main/System/Mingge/MinggeManager.cs
index d23c9a6..97f7a4e 100644
--- a/Main/System/Mingge/MinggeManager.cs
+++ b/Main/System/Mingge/MinggeManager.cs
@@ -6,10 +6,15 @@
public class MinggeManager : GameSystemManager<MinggeManager>
{
+ public int tyItemID; //鎺ㄦ紨鐗╁搧ID
+ public int qlItemID; //绁堢伒鐗╁搧ID
+ public int[] minggeItemTypeList; //鍙惡甯︽剰璞$殑鍗︾帀绫诲瀷鍒楄〃
+ public int[] minggeSkillTypeIDList; //鎰忓悜鏁堟灉鎶�鑳絋ypeID鍒楄〃
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
+ ParseConfig();
}
public override void Release()
@@ -17,6 +22,19 @@
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
}
+
+ void ParseConfig()
+ {
+ var config = FuncConfigConfig.Get("MinggeCfg");
+ tyItemID = int.Parse(config.Numerical2);
+ qlItemID = int.Parse(config.Numerical3);
+
+ config = FuncConfigConfig.Get("MinggeTY");
+ minggeItemTypeList = JsonMapper.ToObject<int[]>(config.Numerical4);
+ minggeSkillTypeIDList = JsonMapper.ToObject<int[]>(config.Numerical5);
+
+ }
+
private void OnBeforePlayerDataInitialize()
{
}
diff --git a/Main/System/Mingge/MinggeWin.cs b/Main/System/Mingge/MinggeWin.cs
index e4fc2b3..e797886 100644
--- a/Main/System/Mingge/MinggeWin.cs
+++ b/Main/System/Mingge/MinggeWin.cs
@@ -1,8 +1,13 @@
锘縰sing System;
using UnityEngine;
+using UnityEngine.UI;
public class MinggeWin : UIBase
{
-
+ [SerializeField] Button seeAttrBtn;
+ [SerializeField] MinggeEquipCell[] equipCells;
+ [SerializeField] MinggeCaseCell[] caseCells;
+ [SerializeField] Text rankLevelText;
+
protected override void InitComponent()
{
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
index 40d114c..7b5fadb 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
@@ -51,7 +51,7 @@
// 鍚戞湇鍔$璇锋眰鍏朵粬鐜╁鏁版嵁
- public void ViewPlayerDetail(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story)
+ public void ViewPlayerDetail(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
{
if (_playerId == PlayerDatas.Instance.baseData.PlayerID)
{
@@ -168,19 +168,30 @@
viewPlayerLineupType = -1;
}
#region 鑾峰彇PlusData涓殑鏁版嵁
- public Dictionary<int, RolePlusData.HeroData> GetHeroDataDict(int playerID, int lineupType)
+
+ public int GetFuncPresetID(int playerID, int battleType, int funcType)
{
ViewPlayerData viewPlayerData = GetViewPlayerData(playerID);
- if (viewPlayerData?.rolePlusData?.LineupDic?.TryGetValue(lineupType, out var lineupData) != true)
+ if (viewPlayerData?.rolePlusData?.BatPresetDic?.TryGetValue(battleType, out var data) != true)
+ {
+ return 1;
+ }
+ return data.ContainsKey(funcType) ? data[funcType] : 1;
+ }
+
+ public Dictionary<int, RolePlusData.HeroData> GetHeroDataDict(int playerID, int presetID)
+ {
+ ViewPlayerData viewPlayerData = GetViewPlayerData(playerID);
+ if (viewPlayerData?.rolePlusData?.LineupDic?.TryGetValue(presetID, out var lineupData) != true)
{
return null;
}
return lineupData?.HeroDic;
}
- public List<RolePlusData.HeroData> GetHeroDataSortList(int playerID, int lineupType)
+ public List<RolePlusData.HeroData> GetHeroDataSortList(int playerID, int presetID)
{
- var heroDataDict = GetHeroDataDict(playerID, lineupType);
+ var heroDataDict = GetHeroDataDict(playerID, presetID);
if (heroDataDict == null)
{
return null;
@@ -199,11 +210,11 @@
return res;
}
- public bool TryGetFightPointByTeamType(int playerID, int teamType, out long fightPower)
+ public bool TryGetFightPointByTeamType(int playerID, int presetID, out long fightPower)
{
fightPower = 0;
var lineupDic = GetViewPlayerData(playerID)?.rolePlusData?.LineupDic;
- if (lineupDic != null && lineupDic.TryGetValue(teamType, out var lineupData))
+ if (lineupDic != null && lineupDic.TryGetValue(presetID, out var lineupData))
{
fightPower = lineupData.FightPower;
return true;
@@ -384,6 +395,7 @@
// 闃靛瀛楀吀 <闃靛ID, 闃靛鏁版嵁>
public Dictionary<int, LineupData> LineupDic = new Dictionary<int, LineupData>();
+ public Dictionary<int, Dictionary<int, int>> BatPresetDic = new Dictionary<int, Dictionary<int, int>>();
// 绾㈤鏁版嵁
public BeautyData beautyData;
@@ -475,6 +487,7 @@
EquipDic.Clear();
LineupDic.Clear();
+ BatPresetDic.Clear();
beautyData = null; // 蹇呴』缃┖锛岄槻姝㈡樉绀轰笂涓�涓帺瀹剁殑鏁版嵁
horseData = null; // 蹇呴』缃┖
// 1. 杞负 JsonData 瀵硅薄
@@ -588,6 +601,29 @@
}
}
}
+ //BatPreset - {"鎴樻枟棰勮绫诲瀷":{"棰勮绫诲瀷":浣跨敤鐨勬柟妗圛D, ...}, ...}
+ if (jd.Keys.Contains("BatPreset"))
+ {
+ JsonData batPresetJson = jd["BatPreset"];
+ BatPresetDic = new Dictionary<int, Dictionary<int, int>>();
+ foreach (string outerKey in batPresetJson.Keys)
+ {
+ if (int.TryParse(outerKey, out int outerKeyInt))
+ {
+ JsonData innerJson = batPresetJson[outerKey];
+ var innerDict = new Dictionary<int, int>();
+ foreach (string innerKey in innerJson.Keys)
+ {
+ if (int.TryParse(innerKey, out int innerKeyInt))
+ {
+ innerDict[innerKeyInt] = int.Parse(innerJson[innerKey].ToString());
+ }
+ }
+ BatPresetDic[outerKeyInt] = innerDict;
+ }
+ }
+
+ }
}
catch (Exception e)
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
index 237a0c4..7af6bad 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
@@ -31,7 +31,7 @@
OtherPlayerDetailManager.ViewPlayerData viewPlayerData;
OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } }
- int teamType = -1;
+ int funcPresetID = -1; //瀛愭柟妗圛D
protected override void InitComponent()
{
@@ -45,7 +45,7 @@
protected override void OnPreOpen()
{
GuildManager.Instance.OnRefreshFairyList += OnRefreshFairyList;
- teamType = functionOrder;
+ funcPresetID = OtherPlayerDetailManager.Instance.GetFuncPresetID(manager.viewPlayer, functionOrder, (int)FuncPresetType.Team);
Display();
}
@@ -90,17 +90,17 @@
DisplayMM(playerID);
- var heroList = manager.GetHeroDataSortList(playerID, teamType);
+ var heroList = manager.GetHeroDataSortList(playerID, funcPresetID);
if (heroList.IsNullOrEmpty())
{
- heroList = manager.GetHeroDataSortList(playerID, (int)TeamType.Story);
+ heroList = manager.GetHeroDataSortList(playerID, FuncPresetManager.FuncDefaultPresetID);
}
DisplayCard(heroList);
long fightPonit;
- if (!manager.TryGetFightPointByTeamType(playerID, teamType, out fightPonit))
+ if (!manager.TryGetFightPointByTeamType(playerID, funcPresetID, out fightPonit))
{
- if (!manager.TryGetFightPointByTeamType(playerID, (int)TeamType.Story, out fightPonit))
+ if (!manager.TryGetFightPointByTeamType(playerID, FuncPresetManager.FuncDefaultPresetID, out fightPonit))
{
fightPonit = 0;
}
@@ -243,6 +243,7 @@
//鑷繁鐨勫叕浼�
if (PlayerDatas.Instance.fairyData.HasFairy && PlayerDatas.Instance.fairyData.fairy.FamilyID == viewPlayerData.FamilyID)
{
+ SysNotifyMgr.Instance.ShowTip("GuildTip01");
return;
}
GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString());
diff --git a/Main/System/PhantasmPavilion/AvatarCell.cs b/Main/System/PhantasmPavilion/AvatarCell.cs
index 1fe0f22..c76f52e 100644
--- a/Main/System/PhantasmPavilion/AvatarCell.cs
+++ b/Main/System/PhantasmPavilion/AvatarCell.cs
@@ -247,7 +247,7 @@
{
return;
}
- AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData, (int)TeamType.Story);
+ AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData);
});
}
diff --git a/Main/System/PhantasmPavilion/AvatarHelper.cs b/Main/System/PhantasmPavilion/AvatarHelper.cs
index f6bd137..6c6b7c6 100644
--- a/Main/System/PhantasmPavilion/AvatarHelper.cs
+++ b/Main/System/PhantasmPavilion/AvatarHelper.cs
@@ -2,7 +2,7 @@
public static class AvatarHelper
{
- public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story)
+ public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
{
if (_playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
return;
diff --git a/Main/System/Team/TeamBase.cs b/Main/System/Team/TeamBase.cs
index aacf5ea..4ae329e 100644
--- a/Main/System/Team/TeamBase.cs
+++ b/Main/System/Team/TeamBase.cs
@@ -19,20 +19,19 @@
// 鏈嶅姟鍣ㄤ笅鍙戠殑闃靛瀷鍜岄樀瀹癸紝鍙兘閫氳繃缃戠粶鍗忚璧嬪�硷紝澶栭儴鍙
- public TeamType teamType
+ public int teamType
{
get;
private set;
}
- private int ShapeType;
- public int ServerShapeType { get; private set; }
+
public TeamHero[] tempHeroes { get; private set; } = new TeamHero[TeamConst.MaxTeamHeroCount];
public TeamHero[] serverHeroes { get; private set; } = new TeamHero[TeamConst.MaxTeamHeroCount];
- public TeamBase(TeamType _teamType)
+ public TeamBase(int _teamType)
{
teamType = _teamType;
teamIndex = 0;
@@ -49,8 +48,6 @@
}
teamIndex = lineUp.Num;
playerId = lineUp.OwnerID;
- ShapeType = lineUp.ShapeType;
- ServerShapeType = lineUp.ShapeType;
for (int i = 0; i < lineUp.ObjCnt; i++)
{
@@ -110,7 +107,6 @@
CB412_tagCSHeroPresetSave savePack = new CB412_tagCSHeroPresetSave();
savePack.PresetID = (byte)teamType;
- savePack.ShapeType = (byte)ShapeType;
savePack.PosCnt = (byte)GetTeamHeroCount();
savePack.HeroPosList = new CB412_tagCSHeroPresetSave.tagCSHeroPresetPos[savePack.PosCnt];
@@ -141,30 +137,20 @@
//闈炰富绾块樀瀹瑰鎴风鑷繁鍋氭垬鍔涘彉鍖栵紝涓荤嚎闃靛鏈嶅姟绔垬鍔涘彉鏇翠細鍚屾鎺ㄩ��
}
- public void OnChangeShapeType(int newShapeType)
- {
- ShapeType = newShapeType;
- }
- public void OnServerChangeShapeType(int newShapeType)
- {
- ServerShapeType = newShapeType;
- ShapeType = newShapeType;
- }
+
- public void RefreshServerData(int shapeType, int positionIndex, HeroInfo heroInfo)
+ public void RefreshServerData(int positionIndex, HeroInfo heroInfo)
{
TeamHero teamHero = heroInfo == null ? null : new TeamHero(heroInfo, positionIndex, this);
SetServerTeamHero(positionIndex, teamHero);
- OnServerChangeShapeType(shapeType);
}
public void CreateDefault(List<HeroInfo> heroInfos)
{
teamIndex = 0;
playerId = PlayerDatas.Instance.baseData.PlayerID;
- OnServerChangeShapeType(0);
for (int i = 0; i < heroInfos.Count; i++)
{
diff --git a/Main/System/Team/TeamManager.cs b/Main/System/Team/TeamManager.cs
index 8daf5c2..4fc2b47 100644
--- a/Main/System/Team/TeamManager.cs
+++ b/Main/System/Team/TeamManager.cs
@@ -6,9 +6,9 @@
public class TeamManager : GameSystemManager<TeamManager>
{
- protected Dictionary<TeamType, TeamBase> teamDict = new Dictionary<TeamType, TeamBase>();
+ protected Dictionary<int, TeamBase> teamDict = new Dictionary<int, TeamBase>();
- public Action<TeamType> OnTeamChange = null;
+ public Action<int> OnTeamChange = null;
public override void Init()
{
@@ -31,10 +31,10 @@
public void OnHeroChangeEvent(HB124_tagSCHeroPresetInfo vNetData)
{
var heroPack = PackManager.Instance.GetSinglePack(PackType.Hero);
- HashSet<TeamType> teamTypeSet = new HashSet<TeamType>();
+ HashSet<int> teamTypeSet = new HashSet<int>();
for (int i = 0; i < vNetData.PresetCnt; i++)
{
- TeamType teamType = (TeamType)vNetData.PresetList[i].PresetID;
+ int teamType = vNetData.PresetList[i].PresetID;
teamTypeSet.Add(teamType);
var team = GetTeam(teamType);
for (int j = 0; j < vNetData.PresetList[i].HeroCnt; j++)
@@ -56,7 +56,7 @@
hero = HeroManager.Instance.GetHero(item.guid);
}
- team.RefreshServerData(vNetData.PresetList[i].ShapeType, j, hero);
+ team.RefreshServerData(j, hero);
}
}
@@ -67,12 +67,13 @@
}
- public bool HasTeam(TeamType teamType)
+ public bool HasTeam(int teamType)
{
return teamDict.ContainsKey(teamType);
}
- public TeamBase GetTeam(TeamType teamType)
+ //閫氳繃闃靛鏂规ID鑾峰彇闃靛
+ public TeamBase GetTeam(int teamType)
{
TeamBase team = null;
@@ -85,4 +86,31 @@
return team;
}
+
+ //閫氳繃鎴樻枟绫诲瀷鑾峰彇闃靛
+ public TeamBase GetTeam(BattlePreSetType battlePassType)
+ {
+ int presetID = GetTeamID((int)battlePassType);
+ TeamBase team = null;
+
+ if (!teamDict.TryGetValue(presetID, out team))
+ {
+ team = new TeamBase(presetID);
+ // team.CreateDefault(HeroManager.Instance.GetPowerfulHeroList());
+ teamDict.Add(presetID, team);
+ }
+
+ return team;
+ }
+
+ // 鑾峰彇涓婚樀瀹规柟妗圛D
+ public int GetMainTeamID()
+ {
+ return FuncPresetManager.Instance.GetFuncPresetID((int)BattlePreSetType.Story, (int)FuncPresetType.Team);
+ }
+
+ public int GetTeamID(int battleType)
+ {
+ return FuncPresetManager.Instance.GetFuncPresetID(battleType, (int)FuncPresetType.Team);
+ }
}
\ No newline at end of file
diff --git a/Main/System/Team/TeamType.cs b/Main/System/Team/TeamType.cs
deleted file mode 100644
index 5c009fe..0000000
--- a/Main/System/Team/TeamType.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-
-//涓庢湇鍔$鐨勭害瀹� 瀵瑰簲鍑芥暟GetSelectTeamTypeByAttackType
-public enum TeamType
-{
- None = 0,
- Story = 1, //涓荤嚎
- Arena = 2, //绔炴妧鍦鸿繘鏀�
- ArenaDefense = 3, //绔炴妧鍦洪槻瀹�
-
- Max, //鏈�澶у�兼斁鏈�鍚庯紝鐢ㄤ簬for寰幆锛屾晠闃靛鏋氫妇鎸夐『搴�+1瀹氫箟锛屽鏋滀笉鎸夋瑙勫垯璇蜂慨鏀筂ax鐩稿叧閫昏緫
-}
-
diff --git a/Main/System/Tip/ServerTipDetails.cs b/Main/System/Tip/ServerTipDetails.cs
index 370d149..56e7a02 100644
--- a/Main/System/Tip/ServerTipDetails.cs
+++ b/Main/System/Tip/ServerTipDetails.cs
@@ -27,20 +27,20 @@
return;
}
- // if (!UIManager.Instance.IsOpened<MarqueeWin>())
- // {
- // UIManager.Instance.OpenWindow<MarqueeWin>();
- // }
+ if (!UIManager.Instance.IsOpened<MarqueeWin>())
+ {
+ UIManager.Instance.OpenWindow<MarqueeWin>();
+ }
}
public static void OnStageLoadFinish()
{
- // if (StageLoad.Instance.currentStage is LoginStage)
- // {
- // m_Marquees.Clear();
- // return;
- // }
- // Co_StageLoadFinish().Forget();
+ if (StageManager.Instance.currentStage == StageName.Login)
+ {
+ m_Marquees.Clear();
+ return;
+ }
+ Co_StageLoadFinish().Forget();
}
private static async UniTask Co_StageLoadFinish()
@@ -55,12 +55,9 @@
}
}
-
static bool CheckOpenMarquee()
{
- return true;
- // TODO YYL
- // return (StageLoad.Instance.currentStage is DungeonStage) && !StageLoad.Instance.isLoading;
+ return StageManager.Instance.currentStage == StageName.Game;
}
public static SystemHintData RequireMarquee()
diff --git a/Main/System/UIBase/UIBase.cs b/Main/System/UIBase/UIBase.cs
index 2d8d7b7..6d1fddb 100644
--- a/Main/System/UIBase/UIBase.cs
+++ b/Main/System/UIBase/UIBase.cs
@@ -303,10 +303,6 @@
try
{
OnPreOpen();
- if (layout != null)
- {
- UIUtility.ForceRefreshLayout(layout).Forget();
- }
}
catch (Exception e)
{
@@ -341,6 +337,10 @@
try
{
NextFrameAfterOpen();
+ if (layout != null)
+ {
+ UIUtility.ForceRefreshLayout(layout).Forget();
+ }
}
catch (Exception e)
{
diff --git a/Main/System/WarlordPavilion/WarlordPavilionManager.cs b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
index ada23cf..361025e 100644
--- a/Main/System/WarlordPavilion/WarlordPavilionManager.cs
+++ b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
@@ -596,23 +596,15 @@
return true;
}
- public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)
+ public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCConfig npcConfig)
{
npcConfig = null;
- npcLineupConfig = null;
if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out var config))
return false;
- int[] lineupIDList = config.LineupIDList;
- if (lineupIDList.IsNullOrEmpty())
+ int npcID = config.NPCID;
+ if (!NPCConfig.HasKey(npcID))
return false;
- int lineupID = lineupIDList[0];
- if (!NPCLineupConfig.HasKey(lineupID))
- return false;
- npcLineupConfig = NPCLineupConfig.Get(lineupID);
- int bossId = npcLineupConfig.BossID;
- if (!NPCConfig.HasKey(bossId))
- return false;
- npcConfig = NPCConfig.Get(bossId);
+ npcConfig = NPCConfig.Get(npcID);
return true;
}
diff --git a/Main/System/WarlordPavilion/WarlordPavilionWin.cs b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
index 2e0cd79..a75ff76 100644
--- a/Main/System/WarlordPavilion/WarlordPavilionWin.cs
+++ b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
@@ -53,7 +53,7 @@
});
btnFormation.SetListener(() =>
{
- HeroUIManager.Instance.selectTeamType = TeamType.Story;
+ HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID();
UIManager.Instance.OpenWindow<HeroPosWin>();
});
btnSelectOneClick.SetListener(() =>
@@ -135,7 +135,6 @@
int showLayerNum;
int showLevelNum;
FBDJGLevelConfig config;
- NPCLineupConfig npcLineupConfig;
NPCConfig npcConfig;
private void Display()
{
@@ -148,13 +147,13 @@
return;
if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(showLayerNum, showLevelNum, out config))
return;
- if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcLineupConfig, out npcConfig))
+ if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcConfig))
return;
txtCurrentLevel.text = Language.Get("WarlordPavilion22", showLayerNum, showLevelNum);
txtBossName.text = npcConfig.NPCName;
uiHeroController.Create(npcConfig.SkinID, modelSize);
- DisplaySkillWordsList(npcLineupConfig);
+ DisplaySkillWordsList(config.SkillIDExList);
DisplayItemCell(firstAwards, config.PassAwardList);
manager.DisplayItemCell(challengeAwards, config.AwardList);
DisplayButtons();
@@ -249,16 +248,16 @@
}
}
- public void DisplaySkillWordsList(NPCLineupConfig lineUPConfig)
+ public void DisplaySkillWordsList(int[] skillIDExList)
{
if (skillWords.IsNullOrEmpty())
return;
for (int i = 0; i < skillWords.Count; i++)
{
- if (i < lineUPConfig.SkillIDExList.Length)
+ if (i < skillIDExList.Length)
{
skillWords[i].SetActive(true);
- int skillID = lineUPConfig.SkillIDExList[i];
+ int skillID = skillIDExList[i];
skillWords[i].Init(skillID, () =>
{
SmallTipWin.showText = Language.Get("SmallTipFomat", SkillConfig.Get(skillID)?.SkillName, SkillConfig.Get(skillID)?.Description);
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index d7bec8f..22d3d9f 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -733,18 +733,9 @@
DogzEquip = 33, //绁炲吔瑁呭鑳屽寘锛堢鍏界┛鎴达級
Hero = 35, // 姝﹀皢鑳屽寘
+ Mingge = 36, // 鍛芥牸瑁呭鑳屽寘
+ MinggeDrop = 37, //鍛芥牸鎺夎惤鑳屽寘
- //鍚庣画IL寮�鍙戞坊鍔犻璁�
- default1, //34 鍨冨溇鍥炴敹
- default2,
- default3,
- default4,
- default5,
- default6,
- default7,
- default8,
- default9,
- default10,
GatherSoul = 254,//鑱氶瓊
RunePack = 255,//绗﹀嵃鑳屽寘
@@ -851,6 +842,7 @@
LineupRecommend = 50, //闃靛鎺ㄨ崘
DailySpecials = 51, //姣忔棩鐗规儬
Mail = 52, //閭
+ Mingge = 54, //鍛芥牸
WarlordPavilion = 55, //瀹氬啗闃�
}
--
Gitblit v1.8.0