From c6a7ac3739907e8bb7c751d408e227e19f246f49 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 08 五月 2026 17:27:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version
---
Main/System/FestivalActivity/FestivalActivityPopWin.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs | 23
Main/System/FestivalActivity/FestivalActivityPopWin.cs | 83
Main/System/FestivalActivity/FestivalActivityShopWin.cs.meta | 11
Main/System/Qunying/QYBattleWin.cs | 2
Main/System/Arena/ArenaCrossAwardCell.cs | 69
Main/System/Arena/ArenaPlayerRankCell.cs | 43
Main/Core/NetworkPackage/ServerPack/HA9_Function/HA922_tagSCArenaMatchList.cs | 2
Main/System/Redpoint/MainRedDot.cs | 3
Main/System/FestivalActivity/FestivalActivityManager.cs | 451 ++++
Main/System/Qunying/QunyingManager.cs | 11
Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs | 7
Main/System/FestivalActivity/FestivalActivityCheckInManager.cs | 191 +
Main/System/FestivalActivity/FestivalActivityShopLineCell.cs | 28
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs | 12
Main/Config/Configs/ActTaskTempConfig.cs | 56
Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs.meta | 11
Main/Config/Configs/ADAwardConfig.cs | 5
Main/Config/Configs/ActTaskConfig.cs.meta | 11
Main/Config/ConfigBase.cs | 8
Main/Utility/EnumHelper.cs | 10
Main/System/FestivalActivity/OperationMissionActivityInfo.cs | 23
Main/System/OSActivity/OSActivityManager.cs | 6
Main/System/FestivalActivity/FestivalActivityShopWin.cs | 83
Main/System/BillboardRank/PlayerRankCell.cs | 7
Main/System/FestivalActivity/FestivalActivityCheckInCell.cs | 92
Main/System/FestivalActivity/FestivalActivityMissionManager.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityMissionManager.cs | 471 ++++
Main/System/FestivalActivity/OperationCheckInActivityInfo.cs.meta | 11
Main/System/Arena/ArenaManager.cs | 202 +
Main/Config/Configs/ActSignConfig.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs | 74
Main/Config/PartialConfigs/ActTaskTempConfig.cs | 63
Main/System/OpenServerActivity/OperationTimeHepler.cs | 227 +
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityShopCell.cs | 132 +
Main/Config/Configs/HorseSkinConfig.cs | 5
Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs | 113 +
Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs | 249 ++
Main/System/FestivalActivity/FestivalActivityPopCell.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs.meta | 11
Main/System/BillboardRank/PlayerTop3Cell.cs | 2
Main/System/FestivalActivity/FestivalActivityCheckInWin.cs | 63
Main/System/Arena/ArenaCrossAwardWin.cs | 192 +
Main/System/FestivalActivity/FestivalActivityCheckInCell.cs.meta | 11
Main/System/Qunying/QYFighterCell.cs | 21
Main/Config/Configs/ActTaskConfig.cs | 53
Main/Config/Configs/RobotConfig.cs | 38
Main/System/Qunying/QYBattleVictoryWin.cs | 2
Main/Config/Configs/ActSpecialSaleConfig.cs | 62
Main/System/FestivalActivity/FestivalActivityMissionWin.cs | 157 +
Main/System/Arena/ArenaCrossAwardCell.cs.meta | 11
Main/System/Horse/HorseController.cs | 40
Main/System/FestivalActivity/FestivalActivityGiftCell.cs.meta | 11
Main/Config/Configs/ActTaskTempConfig.cs.meta | 11
Main/Config/PartialConfigs/ActTaskTempConfig.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs.meta | 11
Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs | 23
Main/System/Qunying/QYNoteCell.cs | 2
Main/Config/Configs/RobotConfig.cs.meta | 11
Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs | 4
Main/System/FestivalActivity/FestivalActivityGiftCell.cs | 227 ++
Main/System/FestivalActivity/OperationCheckInActivityInfo.cs | 23
Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs | 34
Main/Utility/UIHelper.cs | 12
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityCheckInManager.cs.meta | 11
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 5
Main/System/HeroDebut/HeroDebutCallRateItem.cs | 34
Main/System/PhantasmPavilion/PhantasmPavilionManager.DefaultID.cs | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs | 12
Main/System/Login/ServerData.cs | 2
Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs.meta | 11
Main/System/Qunying/QYPlayerTop3Cell.cs | 2
Main/System/Arena/ArenaRecordCell.cs | 50
Main/System/HeroReturn/HeroReturnCallRateItem.cs | 34
Main/System/FestivalActivity/FestivalActivityShopLineCell.cs.meta | 11
Main/System/BoneField/AdsManager.cs | 3
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1C_tagSCActTotalRechargePlayerInfo.cs | 1
Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs | 52
Main/System/Horse/HorseSkinWin.cs | 26
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityManager.cs.meta | 11
Main/System/Settlement/BattleSettlementManager.cs | 5
Main/System/PhantasmPavilion/PhantasmPavilionManager.cs | 124
Main/Config/Configs/ActSignConfig.cs | 41
Main/System/HeroReturn/HeroReturnZhanLingWin.cs | 2
Main/System/Arena/ArenaPlayerTop3Cell.cs | 31
Main/System/BillboardRank/RankModel.cs | 2
Main/System/Arena/ArenaCrossAwardWin.cs.meta | 11
Main/System/FestivalActivity/OperationMissionActivityInfo.cs.meta | 11
Main/System/Main/FightPowerManager.cs | 43
Main/System/Arena/ArenaBattleVictoryWin.cs | 13
Main/System/Login/ServerListCenter.cs | 6
Main/System/Arena/ArenaWin.cs | 233 ++
Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs.meta | 11
Main/System/PhantasmPavilion/AvatarHelper.cs | 2
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs | 23
Main/Config/Configs/ActSpecialSaleConfig.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs | 12
Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs | 118 +
Main/System/FestivalActivity/FestivalActivityMissionCell.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityWin.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs.meta | 11
Main/System/CrossServer/CrossServerBaseManager.cs | 7
Main/System/FestivalActivity/FestivalActivityPopCell.cs | 19
Main/System/FestivalActivity/FestivalActivityWin.cs | 79
Main/Config/ConfigManager.cs | 369 +--
Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs | 74
Main/System/Arena/ArenaChallengeCell.cs | 44
Main/System/Arena/ArenaBattleFailWin.cs | 14
Main/System/FestivalActivity/FestivalActivityMissionWin.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs | 25
Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs | 248 ++
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs | 23
Main/System/FestivalActivity/FestivalActivityGiftWin.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs | 14
Main/System/FestivalActivity/FestivalActivityCheckInWin.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs | 14
Main/System/Main/HomeWin.cs | 25
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagSCActTotDayRechargePlayerInfo.cs | 1
Main/Main.cs | 6
Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs.meta | 11
Main/System/Qunying/QYBattleFailWin.cs | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityGiftWin.cs | 82
Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs.meta | 11
Main/System/Qunying/QYWin.cs | 3
Main/System/FestivalActivity/FestivalActivityShopCell.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs.meta | 11
Main/System/FestivalActivity/FestivalActivityMissionCell.cs | 73
Main/System/FestivalActivity.meta | 8
Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs | 31
138 files changed, 5,661 insertions(+), 557 deletions(-)
diff --git a/Main/Config/ConfigBase.cs b/Main/Config/ConfigBase.cs
index f78abc7..04098ed 100644
--- a/Main/Config/ConfigBase.cs
+++ b/Main/Config/ConfigBase.cs
@@ -83,10 +83,16 @@
for (int i = 3; i < lines.Length; i++)
{
string line = lines[i];
+
+ // 璺宠繃绌鸿
+ if (string.IsNullOrEmpty(line))
+ continue;
+
var index = line.IndexOf("\t");
if (index == -1)
{
- continue;
+ string result = line.Trim();
+ index = result.Length;
}
string strKey = line.Substring(0, index);
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index e178ae3..e9e2723 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -17,16 +17,12 @@
private set;
}
- private List<Type> preInitConfig = new List<Type>()
- {
- typeof (FuncConfigConfig),
- };
-
private float loadingProgress = 0f;
- public override async UniTask Init()
+ public override void Init()
{
- await InitConfigs();
+ base.Init();
+ InitConfigs();
}
public virtual async UniTask InitConfigs()
@@ -35,25 +31,12 @@
await LoadConfigs();
}
- public async UniTask PreInit()
- {
- List<UniTask> uniTasks = new List<UniTask>();
- foreach (var type in preInitConfig)
- {
- uniTasks.Add(LoadConfigByTypeAsync(type));
- }
- await UniTask.WhenAll(uniTasks);
- }
-
protected async UniTask LoadConfigs()
{
loadingProgress = 0f;
isLoadFinished = false;
- // 鑷姩鐢熸垚锛氭敹闆嗘墍鏈夐厤缃被鍨嬶紙姝ゆ灏嗚 ConfigGenerater.Generate 鑷姩瑕嗙洊锛�
- // 鑷姩鐢熸垚锛氭敹闆嗘墍鏈夐厤缃被鍨�
- // 鑷姩鐢熸垚锛氭敹闆嗘墍鏈夐厤缃被鍨�
- // 鑷姩鐢熸垚锛氭敹闆嗘墍鏈夐厤缃被鍨�
+ // 鍔犺浇閰嶇疆鏂囦欢
HashSet<Type> configTypes = new HashSet<Type>() {
typeof(ActBillboardAwardConfig),
typeof(ActHeroAppearArtConfig),
@@ -62,47 +45,33 @@
typeof(ActHeroReturnArtConfig),
typeof(ActLunhuidianTypeConfig),
typeof(ActSignAwardConfig),
+ typeof(ActSignConfig),
+ typeof(ActSpecialSaleConfig),
+ typeof(ActTaskConfig),
+ typeof(ActTaskTempConfig),
typeof(ActTotalRechargeConfig),
typeof(ActTotalRechargeTempConfig),
typeof(ActTotDayRechargeConfig),
typeof(ActTotDayRechargeTempConfig),
typeof(ADAwardConfig),
- typeof(AppointItemConfig),
- typeof(AudioConfig),
typeof(BattleMapConfig),
typeof(BeautyConfig),
typeof(BeautyQualityLVConfig),
typeof(BeautySkinConfig),
- typeof(ChatBubbleBoxConfig),
typeof(ChestsAwardConfig),
- typeof(ChestsConfig),
typeof(CTGConfig),
- typeof(CTGSelectItemConfig),
- typeof(DailyLivenessRewardConfig),
typeof(DailyTaskConfig),
typeof(DamageNumConfig),
- typeof(DirtyNameConfig),
typeof(DirtyWordConfig),
typeof(DungeonConfig),
typeof(DungeonOpenTimeConfig),
- typeof(EffectConfig),
- typeof(EmojiPackConfig),
typeof(FaceConfig),
- typeof(FamilyConfig),
typeof(FamilyDonateConfig),
- typeof(FamilyEmblemConfig),
typeof(FBDJGEffectConfig),
typeof(FBDJGLevelConfig),
typeof(FBDJGQuickConfig),
typeof(FightPowerRatioConfig),
typeof(FirstChargeConfig),
- typeof(FirstGoldConfig),
- typeof(FrameAnimationConfig),
- typeof(FuncConfigConfig),
- typeof(FuncOpenLVConfig),
- typeof(FunctionTeamSetConfig),
- typeof(GetItemWaysConfig),
- typeof(GmCmdConfig),
typeof(GoldRushCampConfig),
typeof(GoldRushItemConfig),
typeof(GoldRushWorkerConfig),
@@ -112,32 +81,18 @@
typeof(GubaoResonanceAttrConfig),
typeof(GubaoResonanceConfig),
typeof(GubaoStarConfig),
- typeof(GuideConfig),
- typeof(HeroAwakeConfig),
- typeof(HeroBreakConfig),
- typeof(HeroConfig),
typeof(HeroFatesConfig),
typeof(HeroFatesQualityLVConfig),
- typeof(HeroFetterConfig),
typeof(HeroLineupHaloConfig),
- typeof(HeroQualityAwakeConfig),
- typeof(HeroQualityBreakConfig),
- typeof(HeroQualityConfig),
typeof(HeroQualityLVConfig),
typeof(HeroSkinAttrConfig),
- typeof(HeroSkinConfig),
- typeof(HeroTalentConfig),
typeof(HorseClassConfig),
typeof(HorseIDConfig),
typeof(HorseSkinConfig),
- typeof(IconConfig),
typeof(ItemCompoundConfig),
typeof(ItemConfig),
- typeof(KickOutReasonConfig),
- typeof(LanguageConfig),
typeof(LineupRecommendConfig),
typeof(LLMJConfig),
- typeof(MailConfig),
typeof(MainChapterConfig),
typeof(MainLevelConfig),
typeof(MGGanwuLVConfig),
@@ -152,24 +107,16 @@
typeof(OrderInfoConfig),
typeof(PlayerAttrConfig),
typeof(PlayerFaceConfig),
- typeof(PlayerFacePicConfig),
- typeof(PlayerLVConfig),
- typeof(PlayerPropertyConfig),
typeof(PopWinOrderConfig),
typeof(PresetUnlockConfig),
typeof(PriorBundleConfig),
typeof(RandomNameConfig),
- typeof(RealmConfig),
- typeof(RealmLVUPTaskConfig),
- typeof(RichTextMsgReplaceConfig),
- typeof(RuleConfig),
+ typeof(RobotConfig),
typeof(SignInConfig),
- typeof(SkillConfig),
typeof(SkillSkinConfig),
typeof(StoreConfig),
typeof(SuccessConfig),
typeof(SysInfoConfig),
- typeof(TaskConfig),
typeof(TianziConfig),
typeof(TimingGiftConfig),
typeof(TimingGiftTypeConfig),
@@ -177,8 +124,6 @@
typeof(TitleStarUpConfig),
typeof(TravelEventConfig),
typeof(TravelSceneryConfig),
- typeof(TreasureCntAwardConfig),
- typeof(TreasureItemLibConfig),
typeof(TreasureSetConfig),
typeof(TreeLVConfig),
typeof(WindowSearchConfig),
@@ -186,85 +131,64 @@
typeof(ZhanlingConfig)
};
-
+#if UNITY_EDITOR
+ HashSet<Type> configHashSet = new HashSet<Type>();
+ if (System.IO.File.Exists(Application.dataPath + "/fastConfig.txt") && Launch.Instance.isOpenConfigTesting)
+ {
+ string[] strConfgsArr = System.IO.File.ReadAllLines(Application.dataPath + "/fastConfig.txt");
+ foreach (string str in strConfgsArr)
+ {
+ Type tpy = Type.GetType(str);
+ configHashSet.Add(tpy);
+ }
+ }
+ // 缂栬緫鍣ㄤ笅鍔犲叆 璇勪及鍔犺浇鏃跺父
+ foreach (var config in configHashSet)
+ {
+ if (!configTypes.Add(config))
+ {
+ Debug.LogWarning($"閰嶇疆 {config.Name} 宸茬粡瀛樺湪浜� configTypes 涓紝璺宠繃娣诲姞銆�");
+ }
+ }
+ List<string> fastName = new List<string>();
+#endif
int iterator = 0;
int totalConfigs = configTypes.Count;
-
-#if UNITY_WEBGL && !UNITY_EDITOR
- // ============================================================
- // WebGL 浼樺寲锛氫袱闃舵鍔犺浇
- // 闃舵1: 涓�娆℃�у苟鍙戝彂璧锋墍鏈� TextAsset 鍔犺浇锛堝悓 bundle 鍙笅杞戒竴娆★級
- // 闃舵2: 浠庡唴瀛樹腑鍒嗘壒瑙f瀽锛屾瘡鎵� Yield 闃叉娴忚鍣ㄥ崱姝�
- // ============================================================
-
- // 闃舵1: 骞跺彂鍔犺浇鎵�鏈夐厤缃枃鏈埌鍐呭瓨
- Debug.Log("[ConfigManager] WebGL 闃舵1: 鎵归噺鍔犺浇閰嶇疆鏂囦欢...");
- var configList = configTypes.ToList();
- var configDataMap = new Dictionary<Type, string[]>(totalConfigs);
- var loadTasks = new List<UniTask>(totalConfigs);
-
- foreach (var configType in configList)
- {
- var ct = configType; // closure capture
- loadTasks.Add(LoadConfigTextAsync(ct).ContinueWith(texts =>
- {
- if (texts != null)
- configDataMap[ct] = texts;
- else
- Debug.LogError($"鎵句笉鍒伴厤缃枃浠�: {ct.Name}");
- }));
- }
- await UniTask.WhenAll(loadTasks);
- loadingProgress = 0.5f; // 缃戠粶鍔犺浇瀹屾垚 50%
- Debug.Log($"[ConfigManager] WebGL 闃舵1瀹屾垚: {configDataMap.Count}/{totalConfigs} 涓厤缃凡鍔犺浇鍒板唴瀛�");
-
- // 闃舵2: 浠庡唴瀛樹腑鍒嗘壒瑙f瀽鍒濆鍖�
- const int parseBatchSize = 10;
- int parsed = 0;
- foreach (var configType in configList)
- {
- if (configDataMap.TryGetValue(configType, out var texts))
- {
- InitConfigFromTexts(configType, texts);
- }
- parsed++;
- loadingProgress = 0.5f + 0.5f * parsed / totalConfigs;
-
- // 姣� parseBatchSize 涓鍑轰富绾跨▼
- if (parsed % parseBatchSize == 0)
- await UniTask.Yield();
- }
-#else
- List<UniTask> loadTasks = new List<UniTask>();
// 閫愪釜鍔犺浇閰嶇疆骞舵洿鏂拌繘搴�
foreach (var configType in configTypes)
{
-#if UNITY_EDITOR
var sw = System.Diagnostics.Stopwatch.StartNew();
-#endif
- UniTask uniTask = LoadConfigByTypeAsync(configType).ContinueWith(() =>
- {
+ LoadConfigByType(configType);
+ sw.Stop();
#if UNITY_EDITOR
- if (sw.ElapsedMilliseconds >= 100)
- {
- Debug.LogWarning($"鍔犺浇閰嶇疆 {configType.Name} 鑰楁椂杈冮暱: {sw.ElapsedMilliseconds} ms");
- }
- else
- {
- Debug.Log($"鍔犺浇閰嶇疆: {configType.Name} 鐢ㄦ椂: {sw.ElapsedMilliseconds} ms");
- }
- sw.Stop();
+ if (sw.ElapsedMilliseconds >= 500)
+ {
+ Debug.LogError($"鍔犺浇閰嶇疆 {configType.Name} 鑰楁椂杈冮暱: {sw.ElapsedMilliseconds} ms");
+ }
+ else if (sw.ElapsedMilliseconds <= 5)
+ {
+ fastName.Add(configType.Name);
+ }
+ Debug.Log($"鍔犺浇閰嶇疆: {configType.Name} 鐢ㄦ椂: {sw.ElapsedMilliseconds} ms");
#endif
-
- loadingProgress = (float)(++iterator) / totalConfigs;
- });
-
- loadTasks.Add(uniTask);
-
+ loadingProgress = (float)(iterator++ + 1) / totalConfigs;
}
+#if UNITY_EDITOR
+ if (Launch.Instance.isOpenConfigTesting)
+ {
+ System.IO.File.WriteAllText(Application.dataPath + "/fastConfig.txt", string.Join("\n", fastName));
- await UniTask.WhenAll(loadTasks);
+ //鍔犺浇瀹屽悗鍗歌浇
+ foreach (var configType in configTypes)
+ {
+ var methodInfo = configType.GetMethod("ForceRelease", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
+ if (methodInfo != null)
+ {
+ methodInfo.Invoke(null, null);
+ }
+ }
+ }
#endif
// 鍔犺浇瀹屾垚鍚庤缃甶sLoadFinished涓簍rue
@@ -272,64 +196,28 @@
isLoadFinished = true;
}
- // public void LoadConfigByType(Type configType)
- // {
- // string configName = configType.Name;
- // if (configName.EndsWith("Config"))
- // {
- // configName = configName.Substring(0, configName.Length - 6);
- // }
- // #pragma warning disable CS0618 // Obsolete 鈥� sync legacy fallback, use LoadConfigByTypeAsync
- // string[] texts = ResManager.Instance.LoadConfig(configName);
- // #pragma warning restore CS0618
- // if (texts != null)
- // {
- // string[] lines = texts;
- // var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
- // if (methodInfo != null)
- // {
- // methodInfo.Invoke(null, new object[] { lines });
- // // 璁剧疆鍒濆鍖栨爣蹇�
- // var isInitField = configType.GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- // if (isInitField != null)
- // {
- // isInitField.SetValue(null, true);
- // }
- // Debug.Log($"鍔犺浇閰嶇疆: {configType.Name} 鎴愬姛");
- // }
- // else
- // {
- // Debug.LogError($"閰嶇疆绫� {configType.Name} 娌℃湁闈欐�両nit鏂规硶");
- // }
- // }
- // else
- // {
- // Debug.LogError($"鎵句笉鍒伴厤缃枃浠�: {configName}");
- // }
- // }
-
- /// <summary>
- /// US2: Async variant of LoadConfigByType. Uses UniTask-based config loading.
- /// </summary>
- public async UniTask LoadConfigByTypeAsync(Type configType)
+ public void LoadConfigByType(Type configType)
{
string configName = configType.Name;
if (configName.EndsWith("Config"))
{
configName = configName.Substring(0, configName.Length - 6);
}
- string[] texts = await ResManager.Instance.LoadConfigAsync(configName);
+ string[] texts = ResManager.Instance.LoadConfig(configName);
if (texts != null)
{
- var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
+ string[] lines = texts;
+ var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
if (methodInfo != null)
{
- methodInfo.Invoke(null, new object[] { texts });
+ methodInfo.Invoke(null, new object[] { lines });
+ // 璁剧疆鍒濆鍖栨爣蹇�
var isInitField = configType.GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
if (isInitField != null)
{
isInitField.SetValue(null, true);
}
+ Debug.Log($"鍔犺浇閰嶇疆: {configType.Name} 鎴愬姛");
}
else
{
@@ -342,38 +230,36 @@
}
}
- // private async UniTask LoadConfig<T>() where T : class
- // {
- // string configName = typeof(T).Name;
+ private async UniTask LoadConfig<T>() where T : class
+ {
+ string configName = typeof(T).Name;
- // #pragma warning disable CS0618
- // string[] texts = ResManager.Instance.LoadConfig(configName);
- // #pragma warning restore CS0618
- // if (texts != null)
- // {
- // string[] lines = texts;
- // var methodInfo = typeof(T).GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
- // if (methodInfo != null)
- // {
- // methodInfo.Invoke(null, lines);
- // // 璁剧疆鍒濆鍖栨爣蹇�
- // var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- // if (isInitField != null)
- // {
- // isInitField.SetValue(null, true);
- // }
- // Debug.Log($"鍔犺浇閰嶇疆: {typeof(T).Name} 鎴愬姛");
- // }
- // else
- // {
- // Debug.LogError($"閰嶇疆绫� {typeof(T).Name} 娌℃湁闈欐�両nit鏂规硶");
- // }
- // }
- // else
- // {
- // Debug.LogError($"鎵句笉鍒伴厤缃枃浠�: {configName}");
- // }
- // }
+ string[] texts = ResManager.Instance.LoadConfig(configName);
+ if (texts != null)
+ {
+ string[] lines = texts;
+ var methodInfo = typeof(T).GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
+ if (methodInfo != null)
+ {
+ methodInfo.Invoke(null, lines);
+ // 璁剧疆鍒濆鍖栨爣蹇�
+ var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
+ if (isInitField != null)
+ {
+ isInitField.SetValue(null, true);
+ }
+ Debug.Log($"鍔犺浇閰嶇疆: {typeof(T).Name} 鎴愬姛");
+ }
+ else
+ {
+ Debug.LogError($"閰嶇疆绫� {typeof(T).Name} 娌℃湁闈欐�両nit鏂规硶");
+ }
+ }
+ else
+ {
+ Debug.LogError($"鎵句笉鍒伴厤缃枃浠�: {configName}");
+ }
+ }
public float GetLoadingProgress()
{
@@ -406,6 +292,14 @@
ClearConfigDictionary<ActLunhuidianTypeConfig>();
// 娓呯┖ ActSignAwardConfig 瀛楀吀
ClearConfigDictionary<ActSignAwardConfig>();
+ // 娓呯┖ ActSignConfig 瀛楀吀
+ ClearConfigDictionary<ActSignConfig>();
+ // 娓呯┖ ActSpecialSaleConfig 瀛楀吀
+ ClearConfigDictionary<ActSpecialSaleConfig>();
+ // 娓呯┖ ActTaskConfig 瀛楀吀
+ ClearConfigDictionary<ActTaskConfig>();
+ // 娓呯┖ ActTaskTempConfig 瀛楀吀
+ ClearConfigDictionary<ActTaskTempConfig>();
// 娓呯┖ ActTotalRechargeConfig 瀛楀吀
ClearConfigDictionary<ActTotalRechargeConfig>();
// 娓呯┖ ActTotalRechargeTempConfig 瀛楀吀
@@ -530,6 +424,8 @@
ClearConfigDictionary<PriorBundleConfig>();
// 娓呯┖ RandomNameConfig 瀛楀吀
ClearConfigDictionary<RandomNameConfig>();
+ // 娓呯┖ RobotConfig 瀛楀吀
+ ClearConfigDictionary<RobotConfig>();
// 娓呯┖ SignInConfig 瀛楀吀
ClearConfigDictionary<SignInConfig>();
// 娓呯┖ SkillSkinConfig 瀛楀吀
@@ -566,22 +462,9 @@
ClearConfigDictionary<ZhanlingConfig>();
}
- /// <summary>
- /// 鍙姞杞介厤缃枃鏈紝涓嶅仛瑙f瀽銆傜敤浜� WebGL 鎵归噺棰勫姞杞姐��
- /// </summary>
- private async UniTask<string[]> LoadConfigTextAsync(Type configType)
- {
- string configName = configType.Name;
- if (configName.EndsWith("Config"))
- configName = configName.Substring(0, configName.Length - 6);
- return await ResManager.Instance.LoadConfigAsync(configName);
- }
-
#if UNITY_EDITOR
- /// <summary>
- /// Editor 鑷锛氬弽灏勫姞杞芥墍鏈夐厤缃被骞惰褰曡�楁椂銆�
- /// </summary>
- public async void SelfCheckAllConfigs()
+ [MenuItem("Tools/Config/鑷")]
+ public static void CheckAndGenerateFastConfig()
{
// 鑾峰彇 Editor Assembly
var editorAsm = System.AppDomain.CurrentDomain.GetAssemblies()
@@ -622,8 +505,8 @@
foreach (var className in checkClasses)
{
// 杩欓噷涔熻鐢� Editor Assembly 鑾峰彇绫诲瀷
- var cfgType = editorAsm.GetType(className) ?? Type.GetType(className);
- if (cfgType == null)
+ var configType = editorAsm.GetType(className) ?? Type.GetType(className);
+ if (configType == null)
{
Debug.LogWarning($"[鑷] 鏈壘鍒扮被鍨�: {className}");
continue;
@@ -632,15 +515,15 @@
var sw = System.Diagnostics.Stopwatch.StartNew();
// 鍙嶅皠璋冪敤闈欐�両nit鏂规硶
- string configName = cfgType.Name;
+ string configName = configType.Name;
if (configName.EndsWith("Config"))
configName = configName.Substring(0, configName.Length - 6);
- string[] texts = await ResManager.Instance.LoadConfigAsync(configName);
+ string[] texts = ResManager.Instance.LoadConfig(configName);
if (texts != null)
{
string[] lines = texts;
- var methodInfo = cfgType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
+ var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
if (methodInfo != null)
{
methodInfo.Invoke(null, new object[] { lines });
@@ -651,21 +534,21 @@
if (sw.ElapsedMilliseconds >= 500)
{
- Debug.LogError($"[鑷] 鍔犺浇閰嶇疆 {cfgType.Name} 鑰楁椂杈冮暱: {sw.ElapsedMilliseconds} ms");
+ Debug.LogError($"[鑷] 鍔犺浇閰嶇疆 {configType.Name} 鑰楁椂杈冮暱: {sw.ElapsedMilliseconds} ms");
}
else if (sw.ElapsedMilliseconds <= 5)
{
- fastName.Add(cfgType.Name);
+ fastName.Add(configType.Name);
}
- Debug.Log($"[鑷] 鍔犺浇閰嶇疆: {cfgType.Name} 鐢ㄦ椂: {sw.ElapsedMilliseconds} ms");
+ Debug.Log($"[鑷] 鍔犺浇閰嶇疆: {configType.Name} 鐢ㄦ椂: {sw.ElapsedMilliseconds} ms");
}
// 閲婃斁鎵�鏈夊凡鍔犺浇鐨勯厤缃�
foreach (var className in checkClasses)
{
- var cfgType = editorAsm.GetType(className) ?? Type.GetType(className);
- if (cfgType == null) continue;
- var methodInfo = cfgType.GetMethod("ForceRelease", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
+ var configType = editorAsm.GetType(className) ?? Type.GetType(className);
+ if (configType == null) continue;
+ var methodInfo = configType.GetMethod("ForceRelease", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
if (methodInfo != null)
{
methodInfo.Invoke(null, null);
@@ -676,26 +559,4 @@
Debug.Log($"[鑷] fastConfig.txt 鐢熸垚瀹屾瘯锛屽揩閫熻〃鏈夛細{string.Join(", ", fastName)}");
}
#endif
-
- /// <summary>
- /// 浠庡凡鍔犺浇鐨勬枃鏈垵濮嬪寲閰嶇疆锛堢函鍐呭瓨鎿嶄綔锛屾棤缃戠粶锛夈��
- /// </summary>
- private void InitConfigFromTexts(Type configType, string[] texts)
- {
- var methodInfo = configType.GetMethod("Init",
- System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
- if (methodInfo != null)
- {
- methodInfo.Invoke(null, new object[] { texts });
- var isInitField = configType.GetField("isInit",
- System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
- if (isInitField != null)
- isInitField.SetValue(null, true);
- }
- else
- {
- Debug.LogError($"閰嶇疆绫� {configType.Name} 娌℃湁闈欐�両nit鏂规硶");
- }
- }
-
}
diff --git a/Main/Config/Configs/ADAwardConfig.cs b/Main/Config/Configs/ADAwardConfig.cs
index dfdbe0d..23a9130 100644
--- a/Main/Config/Configs/ADAwardConfig.cs
+++ b/Main/Config/Configs/ADAwardConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2026骞�1鏈�15鏃�
+// [ Date ]: Monday, April 27, 2026
//--------------------------------------------------------
using System.Collections.Generic;
@@ -24,6 +24,7 @@
public int FuncID;
public int RedpointID;
public int ParentRedpointID;
+ public string Name;
public override int LoadKey(string _key)
{
@@ -50,6 +51,8 @@
int.TryParse(tables[6],out RedpointID);
int.TryParse(tables[7],out ParentRedpointID);
+
+ Name = tables[8];
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/ActSignConfig.cs b/Main/Config/Configs/ActSignConfig.cs
new file mode 100644
index 0000000..9b58a27
--- /dev/null
+++ b/Main/Config/Configs/ActSignConfig.cs
@@ -0,0 +1,41 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Tuesday, April 28, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ActSignConfig : ConfigBase<int, ActSignConfig>
+{
+ static ActSignConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int CfgID;
+ public int SignTempID;
+
+ 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 CfgID);
+
+ int.TryParse(tables[1],out SignTempID);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ActSignConfig.cs.meta b/Main/Config/Configs/ActSignConfig.cs.meta
new file mode 100644
index 0000000..50b4b82
--- /dev/null
+++ b/Main/Config/Configs/ActSignConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 28335628185079b4cae244317f179653
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/ActSpecialSaleConfig.cs b/Main/Config/Configs/ActSpecialSaleConfig.cs
new file mode 100644
index 0000000..7415d3c
--- /dev/null
+++ b/Main/Config/Configs/ActSpecialSaleConfig.cs
@@ -0,0 +1,62 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2026骞�4鏈�29鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ActSpecialSaleConfig : ConfigBase<int, ActSpecialSaleConfig>
+{
+ static ActSpecialSaleConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int CfgID;
+ public int[] CTGIDList;
+ public int ActShopType;
+ public int ADID;
+ public int[][] PopItems;
+
+ 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 CfgID);
+
+ if (tables[1].Contains("["))
+ {
+ CTGIDList = JsonMapper.ToObject<int[]>(tables[1]);
+ }
+ else
+ {
+ string[] CTGIDListStringArray = tables[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ CTGIDList = new int[CTGIDListStringArray.Length];
+ for (int i=0;i<CTGIDListStringArray.Length;i++)
+ {
+ int.TryParse(CTGIDListStringArray[i],out CTGIDList[i]);
+ }
+ }
+
+ int.TryParse(tables[2],out ActShopType);
+
+ int.TryParse(tables[3],out ADID);
+
+ PopItems = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]"));
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ActSpecialSaleConfig.cs.meta b/Main/Config/Configs/ActSpecialSaleConfig.cs.meta
new file mode 100644
index 0000000..47a71d6
--- /dev/null
+++ b/Main/Config/Configs/ActSpecialSaleConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fee90584a2c90bf429ad939a6a80973a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/ActTaskConfig.cs b/Main/Config/Configs/ActTaskConfig.cs
new file mode 100644
index 0000000..43d5d60
--- /dev/null
+++ b/Main/Config/Configs/ActTaskConfig.cs
@@ -0,0 +1,53 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Wednesday, April 29, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ActTaskConfig : ConfigBase<int, ActTaskConfig>
+{
+ static ActTaskConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int CfgID;
+ public int IsDayReset;
+ public int TemplateID;
+ public int ActScoreItemID;
+ public int ActShopTypeEx;
+ public string ActScoreAwardInfo;
+
+ 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 CfgID);
+
+ int.TryParse(tables[1],out IsDayReset);
+
+ int.TryParse(tables[2],out TemplateID);
+
+ int.TryParse(tables[3],out ActScoreItemID);
+
+ int.TryParse(tables[4],out ActShopTypeEx);
+
+ ActScoreAwardInfo = tables[5];
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ActTaskConfig.cs.meta b/Main/Config/Configs/ActTaskConfig.cs.meta
new file mode 100644
index 0000000..6162e71
--- /dev/null
+++ b/Main/Config/Configs/ActTaskConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 18ccb33588d91924e929f132457591f2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/ActTaskTempConfig.cs b/Main/Config/Configs/ActTaskTempConfig.cs
new file mode 100644
index 0000000..d340282
--- /dev/null
+++ b/Main/Config/Configs/ActTaskTempConfig.cs
@@ -0,0 +1,56 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2026骞�4鏈�28鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ActTaskTempConfig : ConfigBase<int, ActTaskTempConfig>
+{
+ static ActTaskTempConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int ID;
+ public int TemplateID;
+ public int TasklD;
+ public int TaskType;
+ public int NeedValue;
+ public int[][] AwardItemList;
+ public int GuideID;
+
+ 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 TemplateID);
+
+ int.TryParse(tables[2],out TasklD);
+
+ int.TryParse(tables[3],out TaskType);
+
+ int.TryParse(tables[4],out NeedValue);
+
+ AwardItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]"));
+
+ int.TryParse(tables[6],out GuideID);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ActTaskTempConfig.cs.meta b/Main/Config/Configs/ActTaskTempConfig.cs.meta
new file mode 100644
index 0000000..c27b0cd
--- /dev/null
+++ b/Main/Config/Configs/ActTaskTempConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ec9a5f1c58db6994b8f558fc17c191d9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/HorseSkinConfig.cs b/Main/Config/Configs/HorseSkinConfig.cs
index 07f4660..c02ddd8 100644
--- a/Main/Config/Configs/HorseSkinConfig.cs
+++ b/Main/Config/Configs/HorseSkinConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Monday, April 13, 2026
+// [ Date ]: Wednesday, April 29, 2026
//--------------------------------------------------------
using System.Collections.Generic;
@@ -34,6 +34,7 @@
public string Icon;
public int showType;
public int sortOrder;
+ public int pmaVertexColorsOpen;
public override int LoadKey(string _key)
{
@@ -128,6 +129,8 @@
int.TryParse(tables[16],out showType);
int.TryParse(tables[17],out sortOrder);
+
+ int.TryParse(tables[18],out pmaVertexColorsOpen);
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/RobotConfig.cs b/Main/Config/Configs/RobotConfig.cs
new file mode 100644
index 0000000..7bceaf4
--- /dev/null
+++ b/Main/Config/Configs/RobotConfig.cs
@@ -0,0 +1,38 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Thursday, May 7, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class RobotConfig : ConfigBase<int, RobotConfig>
+{
+ static RobotConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int ID;
+
+ 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);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/RobotConfig.cs.meta b/Main/Config/Configs/RobotConfig.cs.meta
new file mode 100644
index 0000000..136fea6
--- /dev/null
+++ b/Main/Config/Configs/RobotConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fcdec0934a6834f498bdf03a22e215c5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/ActTaskTempConfig.cs b/Main/Config/PartialConfigs/ActTaskTempConfig.cs
new file mode 100644
index 0000000..915dfd5
--- /dev/null
+++ b/Main/Config/PartialConfigs/ActTaskTempConfig.cs
@@ -0,0 +1,63 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public partial class ActTaskTempConfig : ConfigBase<int, ActTaskTempConfig>
+{
+ public static Dictionary<int, List<ActTaskTempConfig>> templateIDToConfigsDict = new Dictionary<int, List<ActTaskTempConfig>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ if (!templateIDToConfigsDict.ContainsKey(TemplateID))
+ {
+ templateIDToConfigsDict[TemplateID] = new List<ActTaskTempConfig>();
+ }
+ templateIDToConfigsDict[TemplateID].Add(this);
+ }
+
+ public static List<ActTaskTempConfig> GetTemplateIDToConfigsDict(int templateID)
+ {
+ if (templateIDToConfigsDict.ContainsKey(templateID))
+ {
+ return templateIDToConfigsDict[templateID];
+ }
+ return null;
+ }
+
+ // 绱绉垎濂栧姳閰嶇疆
+ public class TotalScoreAwardConfig
+ {
+ public int needScore; // 鎵�闇�绉垎
+ public int recordIndex; // 璁板綍绱㈠紩
+ public int itemId; // 濂栧姳鐗╁搧ID
+ public int itemCount; // 濂栧姳鐗╁搧鏁伴噺
+ }
+
+ // 閫氳繃CfgID鑾峰彇绱绉垎濂栧姳鍒楄〃
+ public static List<TotalScoreAwardConfig> GetTotalScoreAwardListByCfgID(int cfgId)
+ {
+ var result = new List<TotalScoreAwardConfig>();
+ var config = ActTaskConfig.Get(cfgId);
+ if (config == null || string.IsNullOrEmpty(config.ActScoreAwardInfo) || config.ActScoreAwardInfo == "{}")
+ {
+ return result;
+ }
+
+
+ var dict = ConfigParse.ParseIntArrayDict(config.ActScoreAwardInfo);
+ foreach (var kvp in dict)
+ {
+ var arr = kvp.Value;
+ if (arr != null && arr.Length >= 3)
+ {
+ result.Add(new TotalScoreAwardConfig
+ {
+ needScore = kvp.Key,
+ recordIndex = arr[0],
+ itemId = arr[1],
+ itemCount = arr[2]
+ });
+ }
+ }
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/ActTaskTempConfig.cs.meta b/Main/Config/PartialConfigs/ActTaskTempConfig.cs.meta
new file mode 100644
index 0000000..afa5dca
--- /dev/null
+++ b/Main/Config/PartialConfigs/ActTaskTempConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0f7b949b0b810ea4b83d18d7d1113caf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs
new file mode 100644
index 0000000..75f4835
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 10 鐗瑰崠娲诲姩淇℃伅 #tagSCActSpecialSaleInfo
+
+public class DTCAA10_tagSCActSpecialSaleInfo : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HAA10_tagSCActSpecialSaleInfo vNetData = vNetPack as HAA10_tagSCActSpecialSaleInfo;
+ OperationTimeHepler.Instance.UpdateFlashSaleActivityInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs.meta
new file mode 100644
index 0000000..4410fcf
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA10_tagSCActSpecialSaleInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 93050a26bbe6ce449a5021d8cdebc682
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagSCActTotDayRechargePlayerInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagSCActTotDayRechargePlayerInfo.cs
index 58c7e01..b263010 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagSCActTotDayRechargePlayerInfo.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1A_tagSCActTotDayRechargePlayerInfo.cs
@@ -10,5 +10,6 @@
base.Done(vNetPack);
HAA1A_tagSCActTotDayRechargePlayerInfo vNetData = vNetPack as HAA1A_tagSCActTotDayRechargePlayerInfo;
TotDayRechargeManager.Instance.UpdateTotDayRechargePlayerInfo(vNetData);
+ FestivalActivityRechargeTotDayManager.Instance.UpdateTotDayRechargePlayerInfo(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1C_tagSCActTotalRechargePlayerInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1C_tagSCActTotalRechargePlayerInfo.cs
index 15cb47b..28fd150 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1C_tagSCActTotalRechargePlayerInfo.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA1C_tagSCActTotalRechargePlayerInfo.cs
@@ -8,5 +8,6 @@
base.Done(vNetPack);
HAA1C_tagSCActTotalRechargePlayerInfo vNetData = vNetPack as HAA1C_tagSCActTotalRechargePlayerInfo;
TotalRechargeManager.Instance.UpdateTotalRechargePlayerInfo(vNetData);
+ FestivalActivityRechargeTotalManager.Instance.UpdateTotalRechargePlayerInfo(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs
new file mode 100644
index 0000000..9677e36
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 23 绛惧埌娲诲姩淇℃伅 #tagSCActSignInfo
+
+public class DTCAA23_tagSCActSignInfo : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HAA23_tagSCActSignInfo vNetData = vNetPack as HAA23_tagSCActSignInfo;
+ OperationTimeHepler.Instance.UpdateCheckInActivityInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs.meta
new file mode 100644
index 0000000..a94783c
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA23_tagSCActSignInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7b92c42956c922f4689fb3d005ccd63c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs
new file mode 100644
index 0000000..a756868
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 71 浠诲姟娲诲姩淇℃伅 #tagSCActTaskInfo
+
+public class DTCAA71_tagSCActTaskInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HAA71_tagSCActTaskInfo vNetData = vNetPack as HAA71_tagSCActTaskInfo;
+ OperationTimeHepler.Instance.UpdateMissionActivityInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs.meta
new file mode 100644
index 0000000..972addf
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA71_tagSCActTaskInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e5bfd63d84d04a64295b1e67df4182ba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs
new file mode 100644
index 0000000..2e80c04
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 72 浠诲姟娲诲姩鐜╁浠诲姟鍊� #tagSCActTaskPlayerValueInfo
+
+public class DTCAA72_tagSCActTaskPlayerValueInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HAA72_tagSCActTaskPlayerValueInfo vNetData = vNetPack as HAA72_tagSCActTaskPlayerValueInfo;
+ FestivalActivityMissionManager.Instance.UpdatePlayerValueInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs.meta
new file mode 100644
index 0000000..f7dbefe
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA72_tagSCActTaskPlayerValueInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ff88da8b58bd357419087982180462a2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs
new file mode 100644
index 0000000..9e6cda6
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 73 浠诲姟娲诲姩鐜╁淇℃伅 #tagSCActTaskPlayerInfo
+
+public class DTCAA73_tagSCActTaskPlayerInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HAA73_tagSCActTaskPlayerInfo vNetData = vNetPack as HAA73_tagSCActTaskPlayerInfo;
+ FestivalActivityMissionManager.Instance.UpdatePlayerInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs.meta
new file mode 100644
index 0000000..afbbab7
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HAA_SaleActivity/DTCAA73_tagSCActTaskPlayerInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2622ac73ea207bc41b42b0bea6da8886
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 270cccc..a02adb8 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -167,6 +167,11 @@
Register(typeof(HAA1B_tagSCActTotDayRechargeInfo), typeof(DTCAA1B_tagSCActTotDayRechargeInfo));
Register(typeof(HAA1C_tagSCActTotalRechargePlayerInfo), typeof(DTCAA1C_tagSCActTotalRechargePlayerInfo));
Register(typeof(HAA1D_tagSCActTotalRechargeInfo), typeof(DTCAA1D_tagSCActTotalRechargeInfo));
+ Register(typeof(HAA10_tagSCActSpecialSaleInfo), typeof(DTCAA10_tagSCActSpecialSaleInfo));
+ Register(typeof(HAA23_tagSCActSignInfo), typeof(DTCAA23_tagSCActSignInfo));
+ Register(typeof(HAA71_tagSCActTaskInfo), typeof(DTCAA71_tagSCActTaskInfo));
+ Register(typeof(HAA72_tagSCActTaskPlayerValueInfo), typeof(DTCAA72_tagSCActTaskPlayerValueInfo));
+ Register(typeof(HAA73_tagSCActTaskPlayerInfo), typeof(DTCAA73_tagSCActTaskPlayerInfo));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA922_tagSCArenaMatchList.cs b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA922_tagSCArenaMatchList.cs
index 2b09559..4a64ebd 100644
--- a/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA922_tagSCArenaMatchList.cs
+++ b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA922_tagSCArenaMatchList.cs
@@ -25,6 +25,7 @@
TransBytes (out MatchList[i].Face, vBytes, NetDataType.DWORD);
TransBytes (out MatchList[i].FacePic, vBytes, NetDataType.DWORD);
TransBytes (out MatchList[i].TitleID, vBytes, NetDataType.DWORD);
+ TransBytes (out MatchList[i].ServerID, vBytes, NetDataType.DWORD);
}
}
@@ -38,6 +39,7 @@
public uint Face; //鍩烘湰鑴稿瀷
public uint FacePic; //澶村儚妗�
public uint TitleID; //绉板彿
+ public uint ServerID;
}
}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs
new file mode 100644
index 0000000..4ae96a6
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 10 鐗瑰崠娲诲姩淇℃伅 #tagSCActSpecialSaleInfo
+
+public class HAA10_tagSCActSpecialSaleInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public string StartDate; // 寮�濮嬫棩鏈� y-m-d
+ public string EndtDate; // 缁撴潫鏃ユ湡 y-m-d
+ public ushort CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public HAA10_tagSCActSpecialSaleInfo () {
+ _cmd = (ushort)0xAA10;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out CfgID, vBytes, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs.meta
new file mode 100644
index 0000000..5da34ee
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA10_tagSCActSpecialSaleInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0cedf55511caa534a998927e86ba2ac5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs
new file mode 100644
index 0000000..7d38872
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 23 绛惧埌娲诲姩淇℃伅 #tagSCActSignInfo
+
+public class HAA23_tagSCActSignInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public string StartDate; // 寮�濮嬫棩鏈� y-m-d
+ public string EndtDate; // 缁撴潫鏃ユ湡 y-m-d
+ public ushort CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public HAA23_tagSCActSignInfo () {
+ _cmd = (ushort)0xAA23;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out CfgID, vBytes, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs.meta
new file mode 100644
index 0000000..829d122
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA23_tagSCActSignInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e62482e93459c95489f5f137a1367382
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs
new file mode 100644
index 0000000..6a5e0f0
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 71 浠诲姟娲诲姩淇℃伅 #tagSCActTaskInfo
+
+public class HAA71_tagSCActTaskInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public string StartDate; // 寮�濮嬫棩鏈� y-m-d
+ public string EndtDate; // 缁撴潫鏃ユ湡 y-m-d
+ public ushort CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public HAA71_tagSCActTaskInfo () {
+ _cmd = (ushort)0xAA71;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
+ TransBytes (out CfgID, vBytes, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs.meta
new file mode 100644
index 0000000..5d64d0d
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA71_tagSCActTaskInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 43a1369401f48644886a0ed6ead11c9a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs
new file mode 100644
index 0000000..00c21f6
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 72 浠诲姟娲诲姩鐜╁浠诲姟鍊� #tagSCActTaskPlayerValueInfo
+
+public class HAA72_tagSCActTaskPlayerValueInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public byte TaskCount;
+ public tagSCActTaskPlayerValue[] TaskValueList; // 鏈夊悓姝ョ殑浠诲姟绫诲瀷鐩存帴瑕嗙洊鍗冲彲
+
+ public HAA72_tagSCActTaskPlayerValueInfo () {
+ _cmd = (ushort)0xAA72;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out TaskCount, vBytes, NetDataType.BYTE);
+ TaskValueList = new tagSCActTaskPlayerValue[TaskCount];
+ for (int i = 0; i < TaskCount; i ++) {
+ TaskValueList[i] = new tagSCActTaskPlayerValue();
+ TransBytes (out TaskValueList[i].TaskType, vBytes, NetDataType.BYTE);
+ TransBytes (out TaskValueList[i].TaskValue, vBytes, NetDataType.DWORD);
+ }
+ }
+
+ public class tagSCActTaskPlayerValue {
+ public byte TaskType; // 浠诲姟绫诲瀷
+ public uint TaskValue; // 褰撳墠浠诲姟鍊硷紝鎵�鏈夌浉鍚屼换鍔$被鍨嬪叡浜杩涘害鍊�
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs.meta
new file mode 100644
index 0000000..dbeeb58
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA72_tagSCActTaskPlayerValueInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e3ae0803689cf9c41a5e5fdf2674875a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs
new file mode 100644
index 0000000..99b600f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+using System.Collections;
+
+// AA 73 浠诲姟娲诲姩鐜╁淇℃伅 #tagSCActTaskPlayerInfo
+
+public class HAA73_tagSCActTaskPlayerInfo : GameNetPackBasic {
+ public byte ActNum; // 娲诲姩缂栧彿
+ public uint ActScoreTotal; // 绱娲诲姩绉垎锛岀敤浜庨獙璇侀鍙栫疮璁$Н鍒嗗鍔辩敤锛屽晢搴楀厬鎹㈢洿鎺ョ敤鐗╁搧鍏戞崲鐗╁搧
+ public uint ActScoreAward; // 绱娲诲姩绉垎棰嗗璁板綍锛屾寜濂栧姳绱㈠紩浣嶈繍绠楀垽鏂槸鍚﹀凡棰嗗彇
+ public byte AwardCount;
+ public uint[] AwardRecordList; // 浠诲姟ID棰嗗璁板綍鍊煎垪琛紝鏍规嵁浠诲姟ID浣嶅垽鏂槸鍚﹀凡棰嗗彇锛屼竴涓褰曞�煎瓨31浣� [璁板綍鍊�0, 璁板綍鍊�1, ...]
+
+ public HAA73_tagSCActTaskPlayerInfo () {
+ _cmd = (ushort)0xAA73;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out ActNum, vBytes, NetDataType.BYTE);
+ TransBytes (out ActScoreTotal, vBytes, NetDataType.DWORD);
+ TransBytes (out ActScoreAward, vBytes, NetDataType.DWORD);
+ TransBytes (out AwardCount, vBytes, NetDataType.BYTE);
+ TransBytes (out AwardRecordList, vBytes, NetDataType.DWORD, AwardCount);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs.meta
new file mode 100644
index 0000000..267ed65
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HAA_SaleActivity/HAA73_tagSCActTaskPlayerInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 822917aa36513164eaa88bab3498a208
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Main.cs b/Main/Main.cs
index 4cbc618..b2e97e9 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -143,7 +143,11 @@
managers.Add(CrossServerBaseManager.Instance);
managers.Add(TotalRechargeManager.Instance);
managers.Add(TotDayRechargeManager.Instance);
-
+ managers.Add(FestivalActivityManager.Instance);
+ managers.Add(FestivalActivityRechargeTotalManager.Instance);
+ managers.Add(FestivalActivityRechargeTotDayManager.Instance);
+ managers.Add(FestivalActivityCheckInManager.Instance);
+ managers.Add(FestivalActivityMissionManager.Instance);
foreach (var manager in managers)
{
diff --git a/Main/System/Arena/ArenaBattleFailWin.cs b/Main/System/Arena/ArenaBattleFailWin.cs
index 1d6bc75..c521db5 100644
--- a/Main/System/Arena/ArenaBattleFailWin.cs
+++ b/Main/System/Arena/ArenaBattleFailWin.cs
@@ -69,17 +69,13 @@
myAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
PlayerDatas.Instance.baseData.face,
- PlayerDatas.Instance.baseData.facePic)).Forget();
- enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)).Forget();
- enemyAvatarCell.SetOnLoaded(() =>
+ PlayerDatas.Instance.baseData.facePic));
+ enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic));
+ enemyAvatarCell.SetListener(() =>
{
- if (this == null) return;
- enemyAvatarCell.SetListener(() =>
- {
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
- });
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && tagPlayerID != PlayerDatas.Instance.baseData.PlayerID) ? (int)info.ServerID : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
-
txtMyName.text = PlayerDatas.Instance.baseData.PlayerName;
txtEnemyName.text = UIHelper.ServerStringTrim(info.PlayerName);
diff --git a/Main/System/Arena/ArenaBattleVictoryWin.cs b/Main/System/Arena/ArenaBattleVictoryWin.cs
index b31f782..1b1a4e0 100644
--- a/Main/System/Arena/ArenaBattleVictoryWin.cs
+++ b/Main/System/Arena/ArenaBattleVictoryWin.cs
@@ -63,15 +63,12 @@
myAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
PlayerDatas.Instance.baseData.face,
- PlayerDatas.Instance.baseData.facePic)).Forget();
- enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)).Forget();
- enemyAvatarCell.SetOnLoaded(() =>
+ PlayerDatas.Instance.baseData.facePic));
+ enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic));
+ enemyAvatarCell.SetListener(() =>
{
- if (this == null) return;
- enemyAvatarCell.SetListener(() =>
- {
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
- });
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && tagPlayerID != PlayerDatas.Instance.baseData.PlayerID) ? (int)info.ServerID : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, serverID, 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 3a44e6c..e63148d 100644
--- a/Main/System/Arena/ArenaChallengeCell.cs
+++ b/Main/System/Arena/ArenaChallengeCell.cs
@@ -1,5 +1,4 @@
-锘縰sing System.Collections.Generic;
-using Cysharp.Threading.Tasks;
+using System.Collections.Generic;
using UnityEngine;
public class ArenaChallengeCell : MonoBehaviour
@@ -7,6 +6,8 @@
[SerializeField] AvatarCell avatarCell;
[SerializeField] TextEx txtName;
[SerializeField] TextEx txtAddScore;
+ [SerializeField] TextEx txtServerName;
+ [SerializeField] TextEx txtAddCrossScore;
[SerializeField] TextEx txtFightPoint;
[SerializeField] OfficialTitleCell officialTitleCell;
[SerializeField] List<ItemCell> itemCells;
@@ -33,20 +34,37 @@
return;
arenaMatchInfo = list[index];
- avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaMatchInfo.PlayerID, (int)arenaMatchInfo.Face, (int)arenaMatchInfo.FacePic)).Forget();
- avatarCell.SetOnLoaded(() =>
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaMatchInfo.PlayerID, (int)arenaMatchInfo.Face, (int)arenaMatchInfo.FacePic));
+ avatarCell.SetListener(() =>
{
- avatarCell.SetListener(() =>
- {
- AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
- });
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && arenaMatchInfo.PlayerID != PlayerDatas.Instance.baseData.PlayerID) ? (int)arenaMatchInfo.ServerID : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtName.text = UIHelper.ServerStringTrim(arenaMatchInfo.PlayerName);
txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaMatchInfo.FightPower);
- txtAddScore.text = Language.Get("Arena16", ArenaManager.Instance.GetChallengePoints(index));
-
- officialTitleCell.InitUI(arenaMatchInfo.RealmLV, (int)arenaMatchInfo.TitleID, 0.55f).Forget();
+
+ bool isCrossServer = ArenaManager.Instance.IsOpenCrossServer();
+ if (isCrossServer)
+ {
+ txtAddScore.SetActive(false);
+ txtServerName.SetActive(true);
+ if (ArenaManager.Instance.IsRobot((int)arenaMatchInfo.PlayerID))
+ txtServerName.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ else
+ txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaMatchInfo.ServerID);
+ txtAddCrossScore.SetActive(true);
+ txtAddCrossScore.text = Language.Get("Arena16", ArenaManager.Instance.GetChallengePoints(index));
+ }
+ else
+ {
+ txtAddScore.SetActive(true);
+ txtAddScore.text = Language.Get("Arena16", ArenaManager.Instance.GetChallengePoints(index));
+ txtServerName.SetActive(false);
+ txtAddCrossScore.SetActive(false);
+ }
+
+ officialTitleCell.InitUI(arenaMatchInfo.RealmLV, (int)arenaMatchInfo.TitleID, 0.55f);
int[][] rewards = ArenaManager.Instance.fixedChallengeRewards;
for (int i = 0; i < itemCells.Count; i++)
@@ -57,7 +75,7 @@
int itemCellIndex = i;
itemCell.SetActive(true);
itemCell.Init(new ItemCellModel(rewards[i][0], true, rewards[i][1]));
- itemCell.SetClickListener(() => ItemTipUtility.Show(rewards[itemCellIndex][0]));
+ itemCell.button.SetListener(() => ItemTipUtility.Show(rewards[itemCellIndex][0]));
}
else
{
@@ -65,4 +83,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Main/System/Arena/ArenaCrossAwardCell.cs b/Main/System/Arena/ArenaCrossAwardCell.cs
new file mode 100644
index 0000000..e79fa7e
--- /dev/null
+++ b/Main/System/Arena/ArenaCrossAwardCell.cs
@@ -0,0 +1,69 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+/// <summary>
+/// 绔炴妧鍦哄鍔卞崟鍏冩牸
+/// </summary>
+public class ArenaCrossAwardCell : CellView
+{
+ [SerializeField] ImageEx imgRank;
+ [SerializeField] TextEx txtRank;
+ [SerializeField] ItemCell[] itemCells;
+
+ public void Display(int index, CellView cellView)
+ {
+ int functionOrder = cellView.info.Value.infoInt1;
+ var rewardDict = ArenaManager.Instance.GetCrossArenaAwardDict(functionOrder);
+ if (rewardDict.IsNullOrEmpty()) return;
+
+ var sortedKeys = rewardDict.Keys.ToList();
+ sortedKeys.Sort();
+
+ DisplayRank(sortedKeys, index);
+ DisplayItems(sortedKeys, index, rewardDict);
+ }
+
+ private void DisplayRank(List<int> sortedKeys, int index)
+ {
+ int rank = sortedKeys[index];
+ if (rank <= 3)
+ {
+ imgRank.SetActive(true);
+ txtRank.SetActive(false);
+ imgRank.SetSprite($"Rank{rank}");
+ }
+ else
+ {
+ imgRank.SetActive(false);
+ txtRank.SetActive(true);
+ int lastIndex = index - 1;
+ txtRank.text = lastIndex > 0 && lastIndex < sortedKeys.Count
+ ? Language.Get("Arena15", sortedKeys[lastIndex] + 1, rank)
+ : string.Empty;
+ }
+ }
+
+ private void DisplayItems(List<int> sortedKeys, int index, Dictionary<int, int[][]> rewardDict)
+ {
+ int[][] rewardArr = rewardDict[sortedKeys[index]];
+ if (rewardArr.IsNullOrEmpty())
+ {
+ for (int i = 0; i < itemCells.Length; i++)
+ itemCells[i].SetActive(false);
+ return;
+ }
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ bool hasReward = i < rewardArr.Length;
+ itemCells[i].SetActive(hasReward);
+ if (hasReward)
+ {
+ int itemId = rewardArr[i][0];
+ itemCells[i].Init(new ItemCellModel(itemId, true, rewardArr[i][1]));
+ itemCells[i].button.SetListener(() => ItemTipUtility.Show(itemId));
+ }
+ }
+ }
+}
diff --git a/Main/System/Arena/ArenaCrossAwardCell.cs.meta b/Main/System/Arena/ArenaCrossAwardCell.cs.meta
new file mode 100644
index 0000000..45cac21
--- /dev/null
+++ b/Main/System/Arena/ArenaCrossAwardCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: db50e766c48693241827170a23113478
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Arena/ArenaCrossAwardWin.cs b/Main/System/Arena/ArenaCrossAwardWin.cs
new file mode 100644
index 0000000..68cc462
--- /dev/null
+++ b/Main/System/Arena/ArenaCrossAwardWin.cs
@@ -0,0 +1,192 @@
+using System;
+using System.Linq;
+using UnityEngine;
+
+/// <summary>
+/// 绔炴妧鍦哄鍔辩獥鍙o細functionOrder=0/1/2 鈫� 鏈湇鏃�/鏈湇鍛�/璺ㄦ湇鍛ㄥ鍔�
+/// </summary>
+public class ArenaCrossAwardWin : FunctionsBaseWin
+{
+ [HideInInspector] public string valueFormat = "{0}";
+ [SerializeField] ArenaPlayerRankCell myRankCell;
+ [SerializeField] ButtonEx btnClose;
+ [SerializeField] TextEx txtCountdown;
+
+ [SerializeField] Transform localDayRect;
+ [SerializeField] ScrollerController scrLocalDayAward;
+ [SerializeField] Transform localWeekRect;
+ [SerializeField] ScrollerController scrLocalWeekAward;
+ [SerializeField] Transform crossWeekRect;
+ [SerializeField] ScrollerController scrCrossWeekAward;
+
+ protected override void InitComponent()
+ {
+ base.InitComponent();
+ btnClose.SetListener(CloseWindow);
+ }
+
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ ArenaManager.Instance.OnArenaMatchListEvent += OnArenaMatchListEvent;
+ ArenaManager.Instance.OnUpdateArenaPlayerInfo += OnUpdateArenaPlayerInfo;
+ ArenaManager.Instance.OnUpdateGameRecInfo += OnUpdateGameRecInfo;
+ RankModel.Instance.onRankRefresh += OnRankRefresh;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ scrLocalDayAward.OnRefreshCell += OnRefreshLocalDayCell;
+ scrLocalWeekAward.OnRefreshCell += OnRefreshLocalWeekCell;
+ scrCrossWeekAward.OnRefreshCell += OnRefreshCrossWeekCell;
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ base.OnPreClose();
+ ArenaManager.Instance.OnArenaMatchListEvent -= OnArenaMatchListEvent;
+ ArenaManager.Instance.OnUpdateArenaPlayerInfo -= OnUpdateArenaPlayerInfo;
+ ArenaManager.Instance.OnUpdateGameRecInfo -= OnUpdateGameRecInfo;
+ RankModel.Instance.onRankRefresh -= OnRankRefresh;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ scrLocalDayAward.OnRefreshCell -= OnRefreshLocalDayCell;
+ scrLocalWeekAward.OnRefreshCell -= OnRefreshLocalWeekCell;
+ scrCrossWeekAward.OnRefreshCell -= OnRefreshCrossWeekCell;
+ }
+
+ private void OnSecondEvent()
+ {
+ TimeSpan remainingTime;
+
+ if (functionOrder == 0)
+ {
+ // 鏈湇鏃ュ鍔憋細浣跨敤鍒版槑澶�0鐐圭殑鏃堕棿
+ remainingTime = TimeUtility.ServerNow.AddDays(1).Date - TimeUtility.ServerNow;
+
+ }
+ else if (functionOrder == 1)
+ {
+ // 鏈湇鍛ㄥ鍔憋細浣跨敤鏈湇璧涘缁撴潫鏃堕棿
+ ArenaManager.Instance.GetCurrentSeasonDates(out _, out DateTime seasonEndDate);
+ remainingTime = seasonEndDate - TimeUtility.ServerNow;
+ }
+ else
+ {
+ // 璺ㄦ湇鍛ㄥ鍔憋細浣跨敤璺ㄦ湇璧涘缁撴潫鏃堕棿
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(ArenaManager.Instance.DataMapID);
+ int zoneID = crossZoneInfo != null ? (int)crossZoneInfo.ZoneID : 0;
+ ArenaManager.Instance.GetCrossCurrentSeasonDates(zoneID, out _, out DateTime crossSeasonEndDate);
+ remainingTime = crossSeasonEndDate - TimeUtility.ServerNow;
+ }
+
+ int remainingSeconds = (int)remainingTime.TotalSeconds;
+ bool hasTime = remainingSeconds > 0;
+ txtCountdown.SetActive(hasTime);
+ if (hasTime)
+ txtCountdown.text = Language.Get("Arena14", TimeUtility.SecondsToDHMSCHS(remainingSeconds));
+ }
+
+ protected override void OpenSubUIByTabIndex()
+ {
+ Display();
+ }
+
+ private void OnRefreshLocalDayCell(ScrollerDataType type, CellView cell)
+ {
+ cell.GetComponent<ArenaCrossAwardCell>()?.Display(cell.index, cell);
+ }
+
+ private void OnRefreshLocalWeekCell(ScrollerDataType type, CellView cell)
+ {
+ cell.GetComponent<ArenaCrossAwardCell>()?.Display(cell.index, cell);
+ }
+
+ private void OnRefreshCrossWeekCell(ScrollerDataType type, CellView cell)
+ {
+ cell.GetComponent<ArenaCrossAwardCell>()?.Display(cell.index, cell);
+ }
+
+ private void OnArenaMatchListEvent() => Display();
+ private void OnUpdateArenaPlayerInfo() => Display();
+ private void OnUpdateGameRecInfo() => Display();
+ private void OnRankRefresh(int _) => DisplayMyRank();
+
+ private void Display()
+ {
+ localDayRect.SetActive(functionOrder == 0);
+ localWeekRect.SetActive(functionOrder == 1);
+ crossWeekRect.SetActive(functionOrder == 2);
+ CreateScroller();
+ DisplayMyRank();
+ OnSecondEvent();
+ }
+
+ private void CreateScroller()
+ {
+ switch (functionOrder)
+ {
+ case 0:
+ CreateLocalDayScroller();
+ break;
+ case 1:
+ CreateLocalWeekScroller();
+ break;
+ case 2:
+ CreateCrossWeekScroller();
+ break;
+ }
+ DisplayMyRank();
+ OnSecondEvent();
+ }
+
+ private void CreateLocalDayScroller()
+ {
+ scrLocalDayAward.Refresh();
+ var rewardDict = ArenaManager.Instance.GetCrossArenaAwardDict(0);
+ if (rewardDict.IsNullOrEmpty()) return;
+
+ var sortedKeys = rewardDict.Keys.ToList();
+ sortedKeys.Sort();
+
+ CellInfo cellInfo = new CellInfo { infoInt1 = 0 };
+ for (int i = 0; i < sortedKeys.Count; i++)
+ scrLocalDayAward.AddCell(ScrollerDataType.Header, i, cellInfo);
+
+ scrLocalDayAward.Restart();
+ }
+
+ private void CreateLocalWeekScroller()
+ {
+ scrLocalWeekAward.Refresh();
+ var rewardDict = ArenaManager.Instance.GetCrossArenaAwardDict(1);
+ if (rewardDict.IsNullOrEmpty()) return;
+
+ var sortedKeys = rewardDict.Keys.ToList();
+ sortedKeys.Sort();
+
+ CellInfo cellInfo = new CellInfo { infoInt1 = 1 };
+ for (int i = 0; i < sortedKeys.Count; i++)
+ scrLocalWeekAward.AddCell(ScrollerDataType.Header, i, cellInfo);
+
+ scrLocalWeekAward.Restart();
+ }
+
+ private void CreateCrossWeekScroller()
+ {
+ scrCrossWeekAward.Refresh();
+ var rewardDict = ArenaManager.Instance.GetCrossArenaAwardDict(2);
+ if (rewardDict.IsNullOrEmpty()) return;
+
+ var sortedKeys = rewardDict.Keys.ToList();
+ sortedKeys.Sort();
+
+ CellInfo cellInfo = new CellInfo { infoInt1 = 2 };
+ for (int i = 0; i < sortedKeys.Count; i++)
+ scrCrossWeekAward.AddCell(ScrollerDataType.Header, i, cellInfo);
+
+ scrCrossWeekAward.Restart();
+ }
+
+ private void DisplayMyRank()
+ {
+ myRankCell.Display(ArenaManager.Instance.rankType, 0, valueFormat);
+ }
+}
diff --git a/Main/System/Arena/ArenaCrossAwardWin.cs.meta b/Main/System/Arena/ArenaCrossAwardWin.cs.meta
new file mode 100644
index 0000000..51535a4
--- /dev/null
+++ b/Main/System/Arena/ArenaCrossAwardWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f638d0723d6fc9347ac43f23a5a2f944
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Arena/ArenaManager.cs b/Main/System/Arena/ArenaManager.cs
index cd9cdaa..4323c33 100644
--- a/Main/System/Arena/ArenaManager.cs
+++ b/Main/System/Arena/ArenaManager.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Linq;
using UnityEngine;
using LitJson;
using System;
@@ -6,6 +7,7 @@
public class ArenaManager : GameSystemManager<ArenaManager>
{
public readonly int rankType = 1; // 姒滃崟绫诲瀷
+ public readonly int corssRankType = 151; // 姒滃崟绫诲瀷
public readonly int funcId = 27; // 鍔熻兘Id
public readonly int DeployTroopsFuncId = 31; // 甯冮樀鍔熻兘ID
public readonly int BattleChangeTabFuncId = 32; // 鎴樻枟鑳藉垏鎹㈤〉绛惧姛鑳絀D
@@ -26,6 +28,8 @@
public Dictionary<int, int[][]> dailyRankRewards; // 姣忔棩鎺掕濂栧姳 {"鍚嶆":[[鐗╁搧ID, 涓暟,鏄惁鎷嶅搧], ...], ...} 閰嶇疆鐨勫悕娆ey锛岃嚜鍔ㄦ寜灏忎簬绛変簬瀵瑰簲鍚嶆缁欏鍔�
public Dictionary<int, int[][]> seasonRankRewards; // 璧涘鎺掕濂栧姳 {"鍚嶆":[[鐗╁搧ID, 涓暟,鏄惁鎷嶅搧], ...], ...}
+ public Dictionary<int, int> crossRewardTemps;//鏁板��2锛氳法鏈嶈禌瀛f帓琛屽鍔辨ā鐗� {"浜掗�氭湇鍔″櫒鏁�";瀵瑰簲娲诲姩鎺掕濂栧姳琛ㄦā鐗堢紪鍙�, ...} 鎸夊皬浜庣瓑浜庡垽鏂紝澶т簬鏈�澶ч厤缃殑鏈嶅姟鍣ㄦ暟鏃堕粯璁ゅ彇閰嶇疆涓渶澶ф湇鍔″櫒鏁板搴斿鍔�
+ public Dictionary<int, int[][]> crossWeekRewards;
public uint score; // 褰撳墠绉垎
public int totalWinCnt; //绱鑳滃埄娆℃暟
@@ -40,18 +44,97 @@
public event Action OnArenaMatchListEvent;
public event Action OnUpdateArenaPlayerInfo;
public event Action OnUpdateGameRecInfo;
+
+ private int lastLocalWeekday; // 涓婃鏈湇weekday (1-7, 鍛ㄤ竴=1, 鍛ㄦ棩=7)
+ private int lastCrossWeekday; // 涓婃璺ㄦ湇weekday
+
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += BeforePlayerDataInitializeEventOnRelogin;
PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ CrossServerBaseManager.Instance.OnCrossZoneInfoUpdateEvent += OnCrossZoneInfoUpdate;
InitTable();
InitRedpoint();
+ InitCrossServerState();
}
public override void Release()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= BeforePlayerDataInitializeEventOnRelogin;
PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ CrossServerBaseManager.Instance.OnCrossZoneInfoUpdateEvent -= OnCrossZoneInfoUpdate;
+ }
+
+ void InitCrossServerState()
+ {
+ lastLocalWeekday = TimeUtility.GetCommonWeekday(); // zoneID=0鏈湇
+ int crossZoneID = GetCrossZoneID();
+ lastCrossWeekday = crossZoneID > 0 ? TimeUtility.GetCommonWeekday(crossZoneID) : lastLocalWeekday;
+ }
+
+ void OnSecondEvent()
+ {
+ CheckCrossWeekChange();
+ }
+
+ // 璺ㄦ湇鐘舵�佹洿鏂颁簨浠跺鐞�
+ void OnCrossZoneInfoUpdate(int mapID)
+ {
+ if (mapID != DataMapID)
+ return;
+
+ bool currentIsOpenCrossServer = IsOpenCrossServer();
+
+ // 鍙細浠庢湭璺ㄦ湇鍙樹负璺ㄦ湇锛屽彉涓鸿法鏈嶆椂鍏抽棴ArenaWin
+ if (currentIsOpenCrossServer)
+ {
+ CloseArenaWinAndClearData();
+ }
+
+ int crossZoneID = GetCrossZoneID();
+ lastCrossWeekday = crossZoneID > 0 ? TimeUtility.GetCommonWeekday(crossZoneID) : TimeUtility.GetCommonWeekday();
+ }
+
+ int GetCrossZoneID()
+ {
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(DataMapID);
+ return crossZoneInfo != null ? (int)crossZoneInfo.ZoneID : 0;
+ }
+
+ void CheckCrossWeekChange()
+ {
+ int currentLocalWeekday = TimeUtility.GetCommonWeekday(); // zoneID=0鏈湇
+ int crossZoneID = GetCrossZoneID();
+ int currentCrossWeekday = crossZoneID > 0 ? TimeUtility.GetCommonWeekday(crossZoneID) : currentLocalWeekday;
+
+ // 鏉′欢1: 鏈湇鏃堕棿杩囧懆 (weekday浠�7鍙樹负1, 鍛ㄦ棩->鍛ㄤ竴)
+ if (lastLocalWeekday == 7 && currentLocalWeekday == 1)
+ {
+ CloseArenaWinAndClearData();
+ }
+ lastLocalWeekday = currentLocalWeekday;
+
+ bool currentIsOpenCrossServer = IsOpenCrossServer();
+ if (!currentIsOpenCrossServer)
+ return;
+ // 鏉′欢2: 璺ㄦ湇鏃堕棿杩囧懆 (weekday浠�7鍙樹负1, 鍛ㄦ棩->鍛ㄤ竴)
+ if (crossZoneID > 0 && lastCrossWeekday == 7 && currentCrossWeekday == 1)
+ {
+ CloseArenaWinAndClearData();
+ }
+ lastCrossWeekday = currentCrossWeekday;
+ }
+
+ void CloseArenaWinAndClearData()
+ {
+ if (UIManager.Instance.IsOpened<ArenaWin>())
+ {
+ UIManager.Instance.CloseWindow<ArenaWin>();
+ }
+ matchInfoList.Clear();
+ gameRecDict.Clear();
}
public void BeforePlayerDataInitializeEventOnRelogin()
@@ -86,6 +169,9 @@
config = FuncConfigConfig.Get("ArenaBillboradAward");
dailyRankRewards = ConfigParse.ParseIntArray2Dict(config.Numerical1);
seasonRankRewards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
+
+ config = FuncConfigConfig.Get("ArenaCross");
+ crossRewardTemps = ConfigParse.ParseIntDict(config.Numerical2);
}
public void UpdateRedPonit()
{
@@ -141,7 +227,9 @@
RealmLV = item.RealmLV,
FightPower = (ulong)item.FightPowerEx * 100000000 + (ulong)item.FightPower,
Face = item.Face,
- FacePic = item.FacePic
+ FacePic = item.FacePic,
+ TitleID = item.TitleID,
+ ServerID = item.ServerID,
};
matchInfoList.Add(matchInfo);
allFaceInfoDict[item.PlayerID] = matchInfo;
@@ -175,6 +263,16 @@
string name = userData["Name"].ToString();
int addScore = int.Parse(userData["AddScore"].ToString());
ulong fightPower = ulong.Parse(userData["FightPower"].ToString());
+ uint serverID = 0;
+ if (userData.ContainsKey("ServerID"))
+ {
+ serverID = uint.Parse(userData["ServerID"].ToString());
+ }
+ uint cross = 0;
+ if (userData.ContainsKey("Cross"))
+ {
+ cross = uint.Parse(userData["Cross"].ToString());
+ }
var arenaGameRec = new ArenaGameRec
{
@@ -189,7 +287,9 @@
Value8 = rec.Value8,
Name = name,
AddScore = addScore,
- FightPower = fightPower
+ FightPower = fightPower,
+ ServerID = serverID,
+ Cross = cross
};
gameRecDict[recID].Add(arenaGameRec);
@@ -289,6 +389,8 @@
seasonEndDate = new DateTime(sunday.Year, sunday.Month, sunday.Day, 23, 59, 59);
}
+
+
/// <summary>
/// 鏍规嵁recID鑾峰彇鎸夋椂闂翠粠澶у埌灏忔帓搴忕殑List<ArenaGameRec>
/// </summary>
@@ -313,6 +415,99 @@
PlayerDatas.Instance.baseData.FightPower :
FightPowerManager.Instance.GetTeamFightPower(TeamManager.Instance.GetTeamID(BattlePreSetType.Arena), false);
}
+
+ public readonly int DataMapID = 3;
+ public bool IsOpenCrossServer()
+ {
+ bool isOpenCrossServer = CrossServerBaseManager.Instance.IsOpenCrossServer(DataMapID);
+ return isOpenCrossServer;
+ }
+
+ public Dictionary<int, int[][]> GetCrossArenaAwardDict(int functionOrder)
+ {
+ return functionOrder switch
+ {
+ 0 => dailyRankRewards,
+ 1 => seasonRankRewards,
+ 2 => GetCrossWeekRewards(),
+ _ => new Dictionary<int, int[][]>()
+ };
+ }
+ public Dictionary<int, int[][]> GetCrossWeekRewards()
+ {
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(DataMapID);
+ if (crossZoneInfo == null || crossZoneInfo.ServerIDList == null || crossRewardTemps.IsNullOrEmpty())
+ {
+ return new Dictionary<int, int[][]>();
+ }
+
+ int serverCount = crossZoneInfo.ServerIDList.Length;
+
+ // 鍏堝key杩涜鎺掑簭锛岄伩鍏嶉亶鍘嗛『搴忎緷璧�
+ var sortedKeys = crossRewardTemps.Keys.OrderBy(k => k).ToList();
+
+ int templateID = 0;
+ int matchedKey = 0;
+
+ foreach (var key in sortedKeys)
+ {
+ if (key <= serverCount && key >= matchedKey)
+ {
+ matchedKey = key;
+ templateID = crossRewardTemps[key];
+ }
+ }
+
+ // 濡傛灉娌℃湁鍖归厤鐨刱ey锛坰erverCount灏忎簬鎵�鏈夐厤缃殑key锛夛紝鍙栨渶灏弅ey瀵瑰簲鐨勫鍔�
+ if (templateID == 0 && sortedKeys.Count > 0)
+ {
+ var minKey = sortedKeys[0];
+ templateID = crossRewardTemps[minKey];
+ }
+
+ if (templateID == 0) return new Dictionary<int, int[][]>();
+
+ var rankList = ActBillboardAwardConfig.GetRankASortList(templateID);
+ if (rankList.IsNullOrEmpty()) return new Dictionary<int, int[][]>();
+
+ var result = new Dictionary<int, int[][]>();
+ foreach (var rankA in rankList)
+ {
+ var config = ActBillboardAwardConfig.GetConfig(templateID, rankA);
+ if (config?.AwardItemList != null)
+ {
+ result[rankA] = config.AwardItemList;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 鑾峰緱褰撳墠璧涘鐨勮捣姝㈡棩鏈燂紙璺ㄦ湇鐗堟湰锛夈�傝禌瀛d粠鍛ㄤ竴 00:00:00 寮�濮嬶紝鍒板懆鏃� 23:59:59 缁撴潫銆�
+ /// 鏈嶅姟绔畾涔夊懆涓�涓烘瘡鍛ㄧ殑绗竴澶┿��
+ /// </summary>
+ /// <param name="zoneID">璺ㄦ湇zoneID锛�0琛ㄧず鏈湇鏃堕棿锛岄潪0琛ㄧず璺ㄦ湇鏃堕棿</param>
+ /// <param name="seasonStartDate">杈撳嚭鍙傛暟锛氳禌瀛g殑璧峰鏃ユ湡锛堟湰鍛ㄤ竴 00:00:00锛�</param>
+ /// <param name="seasonEndDate">杈撳嚭鍙傛暟锛氳禌瀛g殑缁撴潫鏃ユ湡锛堟湰鍛ㄦ棩 23:59:59锛�</param>
+ public void GetCrossCurrentSeasonDates(int zoneID, out DateTime seasonStartDate, out DateTime seasonEndDate)
+ {
+ DateTime now = TimeUtility.GetCommServerNow(zoneID);
+ // 涓轰簡绗﹀悎鍛ㄤ竴鏄竴鍛ㄧ涓�澶╃殑璁$畻鏍囧噯锛屽皢鍛ㄦ棩瑙嗕负涓�鍛ㄧ殑绗�7澶┿��
+ int currentDayOfWeek = (int)now.DayOfWeek;
+ if (currentDayOfWeek == 0) // 濡傛灉鏄懆鏃� (Sunday = 0)
+ {
+ currentDayOfWeek = 7;
+ }
+ DateTime monday = now.AddDays(-(currentDayOfWeek - 1));
+ seasonStartDate = new DateTime(monday.Year, monday.Month, monday.Day, 0, 0, 0);
+ DateTime sunday = seasonStartDate.AddDays(6);
+ seasonEndDate = new DateTime(sunday.Year, sunday.Month, sunday.Day, 23, 59, 59);
+ }
+
+ public bool IsRobot(int playerID)
+ {
+ return RobotConfig.HasKey(playerID);
+ }
}
@@ -327,6 +522,7 @@
public ulong FightPower; //鎴樺姏
public uint Face; //鍩烘湰鑴稿瀷
public uint FacePic; //澶村儚妗�
+ public uint ServerID;
}
@@ -345,5 +541,7 @@
public int AddScore; //鏈鑷繁鍙樻洿鐨勭Н鍒嗭紝鏈夋璐�
public ulong FightPower; //鐩爣鎴樺姏
public int TitileId; //鏈潵鎺ュ叆
+ public uint ServerID; //瀵规墜鍖烘湇ID
+ public uint Cross; //鏄惁璺ㄦ湇璁板綍
}
\ No newline at end of file
diff --git a/Main/System/Arena/ArenaPlayerRankCell.cs b/Main/System/Arena/ArenaPlayerRankCell.cs
index 285a625..aaeec05 100644
--- a/Main/System/Arena/ArenaPlayerRankCell.cs
+++ b/Main/System/Arena/ArenaPlayerRankCell.cs
@@ -1,4 +1,3 @@
-using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
@@ -8,12 +7,23 @@
[SerializeField] Text rankText;
[SerializeField] Text rankValueText; //鎺掑悕姣旇緝鍐呭
[SerializeField] Text nameText;
+ [SerializeField] Text serverText;
[SerializeField] OfficialTitleCell officialTitleCell;
[SerializeField] Button queryPlayerBtn; //鍚庣画娣诲姞鐐瑰嚮鏌ョ湅鐜╁璇︽儏
// rank 涓�0 浠h〃鐜╁鑷繁
public void Display(int rankType, int rank, string valueFormat)
+ {
+ DisplayCross(rankType, rank, valueFormat, false);
+ }
+
+ public void DisplayCross(int rankType, int rank, string valueFormat)
+ {
+ DisplayCross(rankType, rank, valueFormat, true);
+ }
+
+ void DisplayCross(int rankType, int rank, string valueFormat, bool isCross)
{
RankData rankData = null;
int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID;
@@ -29,11 +39,11 @@
//鍙栫帺瀹惰嚜宸辩殑鏁版嵁
avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
PlayerDatas.Instance.baseData.face,
- PlayerDatas.Instance.baseData.facePic)).Forget();
+ PlayerDatas.Instance.baseData.facePic));
rankText.text = Language.Get("L1045");
rankValueText.text = ArenaManager.Instance.score.ToString();
nameText.text = PlayerDatas.Instance.baseData.PlayerName;
- officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID).Forget();
+ officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
return;
}
rank = rankData.rank;
@@ -44,20 +54,30 @@
avatarCell.SetActive(false);
nameText.text = Language.Get("L1124");
rankValueText.text = "0";//Language.Get("L1125");
+ if (serverText != null)
+ serverText.text = "";
}
else
{
viewPlayerId = (int)rankData.id;
officialTitleCell.SetActive(true);
- officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2).Forget();
+ officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
avatarCell.SetActive(true);
- avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)).Forget();
- avatarCell.SetOnLoaded(() =>
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4));
+
+ // 璺ㄦ湇鏄剧ず鏈嶅姟鍣ㄥ悕绉�
+ if (isCross && serverText != null)
{
- avatarCell.SetListener(() =>
- {
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena);
- });
+ if (ArenaManager.Instance.IsRobot((int)rankData.id))
+ serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ else
+ serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
+ }
+
+ avatarCell.SetListener(() =>
+ {
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && rankData.id != PlayerDatas.Instance.baseData.PlayerID) ? UIHelper.GetServerIDByAccount(rankData.name2) : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
nameText.text = rankData.name1;
rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue));
@@ -68,7 +88,8 @@
{
queryPlayerBtn.AddListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)BattlePreSetType.Arena);
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && viewPlayerId != PlayerDatas.Instance.baseData.PlayerID) ? UIHelper.GetServerIDByAccount(rankData.name2) : 0;
+ AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
}
}
diff --git a/Main/System/Arena/ArenaPlayerTop3Cell.cs b/Main/System/Arena/ArenaPlayerTop3Cell.cs
index 842cf2b..7ae89e0 100644
--- a/Main/System/Arena/ArenaPlayerTop3Cell.cs
+++ b/Main/System/Arena/ArenaPlayerTop3Cell.cs
@@ -1,17 +1,28 @@
-using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
+
public class ArenaPlayerTop3Cell : MonoBehaviour
{
//[SerializeField] Model 鏄剧ずNPC 姝﹀皢妯″瀷
[SerializeField] Text rankValueText; //鎺掑悕姣旇緝鍐呭
[SerializeField] Text nameText;
+ [SerializeField] Text serverText;
[SerializeField] OfficialTitleCell officialTitleCell;
[SerializeField] Button queryPlayerBtn; //鍚庣画娣诲姞鐐瑰嚮鏌ョ湅鐜╁璇︽儏
[SerializeField] HorseController model;
public void Display(int rankType, int rank, string valueFormat = "{0}")
+ {
+ DisplayCross(rankType, rank, valueFormat, false);
+ }
+
+ public void DisplayCross(int rankType, int rank, string valueFormat = "{0}")
+ {
+ DisplayCross(rankType, rank, valueFormat, true);
+ }
+
+ void DisplayCross(int rankType, int rank, string valueFormat, bool isCross)
{
var rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
if (rankData == null)
@@ -19,16 +30,28 @@
rankValueText.text = "0";//Language.Get("L1125");
nameText.text = Language.Get("L1124");
officialTitleCell.SetActive(false);
+ if (serverText != null)
+ serverText.text = "";
return;
}
officialTitleCell.SetActive(true);
rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue));
nameText.text = rankData.name1;
- officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2).Forget();
- model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, 1).Forget();
+ officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
+ model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, 1);
+
+ if (isCross && serverText != null)
+ {
+ if (ArenaManager.Instance.IsRobot((int)rankData.id))
+ serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ else
+ serverText.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(rankData.name2));
+ }
+
queryPlayerBtn.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena);
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && rankData.id != PlayerDatas.Instance.baseData.PlayerID) ? UIHelper.GetServerIDByAccount(rankData.name2) : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
}
diff --git a/Main/System/Arena/ArenaRecordCell.cs b/Main/System/Arena/ArenaRecordCell.cs
index 9484c25..f1e817b 100644
--- a/Main/System/Arena/ArenaRecordCell.cs
+++ b/Main/System/Arena/ArenaRecordCell.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using Cysharp.Threading.Tasks;
using UnityEngine;
using System;
@@ -8,6 +7,8 @@
[SerializeField] AvatarCell avatarCell;
[SerializeField] TextEx txtName;
[SerializeField] TextEx txtDate;
+ [SerializeField] TextEx txtCrossDate;
+ [SerializeField] TextEx txtServerName;
[SerializeField] TextEx txtFightPoint;
[SerializeField] TextEx txtState;
[SerializeField] TextEx txtAdd;
@@ -38,7 +39,40 @@
return;
arenaGameRec = sortedList[index];
imgType.SetSprite(arenaGameRec.Value2 == 1 ? "ArenaRecordTypeAtk" : "ArenaRecordTypeDef");
- txtDate.text = FormatTime(arenaGameRec.Time);
+
+ // 璺ㄦ湇璁板綍鏍峰紡鏄剧ず閫昏緫
+ if (ArenaManager.Instance.IsOpenCrossServer())
+ {
+ // 璺ㄦ湇鏍峰紡锛歵xtDate闅愯棌锛宼xtCrossDate鍜宼xtServerName鏄剧ず
+ txtDate.SetActive(false);
+ txtCrossDate.SetActive(true);
+ txtServerName.SetActive(true);
+
+ if (arenaGameRec.Cross == 1)
+ {
+ // 璺ㄦ湇璁板綍锛氭樉绀鸿法鏈嶆椂闂村拰璺ㄦ湇鏈嶅姟鍣�
+ txtCrossDate.text = FormatTime(arenaGameRec.Time);
+ if (ArenaManager.Instance.IsRobot((int)arenaGameRec.Value3))
+ txtServerName.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ else
+ txtServerName.text = ServerListCenter.Instance.GetServerName((int)arenaGameRec.ServerID);
+ }
+ else
+ {
+ // 鏈湇璁板綍锛氭樉绀烘湰鏈嶆椂闂村拰鏈湇鏈嶅姟鍣�
+ txtCrossDate.text = FormatTime(arenaGameRec.Time);
+ txtServerName.text = ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID));
+ }
+ }
+ else
+ {
+ // 姝e父鏍峰紡锛歵xtDate鏄剧ず锛宼xtCrossDate鍜宼xtServerName闅愯棌
+ txtDate.SetActive(true);
+ txtDate.text = FormatTime(arenaGameRec.Time);
+ txtCrossDate.SetActive(false);
+ txtServerName.SetActive(false);
+ }
+
// true 宸插け鏁� false 鏈け鏁�
bool isTimeInvalid = ArenaManager.Instance.IsTimeInvalid(arenaGameRec.Time);
// 鍙戣捣鏀诲嚮,鎵撹耽鏈夌Н鍒�,鎵撹緭娌℃湁
@@ -65,17 +99,15 @@
}
}
- avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaGameRec.Value3, (int)arenaGameRec.Value5, (int)arenaGameRec.Value6)).Forget();
- avatarCell.SetOnLoaded(() =>
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaGameRec.Value3, (int)arenaGameRec.Value5, (int)arenaGameRec.Value6));
+ avatarCell.SetListener(() =>
{
- avatarCell.SetListener(() =>
- {
- AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)BattlePreSetType.Arena);
- });
+ int serverID = (ArenaManager.Instance.IsOpenCrossServer() && arenaGameRec.Value3 != PlayerDatas.Instance.baseData.PlayerID) ? (int)arenaGameRec.ServerID : 0;
+ AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, serverID, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
txtName.text = arenaGameRec.Name;
txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaGameRec.FightPower);
- officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID, 0.55f).Forget();
+ officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID, 0.55f);
imgMoneyIcon.SetIconWithMoneyType(ArenaManager.Instance.ChallengeMoneyType);
txtNeedCount.text = ArenaManager.Instance.NeedChallengeMoneyCnt.ToString();
}
diff --git a/Main/System/Arena/ArenaWin.cs b/Main/System/Arena/ArenaWin.cs
index 2fcd521..a1d4428 100644
--- a/Main/System/Arena/ArenaWin.cs
+++ b/Main/System/Arena/ArenaWin.cs
@@ -2,10 +2,18 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
-using Cysharp.Threading.Tasks;
-public class ArenaWin : UIBase
+public class ArenaWin : FunctionsBaseWin
{
+ [SerializeField] TextEx txtTip;
+ [SerializeField] TextEx txtCrossTip;
+
+ [SerializeField] Transform transLocalRank;
+ [SerializeField] Transform transLocalButton;
+ [SerializeField] Transform transLocalCrossButton;
+ [SerializeField] ButtonEx btnCrossAward;
+ [SerializeField] Button btnFunPresetCross;
+
[SerializeField] ButtonEx btnRecord;
[SerializeField] ButtonEx btnAward;
[SerializeField] ButtonEx btnChallage;
@@ -16,7 +24,21 @@
[SerializeField] ArenaPlayerRankCell myRankCell;
[SerializeField] ArenaChallengeVoucher voucher;
[SerializeField] Button funPresetBtn;
-
+
+ //璺ㄦ湇鎺掕
+ [SerializeField] Transform transCrossRank;
+ [SerializeField] ButtonEx btnRecordCross;
+ [SerializeField] ButtonEx btnAwardCross;
+ [SerializeField] ButtonEx btnChallageCross;
+ [SerializeField] RedpointBehaviour rpChallageCross;
+ [SerializeField] List<ArenaPlayerTop3Cell> playerTop3CellsCross;
+ [SerializeField] ScrollerController scrollerControllerCross;
+ [SerializeField] ArenaPlayerRankCell myRankCellCross;
+ [SerializeField] ArenaChallengeVoucher voucherCross;
+ [SerializeField] Button funPresetBtnCross;
+ [SerializeField] Button serversBtn;
+
+
[HideInInspector] public int groupValue1 = 0; //涓�鑸敤浜庤法鏈�
[HideInInspector] public int groupValue2 = 0; //涓�鑸敤浜庤法鏈�
[HideInInspector] public string valueFormat = "{0}";
@@ -24,42 +46,162 @@
protected override void InitComponent()
{
base.InitComponent();
- btnAward.SetListener(() => UIManager.Instance.OpenWindowAsync<ArenaAwardWin>().Forget());
+ btnAward.SetListener(() =>
+ {
+ if (ArenaManager.Instance.IsOpenCrossServer())
+ UIManager.Instance.OpenWindow<ArenaCrossAwardWin>();
+ else
+ UIManager.Instance.OpenWindow<ArenaAwardWin>();
+ });
btnRecord.SetListener(() =>
{
ArenaManager.Instance.SendViewGameRecPack();
- UIManager.Instance.OpenWindowAsync<ArenaRecordWin>().Forget();
+ UIManager.Instance.OpenWindow<ArenaRecordWin>();
});
btnChallage.SetListener(() =>
{
ArenaManager.Instance.SendArenaMatch();
- UIManager.Instance.OpenWindowAsync<ArenaChallengeWin>().Forget();
+ UIManager.Instance.OpenWindow<ArenaChallengeWin>();
});
- funPresetBtn.AddListener(()=>
+ funPresetBtn.AddListener(() =>
{
FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Arena);
+ });
+ btnCrossAward.SetListener(() =>
+ {
+ if (ArenaManager.Instance.IsOpenCrossServer())
+ UIManager.Instance.OpenWindow<ArenaCrossAwardWin>();
+ else
+ UIManager.Instance.OpenWindow<ArenaAwardWin>();
+ });
+ btnFunPresetCross.AddListener(() =>
+ {
+ FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Arena);
+ });
+
+ // 璺ㄦ湇鎸夐挳鐩戝惉鍣�
+ btnAwardCross.SetListener(() =>
+ {
+ UIManager.Instance.OpenWindow<ArenaCrossAwardWin>();
+ });
+ btnRecordCross.SetListener(() =>
+ {
+ ArenaManager.Instance.SendViewGameRecPack();
+ UIManager.Instance.OpenWindow<ArenaRecordWin>();
+ });
+ btnChallageCross.SetListener(() =>
+ {
+ ArenaManager.Instance.SendArenaMatch();
+ UIManager.Instance.OpenWindow<ArenaChallengeWin>();
+ });
+ funPresetBtnCross.AddListener(() =>
+ {
+ FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Arena);
+ });
+ serversBtn.SetListener(() =>
+ {
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(ArenaManager.Instance.DataMapID);
+ if (crossZoneInfo == null) return;
+
+ var serverIDList = new List<int>(Array.ConvertAll(crossZoneInfo.ServerIDList, x => (int)x));
+
+ UIHelper.ShowServersPanel(serverIDList);
});
}
protected override void OnPreOpen()
{
- base.OnPreOpen();
- RankModel.Instance.ResetQueryParam();
- RankModel.Instance.QueryRankByPage(ArenaManager.Instance.rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
- rpChallage.redpointId = ArenaManager.Instance.GetRedPonitId(1);
-
- }
+ // 鍦╞ase.OnPreOpen()涔嬪墠璁剧疆functionOrder锛岄伩鍏嶈鐖剁被浼犲叆鍙傛暟瑕嗙洊
+ bool isOpenCrossServer = ArenaManager.Instance.IsOpenCrossServer();
+ if (isOpenCrossServer)
+ {
+ functionOrder = 1; // 璺ㄦ湇鎺掕
+ }
+ else
+ {
+ functionOrder = 0; // 鏈湇鎺掕
+ }
- protected override void NextFrameAfterOpen()
- {
+ base.OnPreOpen();
+ rpChallage.redpointId = ArenaManager.Instance.GetRedPonitId(1);
+ rpChallageCross.redpointId = ArenaManager.Instance.GetRedPonitId(1);
+
RankModel.Instance.onRankRefresh += OnRankRefresh;
scrollerController.OnRefreshCell += OnRefreshCell;
+ scrollerControllerCross.OnRefreshCell += OnRefreshCellCross;
ArenaManager.Instance.OnArenaMatchListEvent += OnArenaMatchListEvent;
ArenaManager.Instance.OnUpdateArenaPlayerInfo += OnUpdateArenaPlayerInfo;
ArenaManager.Instance.OnUpdateGameRecInfo += OnUpdateGameRecInfo;
PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
+
+ ShowRankByFunctionOrder();
+
+ txtTip.SetActive(!isOpenCrossServer);
+ txtCrossTip.SetActive(isOpenCrossServer);
+
+ for (int i = 0; i < tabButtons.Length; i++)
+ {
+ tabButtons[i].SetActive(isOpenCrossServer);
+ }
+
+ RankModel.Instance.ResetQueryParam();
+ if (isOpenCrossServer)
+ {
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(ArenaManager.Instance.DataMapID);
+ if (crossZoneInfo != null)
+ {
+ RankModel.Instance.QueryRankByPage(ArenaManager.Instance.corssRankType, groupValue1: (int)crossZoneInfo.ZoneID, crossServerID: (int)crossZoneInfo.CrossServerID, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
+ }
+ }
+ else
+ {
+ RankModel.Instance.QueryRankByPage(ArenaManager.Instance.rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
+ }
+
Display();
+ }
+
+ protected override void OpenSubUIByTabIndex()
+ {
+ ShowRankByFunctionOrder();
+ RankModel.Instance.ResetQueryParam();
+
+ // 閲嶆柊鏌ヨ瀵瑰簲鎺掕
+ bool isOpenCrossServer = ArenaManager.Instance.IsOpenCrossServer();
+ if (functionOrder == 0 && isOpenCrossServer)
+ {
+ // 鏈湇鎺掕
+ RankModel.Instance.QueryRankByPage(ArenaManager.Instance.rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
+ }
+ else if (functionOrder == 1 && isOpenCrossServer)
+ {
+ // 璺ㄦ湇鎺掕
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(ArenaManager.Instance.DataMapID);
+ if (crossZoneInfo != null)
+ {
+ RankModel.Instance.QueryRankByPage(ArenaManager.Instance.corssRankType, groupValue1: (int)crossZoneInfo.ZoneID, crossServerID: (int)crossZoneInfo.CrossServerID, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
+ }
+ }
+ }
+
+ void ShowRankByFunctionOrder()
+ {
+ if (functionOrder == 0)
+ {
+ // 鏈湇鎺掕
+ transLocalRank.SetActive(true);
+ bool isOpenCrossServer = ArenaManager.Instance.IsOpenCrossServer();
+ transLocalButton.SetActive(!isOpenCrossServer);
+ transLocalCrossButton.SetActive(isOpenCrossServer);
+ transCrossRank.SetActive(false);
+ }
+ else
+ {
+ // 璺ㄦ湇鎺掕
+ transLocalRank.SetActive(false);
+ transCrossRank.SetActive(true);
+ }
}
protected override void OnPreClose()
@@ -67,6 +209,7 @@
base.OnPreClose();
RankModel.Instance.onRankRefresh -= OnRankRefresh;
scrollerController.OnRefreshCell -= OnRefreshCell;
+ scrollerControllerCross.OnRefreshCell -= OnRefreshCellCross;
ArenaManager.Instance.OnArenaMatchListEvent -= OnArenaMatchListEvent;
ArenaManager.Instance.OnUpdateArenaPlayerInfo -= OnUpdateArenaPlayerInfo;
ArenaManager.Instance.OnUpdateGameRecInfo -= OnUpdateGameRecInfo;
@@ -103,6 +246,18 @@
RankModel.Instance.ListenRankPage(ArenaManager.Instance.rankType, cell.index, groupValue1, groupValue2);
}
+ void OnRefreshCellCross(ScrollerDataType type, CellView cell)
+ {
+
+ var crossZoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(ArenaManager.Instance.DataMapID);
+ int zoneID = crossZoneInfo != null ? (int)crossZoneInfo.ZoneID : 0;
+ int crossServerID = crossZoneInfo != null ? (int)crossZoneInfo.CrossServerID : 0;
+
+ var _cell = cell.GetComponent<ArenaPlayerRankCell>();
+ _cell.DisplayCross(ArenaManager.Instance.corssRankType, cell.index + 1, valueFormat);
+ RankModel.Instance.ListenRankPage(ArenaManager.Instance.corssRankType, cell.index, zoneID, 0, crossServerID);
+ }
+
private void OnUpdateArenaPlayerInfo()
{
Display();
@@ -127,6 +282,13 @@
DisplayDeployTroop();
funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow());
+
+ // 璺ㄦ湇鏄剧ず
+ voucherCross.Display();
+ CreateScrollerCross();
+ DisplayMyRankCross();
+ DisplayTop3Cross();
+ funPresetBtnCross.SetActive(FuncPresetManager.Instance.IsPreShow());
}
void CreateScroller()
@@ -140,9 +302,25 @@
scrollerController.Restart();
}
+ void CreateScrollerCross()
+ {
+ scrollerControllerCross.Refresh();
+ var cnt = RankModel.Instance.GetRankShowMaxCnt(ArenaManager.Instance.corssRankType);
+ for (int i = 3; i < cnt; i++)
+ {
+ scrollerControllerCross.AddCell(ScrollerDataType.Header, i);
+ }
+ scrollerControllerCross.Restart();
+ }
+
void DisplayMyRank()
{
myRankCell.Display(ArenaManager.Instance.rankType, 0, ArenaManager.Instance.score.ToString());
+ }
+
+ void DisplayMyRankCross()
+ {
+ myRankCellCross.DisplayCross(ArenaManager.Instance.corssRankType, 0, ArenaManager.Instance.score.ToString());
}
void DisplayTop3()
@@ -153,12 +331,27 @@
}
}
+ void DisplayTop3Cross()
+ {
+ for (int i = 0; i < playerTop3CellsCross.Count; i++)
+ {
+ playerTop3CellsCross[i].DisplayCross(ArenaManager.Instance.corssRankType, i + 1);
+ }
+ }
+
void OnRankRefresh(int type)
{
- if (type != ArenaManager.Instance.rankType)
- return;
- DisplayTop3();
- scrollerController.m_Scorller.RefreshActiveCellViews();
- DisplayMyRank();
+ if (type == ArenaManager.Instance.rankType)
+ {
+ DisplayTop3();
+ scrollerController.m_Scorller.RefreshActiveCellViews();
+ DisplayMyRank();
+ }
+ else if (type == ArenaManager.Instance.corssRankType)
+ {
+ DisplayTop3Cross();
+ scrollerControllerCross.m_Scorller.RefreshActiveCellViews();
+ DisplayMyRankCross();
+ }
}
}
diff --git a/Main/System/BillboardRank/PlayerRankCell.cs b/Main/System/BillboardRank/PlayerRankCell.cs
index 3ac8d4a..31ae7fe 100644
--- a/Main/System/BillboardRank/PlayerRankCell.cs
+++ b/Main/System/BillboardRank/PlayerRankCell.cs
@@ -32,6 +32,7 @@
RankData rankData = null;
int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID;
+ int sid = 0;
if (rank != 0)
{
rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
@@ -68,15 +69,17 @@
avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)).Forget();
viewPlayerId = (int)rankData.id;
nameText.text = rankData.name1;
- rankValueText.text = RankModel.Instance.GetCmpValueStr(rankType, rankData.cmpValue); ;
+ rankValueText.text = RankModel.Instance.GetCmpValueStr(rankType, rankData.cmpValue);
+ sid = UIHelper.GetServerIDByAccount(rankData.name2);
}
rankText.text = rank.ToString();
if (queryPlayerBtn != null)
{
+
queryPlayerBtn.AddListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId);
+ AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, sid);
});
}
diff --git a/Main/System/BillboardRank/PlayerTop3Cell.cs b/Main/System/BillboardRank/PlayerTop3Cell.cs
index 51027f7..a692b84 100644
--- a/Main/System/BillboardRank/PlayerTop3Cell.cs
+++ b/Main/System/BillboardRank/PlayerTop3Cell.cs
@@ -48,7 +48,7 @@
model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, rank == 1 ? 1f : 0.8f).Forget();
queryPlayerBtn.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id);
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, UIHelper.GetServerIDByAccount(rankData.name2));
});
}
diff --git a/Main/System/BillboardRank/RankModel.cs b/Main/System/BillboardRank/RankModel.cs
index c2a920e..b9b99f0 100644
--- a/Main/System/BillboardRank/RankModel.cs
+++ b/Main/System/BillboardRank/RankModel.cs
@@ -117,7 +117,7 @@
var pak = new CA130_tagCMViewBillboard();
pak.Type = (byte)type;
- pak.GroupValue1 = (byte)groupValue1;
+ pak.GroupValue1 = (uint)groupValue1;
pak.GroupValue2 = (uint)groupValue2;
pak.StartIndex = (ushort)startIndex; //鎺掑悕浠�0寮�濮�
pak.ViewCnt = (byte)count;
diff --git a/Main/System/BoneField/AdsManager.cs b/Main/System/BoneField/AdsManager.cs
index 45afd4b..439d04a 100644
--- a/Main/System/BoneField/AdsManager.cs
+++ b/Main/System/BoneField/AdsManager.cs
@@ -189,6 +189,9 @@
case 6:
SendGetReward(ADID);
break;
+ case 7:
+ SendGetReward(ADID);
+ break;
}
}
diff --git a/Main/System/CrossServer/CrossServerBaseManager.cs b/Main/System/CrossServer/CrossServerBaseManager.cs
index d08c743..147016c 100644
--- a/Main/System/CrossServer/CrossServerBaseManager.cs
+++ b/Main/System/CrossServer/CrossServerBaseManager.cs
@@ -8,6 +8,10 @@
public class CrossServerBaseManager : GameSystemManager<CrossServerBaseManager>
{
public Dictionary<int, CrossZoneInfo> crossZoneInfoDict = new Dictionary<int, CrossZoneInfo>();
+
+ // 璺ㄦ湇鐘舵�佹洿鏂颁簨浠讹紝鍙傛暟涓簃apID
+ public event Action<int> OnCrossZoneInfoUpdateEvent;
+
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize;
@@ -32,7 +36,8 @@
ServerIDList = netPack.ServerIDList,
CrossServerID = netPack.CrossServerID
};
-
+
+ OnCrossZoneInfoUpdateEvent?.Invoke((int)netPack.MapID);
}
// 娌℃湁鏁版嵁浠h〃涓嶅湪璺ㄦ湇涓紝缇よ嫳鏈変釜鐗规畩绾﹀畾zoneid绛変簬0浠h〃缁撶畻涓�
diff --git a/Main/System/FestivalActivity.meta b/Main/System/FestivalActivity.meta
new file mode 100644
index 0000000..e2902c7
--- /dev/null
+++ b/Main/System/FestivalActivity.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5533b52633741964d91069149670dd58
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs b/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs
new file mode 100644
index 0000000..7c952b4
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs
@@ -0,0 +1,92 @@
+using UnityEngine;
+
+public class FestivalActivityCheckInCell : MonoBehaviour
+{
+ [SerializeField] ButtonEx clickButton;
+ [SerializeField] ImageEx darkImage;
+ [SerializeField] ImageEx lightImage;
+ [SerializeField] TextEx dayText;
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] UIEffectPlayer[] uiEffectPlayers;
+ [SerializeField] UIEffectPlayer bgUIEffectPlayer;
+ [SerializeField] ImageEx[] haveImages;
+ [SerializeField] Transform imgMask;
+
+ FestivalActivityCheckInManager manager => FestivalActivityCheckInManager.Instance;
+
+ private int currentState;
+
+ public void Display(int templateID, int dayNum)
+ {
+ bgUIEffectPlayer.Stop();
+ for (int i = 0; i < uiEffectPlayers.Length; i++)
+ {
+ uiEffectPlayers[i].Stop();
+ }
+ for (int i = 0; i < haveImages.Length; i++)
+ {
+ haveImages[i].SetActive(false);
+ }
+
+ var config = ActSignAwardConfig.GetConfig(templateID, dayNum);
+ if (config == null) return;
+ if (config.SignAwardItemList.IsNullOrEmpty()) return;
+
+ currentState = manager.GetCheckInState(dayNum);
+ imgMask.SetActive(currentState == 2);
+ darkImage.SetActive(currentState != 1);
+ lightImage.SetActive(currentState == 1);
+
+ if (currentState == 1)
+ {
+ bgUIEffectPlayer.Play();
+ for (int i = 0; i < uiEffectPlayers.Length; i++)
+ {
+ if (i < config.SignAwardItemList.Length)
+ {
+ uiEffectPlayers[i].Play();
+ }
+ }
+ }
+
+ if (currentState == 2)
+ {
+ for (int i = 0; i < haveImages.Length; i++)
+ {
+ if (i < config.SignAwardItemList.Length)
+ {
+ haveImages[i].SetActive(true);
+ }
+ }
+ }
+
+ dayText.text = Language.Get($"SignDay{dayNum}");
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ int index = i;
+ if (i < config.SignAwardItemList.Length)
+ {
+ itemCells[i].SetActive(true);
+ itemCells[i].Init(new ItemCellModel(config.SignAwardItemList[i][0], false, config.SignAwardItemList[i][1]));
+ itemCells[i].button.AddListener(() =>
+ {
+ if (currentState == 1)
+ {
+ manager.SendGetCheckInReward();
+ }
+ else
+ {
+ ItemTipUtility.Show(config.SignAwardItemList[index][0]);
+ }
+ });
+ }
+ else
+ {
+ itemCells[i].SetActive(false);
+ }
+ }
+ clickButton.SetListener(() => manager.SendGetCheckInReward());
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs.meta
new file mode 100644
index 0000000..d20e360
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 466abe185fe4c1e4bbd404360dfe9e42
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs b/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs
new file mode 100644
index 0000000..26e4a0f
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs
@@ -0,0 +1,191 @@
+using System;
+
+public class FestivalActivityCheckInManager : GameSystemManager<FestivalActivityCheckInManager>, IOpenServerActivity
+{
+ public readonly int ActNum = 30;
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent;
+ TimeMgr.Instance.OnDayEvent += OnDayEvent;
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent;
+ TimeMgr.Instance.OnDayEvent -= OnDayEvent;
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ }
+
+ private void OnDayEvent()
+ {
+ UpdateRedPoint();
+ }
+
+ private void OnUpdateActSignInfosEvent(int arg1, int arg2)
+ {
+ UpdateRedPoint();
+ }
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj != (int)FuncOpenEnum.FestivalActivity)
+ return;
+ UpdateRedPoint();
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity;
+ public const int activityID = (int)NewDayActivityID.FestivalActivityCheckInAct;
+ public static OperationType operaType = OperationType.FestivalActivity_CheckIn;
+
+ public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint,
+ FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.CheckIn));
+
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+ public event Action<int> onStateUpdate;
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ UpdateRedPoint();
+ }
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ public void UpdateRedPoint()
+ {
+ redPoint.state = RedPointState.None;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity))
+ return;
+ if (!IsOpen)
+ return;
+
+ if (HasCheckInCanHave())
+ {
+ redPoint.state = RedPointState.Simple;
+ }
+ }
+
+ public OperationCheckInActivityInfo GetOperationCheckInInfo()
+ {
+ OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationCheckInActivityInfo act);
+ return act;
+ }
+
+ public bool GetActInfo(out OperationCheckInActivityInfo act, out ActSignConfig config)
+ {
+ config = null;
+ act = GetOperationCheckInInfo();
+ if (act == null)
+ return false;
+ config = ActSignConfig.Get(act.CfgID);
+ return config != null;
+ }
+
+ private int GetNowDayNum()
+ {
+ var act = GetOperationCheckInInfo();
+ if (act == null) return 0;
+
+ int dayNum = act.IndexOfDays(TimeUtility.ServerNow);
+ return dayNum < 0 ? 0 : dayNum + 1;
+ }
+
+ private bool IsCheckInGridUnlock(int gridDayNum)
+ {
+ int nowDayNum = GetNowDayNum();
+ if (nowDayNum <= 0) return false;
+
+ return nowDayNum >= gridDayNum;
+ }
+
+ /// <summary>
+ /// 0-鏈В閿� 1-鍙 2-宸茬
+ /// </summary>
+ public int GetCheckInState(int gridDayNum)
+ {
+ // 绛惧埌娲诲姩鐨凙ctType榛樿涓�0
+ if (GeneralActInfoManager.Instance.IsDaySigned(0, ActNum, gridDayNum)) return 2;
+ if (IsCheckInGridUnlock(gridDayNum)) return 1;
+ return 0;
+ }
+
+ public void SendGetCheckInReward()
+ {
+ // 绛惧埌娲诲姩鐨凙ctType榛樿涓�0
+ GeneralActInfoManager.Instance.SendGetSignReward(0, ActNum);
+ }
+
+ public bool HasCheckInCanHave()
+ {
+ if (!GetActInfo(out var act, out var config))
+ return false;
+
+ int templateID = config.SignTempID;
+ var list = ActSignAwardConfig.GetDayNumSortList(templateID);
+ if (list == null) return false;
+
+ for (int i = 0; i < list.Count; i++)
+ {
+ int dayNum = list[i];
+ int state = GetCheckInState(dayNum);
+ if (state == 1) return true;
+ }
+ return false;
+ }
+
+ public void GetActTimeStr(TextEx timeText, string key = "TimeRush05")
+ {
+ var act = GetOperationCheckInInfo();
+ if (act == null)
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get(key, TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs.meta b/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs.meta
new file mode 100644
index 0000000..d2fa745
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 36e836fe2fdb08041955a6e15c6346ef
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs b/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs
new file mode 100644
index 0000000..5880a8d
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs
@@ -0,0 +1,63 @@
+using UnityEngine;
+
+public class FestivalActivityCheckInWin : UIBase
+{
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] TextEx timeText;
+ [SerializeField] FestivalActivityCheckInCell[] cells;
+ FestivalActivityCheckInManager manager => FestivalActivityCheckInManager.Instance;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ }
+ protected override void OnPreOpen()
+ {
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent;
+ TimeMgr.Instance.OnDayEvent += OnDayEvent;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ Display();
+ }
+ protected override void OnPreClose()
+ {
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent;
+ TimeMgr.Instance.OnDayEvent -= OnDayEvent;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ }
+ private void OnDayEvent()
+ {
+ Display();
+ }
+ private void OnUpdateActSignInfosEvent(int arg1, int arg2)
+ {
+ Display();
+ }
+
+ private void OnSecondEvent()
+ {
+ manager.GetActTimeStr(timeText);
+ }
+ private void Display()
+ {
+ if (!manager.GetActInfo(out var act, out var config))
+ return;
+
+ int templateID = config.SignTempID;
+ var list = ActSignAwardConfig.GetDayNumSortList(templateID);
+ if (list == null) return;
+
+ for (int i = 0; i < cells.Length; i++)
+ {
+ if (i < list.Count)
+ {
+ cells[i].SetActive(true);
+ cells[i].Display(templateID, list[i]);
+ }
+ else
+ {
+ cells[i].SetActive(false);
+ }
+ }
+
+ OnSecondEvent();
+ }
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs.meta
new file mode 100644
index 0000000..c75b84e
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityCheckInWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a837dc5f21722df49bca4419569b24bb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityGiftCell.cs b/Main/System/FestivalActivity/FestivalActivityGiftCell.cs
new file mode 100644
index 0000000..c799d16
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityGiftCell.cs
@@ -0,0 +1,227 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class FestivalActivityGiftCell : MonoBehaviour
+{
+ [SerializeField] ImageEx vipImage;
+ [SerializeField] TextEx vipText;
+ [SerializeField] OutlineEx vipTextOutline;
+ [SerializeField] ImageEx rateImage;
+ [SerializeField] TextEx rateText;
+
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] TextEx titleText;
+ [SerializeField] ButtonEx buyButton;
+ [SerializeField] ImageEx buyImage;
+
+ [SerializeField] TextEx buyText;
+ [SerializeField] TextEx buyText1;
+ [SerializeField] ImageEx moneyIconImage;
+ [SerializeField] ImageEx adImage;
+ [SerializeField] TextEx limitCountText;
+ [SerializeField] ImageEx redImage;
+ FestivalActivityManager manager => FestivalActivityManager.Instance;
+ StoreModel storeModel => StoreModel.Instance;
+
+ public void Display(int index, List<FestivalActivityGiftItem> giftItems)
+ {
+ if (giftItems.IsNullOrEmpty() || index < 0 || index >= giftItems.Count) return;
+
+ FestivalActivityGiftItem item = giftItems[index];
+ if (item.type == 0)
+ {
+ DisplayStore(item.id);
+ return;
+ }
+
+ if (item.type == 1)
+ {
+ DisplayAD(item.id);
+ return;
+ }
+
+
+ DisplayCTG(item.id);
+ }
+
+ private void DisplayCTG(int ctgId)
+ {
+ redImage.SetActive(false);
+ buyText.SetActive(true);
+ buyText1.SetActive(false);
+ moneyIconImage.SetActive(false);
+ adImage.SetActive(false);
+ rateImage.SetActive(true);
+
+ if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderConfig)) return;
+ if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out var rechargeCount)) return;
+ if (!CTGConfig.HasKey(ctgId)) return;
+ if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out var rechargeItemList)) return;
+
+ CTGConfig config = CTGConfig.Get(ctgId);
+ vipImage.SetActive(config.VipLevel > 0);
+ if (config.VipLevel > 0)
+ {
+ vipImage.SetSprite($"VipLevel{config.VipLevel}");
+ vipText.text = Language.Get($"VipLevelInfo{config.VipLevel}");
+ vipText.color = InvestModel.Instance.GetTextColor(config.VipLevel);
+ vipTextOutline.OutlineColor = InvestModel.Instance.GetOutlineColor(config.VipLevel);
+ }
+
+ rateImage.SetActive(true);
+ rateText.text = Language.Get("DailySpecials07", config.Percentage);
+
+ bool isCanBuy = manager.IsCanBuy(ctgId, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt);
+ titleText.text = config.Title;
+ buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2");
+ buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale));
+ limitCountText.SetActive(!isNoLimitBuy && maxBuyCnt > 0);
+ if (!isNoLimitBuy && maxBuyCnt > 0)
+ {
+ limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(nowBuyCnt >= maxBuyCnt ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, maxBuyCnt - nowBuyCnt).ToString()));
+ }
+ buyButton.interactable = isCanBuy;
+ buyButton.SetListener(() =>
+ {
+ if (config.VipLevel > 0 && !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.PrivilegeCard))
+ {
+ SysNotifyMgr.Instance.ShowTip("MinggeAuto8");
+ return;
+ }
+ if (config.VipLevel == 1 && !InvestModel.Instance.IsInvested(InvestModel.monthCardType))
+ {
+ SysNotifyMgr.Instance.ShowTip("MinggeAuto5");
+ UIManager.Instance.OpenWindow<PrivilegeCardWin>();
+ return;
+ }
+ if (config.VipLevel == 2 && !InvestModel.Instance.IsInvested(InvestModel.foreverCardType))
+ {
+ SysNotifyMgr.Instance.ShowTip("MinggeAuto7");
+ UIManager.Instance.OpenWindow<PrivilegeCardWin>();
+ return;
+ }
+ RechargeManager.Instance.CTG(ctgId);
+ });
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < rechargeItemList.Count)
+ {
+ var itemInfo = rechargeItemList[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel((int)itemInfo.id, false, itemInfo.countEx));
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show((int)itemInfo.id);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+
+ private void DisplayStore(int id)
+ {
+ rateImage.SetActive(false);
+ vipImage.SetActive(false);
+ if (!StoreConfig.HasKey(id)) return;
+
+ StoreConfig storeConfig = StoreConfig.Get(id);
+ int remainNum;
+ storeModel.TryGetIsSellOut(storeConfig, out remainNum);
+
+ bool isFree = manager.IsFreeShop(id);
+ titleText.text = storeConfig.Name;
+
+ limitCountText.SetActive(!isFree);
+ limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, remainNum).ToString(), true));
+
+ bool isCanBuy = manager.IsNoSellOutShopID(id);
+
+ redImage.SetActive(isFree && isCanBuy);
+ buyText.SetActive(isFree || !isCanBuy);
+ buyText.text = isFree ? Language.Get("L1127") : Language.Get("storename11");
+ buyText1.SetActive(!isFree && isCanBuy);
+ buyText1.text = UIHelper.GetMoneyFormat(storeConfig.MoneyNum);
+ adImage.SetActive(false);
+ moneyIconImage.SetActive(!isFree && isCanBuy);
+ moneyIconImage.SetIconWithMoneyType(1);
+ buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2");
+ buyButton.interactable = isCanBuy;
+ buyButton.SetListener(() =>
+ {
+ storeModel.SendBuyShopItemWithPopCheck(storeConfig, 1, (int)BuyStoreItemCheckType.ActGift);
+ });
+
+ var items = storeModel.GetShopItemlistByIndex(storeConfig);
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < items.Count)
+ {
+ var itemInfo = items[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel(itemInfo.itemId, false, itemInfo.count));
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemInfo.itemId);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+
+ private void DisplayAD(int ADID)
+ {
+ rateImage.SetActive(false);
+ vipImage.SetActive(false);
+
+ ADAwardConfig config = ADAwardConfig.Get(ADID);
+ if (config == null) return;
+ bool isCanBuy = manager.IsAdAwardCanReceive(ADID);
+ int receivedCnt = AdsManager.Instance.GetADCntByADID(ADID);
+
+ titleText.text = config.Name;
+ limitCountText.SetActive(true);
+ limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(!isCanBuy ? TextColType.Red : TextColType.LightGreen, Mathf.Max(config.ADCntMax - receivedCnt, 0).ToString()));
+ redImage.SetActive(isCanBuy);
+ buyText.SetActive(false);
+ buyText1.SetActive(true);
+ buyText1.text = Language.Get("L1127");
+ moneyIconImage.SetActive(false);
+ adImage.SetActive(true);
+ adImage.gray = !isCanBuy;
+ buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2");
+ buyButton.interactable = isCanBuy;
+ buyButton.SetListener(() =>
+ {
+ AdsManager.Instance.GetAdsAward(ADID);
+ });
+
+ var items = config.ADAwardItemList;
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var itemBaisc = itemCells[i];
+ if (i < items.Length)
+ {
+ var itemInfo = items[i];
+ itemBaisc.SetActive(true);
+ itemBaisc.Init(new ItemCellModel(itemInfo[0], false, itemInfo[1]));
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemInfo[0]);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityGiftCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityGiftCell.cs.meta
new file mode 100644
index 0000000..6969ef2
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityGiftCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cce6bd2f32961ec42b60c48e47665255
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityGiftWin.cs b/Main/System/FestivalActivity/FestivalActivityGiftWin.cs
new file mode 100644
index 0000000..24be001
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityGiftWin.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class FestivalActivityGiftWin : UIBase
+{
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] TextEx timeText;
+ FestivalActivityManager manager => FestivalActivityManager.Instance;
+ StoreModel storeModel => StoreModel.Instance;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent;
+ storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
+ AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent;
+ CreateGiftScroller();
+ OnSecondEvent();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent;
+ storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
+ AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent;
+ }
+
+ private void OnAdsInfoListUpdateEvent(int arg1, int arg2, int arg3)
+ {
+ RefreshAll();
+ }
+
+ private void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<FestivalActivityGiftCell>();
+ _cell?.Display(cell.index, giftItems);
+ }
+
+ private void OnSecondEvent()
+ {
+ manager.GetActTimeStr(timeText);
+ }
+
+ private void OnRechargeCountEvent(int obj)
+ {
+ RefreshAll();
+ }
+
+ private void RefreshBuyShopLimitEvent()
+ {
+ RefreshAll();
+ }
+
+ List<FestivalActivityGiftItem> giftItems;
+ private void CreateGiftScroller()
+ {
+ giftItems = manager.GetGiftItemList(true);
+ scroller.Refresh();
+ if (!giftItems.IsNullOrEmpty())
+ {
+ for (int i = 0; i < giftItems.Count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ scroller.Restart();
+ }
+
+ void RefreshAll()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityGiftWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityGiftWin.cs.meta
new file mode 100644
index 0000000..e5aa9f3
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityGiftWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 030c0370cba35da49bde2e5b27d0c437
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityManager.cs b/Main/System/FestivalActivity/FestivalActivityManager.cs
new file mode 100644
index 0000000..1e2af89
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityManager.cs
@@ -0,0 +1,451 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class FestivalActivityManager : GameSystemManager<FestivalActivityManager>, IOpenServerActivity
+{
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent += OnUpdateActSignInfosEvent;
+ HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
+ TimeMgr.Instance.OnDayEvent += OnDayEvent;
+ AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent;
+ InitRedPointId();
+
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
+ GeneralActInfoManager.Instance.OnUpdateActSignInfosEvent -= OnUpdateActSignInfosEvent;
+ HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
+ TimeMgr.Instance.OnDayEvent -= OnDayEvent;
+ AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent;
+ }
+
+ private void OnAdsInfoListUpdateEvent(int arg1, int arg2, int arg3)
+ {
+ UpdateRedpoint();
+ }
+
+ private void OnDayEvent()
+ {
+ UpdateRedpoint();
+ }
+
+ private void OnHeroChangeEvent(HeroInfo info)
+ {
+ UpdateRedpoint();
+ }
+
+ private void OnUpdateActSignInfosEvent(int arg1, int arg2)
+ {
+ UpdateRedpoint();
+ }
+
+ private void RefreshBuyShopLimitEvent()
+ {
+ UpdateRedpoint();
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+
+ }
+
+ private void OnPlayerLoginOk()
+ {
+ TryPopWin();
+ }
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj != (int)FuncOpenEnum.HeroDebut)
+ return;
+ TryPopWin();
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity;
+ public const int activityID = (int)NewDayActivityID.FestivalActivityAct;
+ public static OperationType operaType = OperationType.FestivalActivity;
+ public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint);
+
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+ public readonly int actNum = 30;
+ public event Action<int> onStateUpdate;
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityPopWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityPopWin>();
+ if (UIManager.Instance.IsOpened<FestivalActivityWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityWin>();
+ UpdateRedpoint();
+ }
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ onStateUpdate?.Invoke(activityID);
+ TryPopWin();
+ UpdateRedpoint();
+ }
+ }
+
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ onStateUpdate?.Invoke(activityID);
+ if (UIManager.Instance.IsOpened<FestivalActivityPopWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityPopWin>();
+ if (UIManager.Instance.IsOpened<FestivalActivityWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityWin>();
+ UpdateRedpoint();
+ }
+ }
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ onStateUpdate?.Invoke(activityID);
+ UpdateRedpoint();
+ }
+ }
+
+ public OperationFlashSaleActivityInfo GetActInfo()
+ {
+ OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationFlashSaleActivityInfo act);
+ return act;
+ }
+ #region 绾㈢偣
+ public int GetRedPointId(FestivalActivityRepointType type)
+ {
+ return MainRedDot.FestivalActivityRepoint * 10 + (int)type;
+ }
+
+ public Redpoint shopRedpoint;
+ public Redpoint giftRedpoint;
+ public Redpoint rechargeRedpoint;
+ public void InitRedPointId()
+ {
+ giftRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, GetRedPointId(FestivalActivityRepointType.Gift));
+ rechargeRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, GetRedPointId(FestivalActivityRepointType.Recharge));
+ }
+
+ public void UpdateRedpoint()
+ {
+ redPoint.state = RedPointState.None;
+ giftRedpoint.state = RedPointState.None;
+
+ if (HasGiftCanHave())//绀煎寘
+ giftRedpoint.state = RedPointState.Simple;
+ }
+ #endregion
+ #region 鎷嶈劯鐣岄潰
+ public bool IsTodayPop
+ {
+ get
+ {
+ int lastPopTime = LoadPopTimeData();
+ int todayStartTime = TimeUtility.GetTodayStartTick();
+ return lastPopTime < todayStartTime;
+ }
+ }
+ private string PopTimeDataKey { get { return $"FestivalActivityManager_PopTimeData_{PlayerDatas.Instance.PlayerId}"; } }
+
+ private int LoadPopTimeData()
+ {
+ return LocalSave.GetInt(PopTimeDataKey);
+ }
+
+ public void SavePopTimeData()
+ {
+ LocalSave.SetInt(PopTimeDataKey, TimeUtility.AllSeconds);
+ }
+
+ public void ClearPopTimeData()
+ {
+ LocalSave.SetInt(PopTimeDataKey, 0);
+ }
+
+ private void TryPopWin()
+ {
+ if (!IsFestivalActivityOpen()) return;
+ if (!IsTodayPop) return;
+ if (UIManager.Instance.IsOpened<FestivalActivityPopWin>()) return;
+ if (UIManager.Instance.IsOpened<FestivalActivityWin>()) return;
+ PopupWindowsProcessor.Instance.Add("FestivalActivityPopWin");
+ }
+ #endregion
+
+
+ public void GetActTimeStr(TextEx timeText, string key = "TimeRush05")
+ {
+ var act = GetActInfo();
+ if (act == null)
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get(key, TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+
+
+
+ public Color32 ParseColor32(int[] colorArr)
+ {
+ return new Color32()
+ {
+ r = (byte)(colorArr.Length > 0 ? colorArr[0] : 0),
+ g = (byte)(colorArr.Length > 1 ? colorArr[1] : 0),
+ b = (byte)(colorArr.Length > 2 ? colorArr[2] : 0),
+ a = (byte)(colorArr.Length > 3 ? colorArr[3] : 255),
+ };
+ }
+
+ public bool IsFestivalActivityOpen()
+ {
+ if (!IsOpen) return false;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity)) return false;
+ return true;
+ }
+
+ #region 闄愭椂绀煎寘
+ public bool IsCanBuy(int ctgID, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt)
+ {
+ isNoLimitBuy = false;
+ nowBuyCnt = 0;
+ maxBuyCnt = 0;
+ CTGConfig config = CTGConfig.Get(ctgID);
+ if (config == null)
+ return false;
+ if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount))
+ return false;
+
+ // 鎵�鏈夐檺鍒堕兘涓�0鏃讹紝鏃犻檺璐拱
+ if (config.TotalBuyCount == 0 && config.DailyBuyCount == 0 &&
+ config.WeekBuyCount == 0 && config.MonthBuyCount == 0)
+ {
+ isNoLimitBuy = true;
+ return true;
+ }
+
+ // 鎸変紭鍏堢骇妫�鏌ワ細姣忔棩 > 姣忓懆 > 姣忔湀 > 鎬昏
+ if (config.DailyBuyCount > 0)
+ {
+ nowBuyCnt = rechargeCount.todayCount;
+ maxBuyCnt = config.DailyBuyCount;
+ return rechargeCount.todayCount < config.DailyBuyCount;
+ }
+ if (config.WeekBuyCount > 0)
+ {
+ nowBuyCnt = rechargeCount.weekPayCount;
+ maxBuyCnt = config.WeekBuyCount;
+ return rechargeCount.weekPayCount < config.WeekBuyCount;
+ }
+ if (config.MonthBuyCount > 0)
+ {
+ nowBuyCnt = rechargeCount.monthPayCount;
+ maxBuyCnt = config.MonthBuyCount;
+ return rechargeCount.monthPayCount < config.MonthBuyCount;
+ }
+ if (config.TotalBuyCount > 0)
+ {
+ nowBuyCnt = rechargeCount.totalCount;
+ maxBuyCnt = config.TotalBuyCount;
+ return rechargeCount.totalCount < config.TotalBuyCount;
+ }
+ return false;
+ }
+
+
+ // 鍏嶈垂鍟嗗搧
+ public bool IsFreeShop(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null) return false;
+ return config.MoneyNum == 0;
+ }
+
+ //娌″敭缃�
+ public bool IsNoSellOutShopID(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null) return false;
+
+ StoreModel.Instance.TryGetIsSellOut(config, out int remainNum);
+ return remainNum > 0;
+ }
+
+ public List<FestivalActivityGiftItem> GetGiftItemList(bool isSort = false)
+ {
+ var act = GetActInfo();
+ if (act == null) return null;
+
+ var config = ActSpecialSaleConfig.Get(act.CfgID);
+ if (config == null) return null;
+
+ List<FestivalActivityGiftItem> res = new List<FestivalActivityGiftItem>();
+
+ var list = StoreModel.Instance.storeTypeDict[config.ActShopType];
+ if (!list.IsNullOrEmpty())
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ var item = list[i];
+ if (item.storeConfig == null)
+ continue;
+ res.Add(new FestivalActivityGiftItem
+ {
+ type = 0,
+ id = item.storeConfig.ID,
+ });
+ }
+ }
+
+ var adAwardConfig = ADAwardConfig.Get(config.ADID);
+ if (adAwardConfig != null)
+ {
+ res.Add(new FestivalActivityGiftItem
+ {
+ type = 1,
+ id = config.ADID,
+ });
+ }
+
+ if (config.CTGIDList != null)
+ {
+ for (int i = 0; i < config.CTGIDList.Length; i++)
+ {
+ var item = config.CTGIDList[i];
+ res.Add(new FestivalActivityGiftItem
+ {
+ type = 2,
+ id = item,
+ });
+ }
+ }
+
+ if (isSort)
+ {
+ res = res.OrderBy(item =>
+ {
+ bool isCanBuy;
+ if (item.type == 0) // 鍟嗗簵
+ {
+ isCanBuy = IsNoSellOutShopID(item.id);
+ }
+ else if (item.type == 1) // 骞垮憡
+ {
+ isCanBuy = IsAdAwardCanReceive(item.id);
+ }
+ else // 鍏呭��
+ {
+ isCanBuy = IsCanBuy(item.id, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt);
+ }
+ return !isCanBuy;
+ })
+ .ThenBy(item => GetSortOrder(item))
+ .ThenBy(item => item.id)
+ .ToList();
+ }
+ return res;
+ }
+
+ // 骞垮憡鏄惁宸查鍙栧畬
+ public bool IsAdAwardCanReceive(int adID)
+ {
+ var config = ADAwardConfig.Get(adID);
+ if (config == null) return false;
+ int receivedCnt = AdsManager.Instance.GetADCntByADID(adID);
+ return receivedCnt < config.ADCntMax;
+ }
+
+ private int GetSortOrder(FestivalActivityGiftItem item)
+ {
+ if (item.type == 0) // 鍟嗗簵
+ {
+ return IsFreeShop(item.id) ? 0 : 2; // 鍏嶈垂=0, 鍏冨疂=2
+ }
+ if (item.type == 1) // 骞垮憡
+ {
+ return 1;
+ }
+ return 3; // RMB (type == 2)
+ }
+
+
+ public bool HasGiftCanHave()
+ {
+ var list = GetGiftItemList(false);
+ if (list.IsNullOrEmpty())
+ return false;
+
+ for (int i = 0; i < list.Count; i++)
+ {
+ var item = list[i];
+ if (item.type == 0)
+ {
+ bool isFree = IsFreeShop(item.id);
+ bool isCanBuy = IsNoSellOutShopID(item.id);
+ if (isFree && isCanBuy)
+ return true;
+ }
+ }
+
+ var act = GetActInfo();
+ if (act == null) return false;
+ var config = ActSpecialSaleConfig.Get(act.CfgID);
+ if (config == null) return false;
+ var adAwardConfig = ADAwardConfig.Get(config.ADID);
+ if (adAwardConfig == null) return false;
+
+ if (IsAdAwardCanReceive(config.ADID))
+ return true;
+ return false;
+ }
+
+ #endregion
+}
+
+public enum FestivalActivityRepointType
+{
+ CheckIn = 1,
+ Mission = 2,
+ Shop = 3,
+ Gift = 4,
+ Recharge = 5,
+ TotalRecharge = 6,
+ TotDayRecharge = 7,
+}
+
+public class FestivalActivityGiftItem
+{
+ public int type;//0 鍟嗗簵id 1 骞垮憡id 2 鍏呭�糹d
+ public int id;
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityManager.cs.meta b/Main/System/FestivalActivity/FestivalActivityManager.cs.meta
new file mode 100644
index 0000000..aae21cc
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e28bb6a585249d94eabdd1bf556d81e7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionCell.cs b/Main/System/FestivalActivity/FestivalActivityMissionCell.cs
new file mode 100644
index 0000000..b9bff06
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionCell.cs
@@ -0,0 +1,73 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+public class FestivalActivityMissionCell : CellView
+{
+ [SerializeField] Text nameText;
+ [SerializeField] Image processImg;
+ [SerializeField] Text processText;
+ [SerializeField] ItemCell[] itemCells;
+
+ [SerializeField] Button getBtn;
+ [SerializeField] Button gotoBtn;
+ [SerializeField] Transform gotRect;
+
+
+ public void Display(ActTaskTempConfig config, int taskIndex)
+ {
+ int targetValue = config.NeedValue;
+ uint curValue = FestivalActivityMissionManager.Instance.GetTaskProgress((byte)config.TaskType);
+
+ // 浣跨敤鏂扮殑璇█閿牸寮� ActTaskType{TaskType}
+ nameText.text = Language.Get($"ActTaskType{config.TaskType}", config.NeedValue);
+
+ processImg.fillAmount = Mathf.Clamp01((float)curValue / targetValue);
+ processText.text = Mathf.Min(targetValue, (int)curValue) + "/" + targetValue;
+
+ var state = FestivalActivityMissionManager.Instance.GetTaskState(config.TasklD);
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ if (i < config.AwardItemList.Length)
+ {
+ itemCells[i].SetActive(true);
+ int itemID = config.AwardItemList[i][0];
+ itemCells[i].Init(new ItemCellModel(itemID, false, config.AwardItemList[i][1]));
+ itemCells[i].button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemID);
+ });
+ }
+ else
+ {
+ itemCells[i].SetActive(false);
+ }
+ }
+
+ getBtn.SetActive(state == 1);
+ gotRect.SetActive(state == 2);
+ gotoBtn.SetActive(state == 0);
+
+ getBtn.AddListener(() =>
+ {
+ FestivalActivityMissionManager.Instance.SendGetAward(config.TasklD);
+ });
+
+ gotoBtn.AddListener(() =>
+ {
+ UIManager.Instance.CloseWindow<FestivalActivityWin>();
+
+ if (config.GuideID > 0)
+ {
+ NewBieCenter.Instance.StartNewBieGuide(config.GuideID);
+ }
+ });
+ }
+
+
+}
+
+
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityMissionCell.cs.meta
new file mode 100644
index 0000000..cac76d7
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f1170cec164834e4ab20b21cb2be5cca
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionManager.cs b/Main/System/FestivalActivity/FestivalActivityMissionManager.cs
new file mode 100644
index 0000000..d506b38
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionManager.cs
@@ -0,0 +1,471 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class FestivalActivityMissionManager : GameSystemManager<FestivalActivityMissionManager>, IOpenServerActivity
+{
+ public readonly int ActNum = 30;
+
+ // 鐜╁浠诲姟杩涘害淇℃伅 (宸紓鏇存柊瀛楀吀: 浠诲姟绫诲瀷 -> 褰撳墠浠诲姟鍊�)
+ private Dictionary<int, uint> taskProgressDict = new Dictionary<int, uint>();
+ public uint ActScoreTotal; // 绱娲诲姩绉垎锛岀敤浜庨獙璇侀鍙栫疮璁$Н鍒嗗鍔辩敤锛屽晢搴楀厬鎹㈢洿鎺ョ敤鐗╁搧鍏戞崲鐗╁搧
+ public uint ActScoreAward; // 绱娲诲姩绉垎棰嗗璁板綍锛屾寜濂栧姳绱㈠紩浣嶈繍绠楀垽鏂槸鍚﹀凡棰嗗彇
+ public byte AwardCount;
+ public uint[] AwardRecordList; // 浠诲姟ID棰嗗璁板綍鍊煎垪琛紝鏍规嵁浠诲姟ID浣嶅垽鏂槸鍚﹀凡棰嗗彇锛屼竴涓褰曞�煎瓨31浣� [璁板綍鍊�0, 璁板綍鍊�1, ...]
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ TimeMgr.Instance.OnDayEvent += OnDayEvent;
+ InitShopRedPointId();
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+ TimeMgr.Instance.OnDayEvent -= OnDayEvent;
+ }
+ private void OnDayEvent()
+ {
+ UpdateRedPoint();
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ UpdateRedPoint();
+ }
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj != (int)FuncOpenEnum.FestivalActivity)
+ return;
+ UpdateRedPoint();
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ taskProgressDict.Clear();
+ ActScoreTotal = 0;
+ ActScoreAward = 0;
+ AwardCount = 0;
+ AwardRecordList = null;
+ UpdateRedPoint();
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity;
+ public const int activityID = (int)NewDayActivityID.FestivalActivityMissionAct;
+ public static OperationType operaType = OperationType.FestivalActivity_Mission;
+
+ public Redpoint redPoint = new Redpoint(MainRedDot.FestivalActivityRepoint, FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Mission));
+
+ // 瀹炴椂鑾峰彇褰撳墠娲诲姩閰嶇疆
+ public ActTaskConfig GetCurrentConfig()
+ {
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation))
+ return null;
+ return ActTaskConfig.Get(operation.CfgID);
+ }
+
+ // 瀹炴椂鑾峰彇浠诲姟妯℃澘鍒楄〃
+ private List<ActTaskTempConfig> GetCurrentTaskList()
+ {
+ ActTaskConfig config = GetCurrentConfig();
+ if (config == null)
+ return null;
+ return ActTaskTempConfig.GetTemplateIDToConfigsDict(config.TemplateID);
+ }
+
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+ public event Action<int> onStateUpdate;
+ public event Action OnMissionDataChangeEvent;
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (type != operaType)
+ return;
+
+ if (UIManager.Instance.IsOpened<FestivalActivityMissionWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityMissionWin>();
+
+ // 瀹炴椂鑾峰彇娲诲姩閰嶇疆
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation))
+ return;
+
+ ActTaskConfig config = ActTaskConfig.Get(operation.CfgID);
+ if (config == null)
+ return;
+
+ UpdateRedPoint();
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ // 瀹炴椂鑾峰彇娲诲姩閰嶇疆
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation))
+ return;
+
+ ActTaskConfig config = ActTaskConfig.Get(operation.CfgID);
+ if (config == null)
+ return;
+
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityMissionWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityMissionWin>();
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ // 瀹炴椂鑾峰彇娲诲姩閰嶇疆
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation))
+ return;
+
+ ActTaskConfig config = ActTaskConfig.Get(operation.CfgID);
+ if (config == null)
+ return;
+
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ public void UpdateRedPoint()
+ {
+ redPoint.state = RedPointState.None;
+ if (shopRedpoint != null)
+ shopRedpoint.state = RedPointState.None;
+
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity))
+ return;
+ if (!IsOpen)
+ return;
+
+ ActTaskConfig config = GetCurrentConfig();
+ if (config == null)
+ return;
+
+ var taskList = GetCurrentTaskList();
+ if (taskList == null)
+ return;
+
+ // 妫�鏌ヤ换鍔℃槸鍚︽湁鍙鍙栫殑
+ for (int i = 0; i < taskList.Count; i++)
+ {
+ if (GetTaskState(taskList[i].TasklD) == 1)
+ {
+ redPoint.state = RedPointState.Simple;
+ break;
+ }
+ }
+
+ // 妫�鏌ョ疮璁$Н鍒嗗鍔辨槸鍚︽湁鍙鍙栫殑
+ var totalScoreAwardList = ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID);
+ for (int i = 0; i < totalScoreAwardList.Count; i++)
+ {
+ if (GetTotalScoreState(i) == 1)
+ {
+ redPoint.state = RedPointState.Simple;
+ break;
+ }
+ }
+
+ // 鍏戞崲鍟嗗簵绾㈢偣
+ if (shopRedpoint != null && ShowShopRedpoint())
+ shopRedpoint.state = RedPointState.Simple;
+ }
+
+ // 鑾峰彇浠诲姟鍒楄〃锛堟帓搴忥細1鍙鍙� > 0涓嶅彲棰嗗彇 > 2宸查鍙栵級
+ public List<ActTaskTempConfig> GetTaskConfigList()
+ {
+ var taskList = GetCurrentTaskList();
+ if (taskList == null)
+ return new List<ActTaskTempConfig>();
+
+ // 鎸変换鍔$姸鎬佹帓搴忥細1鍙鍙� > 0涓嶅彲棰嗗彇 > 2宸查鍙�
+ return taskList.OrderBy(t => GetTaskState(t.TasklD) == 2)
+ .ThenBy(t => GetTaskState(t.TasklD) == 0)
+ .ToList();
+ }
+
+ // 鑾峰彇浠诲姟鐘舵��: 0涓嶅彲棰嗗彇 1鍙鍙� 2宸查鍙�
+ public int GetTaskState(int taskId)
+ {
+ if (AwardRecordList == null)
+ return 0;
+
+ var taskList = GetCurrentTaskList();
+ if (taskList == null)
+ return 0;
+
+ // 妫�鏌ユ槸鍚﹀凡棰嗗彇
+ if (IsTaskAwardReceived(taskId))
+ return 2;
+
+ // 妫�鏌ユ槸鍚﹁揪鎴�
+ if (CanReceiveTaskAward(taskId))
+ return 1;
+
+ return 0;
+ }
+
+ // 妫�鏌ヤ换鍔″鍔辨槸鍚﹀凡棰嗗彇
+ private bool IsTaskAwardReceived(int id)
+ {
+ if (AwardRecordList == null)
+ return false;
+ var index = id / 31;
+ var bit = id % 31;
+ return (AwardRecordList[index] & (1u << bit)) != 0;
+ }
+
+ // 妫�鏌ヤ换鍔℃槸鍚﹀彲棰嗗彇
+ private bool CanReceiveTaskAward(int taskId)
+ {
+ if (taskProgressDict.Count == 0)
+ return false;
+
+ var taskList = GetCurrentTaskList();
+ if (taskList == null)
+ return false;
+
+ var config = taskList.FirstOrDefault(t => t.TasklD == taskId);
+ if (config == null)
+ return false;
+
+ uint currentValue = GetTaskProgress((byte)config.TaskType);
+ return currentValue >= (uint)config.NeedValue;
+ }
+
+ // 鑾峰彇浠诲姟褰撳墠杩涘害
+ public uint GetTaskProgress(byte taskType)
+ {
+ if (taskProgressDict.TryGetValue(taskType, out uint value))
+ return value;
+ return 0;
+ }
+
+ // 鑾峰彇浠诲姟鐩爣鍊�
+ public uint GetTaskTarget(byte taskType)
+ {
+ var taskList = GetCurrentTaskList();
+ if (taskList == null)
+ return 0;
+
+ var config = taskList.FirstOrDefault(t => t.TaskType == taskType);
+ if (config == null)
+ return 0;
+ return (uint)config.NeedValue;
+ }
+
+ // 鑾峰彇绱绉垎濂栧姳鐘舵��: 0涓嶅彲棰嗗彇 1鍙鍙� 2宸查鍙�
+ public int GetTotalScoreState(int awardIndex)
+ {
+ if (AwardRecordList == null)
+ return 0;
+
+ ActTaskConfig config = GetCurrentConfig();
+ if (config == null)
+ return 0;
+
+ var totalScoreAwardList = ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID);
+ if (awardIndex < 0 || awardIndex >= totalScoreAwardList.Count)
+ return 0;
+
+ // 妫�鏌ユ槸鍚﹀凡棰嗗彇
+ if (IsTotalScoreAwardReceived(awardIndex))
+ return 2;
+
+ // 妫�鏌ョН鍒嗘槸鍚﹁冻澶�
+ if (ActScoreTotal >= (uint)totalScoreAwardList[awardIndex].needScore)
+ return 1;
+
+ return 0;
+ }
+
+ // 妫�鏌ョ疮璁$Н鍒嗗鍔辨槸鍚﹀凡棰嗗彇
+ private bool IsTotalScoreAwardReceived(int awardIndex)
+ {
+ if (AwardRecordList == null)
+ return false;
+
+ return (ActScoreAward & (1u << awardIndex)) != 0;
+ }
+
+ // 鑾峰彇绱绉垎
+ public uint GetTotalScore()
+ {
+ return ActScoreTotal;
+ }
+
+ // 鑾峰彇绱绉垎濂栧姳鍒楄〃
+ public List<ActTaskTempConfig.TotalScoreAwardConfig> GetTotalScoreAwardList()
+ {
+ ActTaskConfig config = GetCurrentConfig();
+ if (config == null)
+ return new List<ActTaskTempConfig.TotalScoreAwardConfig>();
+ return ActTaskTempConfig.GetTotalScoreAwardListByCfgID(config.CfgID);
+ }
+
+ // 澶勭悊鐜╁浠诲姟杩涘害淇℃伅 (HAA72)
+ public void UpdatePlayerValueInfo(HAA72_tagSCActTaskPlayerValueInfo info)
+ {
+ if (ActNum != info.ActNum)
+ return;
+
+ for (int i = 0; i < info.TaskValueList.Length; i++)
+ {
+ var taskValue = info.TaskValueList[i];
+ taskProgressDict[(int)taskValue.TaskType] = taskValue.TaskValue;
+ }
+ UpdateRedPoint();
+ OnMissionDataChangeEvent?.Invoke();
+ }
+
+ // 澶勭悊鐜╁濂栧姳棰嗗彇淇℃伅 (HAA73)
+ public void UpdatePlayerInfo(HAA73_tagSCActTaskPlayerInfo info)
+ {
+ if (ActNum != info.ActNum)
+ return;
+
+ ActScoreTotal = info.ActScoreTotal;
+ ActScoreAward = info.ActScoreAward;
+ AwardCount = info.AwardCount;
+ AwardRecordList = info.AwardRecordList;
+ UpdateRedPoint();
+ OnMissionDataChangeEvent?.Invoke();
+ }
+
+ // 鍙戦�侀鍙栦换鍔″鍔�
+ public void SendGetAward(int taskId)
+ {
+ string actStr = ActNum.ToString();
+ var pack = new CA504_tagCMPlayerGetReward();
+ pack.RewardType = 71;
+ pack.DataEx = (uint)taskId;
+ pack.DataExStr = actStr;
+ pack.DataExStrLen = (byte)actStr.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ // 鍙戦�侀鍙栫疮璁$Н鍒嗗鍔�
+ public void SendGetTotalScoreAward()
+ {
+ string actStr = ActNum.ToString();
+ var pack = new CA504_tagCMPlayerGetReward();
+ pack.RewardType = 71;
+ pack.DataEx = 0; // 0琛ㄧず棰嗗彇绱绉垎濂栧姳
+ pack.DataExStr = actStr;
+ pack.DataExStrLen = (byte)actStr.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ public string GetActTimeStr()
+ {
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out OperationMissionActivityInfo operation))
+ {
+ return Language.Get("OSActivity6");
+ }
+ return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(operation.GetResetSurplusTime()));
+ }
+
+ public void GetActTimeStr(TextEx timeText, string key = "TimeRush05")
+ {
+ timeText.text = GetActTimeStr();
+ }
+
+ #region 鍏戞崲鍟嗗簵
+ private string ShopVisitTimeDataKey { get { return $"FestivalActivityMissionManager_ShopVisitTime_{PlayerDatas.Instance.PlayerId}"; } }
+
+ private int LoadShopVisitTimeData()
+ {
+ return LocalSave.GetInt(ShopVisitTimeDataKey);
+ }
+
+ public void SaveShopVisitTimeData()
+ {
+ LocalSave.SetInt(ShopVisitTimeDataKey, TimeUtility.AllSeconds);
+ }
+
+ public bool IsShopVisitedToday
+ {
+ get
+ {
+ int lastVisitTime = LoadShopVisitTimeData();
+ int todayStartTime = TimeUtility.GetTodayStartTick();
+ return lastVisitTime >= todayStartTime;
+ }
+ }
+
+ public Redpoint shopRedpoint;
+
+ public void InitShopRedPointId()
+ {
+ shopRedpoint ??= new Redpoint(MainRedDot.FestivalActivityRepoint, FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Shop));
+ }
+
+ public bool ShowShopRedpoint()
+ {
+ ActTaskConfig config = GetCurrentConfig();
+ if (config == null)
+ return false;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ActShopTypeEx, out var list) || list.IsNullOrEmpty())
+ return false;
+
+ for (int i = 0; i < list.Count; i++)
+ {
+ var item = list[i];
+ bool isFree = IsFreeShop(item.shopId);
+ bool isCanBuy = IsNoSellOutShopID(item.shopId);
+ if (isFree && isCanBuy)
+ return true;
+ }
+
+ return !IsShopVisitedToday;
+ }
+
+ public bool IsFreeShop(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null) return false;
+ return config.MoneyNum == 0;
+ }
+
+ public bool IsNoSellOutShopID(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null) return false;
+
+ StoreModel.Instance.TryGetIsSellOut(config, out int remainNum);
+ return remainNum > 0;
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionManager.cs.meta b/Main/System/FestivalActivity/FestivalActivityMissionManager.cs.meta
new file mode 100644
index 0000000..329845b
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 16ba7e2787f697440a4d3ad20ecec557
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionWin.cs b/Main/System/FestivalActivity/FestivalActivityMissionWin.cs
new file mode 100644
index 0000000..473fded
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionWin.cs
@@ -0,0 +1,157 @@
+锘�//--------------------------------------------------------
+// [Author]: 鐜╀釜娓告垙
+// [ Date ]: Tuesday, July 24, 2018
+//--------------------------------------------------------
+
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+////寮�鏈嶇洓鍏�
+public class FestivalActivityMissionWin : UIBase
+{
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] Image processImg;
+ [SerializeField] Image iconImg;
+ [SerializeField] Text galaTimeText;
+ [SerializeField] Text totalScoreText;
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] Image[] gotImgs;
+ [SerializeField] Text[] scoreTexts;
+ [SerializeField] UIEffectPlayer[] effectPlayers;
+ [SerializeField] ScrollerController scroller;
+
+ List<ActTaskTempConfig> taskConfigs = new List<ActTaskTempConfig>();
+
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ }
+ protected override void OnPreOpen()
+ {
+ FestivalActivityMissionManager.Instance.OnMissionDataChangeEvent += OnMissionDataChangeEvent;
+ GlobalTimeEvent.Instance.secondEvent += ShowTime;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ scroller.OnRefreshCell += OnRefreshCell;
+ RefreshScroller();
+ Display();
+
+ var config = FestivalActivityMissionManager.Instance.GetCurrentConfig();
+ if (config != null)
+ {
+ iconImg.SetItemSprite(config.ActScoreItemID);
+ }
+
+ }
+
+ protected override void OnPreClose()
+ {
+ FestivalActivityMissionManager.Instance.OnMissionDataChangeEvent -= OnMissionDataChangeEvent;
+ GlobalTimeEvent.Instance.secondEvent -= ShowTime;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+ void OnMissionDataChangeEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ Display();
+ }
+
+ void RefreshScroller()
+ {
+ taskConfigs = FestivalActivityMissionManager.Instance.GetTaskConfigList();
+ var count = taskConfigs.Count;
+ scroller.Refresh();
+ for (int i = 0; i < count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as FestivalActivityMissionCell;
+ _cell.Display(taskConfigs[cell.index], cell.index);
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ Display();
+ }
+
+ void Display()
+ {
+ uint totalScore = FestivalActivityMissionManager.Instance.GetTotalScore();
+ var awardList = FestivalActivityMissionManager.Instance.GetTotalScoreAwardList();
+
+ // 杩涘害鏉¤绠�
+ uint maxScore = 0;
+ if (awardList != null && awardList.Count > 0)
+ {
+ maxScore = (uint)awardList[awardList.Count - 1].needScore;
+ }
+
+ if (maxScore > 0)
+ {
+ processImg.fillAmount = Mathf.Clamp01((float)totalScore / maxScore);
+ }
+ else
+ {
+ processImg.fillAmount = 0;
+ }
+
+ ShowTime();
+ totalScoreText.text = Language.Get("FestivalActivityMissionScore", totalScore);
+
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ if (i < awardList.Count)
+ {
+ itemCells[i].SetActive(true);
+ int index = i;
+ int itemID = awardList[i].itemId;
+ itemCells[i].Init(new ItemCellModel(itemID, false, awardList[i].itemCount));
+ itemCells[i].button.AddListener(() =>
+ {
+ if (FestivalActivityMissionManager.Instance.GetTotalScoreState(index) != 1)
+ {
+ ItemTipUtility.Show(itemID);
+ return;
+ }
+
+ FestivalActivityMissionManager.Instance.SendGetTotalScoreAward();
+ });
+
+ gotImgs[i].SetActive(FestivalActivityMissionManager.Instance.GetTotalScoreState(i) == 2);
+ scoreTexts[i].text = awardList[i].needScore.ToString();
+ if (FestivalActivityMissionManager.Instance.GetTotalScoreState(i) == 1)
+ {
+ effectPlayers[i].Play();
+ }
+ else
+ {
+ effectPlayers[i].Stop();
+ }
+ }
+ else
+ {
+ itemCells[i].SetActive(false);
+ }
+ }
+ }
+
+ void ShowTime()
+ {
+ galaTimeText.text = FestivalActivityMissionManager.Instance.GetActTimeStr();
+ }
+}
+
+
+
+
diff --git a/Main/System/FestivalActivity/FestivalActivityMissionWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityMissionWin.cs.meta
new file mode 100644
index 0000000..cf25a4a
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityMissionWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8cc4efe602e822743a4ee236fcd0e3d4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityPopCell.cs b/Main/System/FestivalActivity/FestivalActivityPopCell.cs
new file mode 100644
index 0000000..e23181b
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityPopCell.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class FestivalActivityPopCell : CellView
+{
+ [SerializeField] ItemCell itemCell;
+ public void Display(int index, int[][] popItems)
+ {
+ if (popItems == null || popItems.Length <= index || index < 0)
+ return;
+ int itemID = popItems[index][0];
+ int itemCount = popItems[index][1];
+ itemCell.Init(new ItemCellModel(itemID, false, itemCount));
+ itemCell.countText.SetActive(itemCount > 1);
+ itemCell.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemID);
+ });
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityPopCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityPopCell.cs.meta
new file mode 100644
index 0000000..ce03b66
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityPopCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5698be6bce9f11240b0f8866851956f3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityPopWin.cs b/Main/System/FestivalActivity/FestivalActivityPopWin.cs
new file mode 100644
index 0000000..e72d533
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityPopWin.cs
@@ -0,0 +1,83 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+public class FestivalActivityPopWin : UIBase
+{
+ [SerializeField] TextEx timeText;
+ [SerializeField] ButtonEx goButton;
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] Toggle todayPopToggle;
+ [SerializeField] ScrollerController scroller;
+
+ FestivalActivityManager manager => FestivalActivityManager.Instance;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ goButton.SetListener(() =>
+ {
+ UIManager.Instance.CloseWindow<FestivalActivityPopWin>();
+ if (!UIManager.Instance.IsOpened<FestivalActivityWin>())
+ UIManager.Instance.OpenWindow<FestivalActivityWin>();
+ });
+ todayPopToggle.AddListener((bool value) =>
+ {
+ if (value)
+ {
+ // 鍕鹃�夛細浠婃棩涓嶅啀寮瑰嚭
+ manager.SavePopTimeData();
+ }
+ else
+ {
+ // 鍙栨秷鍕鹃�夛細浠婃棩渚濈劧鍙互寮瑰嚭锛堥噸缃椂闂磋褰曪級
+ manager.ClearPopTimeData();
+ }
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ todayPopToggle.isOn = !manager.IsTodayPop;
+ DisplayTime();
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as FestivalActivityPopCell;
+ _cell.Display(cell.index, popItems);
+ }
+ int[][] popItems;
+ void CreateScroller()
+ {
+ var act = manager.GetActInfo();
+ if (act == null)
+ return;
+ var config = ActSpecialSaleConfig.Get(act.CfgID);
+ if (config == null)
+ return;
+ popItems = config.PopItems;
+
+ scroller.Refresh();
+ if (popItems != null)
+ {
+ for (int i = 0; i < popItems.Length; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ scroller.Restart();
+ }
+
+
+ private void DisplayTime()
+ {
+ var act = manager.GetActInfo();
+ timeText.text = act == null ? string.Empty : Language.Get("FestivalActivity01", act.ToDisplayTime());
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityPopWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityPopWin.cs.meta
new file mode 100644
index 0000000..46a9073
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityPopWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6a7825299693150499da31b4f94eefbb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs b/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs
new file mode 100644
index 0000000..0dc9c0b
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs
@@ -0,0 +1,52 @@
+using System;
+using UnityEngine;
+public class FestivalActivityRechargeBaseWin : FunctionsBaseWin
+{
+ [SerializeField] TextEx timeText;
+ [SerializeField] ButtonEx closeButton;
+ FestivalActivityManager manager => FestivalActivityManager.Instance;
+ protected override void InitComponent()
+ {
+ base.InitComponent();
+ closeButton.SetListener(CloseWindow);
+ }
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ tabButtons[0].redpoint.redpointId = FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotalRecharge);
+ tabButtons[1].redpoint.redpointId = FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotDayRecharge);
+ OnSecondEvent();
+ }
+ protected override void OnPreClose()
+ {
+ base.OnPreClose();
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ }
+
+ protected override void OpenSubUIByTabIndex()
+ {
+ switch (functionOrder)
+ {
+ case 0:
+ currentSubUI = UIManager.Instance.OpenWindow<FestivalActivityRechargeTotalWin>();
+ break;
+ case 1:
+ currentSubUI = UIManager.Instance.OpenWindow<FestivalActivityRechargeTotDayWin>();
+ break;
+ }
+ }
+
+ private void OnSecondEvent()
+ {
+ var act = manager.GetActInfo();
+ if (act == null)
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+
+}
+
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs.meta
new file mode 100644
index 0000000..5eae932
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeBaseWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2ed22b2a27c50074ab0addf5fe7c945e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs
new file mode 100644
index 0000000..fc62023
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs
@@ -0,0 +1,74 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class FestivalActivityRechargeTotDayCell : CellView
+{
+ [SerializeField] Text nameText;
+ [SerializeField] Image processImage;
+ [SerializeField] Text processText;
+ [SerializeField] ItemCell[] itemCells;
+
+ [SerializeField] Button getBtn;
+ [SerializeField] Button gotoBtn;
+ [SerializeField] Transform gotRect;
+
+ FestivalActivityRechargeTotDayManager manager { get { return FestivalActivityRechargeTotDayManager.Instance; } }
+
+ public void Display(int index, List<int> list)
+ {
+ if (list.IsNullOrEmpty() || index < 0 || index >= list.Count)
+ return;
+ int awardID = list[index];
+ var config = ActTotDayRechargeTempConfig.Get(awardID);
+ if (config == null)
+ return;
+ nameText.text = Language.Get($"TotalRecharge03", config.NeedDay);
+
+ if (config.AwardItemList != null)
+ {
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var cell = itemCells[i];
+
+ if (i < config.AwardItemList.Length)
+ {
+ var item = config.AwardItemList[i];
+ cell.SetActive(true);
+ cell.Init(new ItemCellModel(item[0], false, item[1]));
+ cell.button.AddListener(() => ItemTipUtility.Show(item[0]));
+ }
+ else
+ {
+ cell.SetActive(false);
+ }
+ }
+ }
+
+ processText.text = Language.Get("BoneField09", manager.totalDays, config.NeedDay);
+ processImage.fillAmount = manager.totalDays / (float)config.NeedDay;
+
+ int state = manager.GetState(awardID);// 鑾峰彇濂栧姳鐘舵�� 0 涓嶅彲棰嗗彇 1 鏈鍙� 2 宸查鍙�
+
+ gotoBtn.SetActive(state == 0);
+ getBtn.SetActive(state == 1);
+ gotRect.SetActive(state == 2);
+
+ getBtn.SetListener(() => manager.SendGetReward(config.NeedDay));
+ gotoBtn.SetListener(() =>
+ {
+ if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true))
+ {
+ RechargeManager.Instance.selectTabIndex = 1;
+ if (UIManager.Instance.IsOpened<StoreBaseWin>())
+ {
+ UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(2);
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<StoreBaseWin>(2);
+ }
+ }
+ });
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs.meta
new file mode 100644
index 0000000..d9d58f0
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a0ea141844e14b645b403981c1b265c0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs
new file mode 100644
index 0000000..0299911
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs
@@ -0,0 +1,248 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+public class FestivalActivityRechargeTotDayManager : GameSystemManager<FestivalActivityRechargeTotDayManager>, IOpenServerActivity
+{
+ public readonly int ActNum = 30;
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ UpdateRedPoint();
+ }
+
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj != (int)FuncOpenEnum.OSGala)
+ return;
+ UpdateRedPoint();
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ totalDays = 0;
+ awardRecord = 0;
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity;
+ public const int activityID = (int)NewDayActivityID.FestivalActivityRechargeTotDayAct;
+ public static OperationType operaType = OperationType.FestivalActivity_RechargeTotDay;
+ // 鎬诲鍔�
+ public Redpoint redPoint = new Redpoint(
+ FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Recharge),
+ FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotDayRecharge));
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+ public event Action<int> onStateUpdate;
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>();
+ UpdateRedPoint();
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>();
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ public void UpdateRedPoint()
+ {
+ redPoint.state = RedPointState.None;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OSGala))
+ return;
+ if (!IsOpen)
+ return;
+
+ var awardList = GetShowList();
+ if (awardList == null)
+ return;
+ for (int i = 0; i < awardList.Count; i++)
+ {
+ if (GetState(awardList[i]) == 1)
+ {
+ redPoint.state = RedPointState.Simple;
+ return;
+ }
+ }
+
+ var storeData = GetStoreData();
+ if (storeData != null && !IsReceived(storeData.shopId))
+ {
+ redPoint.state = RedPointState.Simple;
+ }
+ }
+
+ public bool GetActInfo(out OperationTotDayRechargeInfo act, out ActTotDayRechargeConfig config)
+ {
+ config = null;
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out act) || act == null)
+ return false;
+ config = ActTotDayRechargeConfig.Get(act.CfgID);
+ return config != null;
+ }
+
+ public List<int> GetShowList(bool isSort = false)
+ {
+ if (!GetActInfo(out var act, out var config))
+ return null;
+
+ int templateID = config.TemplateID;
+ var res = new List<int>();
+
+ var awardIndexSortList = ActTotDayRechargeTempConfig.GetNeedDaySortList(templateID);
+ for (int i = 0; i < awardIndexSortList.Count; i++)
+ {
+ var tempConfig = ActTotDayRechargeTempConfig.GetConfig(templateID, awardIndexSortList[i]);
+ if (tempConfig == null)
+ continue;
+ res.Add(tempConfig.AwardID);
+ }
+
+ if (isSort)
+ {
+ res = res.OrderBy(awardId =>
+ {
+ var tempConfig = ActTotDayRechargeTempConfig.Get(awardId);
+ return IsAwardHave(tempConfig.NeedDay);
+ })
+ .ThenBy(awardId => awardId)
+ .ToList();
+
+ }
+ return res;
+ }
+
+ public bool IsCanBuyShop(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null)
+ return false;
+ StoreModel.Instance.TryGetIsSellOut(config, out int remainNum);
+ return remainNum > 0;
+ }
+
+ public StoreModel.StoreData GetStoreData()
+ {
+ if (!GetActInfo(out var act, out var config))
+ return null;
+ int actShopType = config.ActShopType;
+ if (StoreModel.Instance.storeTypeDict == null)
+ return null;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(actShopType, out var list))
+ return null;
+ if (list.IsNullOrEmpty())
+ return null;
+ return list[0];
+ }
+
+ bool IsAwardHave(int awardIndex)
+ {
+ if (awardIndex < 0 || awardIndex >= 32)
+ return false;
+ return (awardRecord & (1u << awardIndex)) != 0;
+ }
+
+ // 鑾峰彇濂栧姳鐘舵�� 0 涓嶅彲棰嗗彇 1 鏈鍙� 2 宸查鍙�
+ public int GetState(int awardID)
+ {
+ var config = ActTotDayRechargeTempConfig.Get(awardID);
+ if (config == null)
+ return 0;
+ if (totalDays < config.NeedDay)
+ return 0;
+ bool isAwardHave = IsAwardHave(config.NeedDay);
+ return isAwardHave ? 2 : 1;
+ }
+
+ public bool IsReceived(int shopId)
+ {
+ var config = StoreConfig.Get(shopId);
+ if (config == null)
+ return false;
+ int boughtCount = StoreModel.Instance.GetShopLimitBuyCount(shopId);
+ return boughtCount >= config.LimitCnt;
+ }
+
+ public string GetActTimeStr()
+ {
+ if (!GetActInfo(out var act, out var config))
+ {
+ return Language.Get("OSActivity6");
+ }
+ return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+
+ public byte totalDays; //娲诲姩绱厖澶╂暟
+ public uint awardRecord; //绱厖濂栧姳棰嗗璁板綍锛屾寜濂栧姳绱㈠紩浜岃繘鍒朵綅瀛樺偍鏄惁宸查鍙�
+ public event Action OnTotDayRechargePlayerInfoEvent;
+ public void UpdateTotDayRechargePlayerInfo(HAA1A_tagSCActTotDayRechargePlayerInfo vNetData)
+ {
+ if (ActNum != vNetData.ActNum)
+ return;
+ totalDays = vNetData.TotalDays;
+ awardRecord = vNetData.AwardRecord;
+ UpdateRedPoint();
+ OnTotDayRechargePlayerInfoEvent?.Invoke();
+ }
+
+ public void SendGetReward(int needDay)
+ {
+ string actStr = ActNum.ToString();
+ var pack = new CA504_tagCMPlayerGetReward();
+ pack.RewardType = 19;
+ pack.DataEx = (uint)needDay;
+ pack.DataExStr = actStr;
+ pack.DataExStrLen = (byte)actStr.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs.meta
new file mode 100644
index 0000000..9182328
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0625bbc16a0d77046b6393549c59b91a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs
new file mode 100644
index 0000000..e869844
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs
@@ -0,0 +1,113 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+
+//寮�鏈嶆椿鍔�-绱厖
+public class FestivalActivityRechargeTotDayWin : UIBase
+{
+ [SerializeField] ItemCell totDayRechargeItemCell;
+ [SerializeField] TextEx totDayRechargeScoreText;
+ [SerializeField] RotationTween totDayRechargeRotationTween;
+ [SerializeField] ImageEx totDayRechargeFreeRedImage;
+ [SerializeField] ImageEx totDayRechargeHaveImage;
+
+ [SerializeField] ScrollerController scroller;
+
+ FestivalActivityRechargeTotDayManager manager { get { return FestivalActivityRechargeTotDayManager.Instance; } }
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ manager.OnTotDayRechargePlayerInfoEvent += OnTotDayRechargePlayerInfoEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ CreateScroller();
+ InitRechargeData();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ manager.OnTotDayRechargePlayerInfoEvent -= OnTotDayRechargePlayerInfoEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ RefreshRechargeData();
+ }
+
+ private void OnTotDayRechargePlayerInfoEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ RefreshRechargeData();
+ }
+
+ void InitRechargeData()
+ {
+ var data = manager.GetStoreData();
+ bool isReceived = manager.IsReceived(data.shopId);
+ totDayRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt));
+ totDayRechargeItemCell.button.SetListener(() =>
+ {
+ if (!isReceived)
+ {
+ StoreModel.Instance.SendBuyShopItem(data.storeConfig, 1);
+ }
+ else
+ {
+ ItemTipUtility.Show(data.storeConfig.ItemID);
+ }
+ });
+
+ totDayRechargeHaveImage.SetActive(isReceived);
+ totDayRechargeFreeRedImage.SetActive(!isReceived);
+ totDayRechargeScoreText.text = Language.Get("TotalRecharge07", manager.totalDays);
+ if (!isReceived)
+ {
+ totDayRechargeRotationTween.Play();
+ }
+ else
+ {
+ totDayRechargeRotationTween.Stop();
+ totDayRechargeRotationTween.SetStartState();
+ }
+ }
+
+ void RefreshRechargeData()
+ {
+ var data = manager.GetStoreData();
+ bool isReceived = manager.IsReceived(data.shopId);
+ totDayRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt));
+ totDayRechargeHaveImage.SetActive(isReceived);
+ totDayRechargeFreeRedImage.SetActive(!isReceived);
+ totDayRechargeScoreText.text = Language.Get("TotalRecharge07", manager.totalDays);
+ if (!isReceived)
+ {
+ totDayRechargeRotationTween.Play();
+ }
+ else
+ {
+ totDayRechargeRotationTween.Stop();
+ totDayRechargeRotationTween.SetStartState();
+ }
+ }
+
+ List<int> showList;
+ void CreateScroller()
+ {
+ showList = manager.GetShowList(true);
+ scroller.Refresh();
+ for (int i = 0; i < showList.Count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as FestivalActivityRechargeTotDayCell;
+ _cell.Display(cell.index, showList);
+ }
+}
+
+
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs.meta
new file mode 100644
index 0000000..6ecb634
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotDayWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6f977063d346b8f4881b912d1243fbdb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs
new file mode 100644
index 0000000..bf53931
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs
@@ -0,0 +1,74 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class FestivalActivityRechargeTotalCell : CellView
+{
+ [SerializeField] Text nameText;
+ [SerializeField] Image processImage;
+ [SerializeField] Text processText;
+ [SerializeField] ItemCell[] itemCells;
+
+ [SerializeField] Button getBtn;
+ [SerializeField] Button gotoBtn;
+ [SerializeField] Transform gotRect;
+
+ FestivalActivityRechargeTotalManager manager { get { return FestivalActivityRechargeTotalManager.Instance; } }
+
+ public void Display(int index, List<int> list)
+ {
+ if (list.IsNullOrEmpty() || index < 0 || index >= list.Count)
+ return;
+ int awardID = list[index];
+ var config = ActTotalRechargeTempConfig.Get(awardID);
+ if (config == null)
+ return;
+ nameText.text = Language.Get($"TotalRecharge02", config.NeedAmount);
+
+ if (config.AwardItemList != null)
+ {
+ for (int i = 0; i < itemCells.Length; i++)
+ {
+ var cell = itemCells[i];
+
+ if (i < config.AwardItemList.Length)
+ {
+ var item = config.AwardItemList[i];
+ cell.SetActive(true);
+ cell.Init(new ItemCellModel(item[0], false, item[1]));
+ cell.button.AddListener(() => ItemTipUtility.Show(item[0]));
+ }
+ else
+ {
+ cell.SetActive(false);
+ }
+ }
+ }
+
+ processText.text = Language.Get("BoneField09", manager.coinTotal, config.NeedAmount);
+ processImage.fillAmount = manager.coinTotal / (float)config.NeedAmount;
+
+ int state = manager.GetState(awardID);// 鑾峰彇濂栧姳鐘舵�� 0 涓嶅彲棰嗗彇 1 鏈鍙� 2 宸查鍙�
+
+ gotoBtn.SetActive(state == 0);
+ getBtn.SetActive(state == 1);
+ gotRect.SetActive(state == 2);
+
+ getBtn.SetListener(() => manager.SendGetReward(config.AwardIndex));
+ gotoBtn.SetListener(() =>
+ {
+ if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge, true))
+ {
+ RechargeManager.Instance.selectTabIndex = 1;
+ if (UIManager.Instance.IsOpened<StoreBaseWin>())
+ {
+ UIManager.Instance.GetUI<StoreBaseWin>().ClickFuncBtn(2);
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<StoreBaseWin>(2);
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs.meta
new file mode 100644
index 0000000..a883fc6
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 57f1d393b81fe04409bfc2fd5e5ecebc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs
new file mode 100644
index 0000000..70fc403
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs
@@ -0,0 +1,249 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+public class FestivalActivityRechargeTotalManager : GameSystemManager<FestivalActivityRechargeTotalManager>, IOpenServerActivity
+{
+ public readonly int ActNum = 30;
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
+ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
+ OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ UpdateRedPoint();
+ }
+
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj != (int)FuncOpenEnum.FestivalActivity)
+ return;
+ UpdateRedPoint();
+ }
+
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ coinTotal = 0;
+ awardRecord = 0;
+ }
+
+ public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_DateActivity;
+ public const int activityID = (int)NewDayActivityID.FestivalActivityRechargeTotalAct;
+ public static OperationType operaType = OperationType.FestivalActivity_RechargeTotal;
+ // 鎬诲鍔�
+ public Redpoint redPoint = new Redpoint(
+ FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.Recharge),
+ FestivalActivityManager.Instance.GetRedPointId(FestivalActivityRepointType.TotalRecharge));
+ public bool IsOpen => OperationTimeHepler.Instance.SatisfyOpenCondition(operaType);
+ public bool IsAdvance => OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType);
+ public bool priorityOpen => redPoint.state == RedPointState.Simple;
+ public event Action<int> onStateUpdate;
+
+ private void OperationTimeUpdateEvent(OperationType type)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>();
+ UpdateRedPoint();
+ }
+
+ private void OperationStartEvent(OperationType type, int state)
+ {
+ if (type == operaType && state == 0)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationEndEvent(OperationType type, int state)
+ {
+ if (type == operaType)
+ {
+ if (UIManager.Instance.IsOpened<FestivalActivityRechargeBaseWin>())
+ UIManager.Instance.CloseWindow<FestivalActivityRechargeBaseWin>();
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ private void OperationAdvanceEvent(OperationType type)
+ {
+ if (type == operaType)
+ {
+ UpdateRedPoint();
+ onStateUpdate?.Invoke(activityID);
+ }
+ }
+
+ public void UpdateRedPoint()
+ {
+ redPoint.state = RedPointState.None;
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.FestivalActivity))
+ return;
+ if (!IsOpen)
+ return;
+
+ var awardList = GetShowList();
+ if (awardList == null)
+ return;
+ for (int i = 0; i < awardList.Count; i++)
+ {
+ if (GetState(awardList[i]) == 1)
+ {
+ redPoint.state = RedPointState.Simple;
+ return;
+ }
+ }
+
+ var storeData = GetStoreData();
+ if (storeData != null && !IsReceived(storeData.shopId))
+ {
+ redPoint.state = RedPointState.Simple;
+ }
+ }
+ public bool GetActInfo(out OperationTotalRechargeInfo act, out ActTotalRechargeConfig config)
+ {
+ config = null;
+ if (!OperationTimeHepler.Instance.TryGetOperation(operaType, out act) || act == null)
+ return false;
+ config = ActTotalRechargeConfig.Get(act.CfgID);
+ return config != null;
+ }
+
+ public List<int> GetShowList(bool isSort = false)
+ {
+ if (!GetActInfo(out var act, out var config))
+ return null;
+
+ int ctgTempID = config.CTGTempID;
+ int ctgShopType = config.CTGShopType;
+ var res = new List<int>();
+
+ var awardIndexSortList = ActTotalRechargeTempConfig.GetAwardIndexSortList(ctgTempID);
+ for (int i = 0; i < awardIndexSortList.Count; i++)
+ {
+ var tempConfig = ActTotalRechargeTempConfig.GetConfig(ctgTempID, awardIndexSortList[i]);
+ if (tempConfig == null)
+ continue;
+ res.Add(tempConfig.AwardID);
+ }
+
+ if (isSort)
+ {
+ res = res.OrderBy(awardId =>
+ {
+ var tempConfig = ActTotalRechargeTempConfig.Get(awardId);
+ return IsAwardHave(tempConfig.AwardIndex);
+ })
+ .ThenBy(awardId => awardId)
+ .ToList();
+
+ }
+ return res;
+ }
+
+ public bool IsCanBuyShop(int shopID)
+ {
+ StoreConfig config = StoreConfig.Get(shopID);
+ if (config == null)
+ return false;
+ StoreModel.Instance.TryGetIsSellOut(config, out int remainNum);
+ return remainNum > 0;
+ }
+
+ public StoreModel.StoreData GetStoreData()
+ {
+ if (!GetActInfo(out var act, out var config))
+ return null;
+ int ctgShopType = config.CTGShopType;
+ if (StoreModel.Instance.storeTypeDict == null)
+ return null;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(ctgShopType, out var list))
+ return null;
+ if (list.IsNullOrEmpty())
+ return null;
+ return list[0];
+ }
+
+ public float coinTotal; //娲诲姩绱鍏呭�奸coin鍊�
+ public uint awardRecord; //绱厖濂栧姳棰嗗璁板綍锛屾寜濂栧姳绱㈠紩浜岃繘鍒朵綅瀛樺偍鏄惁宸查鍙�
+ public event Action OnTotalRechargePlayerInfoEvent;
+ public void UpdateTotalRechargePlayerInfo(HAA1C_tagSCActTotalRechargePlayerInfo vNetData)
+ {
+ if (ActNum != vNetData.ActNum)
+ return;
+ coinTotal = (float)vNetData.CoinTotal / (float)100;
+ awardRecord = vNetData.AwardRecord;
+ UpdateRedPoint();
+ OnTotalRechargePlayerInfoEvent?.Invoke();
+ }
+
+ bool IsAwardHave(int awardIndex)
+ {
+ if (awardIndex < 0 || awardIndex >= 32)
+ return false;
+ return (awardRecord & (1u << awardIndex)) != 0;
+ }
+
+ // 鑾峰彇濂栧姳鐘舵�� 0 涓嶅彲棰嗗彇 1 鏈鍙� 2 宸查鍙�
+ public int GetState(int awardID)
+ {
+ var config = ActTotalRechargeTempConfig.Get(awardID);
+ if (config == null)
+ return 0;
+ if (coinTotal < config.NeedAmount)
+ return 0;
+ bool isAwardHave = IsAwardHave(config.AwardIndex);
+ return isAwardHave ? 2 : 1;
+ }
+
+ public bool IsReceived(int shopId)
+ {
+ var config = StoreConfig.Get(shopId);
+ if (config == null)
+ return false;
+ int boughtCount = StoreModel.Instance.GetShopLimitBuyCount(shopId);
+ return boughtCount >= config.LimitCnt;
+ }
+
+ public string GetActTimeStr()
+ {
+ if (!GetActInfo(out var act, out var config))
+ {
+ return Language.Get("OSActivity6");
+ }
+ return Language.Get("TotalRecharge08", TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+
+ public void SendGetReward(int awardIndex)
+ {
+ string actStr = ActNum.ToString();
+ var pack = new CA504_tagCMPlayerGetReward();
+ pack.RewardType = 18;
+ pack.DataEx = (uint)awardIndex;
+ pack.DataExStr = actStr;
+ pack.DataExStrLen = (byte)actStr.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs.meta
new file mode 100644
index 0000000..b849b79
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bcf0ceb7f1a7c8245afc8842e15ce2a3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs b/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs
new file mode 100644
index 0000000..3c2734b
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs
@@ -0,0 +1,118 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class FestivalActivityRechargeTotalWin : UIBase
+{
+ [SerializeField] ItemCell totalRechargeItemCell;
+ [SerializeField] TextEx totalRechargeScoreText;
+ [SerializeField] RotationTween totalRechargeRotationTween;
+ [SerializeField] ImageEx totalRechargeFreeRedImage;
+ [SerializeField] ImageEx totalRechargeHaveImage;
+ [SerializeField] ScrollerController scroller;
+
+ FestivalActivityRechargeTotalManager manager { get { return FestivalActivityRechargeTotalManager.Instance; } }
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ manager.OnTotalRechargePlayerInfoEvent += OnTotalRechargePlayerInfoEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += OnRefreshBuyShopLimitEvent;
+ CreateScroller();
+ InitRechargeData();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ manager.OnTotalRechargePlayerInfoEvent -= OnTotalRechargePlayerInfoEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= OnRefreshBuyShopLimitEvent;
+ }
+
+ private void OnRefreshBuyShopLimitEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ RefreshRechargeData();
+ }
+
+ private void OnTotalRechargePlayerInfoEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ RefreshRechargeData();
+ }
+
+ void InitRechargeData()
+ {
+ var data = manager.GetStoreData();
+ bool isReceived = manager.IsReceived(data.shopId);
+ totalRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt));
+ totalRechargeItemCell.button.SetListener(() =>
+ {
+ if (!isReceived)
+ {
+ StoreModel.Instance.SendBuyShopItem(data.storeConfig, 1);
+ }
+ else
+ {
+ ItemTipUtility.Show(data.storeConfig.ItemID);
+ }
+ });
+
+ totalRechargeHaveImage.SetActive(isReceived);
+ totalRechargeFreeRedImage.SetActive(!isReceived);
+ totalRechargeScoreText.text = Language.Get("TotalRecharge06", manager.coinTotal);
+ if (!isReceived)
+ {
+ totalRechargeRotationTween.Play();
+ }
+ else
+ {
+ totalRechargeRotationTween.Stop();
+ totalRechargeRotationTween.SetStartState();
+ }
+ }
+
+ void RefreshRechargeData()
+ {
+ var data = manager.GetStoreData();
+ bool isReceived = manager.IsReceived(data.shopId);
+ totalRechargeItemCell.Init(new ItemCellModel(data.storeConfig.ItemID, false, data.storeConfig.ItemCnt));
+ totalRechargeHaveImage.SetActive(isReceived);
+ totalRechargeFreeRedImage.SetActive(!isReceived);
+ totalRechargeScoreText.text = Language.Get("TotalRecharge06", manager.coinTotal);
+ if (!isReceived)
+ {
+ totalRechargeRotationTween.Play();
+ }
+ else
+ {
+ totalRechargeRotationTween.Stop();
+ totalRechargeRotationTween.SetStartState();
+ }
+ }
+
+
+
+ List<int> showList;
+ void CreateScroller()
+ {
+
+ showList = manager.GetShowList(true);
+ scroller.Refresh();
+ for (int i = 0; i < showList.Count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as FestivalActivityRechargeTotalCell;
+ _cell.Display(cell.index, showList);
+ }
+}
+
+
+
+
diff --git a/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs.meta
new file mode 100644
index 0000000..dec0bac
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityRechargeTotalWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1a033d0838bfdfb468b0885f494be34b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityShopCell.cs b/Main/System/FestivalActivity/FestivalActivityShopCell.cs
new file mode 100644
index 0000000..8f84f84
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopCell.cs
@@ -0,0 +1,132 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+public class FestivalActivityShopCell : MonoBehaviour
+{
+ [SerializeField] Transform saleRect;
+ [SerializeField] Text saleText;
+ [SerializeField] Text itemName;
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text limitText;
+ [SerializeField] Text lockTip;
+
+ [SerializeField] Transform priceRect;
+ [SerializeField] Image priceIcon;
+ [SerializeField] Text priceText;
+
+ [SerializeField] Transform priceRect1;//灞呬腑浣嶇疆鐨勪环鏍�
+ [SerializeField] Image priceIcon1;
+ [SerializeField] Text priceText1;
+
+ [SerializeField] Transform salePriceRect;
+ [SerializeField] Text salePriceText;
+ [SerializeField] Button buyButton;
+ [SerializeField] Image freeRedPoint;
+ [SerializeField] Text freeText;
+ [SerializeField] Image exclusiveImage;//涓撳睘
+ [SerializeField] Image sellOutImage;//鍞絼
+ FestivalActivityMissionManager manager => FestivalActivityMissionManager.Instance;
+ public void Display(int index)
+ {
+ ActTaskConfig config = manager.GetCurrentConfig();
+ if (config == null)
+ return;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ActShopTypeEx, out var list))
+ return;
+
+ var storeData = list[index];
+ int shopID = storeData.shopId;
+ var itemID = storeData.storeConfig.ItemID;
+ var itemCount = storeData.storeConfig.ItemCnt;
+ exclusiveImage.SetActive(storeData.storeConfig.IsExclusive == 1);
+ itemCell.Init(new ItemCellModel(itemID, false, itemCount));
+ itemCell.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemID);
+ });
+ var itemConfig = ItemConfig.Get(itemID);
+ itemName.text = itemConfig.ItemName;
+
+ //鎶樻墸
+ if (storeData.storeConfig.MoneyOriginal != 0)
+ {
+ saleRect.SetActive(true);
+ saleText.text = Language.Get("storename5", (storeData.storeConfig.MoneyNum * 10 / (float)storeData.storeConfig.MoneyOriginal).ToString("0.#"));
+ }
+ else
+ {
+ saleRect.SetActive(false);
+ }
+
+
+ var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(shopID);
+ string limitStr = "";
+ if (storeData.storeConfig.MoneyNum == 0)
+ {
+ //鍏嶈垂
+ limitStr = "";
+ }
+ else if (storeData.storeConfig.ResetType == 0)
+ {
+ //闄愯喘
+ limitStr = storeData.storeConfig.LimitCnt > 0 ? Language.Get("storename8", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt) : "";
+ }
+ else if (storeData.storeConfig.ResetType == 1)
+ {
+ //姣忔棩闄愯喘
+ limitStr = Language.Get("storename6", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt);
+ }
+ else if (storeData.storeConfig.ResetType == 2)
+ {
+ //姣忓懆闄愯喘
+ limitStr = Language.Get("storename7", storeData.storeConfig.LimitCnt - buyCnt, storeData.storeConfig.LimitCnt);
+ }
+
+ limitText.text = buyCnt >= storeData.storeConfig.LimitCnt ? UIHelper.AppendColor(TextColType.Gray, limitStr) : limitStr;
+ buyButton.AddListener(() => { BuyGoods(shopID); });
+
+
+ //0鍙喘涔� 1宸插敭缃� 2鍏嶈垂 3鏈В閿�
+ var state = StoreModel.Instance.GetShopIDState(shopID);
+ sellOutImage.SetActive(state == 1);
+ freeRedPoint.SetActive(state == 2);
+ lockTip.text = state == 3 ? Language.Get("storename10", storeData.storeConfig.UnlockValue) : string.Empty;
+
+ priceRect.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal != 0);
+ priceRect1.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal == 0);
+ freeText.SetActive(state == 2 || (state == 1 && storeData.storeConfig.MoneyOriginal == 0));
+ salePriceRect.SetActive((state == 0 || state == 3) && storeData.storeConfig.MoneyOriginal != 0);
+
+ priceText.text = storeData.storeConfig.MoneyNum.ToString();
+ priceText1.text = storeData.storeConfig.MoneyNum.ToString();
+
+ if (storeData.storeConfig.MoneyType <= 0)
+ {
+ priceIcon.SetItemSprite(storeData.storeConfig.CostItemID);
+ priceIcon1.SetItemSprite(storeData.storeConfig.CostItemID);
+ }
+ else
+ {
+ priceIcon.SetIconWithMoneyType(storeData.storeConfig.MoneyType);
+ priceIcon1.SetIconWithMoneyType(storeData.storeConfig.MoneyType);
+ }
+
+ salePriceText.text = storeData.storeConfig.MoneyOriginal.ToString();
+ }
+
+ void BuyGoods(int shopID)
+ {
+ var state = StoreModel.Instance.GetShopIDState(shopID);
+ if (state == 1) return;
+
+ if (state == 2)
+ {
+ StoreModel.Instance.SendBuyShopItem(StoreConfig.Get(shopID), 1);
+ }
+ else
+ {
+ StoreModel.Instance.buyShopID = shopID;
+ UIManager.Instance.OpenWindow<BuyItemWin>();
+ }
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityShopCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityShopCell.cs.meta
new file mode 100644
index 0000000..ea05fa0
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1ab9f2879e44d2a42ab352d11f5254fd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs b/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs
new file mode 100644
index 0000000..b2875ac
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs
@@ -0,0 +1,28 @@
+锘縰sing UnityEngine;
+
+public class FestivalActivityShopLineCell : CellView
+{
+ [SerializeField] FestivalActivityShopCell[] storeCells;
+ FestivalActivityMissionManager manager => FestivalActivityMissionManager.Instance;
+ public void Display(int index)
+ {
+ ActTaskConfig config = manager.GetCurrentConfig();
+ if (config == null)
+ return;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ActShopTypeEx, out var list))
+ return;
+
+ for (int i = 0; i < storeCells.Length; i++)
+ {
+ if (index + i < list.Count)
+ {
+ storeCells[i].SetActive(true);
+ storeCells[i].Display(index + i);
+ }
+ else
+ {
+ storeCells[i].SetActive(false);
+ }
+ }
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs.meta b/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs.meta
new file mode 100644
index 0000000..65e034b
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopLineCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6bd33c42e26241b47987559017eaa303
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityShopWin.cs b/Main/System/FestivalActivity/FestivalActivityShopWin.cs
new file mode 100644
index 0000000..94441db
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopWin.cs
@@ -0,0 +1,83 @@
+using UnityEngine;
+
+public class FestivalActivityShopWin : UIBase
+{
+ [SerializeField] OwnItemCell ownItemCell;
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] TextEx timeText;
+ [SerializeField] ScrollerController scroller;
+ FestivalActivityMissionManager manager => FestivalActivityMissionManager.Instance;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(CloseWindow);
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ StoreModel.Instance.RefreshShopEvent += CreateScroller;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += CreateScroller;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ if (!manager.IsShopVisitedToday)
+ {
+ manager.SaveShopVisitTimeData();
+ manager.UpdateRedPoint();
+ }
+
+ ActTaskConfig config = manager.GetCurrentConfig();
+ if (config == null)
+ return;
+
+ ownItemCell.itemID = config.ActScoreItemID;
+
+ CreateScroller();
+ OnSecondEvent();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ StoreModel.Instance.RefreshShopEvent -= CreateScroller;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= CreateScroller;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ StoreModel.Instance.selectStoreFuncType = StoreFunc.Normal;
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as FestivalActivityShopLineCell;
+ _cell.Display(cell.index);
+ }
+
+ private void OnSecondEvent()
+ {
+ if (!OperationTimeHepler.Instance.TryGetOperation(OperationType.FestivalActivity_Mission, out OperationMissionActivityInfo operation))
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get("TimeRush05", TimeUtility.SecondsToShortDHMS(operation.GetResetSurplusTime()));
+ }
+
+ void CreateScroller()
+ {
+ ActTaskConfig config = manager.GetCurrentConfig();
+ if (config == null)
+ return;
+ if (!StoreModel.Instance.storeTypeDict.TryGetValue(config.ActShopTypeEx, out var list))
+ return;
+
+ scroller.Refresh();
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (i % 3 == 0)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+
+ scroller.Restart();
+ scroller.lockType = EnhanceLockType.KeepVertical;
+ }
+
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityShopWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityShopWin.cs.meta
new file mode 100644
index 0000000..9348df8
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityShopWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f29a66f9d8794c342bce21767d912ecd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/FestivalActivityWin.cs b/Main/System/FestivalActivity/FestivalActivityWin.cs
new file mode 100644
index 0000000..235fb47
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityWin.cs
@@ -0,0 +1,79 @@
+using UnityEngine;
+public class FestivalActivityWin : UIBase
+{
+ [SerializeField] ImageEx bgImage;
+ [SerializeField] TextEx timeText;
+
+ [SerializeField] ButtonEx closeButton;
+ [SerializeField] ButtonEx checkInButton;
+ [SerializeField] ButtonEx missionButton;
+ [SerializeField] ButtonEx shopButton;
+ [SerializeField] ButtonEx giftButton;
+ [SerializeField] ButtonEx rechargeButton;
+ [SerializeField] ButtonEx previewButton;
+
+ [SerializeField] RedpointBehaviour checkInRedpoint;
+ [SerializeField] RedpointBehaviour missionRedpoint;
+ [SerializeField] RedpointBehaviour shopRedpoint;
+ [SerializeField] RedpointBehaviour giftRedpoint;
+ [SerializeField] RedpointBehaviour rechargeRedpoint;
+
+ FestivalActivityManager manager => FestivalActivityManager.Instance;
+ protected override void InitComponent()
+ {
+ closeButton.SetListener(() => UIManager.Instance.CloseWindow<FestivalActivityWin>());
+ checkInButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityCheckInWin>());
+ missionButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityMissionWin>());
+ shopButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityShopWin>());
+ giftButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityGiftWin>());
+ rechargeButton.SetListener(() => UIManager.Instance.OpenWindow<FestivalActivityRechargeBaseWin>());
+ }
+
+ protected override void OnPreOpen()
+ {
+ InitRedpoint();
+
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent += Display;
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent;
+ StoreModel.Instance.RefreshBuyShopLimitEvent -= Display;
+ }
+
+ private void OnRechargeCountEvent(int obj)
+ {
+ Display();
+ }
+
+ public void InitRedpoint()
+ {
+ checkInRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.CheckIn);
+ missionRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Mission);
+ shopRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Shop);
+ giftRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Gift);
+ rechargeRedpoint.redpointId = manager.GetRedPointId(FestivalActivityRepointType.Recharge);
+ }
+
+ private void Display()
+ {
+
+ OnSecondEvent();
+ }
+
+ private void OnSecondEvent()
+ {
+ var act = manager.GetActInfo();
+ if (act == null)
+ {
+ timeText.text = Language.Get("OSActivity6");
+ return;
+ }
+ timeText.text = Language.Get("FestivalActivity02", act.ToDisplayTimeEx(), TimeUtility.SecondsToShortDHMS(act.GetResetSurplusTime()));
+ }
+}
diff --git a/Main/System/FestivalActivity/FestivalActivityWin.cs.meta b/Main/System/FestivalActivity/FestivalActivityWin.cs.meta
new file mode 100644
index 0000000..0fc9230
--- /dev/null
+++ b/Main/System/FestivalActivity/FestivalActivityWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bd54e7e15919c3a409eab1cb99dbfab5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs b/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs
new file mode 100644
index 0000000..8ffb16c
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs
@@ -0,0 +1,23 @@
+
+public class OperationCheckInActivityInfo : OperationBase
+{
+ public int ActType; // 娲诲姩绫诲瀷锛岀敤浜庡叧鑱旀椿鍔ㄧ浉鍏虫ā鍧楃敤锛屽绛惧埌銆佷换鍔$瓑
+ public int CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public override string ToDisplayTime()
+ {
+ var textBuilder = OperationTimeHepler.textBuilder;
+ textBuilder.Length = 0;
+ textBuilder.Append(startDate.ToDisplay(false));
+ textBuilder.Append(" 00:00:00");
+ if (startDate != endDate)
+ {
+ textBuilder.Append("-");
+ textBuilder.Append(endDate.ToDisplay(false));
+ textBuilder.Append(" 23:59:59");
+ }
+ return textBuilder.ToString();
+ }
+
+
+}
diff --git a/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs.meta b/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs.meta
new file mode 100644
index 0000000..03843ac
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationCheckInActivityInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: df08f6c5862454d4c8a24d44af3a84f0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs b/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs
new file mode 100644
index 0000000..195114a
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs
@@ -0,0 +1,34 @@
+
+public class OperationFlashSaleActivityInfo : OperationBase
+{
+ public int ActType; // 娲诲姩绫诲瀷锛岀敤浜庡叧鑱旀椿鍔ㄧ浉鍏虫ā鍧楃敤锛屽绛惧埌銆佷换鍔$瓑
+ public int CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public override string ToDisplayTime()
+ {
+ var textBuilder = OperationTimeHepler.textBuilder;
+ textBuilder.Length = 0;
+ textBuilder.Append(startDate.ToDisplay(false));
+ textBuilder.Append(" 00:00:00");
+ if (startDate != endDate)
+ {
+ textBuilder.Append("-");
+ textBuilder.Append(endDate.ToDisplay(false));
+ textBuilder.Append(" 23:59:59");
+ }
+ return textBuilder.ToString();
+ }
+
+ public string ToDisplayTimeEx()
+ {
+ var textBuilder = OperationTimeHepler.textBuilder;
+ textBuilder.Length = 0;
+ textBuilder.Append(startDate.ToDisplay(false));
+ if (startDate != endDate)
+ {
+ textBuilder.Append("-");
+ textBuilder.Append(endDate.ToDisplay(false));
+ }
+ return textBuilder.ToString();
+ }
+}
diff --git a/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs.meta b/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs.meta
new file mode 100644
index 0000000..1af8ced
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationFlashSaleActivityInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 546d13d472461714fa4e45fd54742409
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/FestivalActivity/OperationMissionActivityInfo.cs b/Main/System/FestivalActivity/OperationMissionActivityInfo.cs
new file mode 100644
index 0000000..6fc7976
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationMissionActivityInfo.cs
@@ -0,0 +1,23 @@
+
+public class OperationMissionActivityInfo : OperationBase
+{
+ public int ActType; // 娲诲姩绫诲瀷锛岀敤浜庡叧鑱旀椿鍔ㄧ浉鍏虫ā鍧楃敤锛屽绛惧埌銆佷换鍔$瓑
+ public int CfgID; // 娲诲姩鏃堕棿琛ㄩ厤缃甀D
+
+ public override string ToDisplayTime()
+ {
+ var textBuilder = OperationTimeHepler.textBuilder;
+ textBuilder.Length = 0;
+ textBuilder.Append(startDate.ToDisplay(false));
+ textBuilder.Append(" 00:00:00");
+ if (startDate != endDate)
+ {
+ textBuilder.Append("-");
+ textBuilder.Append(endDate.ToDisplay(false));
+ textBuilder.Append(" 23:59:59");
+ }
+ return textBuilder.ToString();
+ }
+
+
+}
diff --git a/Main/System/FestivalActivity/OperationMissionActivityInfo.cs.meta b/Main/System/FestivalActivity/OperationMissionActivityInfo.cs.meta
new file mode 100644
index 0000000..560efe3
--- /dev/null
+++ b/Main/System/FestivalActivity/OperationMissionActivityInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: afebd8558abc1734fbb2a360b7da975c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroDebut/HeroDebutCallRateItem.cs b/Main/System/HeroDebut/HeroDebutCallRateItem.cs
index e62992b..38ccf76 100644
--- a/Main/System/HeroDebut/HeroDebutCallRateItem.cs
+++ b/Main/System/HeroDebut/HeroDebutCallRateItem.cs
@@ -46,7 +46,7 @@
if (list == null) return;
if (xbGridArr == null) return;
- if (xbGridArr.Contains(grid))
+ if (AreAllLibItemsRelatedToHeroes(list))
{
int heroID = manager.GetCurrentDisplayCallHeroId();
if (!TryGetHeroItemInfo(heroID, libID, list, out int itemID, out int itemCount)) return;
@@ -85,6 +85,38 @@
return res;
}
+ /// <summary>
+ /// 妫�鏌ュ簱涓墍鏈夌墿鍝佹槸鍚﹂兘涓嶢ctHeroReturnArtConfig涓殑姝﹀皢鐩稿叧
+ /// </summary>
+ private bool AreAllLibItemsRelatedToHeroes(List<int> itemList)
+ {
+ if (itemList == null || itemList.Count == 0) return false;
+
+ List<int> heroIdList = ActHeroAppearArtConfig.GetKeys();
+ if (heroIdList == null || heroIdList.Count == 0) return false;
+
+ for (int i = 0; i < itemList.Count; i++)
+ {
+ int itemID = itemList[i];
+ var config = ItemConfig.Get(itemID);
+ if (config == null) return false;
+
+ if (config.Type == 150)
+ {
+ if (!heroIdList.Contains(itemID)) return false;
+ }
+ else if (config.Type == 151)
+ {
+ if (!heroIdList.Contains(config.EffectValueA1)) return false;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
public bool TryGetHeroItemInfo(int heroID, int libID, List<int> itemList, out int itemID, out int itemCount)
{
itemID = 0;
diff --git a/Main/System/HeroReturn/HeroReturnCallRateItem.cs b/Main/System/HeroReturn/HeroReturnCallRateItem.cs
index 1b2a0ad..30d63be 100644
--- a/Main/System/HeroReturn/HeroReturnCallRateItem.cs
+++ b/Main/System/HeroReturn/HeroReturnCallRateItem.cs
@@ -46,7 +46,7 @@
if (list == null) return;
if (xbGridArr == null) return;
- if (xbGridArr.Contains(grid))
+ if (AreAllLibItemsRelatedToHeroes(list))
{
int heroID = manager.GetCurrentDisplayCallHeroId();
if (!TryGetHeroItemInfo(heroID, libID, list, out int itemID, out int itemCount)) return;
@@ -85,6 +85,38 @@
return res;
}
+ /// <summary>
+ /// 妫�鏌ュ簱涓墍鏈夌墿鍝佹槸鍚﹂兘涓嶢ctHeroReturnArtConfig涓殑姝﹀皢鐩稿叧
+ /// </summary>
+ private bool AreAllLibItemsRelatedToHeroes(List<int> itemList)
+ {
+ if (itemList == null || itemList.Count == 0) return false;
+
+ List<int> heroIdList = ActHeroReturnArtConfig.GetKeys();
+ if (heroIdList == null || heroIdList.Count == 0) return false;
+
+ for (int i = 0; i < itemList.Count; i++)
+ {
+ int itemID = itemList[i];
+ var config = ItemConfig.Get(itemID);
+ if (config == null) return false;
+
+ if (config.Type == 150)
+ {
+ if (!heroIdList.Contains(itemID)) return false;
+ }
+ else if (config.Type == 151)
+ {
+ if (!heroIdList.Contains(config.EffectValueA1)) return false;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
public bool TryGetHeroItemInfo(int heroID, int libID, List<int> itemList, out int itemID, out int itemCount)
{
itemID = 0;
diff --git a/Main/System/HeroReturn/HeroReturnZhanLingWin.cs b/Main/System/HeroReturn/HeroReturnZhanLingWin.cs
index aff6ea6..3d1a8d6 100644
--- a/Main/System/HeroReturn/HeroReturnZhanLingWin.cs
+++ b/Main/System/HeroReturn/HeroReturnZhanLingWin.cs
@@ -120,7 +120,7 @@
var needCount = zhanLingModel.GetLuckValueAward(config.ActTreasureType) - zhanLingModel.subVulue;
itemNameText.text = Language.Get("HeroReturnZhanLing01", needCount);
- int heroID = zhanLingModel.GetCurrentDisplayCallHeroId();
+ int heroID = zhanLingModel.GetFirstHeroId();
adImg.SetSprite($"HeroReturnZhanLingBG_{heroID}");
adWordImg.SetSprite($"HeroReturnZhanLingWord_{heroID}");
adHeroImg.SetSprite($"HeroReturnZhanLingHero_{heroID}");
diff --git a/Main/System/Horse/HorseController.cs b/Main/System/Horse/HorseController.cs
index 97c91dc..1b33cc8 100644
--- a/Main/System/Horse/HorseController.cs
+++ b/Main/System/Horse/HorseController.cs
@@ -1,6 +1,5 @@
using System;
-using Cysharp.Threading.Tasks;
using Spine.Unity;
using UnityEngine;
using UnityEngine.UI;
@@ -22,10 +21,9 @@
// 鍒涘缓鍧愰獞 锛歩d涓�0绌哄潗楠戜篃鏈夐厤缃�
//_skinID 鍧愰獞鐨勭毊鑲D
- public async UniTask Create(int _skinID, int _heroSkinID = 0, float scale = 1f, Action _onComplete = null, string motionName = "idle")
+ public void Create(int _skinID, int _heroSkinID = 0, float scale = 1f, Action _onComplete = null, string motionName = "idle")
{
- pool = GameObjectPoolManager.Instance.GetPool(await UILoader.LoadPrefabAsync("UIHorse"));
- if (this == null) return;
+ pool = GameObjectPoolManager.Instance.GetPool(UILoader.LoadPrefab("UIHorse"));
if (instanceGO == null)
{
instanceGO = pool.Request();
@@ -45,7 +43,7 @@
{
skeletonGraphic.enabled = false;
}
- await CreateHero(_heroSkinID, scale);
+ CreateHero(_heroSkinID, scale);
//閬垮厤閲嶅鍒涘缓
return;
}
@@ -68,12 +66,11 @@
//鍗镐笅鍧愰獞鐨勬儏鍐�
skeletonGraphic.enabled = false;
spineAnimationState = null;
- await CreateHero(_heroSkinID, scale);
+ CreateHero(_heroSkinID, scale);
return;
}
- skeletonGraphic.skeletonDataAsset = await ResManager.Instance.LoadAssetAsync<SkeletonDataAsset>("UIEffect/Spine/Horse", skinConfig.Spine);
- if (this == null) return;
+ skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("UIEffect/Spine/Horse", skinConfig.Spine);
if (skeletonGraphic.skeletonDataAsset == null)
{
@@ -86,6 +83,7 @@
return;
}
skeletonGraphic.enabled = true;
+ skeletonGraphic.MeshGenerator.settings.pmaVertexColors = skinConfig.pmaVertexColorsOpen == 1;
skeletonGraphic.Initialize(true);
skeletonGraphic.transform.localPosition = new Vector3(skinConfig.Poses[0], skinConfig.Poses[1], 0);
@@ -95,13 +93,12 @@
if (motionName == "")
motionName = GetFistSpineAnim();
PlayAnimation(motionName, true);
- await CreateHero(_heroSkinID, scale);
- if (this == null) return;
+ CreateHero(_heroSkinID, scale);
spineAnimationState.Complete -= OnAnimationComplete;
spineAnimationState.Complete += OnAnimationComplete;
}
- public async UniTask CreateHero(int heroSkinID, float _scale)
+ public void CreateHero(int heroSkinID, float _scale)
{
if (instanceGO == null)
{
@@ -110,15 +107,15 @@
// if (heroSkinID == 0)
// {
// if (hero != null && hero.gameObject.activeSelf)
- // {
- // hero.SetActive(false);
- // }
+ // {
+ // hero.SetActive(false);
+ // }
// return;
// }
hero = instanceGO.GetComponentInChildren<UIHeroController>(true);
if (hero == null)
{
- return;
+ return;
}
if (heroSkinID == 0)
{
@@ -126,9 +123,8 @@
return;
}
hero.SetActive(true);
- await hero.Create(heroSkinID, _scale);
- if (this == null) return;
-
+ hero.Create(heroSkinID, _scale);
+
// 纭繚 BoneFollowerGraphic 寮曠敤鍒版纭殑鍧愰獞 SkeletonGraphic
var boneFollower = hero.GetComponent<BoneFollowerGraphic>();
if (boneFollower != null && skeletonGraphic != null && skeletonGraphic.enabled)
@@ -146,7 +142,7 @@
boneFollower.enabled = false;
hero.transform.localPosition = new Vector3(0, -50, 0);
}
-
+
if (isHeroShowBefore)
{
hero.transform.SetAsLastSibling();
@@ -163,7 +159,7 @@
return;
hero.PlayAnimation(motionName, loop, replay);
}
-
+
public UIHeroController GetHero()
{
return hero;
@@ -188,7 +184,7 @@
/// <param name="motionName">鍔ㄤ綔鍚�</param>
/// <param name="loop">寰幆</param>
/// <param name="replay">濡傛灉鐩稿悓鍔ㄤ綔鏄惁鍐嶆閲嶆挱锛屾瘮濡傝窇姝ラ噸鎾氨浼氳烦甯т笉椤烘粦</param>
- public virtual void PlayAnimation(string motionName, bool loop = false, bool replay=true)
+ public virtual void PlayAnimation(string motionName, bool loop = false, bool replay = true)
{
if (spineAnimationState == null) return;
@@ -246,7 +242,7 @@
}
public void SetEnabled(bool isEnable)
- {
+ {
if (skeletonGraphic == null)
{
return;
diff --git a/Main/System/Horse/HorseSkinWin.cs b/Main/System/Horse/HorseSkinWin.cs
index 5f865d9..406b6b6 100644
--- a/Main/System/Horse/HorseSkinWin.cs
+++ b/Main/System/Horse/HorseSkinWin.cs
@@ -230,28 +230,16 @@
var dict = HorseManager.Instance.GetAttrBySkinID(config);
var attrList = new List<string>();
var skinData = HorseManager.Instance.GetSkinData(config.SkinID);
- if (skinData != null)
+ if (skinData != null && skinData.Star < config.StarMax)
{
- //鍗囨槦
- if (skinData.Star == 0 || skinData.Star >= config.StarMax)
+ int i = 0;
+ foreach (var kv in dict)
{
- foreach (var kv in dict)
- {
- attrList.Add(UIHelper.AppendColor(TextColType.itemchuanqi, PlayerPropertyConfig.GetFullDescription(kv.Key, kv.Value)));
- }
- return Language.Get("PhantasmPavilion07") + string.Join(Language.Get("L1112"), attrList);
+ attrList.Add(UIHelper.AppendColor(TextColType.itemchuanqi, PlayerPropertyConfig.GetFullDescription(kv.Key, kv.Value)) +
+ Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.Green, "+" + PlayerPropertyConfig.GetValueDescription(kv.Key, config.AttrPerStarAddList[i]))));
+ i++;
}
- else
- {
- int i = 0;
- foreach (var kv in dict)
- {
- attrList.Add(UIHelper.AppendColor(TextColType.itemchuanqi, PlayerPropertyConfig.GetFullDescription(kv.Key, kv.Value)) +
- Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.Green, "+" + PlayerPropertyConfig.GetValueDescription(kv.Key, config.AttrPerStarAddList[i]))));
- i++;
- }
- return Language.Get("PhantasmPavilion07") + string.Join(Language.Get("L1112"), attrList);
- }
+ return Language.Get("PhantasmPavilion07") + string.Join(Language.Get("L1112"), attrList);
}
else
{
diff --git a/Main/System/Login/ServerData.cs b/Main/System/Login/ServerData.cs
index c38ecdd..6575d0c 100644
--- a/Main/System/Login/ServerData.cs
+++ b/Main/System/Login/ServerData.cs
@@ -14,7 +14,7 @@
{
public ServerGroup recommend;
public ServerGroup[] common;
- public ServerGroup[] crossserver;
+ public ServerGroup[] cross;
public bool FindServerData(int _id, out ServerData _serverData)
{
diff --git a/Main/System/Login/ServerListCenter.cs b/Main/System/Login/ServerListCenter.cs
index ed62ea5..2b30480 100644
--- a/Main/System/Login/ServerListCenter.cs
+++ b/Main/System/Login/ServerListCenter.cs
@@ -168,11 +168,11 @@
}
//璺ㄦ湇鏈嶅姟鍣� 涓嶅睍绀轰絾鏄彲浠ユ悳绱㈢敤
- if (serverInfoCommon != null && serverInfoCommon.crossserver != null)
+ if (serverInfoCommon != null && serverInfoCommon.cross != null)
{
- for (int i = 0; i < serverInfoCommon.crossserver.Length; i++)
+ for (int i = 0; i < serverInfoCommon.cross.Length; i++)
{
- var group = serverInfoCommon.crossserver[i];
+ var group = serverInfoCommon.cross[i];
for (int j = 0; j < group.group_list.Length; j++)
{
var serverData = group.group_list[j];
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index 9454ffc..1872349 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -550,18 +550,18 @@
var Def = GetPropertyVaule(7, hero);
var MaxHP = GetPropertyVaule(8, hero);
var AtkSpeed = GetFighttPropertyVaule(11, hero);
- var StunRate = GetFighttPropertyVaule(21, hero);
- var StunRateDef = GetFighttPropertyVaule(22, hero);
- var SuperHitRate = GetFighttPropertyVaule(23, hero);
- var SuperHitRateDef = GetFighttPropertyVaule(24, hero);
- var ComboRate = GetFighttPropertyVaule(25, hero);
- var ComboRateDef = GetFighttPropertyVaule(26, hero);
- var MissRate = GetFighttPropertyVaule(27, hero);
- var MissRateDef = GetFighttPropertyVaule(28, hero);
- var ParryRate = GetFighttPropertyVaule(29, hero);
- var ParryRateDef = GetFighttPropertyVaule(30, hero);
- var SuckHPPer = GetFighttPropertyVaule(31, hero);
- var SuckHPPerDef = GetFighttPropertyVaule(32, hero);
+ var StunRate = GetFighttPropertyVaule(21, hero) + GetFighttPropertyVaule(33, hero);
+ var StunRateDef = GetFighttPropertyVaule(22, hero) + GetFighttPropertyVaule(34, hero);
+ var SuperHitRate = GetFighttPropertyVaule(23, hero) + GetFighttPropertyVaule(33, hero);
+ var SuperHitRateDef = GetFighttPropertyVaule(24, hero) + GetFighttPropertyVaule(34, hero);
+ var ComboRate = GetFighttPropertyVaule(25, hero) + GetFighttPropertyVaule(33, hero);
+ var ComboRateDef = GetFighttPropertyVaule(26, hero) + GetFighttPropertyVaule(34, hero);
+ var MissRate = GetFighttPropertyVaule(27, hero) + GetFighttPropertyVaule(33, hero);
+ var MissRateDef = GetFighttPropertyVaule(28, hero) + GetFighttPropertyVaule(34, hero);
+ var ParryRate = GetFighttPropertyVaule(29, hero) + GetFighttPropertyVaule(33, hero);
+ var ParryRateDef = GetFighttPropertyVaule(30, hero) + GetFighttPropertyVaule(34, hero);
+ var SuckHPPer = GetFighttPropertyVaule(31, hero) + GetFighttPropertyVaule(33, hero);
+ var SuckHPPerDef = GetFighttPropertyVaule(32, hero) + GetFighttPropertyVaule(34, hero);
var FinalDamPer = GetFighttPropertyVaule(35, hero);
var FinalDamPerDef = GetFighttPropertyVaule(36, hero);
@@ -836,6 +836,7 @@
#endregion
+ //鍜屾垬鍔涜绠楁棤鍏筹紝閲嶇畻灞炴�у睍绀虹敤
public Dictionary<int, long> GetHeroTotalAttr(HeroInfo hero)
{
@@ -845,7 +846,11 @@
var pConfig = PlayerPropertyConfig.GetValues();
foreach (var config in pConfig)
{
- if (config.showType < 1 || config.showType > 4)
+ if (config.showType != 1 &&
+ config.showType != 2 &&
+ config.showType != 3 &&
+ config.showType != 4 &&
+ config.showType != 7)
{
continue;
}
@@ -860,6 +865,18 @@
}
}
+ //鍏ぇ鎴樻枟灞炴�ч渶瑕佸啀鍔犱笂鎬荤殑鎴樻枟灞炴��
+ int[] fightAttrList = { 21, 23, 25, 27, 29, 31};
+ foreach (var attr in fightAttrList)
+ {
+ tmpAttrs[attr] += tmpAttrs[33];
+ }
+ int[] fightDefAttrList = { 22, 24, 26, 28, 30, 32};
+ foreach (var attr in fightDefAttrList)
+ {
+ tmpAttrs[attr] += tmpAttrs[34];
+ }
+
return tmpAttrs;
}
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 4e1ad8d..148394b 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -74,6 +74,7 @@
[SerializeField] TimeRushCell timeRushCell;
[SerializeField] HeroDebutCell heroDebutCell;
[SerializeField] HeroReturnCell heroReturnCell;
+ [SerializeField] Button festivalActivityBtn;
//鍧愰獞
[SerializeField] Image horseBGImg;
@@ -232,7 +233,10 @@
{
UIManager.Instance.OpenWindowAsync<DailySpecialsBaseWin>().Forget();
});
-
+ festivalActivityBtn.AddListener(() =>
+ {
+ UIManager.Instance.OpenWindow<FestivalActivityWin>();
+ });
}
@@ -298,6 +302,7 @@
DisplayTimeRush();
DisplayHeroDebut();
DisplayHeroReturn();
+ DisplayFestivalActivity();
DelayPlayMusic().Forget();
}
@@ -346,6 +351,10 @@
{
DisplayGalaBtn();
}
+ else if (type == OperationType.FestivalActivity)
+ {
+ DisplayFestivalActivity();
+ }
}
private void OpenServerActivityStateChange()
@@ -354,6 +363,7 @@
DisplayHeroDebut();
DisplayHeroReturn();
DisplayGalaBtn();
+ DisplayFestivalActivity();
}
private void OnShowGiftIdListAddEvent()
@@ -876,6 +886,10 @@
{
DisplayHeroReturn();
}
+ else if (funcId == (int)FuncOpenEnum.FestivalActivity)
+ {
+ DisplayFestivalActivity();
+ }
}
private void OnUpdateFirstChargeInfo()
@@ -946,8 +960,7 @@
void DisplayGalaBtn()
{
- bool isGalaOpen = TotDayRechargeManager.Instance.IsOpen || TotalRechargeManager.Instance.IsOpen;
- osGalaBtn.SetActive(OSActivityManager.Instance.IsOpenedOSGala() || isGalaOpen);
+ osGalaBtn.SetActive(OSActivityManager.Instance.IsOpenedOSGala());
}
void DisplayTimeRush()
@@ -976,6 +989,12 @@
return;
heroReturnCell.Display();
}
+
+ void DisplayFestivalActivity()
+ {
+ bool isOpen = FestivalActivityManager.Instance.IsFestivalActivityOpen();
+ festivalActivityBtn.SetActive(isOpen);
+ }
}
diff --git a/Main/System/OSActivity/OSActivityManager.cs b/Main/System/OSActivity/OSActivityManager.cs
index 56002d0..f981cb8 100644
--- a/Main/System/OSActivity/OSActivityManager.cs
+++ b/Main/System/OSActivity/OSActivityManager.cs
@@ -372,6 +372,12 @@
{
return false;
}
+
+ if (TotDayRechargeManager.Instance.IsOpen || TotalRechargeManager.Instance.IsOpen)
+ {
+ return true;
+ }
+
if (needLastDay)
{
//缁撴潫鍚庡欢杩熶竴澶╁叧闂睍绀�
diff --git a/Main/System/OpenServerActivity/OperationTimeHepler.cs b/Main/System/OpenServerActivity/OperationTimeHepler.cs
index 0738659..aa2a94b 100644
--- a/Main/System/OpenServerActivity/OperationTimeHepler.cs
+++ b/Main/System/OpenServerActivity/OperationTimeHepler.cs
@@ -497,72 +497,190 @@
public void UpdateActTotalRechargeInfo(HAA1D_tagSCActTotalRechargeInfo package)
{
- OperationBase operationBase = null;
- operationDict.TryGetValue(OperationType.TotalRecharge, out operationBase);
+ var opreationType = OperationType.TotalRecharge;
+ switch (package.ActNum)
+ {
+ case 10:
+ opreationType = OperationType.TotalRecharge;
+ break;
+ case 30:
+ opreationType = OperationType.FestivalActivity_RechargeTotal;
+ break;
+ }
+
if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
{
- ForceStopOperation(OperationType.TotalRecharge);
+ ForceStopOperation(opreationType);
+ return;
}
- else
- {
- if (operationBase == null)
- {
- operationBase = new OperationTotalRechargeInfo();
- operationDict.Add(OperationType.TotalRecharge, operationBase);
- }
- OperationTotalRechargeInfo operation = operationBase as OperationTotalRechargeInfo;
- operation.Reset();
- operation.startDate = ParseOperationDate(package.StartDate);
- operation.endDate = ParseOperationDate(package.EndtDate);
- operation.ActNum = package.ActNum;
- operation.CfgID = package.CfgID;
-
- var config = ActTotalRechargeConfig.Get(package.CfgID);
- if (config == null)
- {
- SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
- return;
- }
- if (operationTimeUpdateEvent != null)
- {
- operationTimeUpdateEvent(OperationType.TotalRecharge);
- }
+ if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
+ {
+ operationBase = new OperationTotalRechargeInfo();
+ operationDict.Add(opreationType, operationBase);
}
+ OperationTotalRechargeInfo operation = operationBase as OperationTotalRechargeInfo;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.ActNum = package.ActNum;
+ operation.CfgID = package.CfgID;
+
+ var config = ActTotalRechargeConfig.Get(package.CfgID);
+ if (config == null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
+ return;
+ }
+ operation.dayReset = config.IsDayReset == 1;
+ operationTimeUpdateEvent?.Invoke(opreationType);
}
public void UpdateActTotDayRechargeInfo(HAA1B_tagSCActTotDayRechargeInfo package)
{
- OperationBase operationBase = null;
- operationDict.TryGetValue(OperationType.TotDayRecharge, out operationBase);
+ var opreationType = OperationType.TotDayRecharge;
+ switch (package.ActNum)
+ {
+ case 10:
+ opreationType = OperationType.TotDayRecharge;
+ break;
+ case 30:
+ opreationType = OperationType.FestivalActivity_RechargeTotDay;
+ break;
+ }
if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
{
- ForceStopOperation(OperationType.TotDayRecharge);
+ ForceStopOperation(opreationType);
+ return;
}
- else
+ if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
{
- if (operationBase == null)
- {
- operationBase = new OperationTotDayRechargeInfo();
- operationDict.Add(OperationType.TotDayRecharge, operationBase);
- }
- OperationTotDayRechargeInfo operation = operationBase as OperationTotDayRechargeInfo;
- operation.Reset();
- operation.startDate = ParseOperationDate(package.StartDate);
- operation.endDate = ParseOperationDate(package.EndtDate);
- operation.ActNum = package.ActNum;
- operation.CfgID = package.CfgID;
-
- var config = ActTotalRechargeConfig.Get(package.CfgID);
- if (config == null)
- {
- SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
- return;
- }
-
- operation.dayReset = config.IsDayReset == 1;
- operationTimeUpdateEvent?.Invoke(OperationType.TotDayRecharge);
+ operationBase = new OperationTotDayRechargeInfo();
+ operationDict.Add(opreationType, operationBase);
}
+ OperationTotDayRechargeInfo operation = operationBase as OperationTotDayRechargeInfo;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.ActNum = package.ActNum;
+ operation.CfgID = package.CfgID;
+
+ if (ActTotDayRechargeConfig.Get(package.CfgID) == null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
+ return;
+ }
+ operationTimeUpdateEvent?.Invoke(opreationType);
+ }
+
+ public void UpdateFlashSaleActivityInfo(HAA10_tagSCActSpecialSaleInfo package)
+ {
+ var opreationType = OperationType.FestivalActivity;
+ switch (package.ActNum)
+ {
+ case 30:
+ opreationType = OperationType.FestivalActivity;
+ break;
+ }
+
+ if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
+ {
+ ForceStopOperation(opreationType);
+ return;
+ }
+
+ if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
+ {
+ operationBase = new OperationFlashSaleActivityInfo();
+ operationDict.Add(opreationType, operationBase);
+ }
+ OperationFlashSaleActivityInfo operation = operationBase as OperationFlashSaleActivityInfo;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.ActNum = package.ActNum;
+ operation.CfgID = package.CfgID;
+
+ if (ActSpecialSaleConfig.Get(package.CfgID) == null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
+ return;
+ }
+ operationTimeUpdateEvent?.Invoke(opreationType);
+ }
+
+ public void UpdateCheckInActivityInfo(HAA23_tagSCActSignInfo package)
+ {
+ var opreationType = OperationType.FestivalActivity_CheckIn;
+ switch (package.ActNum)
+ {
+ case 30:
+ opreationType = OperationType.FestivalActivity_CheckIn;
+ break;
+ }
+
+ if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
+ {
+ ForceStopOperation(opreationType);
+ return;
+ }
+
+ if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
+ {
+ operationBase = new OperationCheckInActivityInfo();
+ operationDict.Add(opreationType, operationBase);
+ }
+ OperationCheckInActivityInfo operation = operationBase as OperationCheckInActivityInfo;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.ActType = package.ActNum;
+ operation.CfgID = package.CfgID;
+
+ if (ActSignConfig.Get(package.CfgID) == null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
+ return;
+ }
+ operationTimeUpdateEvent?.Invoke(opreationType);
+ }
+
+ public void UpdateMissionActivityInfo(HAA71_tagSCActTaskInfo package)
+ {
+ var opreationType = OperationType.FestivalActivity_Mission;
+ switch (package.ActNum)
+ {
+ case 30:
+ opreationType = OperationType.FestivalActivity_Mission;
+ break;
+ }
+
+ if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
+ {
+ ForceStopOperation(opreationType);
+ return;
+ }
+
+ if (!operationDict.TryGetValue(opreationType, out OperationBase operationBase))
+ {
+ operationBase = new OperationMissionActivityInfo();
+ operationDict.Add(opreationType, operationBase);
+ }
+ OperationMissionActivityInfo operation = operationBase as OperationMissionActivityInfo;
+ operation.Reset();
+ operation.startDate = ParseOperationDate(package.StartDate);
+ operation.endDate = ParseOperationDate(package.EndtDate);
+ operation.ActType = package.ActNum;
+ operation.CfgID = package.CfgID;
+
+ var config = ActTaskConfig.Get(package.CfgID);
+ if (config == null)
+ {
+ SysNotifyMgr.Instance.ShowTip("LoadConfigErr");
+ return;
+ }
+ operation.dayReset = config.IsDayReset == 1;
+ operationTimeUpdateEvent?.Invoke(opreationType);
}
// public void UpdateActYunShiInfo(HAA87_tagMCActYunshiInfo package)
@@ -1157,5 +1275,10 @@
HeroReturn = 3, //鏃ユ湡鍨嬫椿鍔� - 姝﹀皢杩斿満
TotalRecharge = 4,//绱厖娲诲姩
TotDayRecharge = 5, //绱厖澶╂椿鍔�
+ FestivalActivity = 6, //鑺傛棩娲诲姩
+ FestivalActivity_RechargeTotDay = 7, //鑺傛棩娲诲姩-绱ぉ鍏呭��
+ FestivalActivity_RechargeTotal = 8, //鑺傛棩娲诲姩-绱厖鍊�
+ FestivalActivity_CheckIn = 9, //鑺傛棩娲诲姩-绛惧埌
+ FestivalActivity_Mission = 10, //鑺傛棩娲诲姩-浠诲姟
max,
}
\ No newline at end of file
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
index a939a0e..669aeb4 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailManager.cs
@@ -32,6 +32,10 @@
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
}
+ public bool IsRobot(int playerID)
+ {
+ return RobotConfig.HasKey(playerID);
+ }
public void OnBeforePlayerDataInitializeEventOnRelogin()
{
diff --git a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
index 6a12381..e3780e3 100644
--- a/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
+++ b/Main/System/OtherPlayerDetail/OtherPlayerDetailWin.cs
@@ -136,7 +136,7 @@
private void DisplayMingge(int playerID)
{
var mingge = manager.GetMinggeTotalData(playerID);
- txtMinggeLv.text = Language.Get("OtherPlayerDetail13", mingge == null ? 0 : mingge.GWLV);
+ txtMinggeLv.text = Language.Get("OtherPlayerDetail17", mingge == null ? 0 : mingge.GWLV);
}
private void DisplayGuildInfo(OtherPlayerDetailManager.ViewPlayerData viewPlayerData)
@@ -156,7 +156,10 @@
{
txtPlayerName.text = viewPlayerData.PlayerName;
txtPlayerId.text = Language.Get("OtherPlayerDetail02", viewPlayerData.PlayerID);
- txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(viewPlayerData.ServerID));
+ if (OtherPlayerDetailManager.Instance.IsRobot(viewPlayerData.PlayerID))
+ txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID)));
+ else
+ txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(viewPlayerData.ServerID));
txtLV.text = viewPlayerData.LV.ToString();
avatarCell.InitUI(AvatarHelper.GetAvatarModel(viewPlayerData.PlayerID, viewPlayerData.Face, viewPlayerData.FacePic)).Forget();
officialTitle.InitUI(viewPlayerData.RealmLV, viewPlayerData.TitleID, 0.65f).Forget();
diff --git a/Main/System/PhantasmPavilion/AvatarHelper.cs b/Main/System/PhantasmPavilion/AvatarHelper.cs
index b2c7411..bd9d8d9 100644
--- a/Main/System/PhantasmPavilion/AvatarHelper.cs
+++ b/Main/System/PhantasmPavilion/AvatarHelper.cs
@@ -78,7 +78,7 @@
public static int GetAvatarBgColor(int faceID)
{
- int defaultColor = 1;
+ int defaultColor = 0;
if (!PlayerFaceConfig.HasKey(faceID))
return defaultColor;
return PlayerFaceConfig.Get(faceID).BgColor;
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionManager.DefaultID.cs b/Main/System/PhantasmPavilion/PhantasmPavilionManager.DefaultID.cs
index 391ddf7..6fb42cb 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionManager.DefaultID.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionManager.DefaultID.cs
@@ -139,7 +139,7 @@
public int GetModelBgColor(int id)
{
- int defaultColor = 1;
+ int defaultColor = 0;
if (!ModelConfig.HasKey(id))
return defaultColor;
return ModelConfig.Get(id).ModelBgColor;
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs b/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
index 4a81238..ec26648 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
@@ -215,7 +215,7 @@
int unlockValue = GetUnlockValue(type, id);
int resourceType = GetResourceType(type, id);
string resourceValue = GetResourceValue(type, id);
- if ((UnlockWay == 3 || UnlockWay == 4) && resourceValue == "")
+ if ((UnlockWay == 3 || UnlockWay == 4 || UnlockWay == 5) && resourceValue == "")
{
int skinID = 0;
if (UnlockWay == 3)
@@ -227,6 +227,12 @@
else if (UnlockWay == 4)
{
skinID = unlockValue; // UnlockValue 鐩存帴灏辨槸 skinID
+ }
+ else if (UnlockWay == 5)
+ {
+ int modelID = unlockValue; // UnlockValue 鏄� ModelID
+ if (!ModelConfig.HasKey(modelID)) return;
+ skinID = ModelConfig.Get(modelID).SkinID; // 鎷垮埌褰㈣薄瀵瑰簲鐨勭毊鑲D
}
if (!HeroSkinConfig.HasKey(skinID)) return;
@@ -552,90 +558,49 @@
// 闄ら亾鍏疯В閿佸锛屽叾浠栨柟寮忔殏榛樿姘镐箙
// 1 - 榛樿瑙i攣锛屽嵆鍒涜灏卞彲鐢ㄧ殑
// 2 - 閬撳叿瑙i攣锛屾敮鎸佹椂鏁堛�佸崌绾э紝 Value閰嶇墿鍝両D
- // 3 - 鍏宠仈姝﹀皢瑙i攣锛孷alue閰嶆灏咺D
public bool IsUnlock(PhantasmPavilionType type, int id)
{
- // 閰嶇疆琛ㄤ腑涓嶅瓨鍦紝瑙嗕负鏈В閿�
- if (!Has(type, id))
- return false;
+ if (!Has(type, id)) return false;
int unlockWayValue = GetUnlockWay(type, id);
int unlockValue = GetUnlockValue(type, id);
- // 瑙i攣鏂瑰紡鏃犳晥
- if (!Enum.IsDefined(typeof(PhantasmPavilionUnlockWay), unlockWayValue))
- return false;
- var unlockWay = (PhantasmPavilionUnlockWay)unlockWayValue;
- switch (unlockWay)
+ if (unlockWayValue == 1) return true; // 1 - 榛樿瑙i攣
+
+ if (unlockWayValue == 2) // 2 - 閬撳叿瑙i攣
{
- case PhantasmPavilionUnlockWay.Activate:
- return true;
- case PhantasmPavilionUnlockWay.Hero:
- bool hasHero = HeroManager.Instance.HasHero(unlockValue);
- return hasHero;
- case PhantasmPavilionUnlockWay.Item:
- // 灏佸寘閲屾病鏈�
- if (!TryGetInfo(type, id, out var info))
- return false;
- // 鐜╁鏁版嵁涓殑鐘舵�佹槸鈥滄湭婵�娲烩��
- if (!info.State)
- return false;
- // 鏄惁涓衡�滃凡杩囨湡鐨勯亾鍏封��
- if (IsExpired(info, unlockWay))
- return false;
- return true;
- case PhantasmPavilionUnlockWay.Skin:
- bool hasSkin = HeroUIManager.Instance.IsHeroSkinActive(HeroConfig.GetHeroIDBySkinID(unlockValue), unlockValue);
- return hasSkin;
- default:
- return false;
+ if (!TryGetInfo(type, id, out var info)) return false;
+ if (!info.State) return false;
+ if (IsExpired(info, PhantasmPavilionUnlockWay.Item)) return false;
+ return true;
}
+
+ // 3銆�4銆�5鍙婁互涓婂叏閮ㄤ氦缁欏垎鍙戝嚱鏁版寜琛ㄦ牸绫诲瀷鐙珛澶勭悊
+ return CheckTableSpecificUnlock(type, unlockWayValue, unlockValue);
}
- /// <summary>
- /// 鑾峰緱褰撳墠鐘舵��
- /// </summary>
- /// <returns>0 - 鏈縺娲�, 1 - 鍙縺娲�, 2 - 宸叉縺娲�</returns>
public PhantasmPavilionState GetUnLockState(PhantasmPavilionType type, int id)
{
- // 閰嶇疆琛ㄤ腑涓嶅瓨鍦紝瑙嗕负鈥滄湭婵�娲烩��
- if (!Has(type, id))
- return PhantasmPavilionState.Locked;
+ if (!Has(type, id)) return PhantasmPavilionState.Locked;
- // 宸茬粡瑙i攣
- if (IsUnlock(type, id))
- return PhantasmPavilionState.Activated;
+ // 濡傛灉宸茬粡婊¤冻瑙i攣鏉′欢锛岀洿鎺ヨ繑鍥� Activated
+ if (IsUnlock(type, id)) return PhantasmPavilionState.Activated;
- // 杩愯鍒拌繖閲岋紝璇存槑鐗╁搧鏄�滄湭婵�娲烩�濇垨鈥滃凡杩囨湡鈥濈姸鎬� (IsUnlock 杩斿洖 false)
- // 鏃犳晥鐨勮В閿佹柟寮�
int unlockWayValue = GetUnlockWay(type, id);
- if (!Enum.IsDefined(typeof(PhantasmPavilionUnlockWay), unlockWayValue))
- return PhantasmPavilionState.Locked;
-
- var unlockWay = (PhantasmPavilionUnlockWay)unlockWayValue;
int unlockValue = GetUnlockValue(type, id);
- switch (unlockWay)
+ // 鍙湁閬撳叿瑙i攣(2)瀛樺湪"鏈縺娲讳絾鏉愭枡瓒冲"鐨勭壒鏈変腑闂寸姸鎬�
+ if (unlockWayValue == 2)
{
- // 妫�鏌ラ亾鍏锋縺娲绘潯浠�
- case PhantasmPavilionUnlockWay.Item:
- return CheckCanActivateByItem(type, id, unlockValue)
- ? PhantasmPavilionState.CanActivate
- : PhantasmPavilionState.Locked;
- // 妫�鏌ユ灏嗘縺娲绘潯浠�
- case PhantasmPavilionUnlockWay.Hero:
- int heroID = unlockValue;
- return HeroManager.Instance.HasHero(heroID)
- ? PhantasmPavilionState.Activated
- : PhantasmPavilionState.Locked;
- case PhantasmPavilionUnlockWay.Skin:
- return HeroUIManager.Instance.IsHeroSkinActive(HeroConfig.GetHeroIDBySkinID(unlockValue), unlockValue)
- ? PhantasmPavilionState.Activated
- : PhantasmPavilionState.Locked;
- default:
- return PhantasmPavilionState.Locked;
+ return CheckCanActivateByItem(type, id, unlockValue)
+ ? PhantasmPavilionState.CanActivate
+ : PhantasmPavilionState.Locked;
}
+
+ // 鍏朵粬鍏宠仈瑙i攣濡傛灉涓嶆弧瓒� IsUnlock锛屽垯蹇呭畾鏄� Locked 鐘舵��
+ return PhantasmPavilionState.Locked;
}
+
// 妫�鏌ユ槸鍚︽弧瓒斥�滈�氳繃閬撳叿婵�娲烩�濈殑鏉′欢
private bool CheckCanActivateByItem(PhantasmPavilionType type, int id, int itemId)
@@ -659,6 +624,31 @@
return true;
}
+ /// <summary>
+ /// 鏍规嵁鎵�灞炶〃鏍�(Type)瑙f瀽 UnlockWay 鐨勭壒瀹氬惈涔夊苟鍒ゆ柇鏄惁婊¤冻鏉′欢 (鎺掗櫎 UnlockWay 1 鍜� 2)
+ /// </summary>
+ public bool CheckTableSpecificUnlock(PhantasmPavilionType type, int unlockWay, int unlockValue)
+ {
+ switch (type)
+ {
+ case PhantasmPavilionType.Face:
+ // 澶村儚琛ㄧ嫭鏈夌殑 UnlockWay 瑙f瀽瑙勫垯
+ if (unlockWay == 3) return HeroManager.Instance.HasHero(unlockValue);
+ if (unlockWay == 4) return HeroUIManager.Instance.IsHeroSkinActive(HeroConfig.GetHeroIDBySkinID(unlockValue), unlockValue);
+ if (unlockWay == 5) return IsUnlock(PhantasmPavilionType.Model, unlockValue); // 鍏宠仈褰㈣薄
+ break;
+
+ case PhantasmPavilionType.FacePic:
+ case PhantasmPavilionType.ChatBox:
+ case PhantasmPavilionType.Title:
+ case PhantasmPavilionType.Model:
+ // 鍏朵粬琛ㄧ洰鍓嶇殑鍏辨湁瑙f瀽瑙勫垯
+ if (unlockWay == 3) return HeroManager.Instance.HasHero(unlockValue);
+ if (unlockWay == 4) return HeroUIManager.Instance.IsHeroSkinActive(HeroConfig.GetHeroIDBySkinID(unlockValue), unlockValue);
+ break;
+ }
+ return false;
+ }
public void CheckTimeOut()
{
bool isTimeOut = false;
@@ -977,7 +967,9 @@
Activate = 1, // 榛樿(鍒涜鑹插氨鍙互鐢ㄧ殑)
Item, // 閬撳叿
Hero, // 姝﹀皢
- Skin, // 鐨偆
+ Skin, // 鐨偆
+ Model, // 褰㈣薄
+
}
/// 骞诲闃佺墿鍝佺殑鐘舵��
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs b/Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs
index 78d9b25..3b71802 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs
@@ -24,31 +24,24 @@
int useCnt = manager.GetUnlockNeedCnt(type, id);
if (useCnt > hasCnt)
{
- if (!ItemConfig.HasKey(unlockValue))
- return;
+ if (!ItemConfig.HasKey(unlockValue)) return;
string name = ItemConfig.Get(unlockValue).ItemName;
SysNotifyMgr.Instance.ShowTip("UnLockFail2", name);
return;
}
}
- else if (unlockWay == 3)
+ else if (unlockWay != 1) // 缁熶竴澶勭悊 3, 4, 5 浠ュ強鏈潵鑷畾涔夌殑绫诲瀷
{
- bool hasHero = HeroManager.Instance.HasHero(unlockValue);
- if (!hasHero)
+ // UI 灞備笉鍐嶇‖缂栫爜鍚箟锛岀洿鎺ヨ皟鐢ㄥ熀浜� Type 鐨勬牎楠�
+ bool canUnlock = manager.CheckTableSpecificUnlock(type, unlockWay, unlockValue);
+ if (!canUnlock)
{
- SysNotifyMgr.Instance.ShowTip("UnLockFail1");
+ // 杩欓噷缁熶竴澶嶇敤 UnLockFail1锛屾垨鏈潵鍦� CheckTableSpecificUnlock 涓繑鍥炴洿鍏蜂綋鐨勯敊璇灇涓�
+ SysNotifyMgr.Instance.ShowTip("UnLockFail1");
return;
}
}
- else if (unlockWay == 4) // 鏂板锛氬鏋滄槸鐨偆瑙i攣
- {
- bool hasSkin = HeroUIManager.Instance.IsHeroSkinActive(HeroConfig.GetHeroIDBySkinID(unlockValue), unlockValue);
- if (!hasSkin)
- {
- SysNotifyMgr.Instance.ShowTip("UnLockFail1");
- return;
- }
- }
+
manager.SendOPPack(type, PhantasmPavilionOperation.Activate, (uint)id);
SysNotifyMgr.Instance.ShowTip("UnLockSuccess");
});
diff --git a/Main/System/Qunying/QYBattleFailWin.cs b/Main/System/Qunying/QYBattleFailWin.cs
index 69fc0f1..217446e 100644
--- a/Main/System/Qunying/QYBattleFailWin.cs
+++ b/Main/System/Qunying/QYBattleFailWin.cs
@@ -85,7 +85,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)).Forget();
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, (int)info.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
});
txtMyName.text = PlayerDatas.Instance.baseData.PlayerName;
diff --git a/Main/System/Qunying/QYBattleVictoryWin.cs b/Main/System/Qunying/QYBattleVictoryWin.cs
index 0a2a1f6..f03a26c 100644
--- a/Main/System/Qunying/QYBattleVictoryWin.cs
+++ b/Main/System/Qunying/QYBattleVictoryWin.cs
@@ -75,7 +75,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)).Forget();
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
+ AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, (int)info.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
});
txtMyName.text = PlayerDatas.Instance.baseData.PlayerName;
diff --git a/Main/System/Qunying/QYBattleWin.cs b/Main/System/Qunying/QYBattleWin.cs
index 78dcd18..8d2759d 100644
--- a/Main/System/Qunying/QYBattleWin.cs
+++ b/Main/System/Qunying/QYBattleWin.cs
@@ -213,7 +213,7 @@
enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)info.PlayerID, (int)info.Face, (int)info.FacePic)).Forget();
enemyAvatarCell.SetListener(() =>
{
- AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
+ AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, (int)info.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
});
var team = GetTeamHeroList(enemyTeam);
enemyCountry.RefreshOnTeamCountry(team, true);
diff --git a/Main/System/Qunying/QYFighterCell.cs b/Main/System/Qunying/QYFighterCell.cs
index 0911893..7758943 100644
--- a/Main/System/Qunying/QYFighterCell.cs
+++ b/Main/System/Qunying/QYFighterCell.cs
@@ -31,6 +31,12 @@
{
if (matchInfo == null)
return;
+
+ if (QunyingManager.Instance.IsCrossGrouping())
+ {
+ SysNotifyMgr.Instance.ShowTip("QYCrossFightError");
+ return;
+ }
if (!UIHelper.CheckMoneyCount(QunyingManager.challengeMoneyType, 1, 1))
{
StoreModel.Instance.ShowBuyItem(QunyingManager.challengeShopID, -1);
@@ -44,13 +50,19 @@
queryPlayerBtn.AddListener(() =>
{
if (GeneralDefine.IsRobot((int)matchInfo.PlayerID)) return;
- AvatarHelper.TryViewOtherPlayerInfo((int)matchInfo.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
+ AvatarHelper.TryViewOtherPlayerInfo((int)matchInfo.PlayerID, (int)matchInfo.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
});
quickChallengeBtn.AddListener(() =>
{
if (matchInfo == null)
return;
+ if (QunyingManager.Instance.IsCrossGrouping())
+ {
+ SysNotifyMgr.Instance.ShowTip("QYCrossFightError");
+ return;
+ }
+
if (!UIHelper.CheckMoneyCount(QunyingManager.challengeMoneyType, 1, 1))
{
StoreModel.Instance.ShowBuyItem(QunyingManager.challengeShopID, -1);
@@ -64,7 +76,12 @@
{
if (matchInfo == null)
return;
-
+
+ if (QunyingManager.Instance.IsCrossGrouping())
+ {
+ SysNotifyMgr.Instance.ShowTip("QYCrossFightError");
+ return;
+ }
//鏈�浣庢樉绀轰袱娆★紝浣嗗彲浠ユ渶浣庢寫鎴�1娆�
var cnt = Math.Max(1, Math.Min(5, UIHelper.GetMoneyCnt(QunyingManager.challengeMoneyType)));
if (!UIHelper.CheckMoneyCount(QunyingManager.challengeMoneyType, cnt, 1))
diff --git a/Main/System/Qunying/QYNoteCell.cs b/Main/System/Qunying/QYNoteCell.cs
index 83901b2..937d8f2 100644
--- a/Main/System/Qunying/QYNoteCell.cs
+++ b/Main/System/Qunying/QYNoteCell.cs
@@ -52,7 +52,7 @@
tagAvatarCell.SetListener(() =>
{
if (GeneralDefine.IsRobot((int)arenaGameRec.Value3)) return;
- AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)BattlePreSetType.Arena);
+ AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, (int)arenaGameRec.Value1, viewPlayerLineupType: (int)BattlePreSetType.Arena);
});
tagLVTxt.text = arenaGameRec.Value8.ToString();
tagNameTxt.text = arenaGameRec.Name;
diff --git a/Main/System/Qunying/QYPlayerTop3Cell.cs b/Main/System/Qunying/QYPlayerTop3Cell.cs
index abece38..2c59e24 100644
--- a/Main/System/Qunying/QYPlayerTop3Cell.cs
+++ b/Main/System/Qunying/QYPlayerTop3Cell.cs
@@ -40,7 +40,7 @@
queryPlayerBtn.SetListener(() =>
{
if (GeneralDefine.IsRobot((int)rankData.id)) return;
- AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Qunying);
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, UIHelper.GetServerIDByAccount(rankData.name2), viewPlayerLineupType: (int)BattlePreSetType.Qunying);
});
fightPowerText.text = UIHelper.ReplaceLargeArtNum(rankData.fightPower);
}
diff --git a/Main/System/Qunying/QYWin.cs b/Main/System/Qunying/QYWin.cs
index 029ef06..2cf9c3c 100644
--- a/Main/System/Qunying/QYWin.cs
+++ b/Main/System/Qunying/QYWin.cs
@@ -171,8 +171,7 @@
//娲诲姩鏃堕棿
void ShowGameTime()
{
- var zoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(QunyingManager.DataMapID);
- if (zoneInfo != null && zoneInfo.ZoneID == 0)
+ if (QunyingManager.Instance.IsCrossGrouping())
{
//鍊掕鏃舵寜0:05缁撴潫
var seconds = (TimeUtility.GetTodayStartTime().AddMinutes(5) - TimeUtility.GetCommServerNow(0)).TotalSeconds;
diff --git a/Main/System/Qunying/QunyingManager.cs b/Main/System/Qunying/QunyingManager.cs
index eeeff8c..33ccb3f 100644
--- a/Main/System/Qunying/QunyingManager.cs
+++ b/Main/System/Qunying/QunyingManager.cs
@@ -380,6 +380,17 @@
return true;
}
+
+ public bool IsCrossGrouping()
+ {
+ var zoneInfo = CrossServerBaseManager.Instance.GetCrossZoneInfo(DataMapID);
+ if (zoneInfo != null && zoneInfo.ZoneID == 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
#region 绾㈢偣
public Redpoint parentRedpoint = new Redpoint(MainRedDot.Qunying);
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index 2365d68..e4325f9 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -155,7 +155,8 @@
public const int RedPoint_OSHeroTrain = 481;
public const int RedPoint_OSBeautyMM = 482;
public const int RedPoint_OSMingge = 483;
- public const int HeroReturnRepoint = 484; //姝﹀皢杩斿満
+ public const int HeroReturnRepoint = 484; //姝﹀皢杩斿満
+ public const int FestivalActivityRepoint = 485; //鑺傛棩娲诲姩
public void Register()
{
diff --git a/Main/System/Settlement/BattleSettlementManager.cs b/Main/System/Settlement/BattleSettlementManager.cs
index 1144ab6..6b9ce23 100644
--- a/Main/System/Settlement/BattleSettlementManager.cs
+++ b/Main/System/Settlement/BattleSettlementManager.cs
@@ -260,9 +260,10 @@
public void RequestTurnFightData(string guid, string date, int mapID, int crossServerID = 0)
{
//mobile.secondworld.net.cn:53080\S9006\20251202\3042602\5b11338f-cf2c-11f0-a0a0-000c29b22418.tfr
- var serverID = crossServerID !=0 ? crossServerID : UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID);
+ // crossServerID 鍙槸涓轰簡鍙栧尯鏈嶄俊鎭紝鍚庣画鐨勪娇鐢ㄤ緷鐒剁敤serverID鍋氶�昏緫
+ var serverID = UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID);
- var url = ServerListCenter.Instance.GetServerUrl(serverID);
+ var url = ServerListCenter.Instance.GetServerUrl(crossServerID !=0 ? crossServerID : serverID);
string assetVersionUrl = string.Empty;
if (string.IsNullOrEmpty(date))
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 65646a6..a0618e8 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -859,6 +859,7 @@
Qunying = 62, //缇よ嫳姒�
HeroDebut = 63,//姝﹀皢鐧诲満
HeroReturn = 64, //姝﹀皢杩斿満
+ FestivalActivity = 65,//鑺傛棩娲诲姩
}
@@ -1815,8 +1816,13 @@
TimeRushAct = 200, //杞洖娈�(姝﹀皢鍐插埡)
HeroDebutAct = 201, //鑻遍泟鐧诲満娲诲姩
HeroReturnAct = 202, //鑻遍泟杩斿満娲诲姩
- TotalRechargeAct = 4, //绱厖娲诲姩
- TotDayRechargeAct = 5, //绱厖澶╂椿鍔�
+ TotalRechargeAct = 203, //绱厖娲诲姩
+ TotDayRechargeAct = 204, //绱厖澶╂椿鍔�
+ FestivalActivityAct = 205, //鑺傛棩娲诲姩
+ FestivalActivityRechargeTotalAct = 206,
+ FestivalActivityRechargeTotDayAct = 207,
+ FestivalActivityCheckInAct = 208,
+ FestivalActivityMissionAct = 209, //鑺傛棩娲诲姩-浠诲姟
}
//浠欑帀璐拱鐨勪簩娆$‘璁ゆ绫诲瀷
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 4a8b288..8cb49c4 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -23,10 +23,16 @@
//涓嶉渶瑕佹彁鍙栫炕璇戠殑鏂囨湰
private static readonly string[] numbers = new string[] { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�" };
private static readonly string[] units = new string[] { "鍗�", "鐧�", "鍗�", "涓�" };
-
+ private static readonly string[] unitFTs = new string[] { "鍗�", "鐧�", "鍗�", "钀�" };
//鏁板瓧杞腑鏂�(鍙仛灏忔暟瀛�)锛屾捣澶栫増鏈皟鐢ㄦ敼鍑芥暟鍒囨崲鐗堟湰璇风洿鎺ヨ繑鍥炴暟瀛�
public static string ChineseNumber(int number)
{
+ string langId = Language.Id;
+ if (!string.IsNullOrEmpty(langId) && langId != "zh" && langId != "ft")
+ return number.ToString();
+
+ string[] curUnits = (langId == "ft") ? unitFTs : units;
+
if (number == 0)
return numbers[0];
@@ -42,7 +48,7 @@
if (needZero)
result = StringUtility.Concat(numbers[0] + result);
- result = numbers[part] + (unitPlace == 1 ? "" : units[unitPlace - 2]) + result; // 鍗曚綅鍙湪鍗併�佺櫨銆佸崈銆佷竾鍐呴儴浣跨敤
+ result = numbers[part] + (unitPlace == 1 ? "" : curUnits[unitPlace - 2]) + result; // 鍗曚綅鍙湪鍗併�佺櫨銆佸崈銆佷竾鍐呴儴浣跨敤
needZero = false;
}
else
@@ -567,7 +573,7 @@
case 43:
case 44:
return GetUIColor(TextColType.itemshenhua, bright);
-
+
}
--
Gitblit v1.8.0