From f3ae8542aee4b5de78fc20d9543bb424b315708f Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 10 九月 2025 14:23:47 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/Config/PartialConfigs/HeroBreakConfig.cs | 10
Main/System/HeroUI/HeroUIManager.Talent.cs | 5
Main/System/Tip/ItemsConfirmWin.cs | 6
Main/System/HeroUI/HeroCollectionLvUpWin.cs | 203 ++++++++++
Main/Config/ConfigManager.cs | 59 ++
Main/System/HeroUI/HeroCardCell.cs | 5
Main/System/HeroUI/GiftBaseCell.cs | 41 +
Main/System/HeroUI/HeroGiftLineCell.cs | 2
Main/System/Redpoint/MainRedDot.cs | 4
Main/ResModule/UILoader.cs | 2
Main/System/HeroUI/HeroUIManager.Collect.cs | 143 ++++++
Main/System/HeroUI/HeroCollectionLvUpWin.cs.meta | 11
Main/System/Hero/HeroInfo.Talent.cs | 14
Main/System/Hero/HeroInfo.Properties.cs | 4
Main/Config/PartialConfigs/HeroAwakeConfig.cs | 4
Main/System/HeroUI/HeroCollectionLineCell.cs | 9
Main/System/HeroUI/HeroShowBaseCell.cs | 23 +
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs | 2
Main/Config/Configs/HeroConfig.cs | 17
Main/System/HeroUI/HeroGiftRoleListWin.cs | 11
Main/System/HeroUI/HeroUIManager.Awake.cs | 26 +
Main/System/HeroUI/HeroDeleteWin.cs | 20
Main/System/HeroUI/HeroTrainWin.cs | 128 ++---
Main/System/Tip/ConfirmCancel.cs | 4
Main/System/HeroUI/HeroCollectionCardCell.cs | 83 ++--
Main/System/Main/FightPowerManager.cs | 6
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs | 6
Main/System/HeroUI/HeroBaseWin.cs | 2
Main/System/HeroUI/HeroGiftRoleListCell.cs | 9
Main/System/HeroUI/HeroGiftWashCell.cs | 2
Main/System/HeroUI/HeroUIManager.Reborn.cs | 129 ++++++
Main/System/HeroUI/HeroCollectionWin.cs | 138 ++++++
Main/System/Tip/ItemsConfirmCell.cs | 4
Main/Utility/UIHelper.cs | 2
Main/System/HeroUI/HeroGiftWashWin.cs | 16
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB237_tagCSHeroBookUP.cs | 36
Main/System/HeroUI/HeroUIManager.cs | 14
37 files changed, 1,003 insertions(+), 197 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 49c6096..7035beb 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -38,15 +38,32 @@
// 鍔犺浇閰嶇疆鏂囦欢
HashSet<Type> configTypes = new HashSet<Type>() {
+ typeof(ChestsAwardConfig),
+ typeof(CTGConfig),
+ typeof(DamageNumConfig),
typeof(DirtyWordConfig),
+ typeof(FaceConfig),
typeof(FightPowerRatioConfig),
typeof(HeroLineupHaloConfig),
typeof(HeroQualityLVConfig),
typeof(InvestConfig),
typeof(ItemConfig),
+ typeof(MainChapterConfig),
typeof(MainLevelConfig),
- typeof(PlayerLVConfig),
- typeof(TitleStarUpConfig)
+ typeof(NPCConfig),
+ typeof(NPCExConfig),
+ typeof(NPCLineupConfig),
+ typeof(OrderInfoConfig),
+ typeof(PlayerAttrConfig),
+ typeof(PlayerFaceConfig),
+ typeof(StoreConfig),
+ typeof(SuccessConfig),
+ typeof(SysInfoConfig),
+ typeof(TitleStarUpConfig),
+ typeof(TreasureSetConfig),
+ typeof(TreeLVConfig),
+ typeof(WindowSearchConfig),
+ typeof(XBGetItemConfig)
};
#if UNITY_EDITOR
@@ -196,8 +213,16 @@
public override void Release()
{
+ // 娓呯┖ ChestsAwardConfig 瀛楀吀
+ ClearConfigDictionary<ChestsAwardConfig>();
+ // 娓呯┖ CTGConfig 瀛楀吀
+ ClearConfigDictionary<CTGConfig>();
+ // 娓呯┖ DamageNumConfig 瀛楀吀
+ ClearConfigDictionary<DamageNumConfig>();
// 娓呯┖ DirtyWordConfig 瀛楀吀
ClearConfigDictionary<DirtyWordConfig>();
+ // 娓呯┖ FaceConfig 瀛楀吀
+ ClearConfigDictionary<FaceConfig>();
// 娓呯┖ FightPowerRatioConfig 瀛楀吀
ClearConfigDictionary<FightPowerRatioConfig>();
// 娓呯┖ HeroLineupHaloConfig 瀛楀吀
@@ -208,12 +233,38 @@
ClearConfigDictionary<InvestConfig>();
// 娓呯┖ ItemConfig 瀛楀吀
ClearConfigDictionary<ItemConfig>();
+ // 娓呯┖ MainChapterConfig 瀛楀吀
+ ClearConfigDictionary<MainChapterConfig>();
// 娓呯┖ MainLevelConfig 瀛楀吀
ClearConfigDictionary<MainLevelConfig>();
- // 娓呯┖ PlayerLVConfig 瀛楀吀
- ClearConfigDictionary<PlayerLVConfig>();
+ // 娓呯┖ NPCConfig 瀛楀吀
+ ClearConfigDictionary<NPCConfig>();
+ // 娓呯┖ NPCExConfig 瀛楀吀
+ ClearConfigDictionary<NPCExConfig>();
+ // 娓呯┖ NPCLineupConfig 瀛楀吀
+ ClearConfigDictionary<NPCLineupConfig>();
+ // 娓呯┖ OrderInfoConfig 瀛楀吀
+ ClearConfigDictionary<OrderInfoConfig>();
+ // 娓呯┖ PlayerAttrConfig 瀛楀吀
+ ClearConfigDictionary<PlayerAttrConfig>();
+ // 娓呯┖ PlayerFaceConfig 瀛楀吀
+ ClearConfigDictionary<PlayerFaceConfig>();
+ // 娓呯┖ StoreConfig 瀛楀吀
+ ClearConfigDictionary<StoreConfig>();
+ // 娓呯┖ SuccessConfig 瀛楀吀
+ ClearConfigDictionary<SuccessConfig>();
+ // 娓呯┖ SysInfoConfig 瀛楀吀
+ ClearConfigDictionary<SysInfoConfig>();
// 娓呯┖ TitleStarUpConfig 瀛楀吀
ClearConfigDictionary<TitleStarUpConfig>();
+ // 娓呯┖ TreasureSetConfig 瀛楀吀
+ ClearConfigDictionary<TreasureSetConfig>();
+ // 娓呯┖ TreeLVConfig 瀛楀吀
+ ClearConfigDictionary<TreeLVConfig>();
+ // 娓呯┖ WindowSearchConfig 瀛楀吀
+ ClearConfigDictionary<WindowSearchConfig>();
+ // 娓呯┖ XBGetItemConfig 瀛楀吀
+ ClearConfigDictionary<XBGetItemConfig>();
}
#if UNITY_EDITOR
diff --git a/Main/Config/Configs/HeroConfig.cs b/Main/Config/Configs/HeroConfig.cs
index 4b8810f..9f364eb 100644
--- a/Main/Config/Configs/HeroConfig.cs
+++ b/Main/Config/Configs/HeroConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�17鏃�
+// [ Date ]: 2025骞�9鏈�9鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -32,6 +32,7 @@
public int[] FetterIDList;
public float UIScale;
public string Desc;
+ public int[] TalentList;
public override int LoadKey(string _key)
{
@@ -98,6 +99,20 @@
float.TryParse(tables[14],out UIScale);
Desc = tables[15];
+
+ if (tables[16].Contains("["))
+ {
+ TalentList = JsonMapper.ToObject<int[]>(tables[16]);
+ }
+ else
+ {
+ string[] TalentListStringArray = tables[16].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ TalentList = new int[TalentListStringArray.Length];
+ for (int i=0;i<TalentListStringArray.Length;i++)
+ {
+ int.TryParse(TalentListStringArray[i],out TalentList[i]);
+ }
+ }
}
catch (Exception exception)
{
diff --git a/Main/Config/PartialConfigs/HeroAwakeConfig.cs b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
index 52466ce..f93655e 100644
--- a/Main/Config/PartialConfigs/HeroAwakeConfig.cs
+++ b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
@@ -49,6 +49,7 @@
return GetHeroAwakeConfig(heroID, awakeLv) != null;
}
+ //瑙i攣鎸囧畾澶╄祴妲戒綅闇�瑕佺殑瑙夐啋绛夌骇
public static int GetAwakeLVByUnLockGiftIndex(int heroID, int index)
{
Dictionary<int, HeroAwakeConfig> tempDic = null;
@@ -66,6 +67,7 @@
}
return 0;
}
+
public static int GetMaxAwakeLV(int heroID)
{
@@ -73,7 +75,7 @@
if (!configDics.TryGetValue(heroID, out tempDic))
{
return 0;
- }
+ }
return tempDic.Count;
}
}
diff --git a/Main/Config/PartialConfigs/HeroBreakConfig.cs b/Main/Config/PartialConfigs/HeroBreakConfig.cs
index 683b915..06c3558 100644
--- a/Main/Config/PartialConfigs/HeroBreakConfig.cs
+++ b/Main/Config/PartialConfigs/HeroBreakConfig.cs
@@ -46,4 +46,14 @@
{
return GetHeroBreakConfig(heroID, breakLv) == null;
}
+
+ public static int GetMaxBreakLv(int heroID)
+ {
+ Dictionary<int, HeroBreakConfig> tempDic = null;
+ if (!configDics.TryGetValue(heroID, out tempDic))
+ {
+ return 0;
+ }
+ return tempDic.Count;
+ }
}
\ No newline at end of file
diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB237_tagCSHeroBookUP.cs b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB237_tagCSHeroBookUP.cs
index 865bb6d..206f2b8 100644
--- a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB237_tagCSHeroBookUP.cs
+++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB237_tagCSHeroBookUP.cs
@@ -1,22 +1,20 @@
using UnityEngine;
using System.Collections;
-// B2 37 姝﹀皢鍥鹃壌婵�娲诲崌绾� #tagCSHeroBookUP
-
-public class CB237_tagCSHeroBookUP : GameNetPackBasic {
- public uint HeroID; //姝﹀皢ID
- public ushort ItemIndex; //鍏宠仈姝﹀皢鐗╁搧鎵�鍦ㄦ灏嗚儗鍖呯储寮曪紝婵�娲绘椂鍙笉鐢ㄥ彂
- public byte BookType; //鍥鹃壌婵�娲荤被鍨嬶細 0-鍒濆婵�娲伙紱1-鏄熺骇鍗囩骇锛�2-绐佺牬绛夌骇鍗囩骇
-
- public CB237_tagCSHeroBookUP () {
- combineCmd = (ushort)0x03FE;
- _cmd = (ushort)0xB237;
- }
-
- public override void WriteToBytes () {
- WriteBytes (HeroID, NetDataType.DWORD);
- WriteBytes (ItemIndex, NetDataType.WORD);
- WriteBytes (BookType, NetDataType.BYTE);
- }
-
-}
+// B2 37 姝﹀皢鍥鹃壌婵�娲诲崌绾� #tagCSHeroBookUP
+
+public class CB237_tagCSHeroBookUP : GameNetPackBasic {
+ public uint HeroID; //姝﹀皢ID
+ public byte BookType; //鍥鹃壌婵�娲荤被鍨嬶細 0-鍒濆婵�娲伙紱1-鏄熺骇鍗囩骇锛�2-绐佺牬绛夌骇鍗囩骇
+
+ public CB237_tagCSHeroBookUP () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB237;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (HeroID, NetDataType.DWORD);
+ WriteBytes (BookType, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs
index aff48f1..b4423fb 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB122_tagSCHeroInfo.cs
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections;
-// B1 22 姝﹀皢鍥鹃壌淇℃伅 #tagSCHeroInfo
+// B1 22 姝﹀皢淇℃伅 #tagSCHeroInfo
public class DTCB122_tagSCHeroInfo : DtcBasic {
public override void Done(GameNetPackBasic vNetPack)
diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs
index 450f728..d375f2d 100644
--- a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB122_tagSCHeroInfo.cs
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections;
-// B1 22 姝﹀皢鍥鹃壌淇℃伅 #tagSCHeroInfo
+// B1 22 姝﹀皢淇℃伅 #tagSCHeroInfo
public class HB122_tagSCHeroInfo : GameNetPackBasic {
public ushort HeroCnt;
@@ -21,6 +21,8 @@
TransBytes (out HeroInfoList[i].BookInitState, vBytes, NetDataType.BYTE);
TransBytes (out HeroInfoList[i].BookStarLV, vBytes, NetDataType.WORD);
TransBytes (out HeroInfoList[i].BookBreakLV, vBytes, NetDataType.WORD);
+ TransBytes (out HeroInfoList[i].BookStarLVH, vBytes, NetDataType.WORD);
+ TransBytes (out HeroInfoList[i].BookBreakLVH, vBytes, NetDataType.WORD);
}
}
@@ -30,6 +32,8 @@
public byte BookInitState; // 鍥鹃壌婵�娲荤姸鎬侊細0-鏈縺娲伙紱1-鍙縺娲伙紱2-宸叉縺娲�
public ushort BookStarLV; // 鍥鹃壌鏄熺骇绛夌骇
public ushort BookBreakLV; // 鍥鹃壌绐佺牬绛夌骇
+ public ushort BookStarLVH; // 鍥鹃壌鏄熺骇鍘嗗彶鏈�楂樼瓑绾�
+ public ushort BookBreakLVH; // 鍥鹃壌绐佺牬鍘嗗彶鏈�楂樼瓑绾�
}
}
diff --git a/Main/ResModule/UILoader.cs b/Main/ResModule/UILoader.cs
index 6f07dbf..392f0d4 100644
--- a/Main/ResModule/UILoader.cs
+++ b/Main/ResModule/UILoader.cs
@@ -68,6 +68,6 @@
{
return null;
}
- return ResManager.Instance.LoadAsset<Texture2D>(StringUtility.Contact(ResourcesPath.UI_SPRITE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite);
+ return ResManager.Instance.LoadAsset<Texture2D>(StringUtility.Contact(ResourcesPath.UI_TEXTURE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite);
}
}
diff --git a/Main/System/Hero/HeroInfo.Properties.cs b/Main/System/Hero/HeroInfo.Properties.cs
index fc5bb2b..35be8ba 100644
--- a/Main/System/Hero/HeroInfo.Properties.cs
+++ b/Main/System/Hero/HeroInfo.Properties.cs
@@ -120,12 +120,12 @@
//涓婇樀灞炴��:鏀婚槻琛�
public int GetOnBattleAddPer()
{
- return qualityConfig.InitAddPer + qualityConfig.LVAddPer * heroLevel + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar;
+ return qualityConfig.InitAddPer + qualityConfig.LVAddPer * (heroLevel - 1) + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar;
}
public int GetLineupLVAddPer()
{
- return qualityConfig.LVAddPer * heroLevel;
+ return qualityConfig.LVAddPer * (heroLevel - 1);
}
public int GetLineupBreakLVAddPer()
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index 38ad22d..95e3128 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -10,12 +10,24 @@
{
get
{
+ // 鍥犱负瑙夐啋闄嶄綆浜嗘槦绾э紝瀹㈡埛绔嚜宸遍檷浣庢槦绾�
+ if (itemHero == null)
+ return 0;
+
+ return Math.Min(GetCurMaxStar(), heroStarMaxBefore);
+ }
+ }
+
+ // 鍥犱负瑙夐啋闄嶄綆浜嗘槦绾э紝淇濈暀鍘嗗彶鏈�澶ф槦绾�
+ public int heroStarMaxBefore
+ {
+ get
+ {
if (itemHero == null)
return 0;
return itemHero.GetUseDataFirstValue(72);
}
}
-
// 71 # 鑻遍泟澶╄祴ID鍒楄〃
public List<int> talentIDList
diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs
index c7fcd0a..2e6eee9 100644
--- a/Main/System/HeroUI/GiftBaseCell.cs
+++ b/Main/System/HeroUI/GiftBaseCell.cs
@@ -97,6 +97,19 @@
}
}
+ Image m_AwakeLockImg; //閲嶇敓闄嶄綆瑙夐啋绛夌骇閿佸畾鐨勫浘鐗�
+ Image awakeLockImg
+ {
+ get
+ {
+ if (m_AwakeLockImg == null)
+ {
+ m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock");
+ }
+ return m_AwakeLockImg;
+ }
+ }
+
void Awake()
@@ -106,7 +119,7 @@
//showState 0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
//giftID 0 :浠h〃鐏拌壊闇�鍗囨槦婵�娲� -1锛氫唬琛ㄦ鑹查渶瑙夐啋婵�娲伙紝鍏朵粬鏍规嵁閰嶈〃锛屾病鏈夊ぉ璧嬬殑澶栧眰鎺у埗鏄鹃殣
- public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0)
+ public void Init(int giftID, int lv, int showState = 0, int heroID = 0, int index = 0, int awakeLevel = 0)
{
LoadPrefab(); //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
if (HeroTalentConfig.HasKey(giftID))
@@ -121,6 +134,16 @@
stateImg.SetActive(showState > 0);
stateImg.SetSprite("GiftState" + showState);
stateImg.SetNativeSize();
+
+ //鐗规畩澶勭悊閲嶇敓闄嶄綆瑙夐啋绛夌骇閿佸畾鐨勫ぉ璧�
+ if (index >= HeroUIManager.Instance.normalGiftMaxCnt)
+ {
+ awakeLockImg.SetActive(HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index) > awakeLevel);
+ }
+ else
+ {
+ awakeLockImg.SetActive(false);
+ }
}
else
{
@@ -128,11 +151,12 @@
giftName.text = string.Empty;
lvRect.SetActive(false);
stateImg.SetActive(false);
+ awakeLockImg.SetActive(false);
}
- giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); });
+ giftBtn.AddListener(() => { ShowSmallTip(giftID, lv, heroID, index, awakeLevel); });
}
- void ShowSmallTip(int giftID, int giftLV, int heroID, int index)
+ void ShowSmallTip(int giftID, int giftLV, int heroID, int index, int awakeLevel)
{
SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
if (giftID > 0)
@@ -140,6 +164,17 @@
var giftConfig = HeroTalentConfig.Get(giftID);
SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV)));
+
+ if (index >= HeroUIManager.Instance.normalGiftMaxCnt)
+ {
+ int needAwakeLV = HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index);
+ if (needAwakeLV > awakeLevel)
+ {
+ SmallTipWin.showText += "\n" + Language.Get("HeroAwake18", needAwakeLV);
+ }
+ }
+
+
UIManager.Instance.OpenWindow<SmallTipWin>();
}
diff --git a/Main/System/HeroUI/HeroBaseWin.cs b/Main/System/HeroUI/HeroBaseWin.cs
index 1680606..7125cfe 100644
--- a/Main/System/HeroUI/HeroBaseWin.cs
+++ b/Main/System/HeroUI/HeroBaseWin.cs
@@ -54,7 +54,7 @@
currentSubUI = UIManager.Instance.OpenWindow<HeroListWin>();
break;
case 1:
- //currentSubUI = UIManager.Instance.OpenWindow<HeroCollectionsWin>();
+ currentSubUI = UIManager.Instance.OpenWindow<HeroCollectionWin>();
break;
case 2:
break;
diff --git a/Main/System/HeroUI/HeroCardCell.cs b/Main/System/HeroUI/HeroCardCell.cs
index 0ad1a75..dac5741 100644
--- a/Main/System/HeroUI/HeroCardCell.cs
+++ b/Main/System/HeroUI/HeroCardCell.cs
@@ -6,7 +6,6 @@
{
[SerializeField] Button heroCardBtn;
[SerializeField] Image heroCardBG;
- [SerializeField] Material glowMaterial; // 娴佸厜鏁堟灉鏉愯川
[SerializeField] Text lvText;
[SerializeField] Image countryImg;
[SerializeField] Image jobImg;
@@ -32,10 +31,6 @@
this.gameObject.SetActive(true);
heroCardBG.SetSprite("herocardbg" + hero.Quality);
- if (glowMaterial != null)
- {
- heroCardBG.material = glowMaterial;
- }
lvText.text = Language.Get("L1094") + hero.heroLevel.ToString();
var heroConfig = hero.heroConfig;
countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
diff --git a/Main/System/HeroUI/HeroCollectionCardCell.cs b/Main/System/HeroUI/HeroCollectionCardCell.cs
index 3c05118..c947636 100644
--- a/Main/System/HeroUI/HeroCollectionCardCell.cs
+++ b/Main/System/HeroUI/HeroCollectionCardCell.cs
@@ -6,70 +6,61 @@
{
[SerializeField] Button heroCardBtn;
[SerializeField] Image heroCardBG;
- [SerializeField] Material glowMaterial; // 娴佸厜鏁堟灉鏉愯川
- [SerializeField] Text lvText;
+ [SerializeField] UIHeroController heroModel;
+ [SerializeField] List<Image> starImgList;
[SerializeField] Image countryImg;
[SerializeField] Image jobImg;
- [SerializeField] UIHeroController heroModel;
- [SerializeField] Image onStateImg;
- [SerializeField] RedpointBehaviour redpoint;
- [SerializeField] Image trainStateImg;
[SerializeField] Text nameText;
- [SerializeField] Image awakeImg;
- [SerializeField] Text awakeLVText;
- [SerializeField] List<Image> starImgList;
+ [SerializeField] Image trainStateImg;
+ [SerializeField] RedpointBehaviour redpoint;
+ [SerializeField] Button bookLVBtn;
+ [SerializeField] GameObject unGetObj;
+ [SerializeField] GameObject activeObj; // 鍙縺娲诲甫娴佸厜鏁堟灉鏉愯川
- string guid;
- public void Display(int index)
+ public void Display(int index, int quality)
{
- guid = HeroUIManager.Instance.heroSortList[index];
- var hero = HeroManager.Instance.GetHero(guid);
- if (hero == null)
- {
- this.gameObject.SetActive(false);
- return;
- }
+ var heroID = HeroUIManager.Instance.heroCollectDict[quality][index];
+ var heroConfig = HeroConfig.Get(heroID);
+ HB122_tagSCHeroInfo.tagSCHero colData;
+ HeroUIManager.Instance.TryGetHeroBookInfo(heroID, out colData);
+ heroCardBG.SetSprite("herocardbg" + heroConfig.Quality);
- this.gameObject.SetActive(true);
- heroCardBG.SetSprite("herocardbg" + hero.Quality);
- if (glowMaterial != null)
- {
- heroCardBG.material = glowMaterial;
- }
- lvText.text = Language.Get("L1094") + hero.heroLevel.ToString();
- var heroConfig = hero.heroConfig;
+ //鍒嗕负0鏈幏寰椼��1鍙縺娲汇��2甯歌銆�3绐佺牬鍗囩骇銆�4銆佹槦鍗囩骇銆�5宸叉弧绾�
+ int funcState = HeroUIManager.Instance.GetHeroBookState(heroID, quality);
+
+ activeObj.SetActive(funcState == 1);
+ bookLVBtn.SetActive(funcState > 1);
+ unGetObj.SetActive(funcState == 0);
+
countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
- heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
- onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
+ heroModel.Create(heroConfig.SkinIDList[0], heroConfig.UIScale);
- redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
- var funcState = hero.funcState;
- if (funcState > 0)
+ redpoint.redpointId = MainRedDot.HeroCardCollectRedpoint * 10000000 + heroID;
+
+ if (funcState == 3 || funcState == 4)
{
trainStateImg.SetActive(true);
- trainStateImg.SetSprite("herofuncstate" + hero.funcState);
+ trainStateImg.SetSprite("herofuncstate2");
}
else
{
trainStateImg.SetActive(false);
}
- nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel);
- awakeImg.SetActive(hero.awakeLevel > 0);
- awakeLVText.text = hero.awakeLevel.ToString();
+ nameText.text = colData.BookBreakLV == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, colData.BookBreakLV);
for (int i = 0; i < starImgList.Count; i++)
{
- if (hero.heroStar == 0 && i == 0)
+ if (colData.BookStarLV == 0 && i == 0)
{
// 鏃犳槦绾� 鐗规畩澶勭悊
starImgList[i].SetActive(true);
- starImgList[i].SetSprite("herostar" + hero.heroStar);
+ starImgList[i].SetSprite("herostar" + colData.BookStarLV);
}
- else if ((hero.heroStar - 1) % starImgList.Count >= i)
+ else if ((colData.BookStarLV - 1) % starImgList.Count >= i)
{
starImgList[i].SetActive(true);
- starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count);
+ starImgList[i].SetSprite("herostar" + (((colData.BookStarLV - 1) / starImgList.Count) + 1) * starImgList.Count);
}
else
{
@@ -79,8 +70,18 @@
heroCardBtn.AddListener(() =>
{
- HeroUIManager.Instance.selectHeroGuid = guid;
- UIManager.Instance.OpenWindow<HeroTrainWin>();
+ HeroUIManager.Instance.selectCollectHeroID = heroID;
+ var state = HeroUIManager.Instance.GetHeroBookState(heroID, quality);
+ if (state == 1 || state == 3 || state == 4)
+ {
+ UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
+ }
+ });
+
+ bookLVBtn.AddListener(() =>
+ {
+ HeroUIManager.Instance.selectCollectHeroID = heroID;
+ UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
});
}
}
diff --git a/Main/System/HeroUI/HeroCollectionLineCell.cs b/Main/System/HeroUI/HeroCollectionLineCell.cs
index 6f727c2..238e7fa 100644
--- a/Main/System/HeroUI/HeroCollectionLineCell.cs
+++ b/Main/System/HeroUI/HeroCollectionLineCell.cs
@@ -2,16 +2,17 @@
public class HeroCollectionLineCell : CellView
{
- [SerializeField] HeroCardCell[] cardList;
+ [SerializeField] HeroCollectionCardCell[] cardList;
- public void Display(int index)
+ public void Display(int index, int quality)
{
+ var _List = HeroUIManager.Instance.heroCollectDict[quality];
for (int i = 0; i < cardList.Length; i++)
{
- if (i + index < HeroUIManager.Instance.heroSortList.Count)
+ if (i + index < _List.Count)
{
cardList[i].SetActive(true);
- cardList[i].Display(index + i);
+ cardList[i].Display(index + i, quality);
}
else
{
diff --git a/Main/System/HeroUI/HeroCollectionLvUpWin.cs b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
new file mode 100644
index 0000000..e466ef3
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionLvUpWin.cs
@@ -0,0 +1,203 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 鍥鹃壌婵�娲诲崌绾х晫闈�
+/// </summary>
+public class HeroCollectionLvUpWin : UIBase
+{
+ [SerializeField] GameObject lvupPanel;
+ [SerializeField] GameObject fullPanel;
+
+ [SerializeField] HeroHeadBaseCell beforeHeadCell;
+ [SerializeField] Text name1;
+ [SerializeField] GameObject unActiveGo;
+ [SerializeField] HeroHeadBaseCell afterHeadCell;
+ [SerializeField] Text name2;
+
+ [SerializeField] Text[] attrNames;
+ [SerializeField] Text[] beforeAttrValues;
+ [SerializeField] Text[] afterAttrValues;
+
+ [SerializeField] RichText awardInfo;
+ [SerializeField] Button btn;
+ [SerializeField] Text btnText;
+
+ [SerializeField] HeroHeadBaseCell fullHeadCell;
+ [SerializeField] Text name3;
+ [SerializeField] Text[] fullAttrs;
+
+ [SerializeField] GameObject fullImg;
+
+ [SerializeField] Text titleText;
+
+
+ protected override void InitComponent()
+ {
+ btn.AddListener(OnBtnClick);
+ }
+
+ protected override void OnPreOpen()
+ {
+ HeroUIManager.Instance.OnHeroCollectEvent += Display;
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ HeroUIManager.Instance.OnHeroCollectEvent -= Display;
+ }
+
+
+ void Display()
+ {
+ var state = HeroUIManager.Instance.GetHeroBookState(HeroUIManager.Instance.selectCollectHeroID, HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID).Quality);
+ var config = HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID);
+
+ HB122_tagSCHeroInfo.tagSCHero colData;
+ HeroUIManager.Instance.TryGetHeroBookInfo(HeroUIManager.Instance.selectCollectHeroID, out colData);
+ var bookPer = HeroUIManager.Instance.GetHeroBookPer(HeroUIManager.Instance.selectCollectHeroID);
+ if (state == 5)
+ {
+ //宸叉弧绾�
+ titleText.text = Language.Get("HeroAwake13");
+ fullPanel.SetActive(true);
+ lvupPanel.SetActive(false);
+
+ fullHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
+ name3.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
+
+ for (int i = 0; i < fullAttrs.Length; i++)
+ {
+ fullAttrs[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
+ bookPer, "{0} " + UIHelper.AppendColor(TextColType.Green, "+{1}"));
+ }
+ var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
+ if (nextHeroID != 0)
+ {
+ fullImg.SetActive(false);
+ btn.SetActive(true);
+ //涓嬩竴涓�
+ btnText.text = Language.Get("HeroAwake14");
+ }
+ else
+ {
+ fullImg.SetActive(true);
+ btn.SetActive(false);
+ }
+
+ }
+ else
+ {
+ fullPanel.SetActive(false);
+ lvupPanel.SetActive(true);
+ btn.SetActive(true);
+
+ beforeHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], colData.BookStarLV);
+ name1.text = colData.BookBreakLV == 0 ? config.Name : Language.Get("herocardbreaklv", config.Name, colData.BookBreakLV);
+
+ int addPer = 0;
+ var qualityConfig = HeroQualityConfig.Get(config.Quality);
+ awardInfo.text = string.Empty;
+ unActiveGo.SetActive(false);
+ titleText.text = Language.Get("HeroAwake12");
+ int afterBreakLV = colData.BookBreakLV;
+ int afterStarLV = colData.BookStarLV;
+ if (state == 1)
+ {
+ //婵�娲�
+ addPer = qualityConfig.BookInitAddPer;
+ btnText.text = Language.Get("L1131"); //L1131 婵�娲�
+ awardInfo.text = Language.Get("HeroAwake10", UIHelper.GetIconNameWithMoneyType(HeroUIManager.Instance.bookMoneyType),
+ HeroUIManager.Instance.bookMoneyValue);
+ unActiveGo.SetActive(true);
+ titleText.text = Language.Get("HeroAwake11");
+ }
+ else if (state == 3)
+ {
+ //绐佺牬
+ addPer = qualityConfig.BookBreakLVAddPer;
+ btnText.text = Language.Get("L1109"); //鍗囩骇
+ afterBreakLV++;
+ }
+ else if (state == 4)
+ {
+ //鍗囨槦
+ addPer = qualityConfig.BookStarAddPer;
+ btnText.text = Language.Get("L1109");
+ afterStarLV++;
+ }
+ else
+ {
+ var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
+ if (nextHeroID != 0)
+ {
+ //涓嬩竴涓�
+ btnText.text = Language.Get("HeroAwake14");
+ }
+ else
+ {
+ btnText.text = Language.Get("L1109");
+ }
+ }
+
+ afterHeadCell.Init(HeroUIManager.Instance.selectCollectHeroID, config.SkinIDList[0], afterStarLV);
+ name2.text = afterBreakLV == 0 ? config.Name :Language.Get("herocardbreaklv", config.Name, afterBreakLV);
+
+
+ for (int i = 0; i < beforeAttrValues.Length; i++)
+ {
+ beforeAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer);
+ attrNames[i].text = PlayerPropertyConfig.Get(PlayerPropertyConfig.basePerAttrs[i]).Name;
+ afterAttrValues[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], bookPer + addPer);
+ }
+ }
+
+ }
+
+ void OnBtnClick()
+ {
+ var state = HeroUIManager.Instance.GetHeroBookState(HeroUIManager.Instance.selectCollectHeroID, HeroConfig.Get(HeroUIManager.Instance.selectCollectHeroID).Quality);
+ if (state == 1)
+ {
+ //婵�娲�
+ SendPack(0);
+ }
+ else if (state == 3)
+ {
+ //绐佺牬
+ SendPack(2);
+ }
+ else if (state == 4)
+ {
+ //鍗囨槦
+ SendPack(1);
+ }
+ else
+ {
+ var nextHeroID = HeroUIManager.Instance.FindHeroIDCanAddCollectAttr(HeroUIManager.Instance.selectCollectHeroID);
+ if (nextHeroID != 0)
+ {
+ //涓嬩竴涓�
+ HeroUIManager.Instance.selectCollectHeroID = nextHeroID;
+ Display();
+ }
+ else
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift8");
+ }
+ }
+ }
+
+ void SendPack(int type)
+ {
+ var pack = new CB237_tagCSHeroBookUP();
+ pack.BookType = (byte)type;
+ pack.HeroID = (uint)HeroUIManager.Instance.selectCollectHeroID;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroCollectionLvUpWin.cs.meta b/Main/System/HeroUI/HeroCollectionLvUpWin.cs.meta
new file mode 100644
index 0000000..dc925e9
--- /dev/null
+++ b/Main/System/HeroUI/HeroCollectionLvUpWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c8604af8282af244b8ed4d2943122bf6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroCollectionWin.cs b/Main/System/HeroUI/HeroCollectionWin.cs
index 6624ec1..951de4e 100644
--- a/Main/System/HeroUI/HeroCollectionWin.cs
+++ b/Main/System/HeroUI/HeroCollectionWin.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Linq;
using UnityEngine;
using UnityEngine.UI;
@@ -8,20 +9,155 @@
/// </summary>
public class HeroCollectionWin : UIBase
{
+ [SerializeField] Button heroPackBtn;
+ [SerializeField] Text heroPackText;
+ [SerializeField] ScrollerController heroListScroller;
+ [SerializeField] List<Text> totalAttrList;
+ [SerializeField] Button attrBtn;
+ [SerializeField] HeroSelectBehaviour fiterManager; //姝﹀皢绛涢��
+ SinglePack singlePack;
protected override void InitComponent()
{
+ attrBtn.AddListener(() =>
+ {
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ SmallTipWin.showText = Language.Get("herocard6");
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
+ heroPackBtn.AddListener(() =>
+ {
+ HeroUIManager.Instance.QueryUnLockHeroPack();
+ });
}
protected override void OnPreOpen()
{
-
+ singlePack = PackManager.Instance.GetSinglePack(PackType.Hero);
+ PackManager.Instance.gridRefreshEvent += GridRefreshEvent;
+ PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
+ HeroUIManager.Instance.OnHeroCollectEvent += OnHeroCollectEvent;
+ heroListScroller.OnRefreshCell += OnRefreshCell;
+ HeroUIManager.Instance.selectHeroCollectListJob = 0;
+ HeroUIManager.Instance.selectHeroCollectListCountry = 0;
+ HeroUIManager.Instance.SortHeroCollectList();
+ Display();
}
protected override void OnPreClose()
{
+
+ PackManager.Instance.gridRefreshEvent -= GridRefreshEvent;
+ PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
+ HeroUIManager.Instance.OnHeroCollectEvent -= OnHeroCollectEvent;
+ heroListScroller.OnRefreshCell -= OnRefreshCell;
+ }
+
+
+ void Display()
+ {
+ fiterManager.Display(0, HeroUIManager.Instance.selectHeroCollectListJob, HeroUIManager.Instance.selectHeroCollectListCountry, SelectJobCountry);
+
+ CreateScroller();
+ RefreshTotalAttr();
+ RefreshPackCount();
+ }
+
+
+ void RefreshItemEvent(PackType type, int index, int itemID)
+ {
+ if (type != PackType.Hero)
+ return;
+
+
+ RefreshPackCount();
+
+ }
+
+ void RefreshPackCount()
+ {
+ int count = singlePack.GetAllItems().Count;
+ heroPackText.text = UIHelper.AppendColor(count >= singlePack.unlockedGridCount ? TextColType.Red : TextColType.NavyBrown,
+ string.Format("{0}/{1}", count, singlePack.unlockedGridCount));
+
+ }
+
+ void GridRefreshEvent(PackType type)
+ {
+ if (type != PackType.Hero)
+ return;
+
+ RefreshPackCount();
+ }
+
+
+ void RefreshTotalAttr()
+ {
+ for (int i = 0; i < totalAttrList.Count; i++)
+ {
+ totalAttrList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i],
+ HeroUIManager.Instance.allHeroBookPer);
+ }
+ }
+
+
+ void SelectJobCountry(int job, int country)
+ {
+ HeroUIManager.Instance.selectHeroCollectListJob = job;
+ HeroUIManager.Instance.selectHeroCollectListCountry = country;
+ HeroUIManager.Instance.SortHeroCollectList();
+ CreateScroller();
+ }
+
+
+ void CreateScroller()
+ {
+ heroListScroller.Refresh();
+ var _List = HeroUIManager.Instance.heroCollectDict.Keys.ToList();
+ _List.Reverse();
+ for (int i = 0; i < _List.Count; i++)
+ {
+ var ids = HeroUIManager.Instance.heroCollectDict[_List[i]];
+ if (ids.Count == 0)
+ continue;
+ //鍝佽川
+ heroListScroller.AddCell(ScrollerDataType.Header, _List[i]);
+ //姝﹀皢
+ for (int j = 0; j < ids.Count; j++)
+ {
+ if (j % 4 == 0)
+ {
+ CellInfo cellInfo = new CellInfo();
+ cellInfo.infoInt1 = _List[i];
+ heroListScroller.AddCell(ScrollerDataType.Normal, j, cellInfo);
+ }
+ }
+ }
+ heroListScroller.Restart();
+ }
+
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ if (type == ScrollerDataType.Header)
+ {
+ var _cell = cell.GetComponent<Image>();
+ _cell.SetSprite("herocoltitle" + cell.index);
+ }
+ else if (type == ScrollerDataType.Normal)
+ {
+ var _cell = cell as HeroCollectionLineCell;
+ _cell?.Display(cell.index, cell.info.Value.infoInt1);
+
+ }
+ }
+
+ void OnHeroCollectEvent()
+ {
+ RefreshTotalAttr();
+ heroListScroller.m_Scorller.RefreshActiveCellViews();
}
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroDeleteWin.cs b/Main/System/HeroUI/HeroDeleteWin.cs
index ddfb73e..fd7b9bf 100644
--- a/Main/System/HeroUI/HeroDeleteWin.cs
+++ b/Main/System/HeroUI/HeroDeleteWin.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@@ -5,7 +6,7 @@
/// <summary>
-/// 姝﹀皢鍩瑰吇鐣岄潰
+/// 姝﹀皢閬f暎鐣岄潰
/// </summary>
public class HeroDeleteWin : UIBase
{
@@ -150,7 +151,7 @@
HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectDeleteHeroList[i]);
if (hero == null)
continue;
- if (hero.heroStar > 1)
+ if (hero.heroStarMaxBefore > 1)
{
hasStarHero = true;
break;
@@ -192,16 +193,25 @@
{
if (!tmpDict.ContainsKey(itemInfo[0]))
{
- tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStar));
+ tmpDict.Add(itemInfo[0], itemInfo[1] * (1 + hero.heroStarMaxBefore));
}
else
{
- tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStar);
+ tmpDict[itemInfo[0]] += itemInfo[1] * (1 + hero.heroStarMaxBefore);
}
}
allItemDict = CommonFunc.AddDict(allItemDict, tmpDict);
}
+
+ //璁$畻杩旇繕姣斾緥
+ var _list = allItemDict.Keys.ToList();
+ foreach (var key in _list)
+ {
+ allItemDict[key] = Math.Max((long)(allItemDict[key] * HeroUIManager.Instance.deletePayBackPer / 100.0), 1);
+ }
+
+
List<Item> items = CommonFunc.ChangeToItemList(allItemDict);
ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard25"), Language.Get("herocard26"), (bool isOk) =>
@@ -220,7 +230,7 @@
GameNetSystem.Instance.SendInfo(pack);
HeroUIManager.Instance.selectDeleteHeroList.Clear();
}
- });
+ }, itemName:$"( {HeroUIManager.Instance.deletePayBackPer}% )");
}
diff --git a/Main/System/HeroUI/HeroGiftLineCell.cs b/Main/System/HeroUI/HeroGiftLineCell.cs
index d4237d4..ce685b9 100644
--- a/Main/System/HeroUI/HeroGiftLineCell.cs
+++ b/Main/System/HeroUI/HeroGiftLineCell.cs
@@ -11,7 +11,7 @@
{
if (index < configList.Count)
{
- var giftID = configList[index];
+ var giftID = configList[index + i];
var giftLV = HeroUIManager.Instance.maxGiftLevel;
cardList[i].SetActive(true);
cardList[i].Init(giftID, giftLV);
diff --git a/Main/System/HeroUI/HeroGiftRoleListCell.cs b/Main/System/HeroUI/HeroGiftRoleListCell.cs
index c016d95..e84aec0 100644
--- a/Main/System/HeroUI/HeroGiftRoleListCell.cs
+++ b/Main/System/HeroUI/HeroGiftRoleListCell.cs
@@ -63,8 +63,15 @@
return;
}
+ if (hero.heroLevel > 1)
+ {
+ HeroUIManager.Instance.ResetBtnClick(hero);
+ return;
+ }
+
+
if (hero.heroStar > 0)
- {
+ {
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
Language.Get("HeroGift13"), (bool isOK) =>
{
diff --git a/Main/System/HeroUI/HeroGiftRoleListWin.cs b/Main/System/HeroUI/HeroGiftRoleListWin.cs
index e50a3ad..4fc4beb 100644
--- a/Main/System/HeroUI/HeroGiftRoleListWin.cs
+++ b/Main/System/HeroUI/HeroGiftRoleListWin.cs
@@ -12,7 +12,7 @@
[SerializeField] GameObject emptyGo;
-
+
protected override void OnPreOpen()
{
@@ -20,6 +20,7 @@
scroller.OnRefreshCell += Scroller_OnRefreshCell;
TeamManager.Instance.OnTeamChange += OnTeamChange;
PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
+ HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
Display();
}
@@ -28,13 +29,14 @@
scroller.OnRefreshCell -= Scroller_OnRefreshCell;
TeamManager.Instance.OnTeamChange -= OnTeamChange;
PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
+ HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
HeroUIManager.Instance.heroEatList.Clear();
}
public void Display()
{
-
+
if (HeroUIManager.Instance.heroEatList.Count <= 0)
{
emptyGo.SetActive(true);
@@ -67,4 +69,9 @@
{
scroller.m_Scorller.RefreshActiveCellViews();
}
+
+ void OnHeroChangeEvent(HeroInfo hero)
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroGiftWashCell.cs b/Main/System/HeroUI/HeroGiftWashCell.cs
index 86c1f7c..3842aae 100644
--- a/Main/System/HeroUI/HeroGiftWashCell.cs
+++ b/Main/System/HeroUI/HeroGiftWashCell.cs
@@ -20,7 +20,7 @@
int giftID = hero.talentIDList[index];
int giftLV = hero.talentLvList[index];
- giftCell.Init(giftID, giftLV);
+ giftCell.Init(giftID, giftLV, 0, hero.heroId, index, hero.awakeLevel);
if (hero.talentLockList.IndexOf(index) != -1)
{
diff --git a/Main/System/HeroUI/HeroGiftWashWin.cs b/Main/System/HeroUI/HeroGiftWashWin.cs
index 0795e5f..2df32d7 100644
--- a/Main/System/HeroUI/HeroGiftWashWin.cs
+++ b/Main/System/HeroUI/HeroGiftWashWin.cs
@@ -110,6 +110,20 @@
return;
}
+ //娲楃偧鍜岃閱掔殑澶╄祴鏈鐞嗕笉鍙悶鍣�
+ if (hero.talentRandomIDList.Count > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift4");
+ return;
+ }
+
+ if (hero.talentAwakeRandomIDList.Count > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift5");
+ return;
+ }
+
+
//鏍规嵁閿佺姸鎬佸垽鏂潗鏂欐槸鍚﹁冻澶�
if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID,
HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2))
@@ -160,7 +174,7 @@
afterGiftCells[i].SetActive(true);
- afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i]);
+ afterGiftCells[i].Init(hero.talentRandomIDList[i], hero.talentLvList[i], 0, hero.heroId, i, hero.awakeLevel);
//瀵规瘮鍙樺寲鐨勫ぉ璧嬫樉绀虹壒鏁�
if (hero.talentRandomIDList[i] != hero.talentIDList[i])
diff --git a/Main/System/HeroUI/HeroShowBaseCell.cs b/Main/System/HeroUI/HeroShowBaseCell.cs
index cc86c69..594a8cf 100644
--- a/Main/System/HeroUI/HeroShowBaseCell.cs
+++ b/Main/System/HeroUI/HeroShowBaseCell.cs
@@ -116,6 +116,21 @@
return m_LvTextOutline;
}
}
+
+ Button m_StarBtn;
+ Button starBtn
+ {
+ get
+ {
+ if (m_StarBtn == null)
+ {
+ m_StarBtn = this.transform.GetComponent<Button>("Container_HeroShow/layout/layout/stars");
+ }
+ return m_StarBtn;
+ }
+ }
+
+
void Awake()
{
LoadPrefab();
@@ -170,12 +185,18 @@
lvText.SetActive(false);
}
else
- {
+ {
lvText.SetActive(true);
lvText.text = string.Format("{0}{1} {2}", Language.Get("L1094"), lv, awakelv == 0 ? Language.Get("herocard13") : Language.Get("herocard12", awakelv));
heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red;
}
+ starBtn.AddListener(() =>
+ {
+ SmallTipWin.showText = Language.Get("HeroGift14", star);
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
}
GameObject cellContainer;
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 984b749..b0c53de 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -9,6 +9,7 @@
/// </summary>
public class HeroTrainWin : UIBase
{
+ [SerializeField] RawImage bgTexture;
[SerializeField] Button showFuncBtn; //鍙樉绀虹珛缁樻椂鐐瑰嚮锛屾樉绀哄姛鑳�
[SerializeField] Transform funcForm;
[SerializeField] UIHeroController roleLhModel; //灞曠ず鑻遍泟绔嬬粯
@@ -80,6 +81,12 @@
[SerializeField] Text starUPBtnText;
[SerializeField] Button washBtn;
+ //鍐荤粨澶勭悊
+ [SerializeField] Button freezeTipBtn;
+ [SerializeField] GameObject freezeTipGo;
+ [SerializeField] Text freezeStarText;
+ [SerializeField] Text freezeAawkeLVText;
+ [SerializeField] List<Image> starImgFreezeList;
string guid;
HeroInfo hero;
@@ -107,7 +114,10 @@
});
lockBtn.AddListener(() => { hero.ChangeLockState(); });
- resetBtn.AddListener(ResetBtnClick);
+ resetBtn.AddListener(() =>
+ {
+ HeroUIManager.Instance.ResetBtnClick(hero);
+ });
deleteBtn.AddListener(DeleteHero);
awakeBtn.AddListener(() =>
{
@@ -156,6 +166,11 @@
potentialCellList = new List<GameObject>();
awakeCellList = new List<GameObject>();
+
+ freezeTipBtn.AddListener(() =>
+ {
+ freezeTipGo.SetActive(!freezeTipGo.activeSelf);
+ });
}
@@ -164,7 +179,7 @@
PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
UIManager.Instance.OnCloseWindow += OnCloseWindow;
- HeroUIManager.Instance.OnTeamPosChangeEvent += TeamPosChangeEvent;
+ TeamManager.Instance.OnTeamChange += TeamPosChangeEvent;
guid = HeroUIManager.Instance.selectHeroGuid;
hero = HeroManager.Instance.GetHero(guid);
unfoldState = false;
@@ -178,7 +193,7 @@
PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
UIManager.Instance.OnCloseWindow -= OnCloseWindow;
- HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamPosChangeEvent;
+ TeamManager.Instance.OnTeamChange -= TeamPosChangeEvent;
}
private void OnCloseWindow(UIBase closeUI)
@@ -196,6 +211,7 @@
public void Display()
{
+ bgTexture.SetTexture2D("countryBG" + hero.heroConfig.Country);
roleLhModel.Create(hero.SkinID, 1, motionName: "", isLh: true);
roleXsModel.Create(hero.SkinID);
jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
@@ -226,6 +242,7 @@
RefreshFetter();
RefreshGift();
RefreshAwake();
+ RefreshFreeze();
}
void RefreshItemLockEvent(PackType type, string guid, bool lockState)
@@ -276,74 +293,9 @@
Display();
}
- void ResetBtnClick()
- {
- //鍗囩骇銆佺獊鐮淬�佽閱�
- if (hero.heroLevel == 1 && hero.breakLevel == 0 && hero.awakeLevel == 0)
- {
- SysNotifyMgr.Instance.ShowTip("HeroCanNotReset");
- return;
- }
-
- List<Item> items = new List<Item>();
- var payBack1 = CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.Quality, hero.heroLevel),
- HeroUIManager.Instance.GetHeroBreakPayBack(hero.Quality, hero.breakLevel));
- //宸茶閱掔殑闇�瑕佹秷鑰楄揣甯�
- if (hero.awakeLevel == 0)
- {
- items = CommonFunc.ChangeToItemList(payBack1);
- ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
- {
- if (isOk)
- {
- //鍙戝寘
- SendReborn(hero.itemHero.gridIndex);
- }
- });
- }
- else
- {
-
- if (HeroUIManager.Instance.awakeRebirthCnt >= HeroUIManager.Instance.rebornAwakeHeroMaxCount)
- {
- SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax");
- return;
- }
-
- payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel));
- items = CommonFunc.ChangeToItemList(payBack1);
- var info2 = Language.Get("herocard44", HeroUIManager.Instance.rebornAwakeHeroMaxCount - HeroUIManager.Instance.awakeRebirthCnt);
- var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney;
- ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
- {
- if (isOk)
- {
- if (UIHelper.GetMoneyCnt(HeroUIManager.Instance.payBackMoneyType) < payBackMoney)
- {
- ItemTipUtility.ShowMoneyTip(HeroUIManager.Instance.payBackMoneyType);
- return;
- }
- //鍙戝寘
- SendReborn(hero.itemHero.gridIndex);
- }
- }, info2, "", payBackMoney, HeroUIManager.Instance.payBackMoneyType);
-
- }
-
- }
-
- void SendReborn(int index)
- {
- var pack = new CB239_tagCSHeroRebirth();
- pack.ItemIndex = (ushort)index;
- GameNetSystem.Instance.SendInfo(pack);
-
- HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
-
- }
void DeleteHero()
{
@@ -707,7 +659,7 @@
{
for (int k = 0; k < config.AttrIDList.Length; k++)
{
- awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k], "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"))
+ awakeStr += PlayerPropertyConfig.GetFullDescription(config.AttrIDList[k], config.AttrValueList[k], "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}"))
+ (k == config.AttrIDList.Length - 1 ? "" : "\n");
}
}
@@ -726,8 +678,42 @@
}
}
- void TeamPosChangeEvent(List<int> posList, int flyFrom, Vector3 startPos)
- {
+ void TeamPosChangeEvent(TeamType teamType)
+ {
+ if (teamType != TeamType.Story)
+ return;
fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculatePower());
}
+
+ void RefreshFreeze()
+ {
+ //鑷冲皯闇�瑕佽閱掑埌澶氬皯绾�
+ int needAwakeLV = HeroUIManager.Instance.GetAwakeLVByStarLV(hero.heroId, hero.heroStarMaxBefore);
+ if (hero.awakeLevel < needAwakeLV)
+ {
+ freezeTipBtn.SetActive(true);
+ //鏄熺骇
+ for (int i = 0; i < starImgFreezeList.Count; i++)
+ {
+ if ((hero.heroStarMaxBefore - 1) % starImgFreezeList.Count >= i)
+ {
+ starImgFreezeList[i].SetActive(true);
+ starImgFreezeList[i].SetSprite("herostar" + (((hero.heroStarMaxBefore - 1) / starImgFreezeList.Count) + 1) * starImgFreezeList.Count);
+ }
+ else
+ {
+ starImgFreezeList[i].SetActive(false);
+ }
+ }
+ freezeStarText.text = Language.Get("HeroAwake16", hero.heroStarMaxBefore);
+ freezeAawkeLVText.text = Language.Get("HeroAwake17", needAwakeLV);
+
+ }
+ else
+ {
+ freezeTipBtn.SetActive(false);
+ }
+
+ freezeTipGo.SetActive(false);
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroUIManager.Awake.cs b/Main/System/HeroUI/HeroUIManager.Awake.cs
index 733cde1..2cbfe02 100644
--- a/Main/System/HeroUI/HeroUIManager.Awake.cs
+++ b/Main/System/HeroUI/HeroUIManager.Awake.cs
@@ -12,5 +12,31 @@
public List<int> heroBeforeAwakeGiftIDList = new List<int>(); //浼氭湁閲嶅鐨処D锛屼笉瑕佺敤瀛楀吀
public List<int> heroBeforeAwakeGiftLevelList = new List<int>();
+
+ //杈惧埌X鏄熼渶瑕佺殑瑙夐啋绛夌骇
+ public int GetAwakeLVByStarLV(int heroID, int starLV)
+ {
+ var config = HeroConfig.Get(heroID);
+ var starCnt = HeroQualityConfig.Get(config.Quality).InitStarUpper;
+ if (starLV <= starCnt)
+ return 0;
+
+ Dictionary<int, HeroAwakeConfig> tempDic = null;
+ if (!HeroAwakeConfig.configDics.TryGetValue(heroID, out tempDic))
+ {
+ return 0;
+ }
+ foreach (var item in tempDic)
+ {
+ starCnt += item.Value.AddStarUpper;
+ if (starCnt >= starLV)
+ {
+ return item.Key;
+ }
+ }
+ return 0;
+ }
+
+
}
diff --git a/Main/System/HeroUI/HeroUIManager.Collect.cs b/Main/System/HeroUI/HeroUIManager.Collect.cs
index 93932c5..884f986 100644
--- a/Main/System/HeroUI/HeroUIManager.Collect.cs
+++ b/Main/System/HeroUI/HeroUIManager.Collect.cs
@@ -1,18 +1,28 @@
锘縰sing System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using UnityEngine;
+//鍥鹃壌鍜岀毊鑲�
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
- #region 鍥鹃壌鍜岀毊鑲�
+
+ public Dictionary<int, List<int>> heroCollectDict { get; private set; } = new Dictionary<int, List<int>>(); //姝﹀皢鍥鹃壌鎸夊搧璐ㄥ垪琛�
+ public int selectHeroCollectListJob = 0; //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
+ public int selectHeroCollectListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
+ public int selectCollectHeroID; //閫変腑鐨勬灏唅d
+
+ public int bookMoneyType; //鍥鹃壌濂栧姳璐у竵绫诲瀷
+ public int bookMoneyValue;//鍥鹃壌濂栧姳璐у竵鏁伴噺
+
//鍥鹃壌鍜岀毊鑲ょ殑婵�娲绘儏鍐�
- public Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic { get; private set; } = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>();
+ Dictionary<int, HB122_tagSCHeroInfo.tagSCHero> heroCollectInfoDic = new Dictionary<int, HB122_tagSCHeroInfo.tagSCHero>();
- public int bookPer;
+ public int allHeroBookPer; //鍏ㄤ綋姝﹀皢鐨勫浘閴存縺娲荤櫨鍒嗘瘮
public event Action OnHeroCollectEvent;
public void UpdateHeroCollectInfo(HB122_tagSCHeroInfo netPack)
@@ -21,7 +31,7 @@
{
heroCollectInfoDic[(int)netPack.HeroInfoList[i].HeroID] = netPack.HeroInfoList[i];
}
- bookPer = GetHeroCollectBookPer();
+ allHeroBookPer = GetHeroCollectBookPer();
OnHeroCollectEvent?.Invoke();
}
@@ -41,15 +51,130 @@
return per;
}
- public HB122_tagSCHeroInfo.tagSCHero GetHeroBookInfo(int heroID)
- {
+ public bool TryGetHeroBookInfo(int heroID, out HB122_tagSCHeroInfo.tagSCHero heroData)
+ {
if (heroCollectInfoDic.ContainsKey(heroID))
{
- return heroCollectInfoDic[heroID];
+ heroData = heroCollectInfoDic[heroID];
+ return true;
}
- return null;
+ heroData = new HB122_tagSCHeroInfo.tagSCHero();
+ return false;
}
- #endregion
+
+ public void SortHeroCollectList()
+ {
+ var heroIDs = HeroConfig.GetKeys().ToList();
+
+ heroCollectDict.Clear();
+ foreach (var heroID in heroIDs)
+ {
+ HeroConfig heroConfig = HeroConfig.Get(heroID);
+ if (!heroCollectDict.ContainsKey(heroConfig.Quality))
+ {
+ heroCollectDict[heroConfig.Quality] = new List<int>();
+ }
+ //杩囨护鑱屼笟鍥藉
+ if (selectHeroCollectListJob != 0 && selectHeroCollectListJob != heroConfig.Class)
+ {
+ continue;
+ }
+ if (selectHeroCollectListCountry != 0 && selectHeroCollectListCountry != heroConfig.Country)
+ {
+ continue;
+ }
+
+ heroCollectDict[heroConfig.Quality].Add(heroID);
+ }
+ }
+
+ //鍥鹃壌鎬讳笂闄愮瓑绾� = 鍥鹃壌鏄熺骇涓婇檺 + 鍥鹃壌绐佺牬涓婇檺
+ public int GetHeroBookMaxLevel(int heroID, int quality)
+ {
+ return GetMaxStarCount(heroID, quality) + HeroBreakConfig.GetMaxBreakLv(heroID);
+ }
+
+ public int GetHeroBookLevel(int heroID)
+ {
+ if (heroCollectInfoDic.ContainsKey(heroID))
+ {
+ return heroCollectInfoDic[heroID].BookStarLV + heroCollectInfoDic[heroID].BookBreakLV;
+ }
+ return 0;
+ }
+
+ //鍒嗕负0鏈幏寰椼��1鍙縺娲汇��2甯歌銆�3绐佺牬鍗囩骇銆�4銆佹槦鍗囩骇銆�5宸叉弧绾�
+ public int GetHeroBookState(int heroID, int quality)
+ {
+ int funcState = 0;
+
+ HB122_tagSCHeroInfo.tagSCHero colData;
+ TryGetHeroBookInfo(heroID, out colData);
+ int maxBreakLV = colData.BookBreakLVH; //鍘嗗彶鏈�楂樼獊鐮寸瓑绾�
+ int maxStarLV = colData.BookStarLVH; //鍘嗗彶鏈�楂樻槦绾�
+
+ if (colData.BookInitState == 0)
+ {
+ funcState = 0;
+ }
+ else if (colData.BookInitState == 1)
+ {
+ funcState = 1;
+ }
+ else if (colData.BookInitState == 2)
+ {
+ if (GetHeroBookMaxLevel(heroID, quality) == colData.BookBreakLV + colData.BookStarLV)
+ {
+ funcState = 5;
+ }
+ else if (maxBreakLV + maxStarLV == colData.BookBreakLV + colData.BookStarLV)
+ {
+ funcState = 2;
+ }
+ else
+ {
+ //浼樺厛绐佺牬鍗囩骇
+ if (colData.BookBreakLV < colData.BookBreakLVH)
+ {
+ funcState = 3;
+ }
+ else
+ {
+ funcState = 4;
+ }
+ }
+
+ }
+ return funcState;
+ }
+
+ //鎵惧埌鍙互鎿嶄綔鐨勫浘閴存灏�
+ public int FindHeroIDCanAddCollectAttr(int excludeHeroID = 0)
+ {
+ foreach (var kv in heroCollectInfoDic)
+ {
+ if (kv.Key == excludeHeroID)
+ continue;
+ var state = GetHeroBookState(kv.Key, HeroConfig.Get(kv.Key).Quality);
+ if (state == 1 || state == 3 || state == 4)
+ {
+ return kv.Key;
+ }
+ }
+ return 0;
+ }
+
+ public int GetHeroBookPer(int heroID)
+ {
+ var config = HeroQualityConfig.Get(HeroConfig.Get(heroID).Quality);
+ HB122_tagSCHeroInfo.tagSCHero heroData;
+ TryGetHeroBookInfo(heroID, out heroData);
+ if (heroData.BookInitState < 2)
+ {
+ return 0;
+ }
+ return config.BookInitAddPer + heroData.BookStarLV * config.BookStarAddPer + heroData.BookBreakLV * config.BookBreakLVAddPer;
+ }
}
diff --git a/Main/System/HeroUI/HeroUIManager.Reborn.cs b/Main/System/HeroUI/HeroUIManager.Reborn.cs
index 23064e3..18aee2a 100644
--- a/Main/System/HeroUI/HeroUIManager.Reborn.cs
+++ b/Main/System/HeroUI/HeroUIManager.Reborn.cs
@@ -1,17 +1,20 @@
锘縰sing System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using UnityEngine;
+//閲嶇敓 閬f暎
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
-
- #region 閲嶇敓 閬f暎
public int awakeRebirthCnt { get; private set; }
public int payBackMoneyType;
public int rebornAwakeHeroMaxCount; //瑙夐啋姝﹀皢姣忔棩鐨勬渶澶ч噸鐢熸鏁�
+ public string rebornFormula; //閲嶇敓绛夌骇閲嶇疆鐨勬秷鑰楋紝鍙傛暟 heroLV姝﹀皢绛夌骇锛屾渶缁堟秷鑰椾负鍏紡+瑙夐啋娑堣��
+ public int rebornPayBackPer; //閲嶇敓杩旇繕鐨勭櫨鍒嗘瘮
+ public int deletePayBackPer; //閬f暎杩旇繕鐨勭櫨鍒嗘瘮
public List<string> heroDeleteSortList { get; private set; } = new List<string>();
public int selectHeroDeleteListJob = 0; //绛涢�夎亴涓�
@@ -143,7 +146,127 @@
}
- #endregion
+ public void ResetBtnClick(HeroInfo hero)
+ {
+ //鍗囩骇銆佺獊鐮淬�佽閱�
+ if (hero.heroLevel == 1 && hero.breakLevel == 0 && hero.awakeLevel == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroCanNotReset");
+ return;
+ }
+ //娲楃偧鍜岃閱掔殑澶╄祴鏈鐞嗕笉鍙悶鍣�
+ if (hero.talentRandomIDList.Count > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift4");
+ return;
+ }
+
+ if (hero.talentAwakeRandomIDList.Count > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift5");
+ return;
+ }
+
+
+ List<Item> items = new List<Item>();
+ var payBack1 = CommonFunc.AddDict(GetHeroLVPayBack(hero.Quality, hero.heroLevel), GetHeroBreakPayBack(hero.Quality, hero.breakLevel));
+
+ Dictionary<string, double> rebornParam = new Dictionary<string, double>(); //閲嶇敓娑堣�楀叕寮忓弬鏁�
+ //鍏堣绠楁湁娌℃秷鑰�
+ rebornParam.Add("heroLV", hero.heroLevel);
+ int costCnt = (int)JaceCalculator.Calculate(rebornFormula, rebornParam);
+
+ //閲嶇敓绛夌骇閲嶇疆鐨勬秷鑰楋紝鍙傛暟 heroLV姝﹀皢绛夌骇锛屾渶缁堟秷鑰椾负鍏紡+瑙夐啋娑堣��
+ if (hero.awakeLevel == 0)
+ {
+ //璁$畻杩旇繕姣斾緥
+ var _list = payBack1.Keys.ToList();
+ foreach (var key in _list)
+ {
+ payBack1[key] = Math.Max((long)(payBack1[key] * rebornPayBackPer / 100.0), 1);
+ }
+
+ items = CommonFunc.ChangeToItemList(payBack1);
+
+ if (costCnt == 0)
+ {
+ //鏃犳秷鑰楁樉绀�
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ //鍙戝寘
+ SendReborn(hero);
+ }
+ }, itemName:$"( {rebornPayBackPer}% )");
+ }
+ else
+ {
+ //鏈夋秷鑰楁樉绀�
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ if (UIHelper.GetMoneyCnt(payBackMoneyType) < costCnt)
+ {
+ ItemTipUtility.ShowMoneyTip(payBackMoneyType);
+ return;
+ }
+ //鍙戝寘
+ SendReborn(hero);
+ }
+ }, "", "", costCnt, payBackMoneyType, $"( {rebornPayBackPer}% )");
+ }
+ }
+ else
+ {
+
+ if (awakeRebirthCnt >= rebornAwakeHeroMaxCount)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroRebornAwakeMax");
+ return;
+ }
+
+ payBack1 = CommonFunc.AddDict(payBack1, GetHeroQualityAwakePayBack(hero.Quality, hero.awakeLevel));
+
+ //璁$畻杩旇繕姣斾緥
+ var _list = payBack1.Keys.ToList();
+ foreach (var key in _list)
+ {
+ payBack1[key] = Math.Max((long)(payBack1[key] * rebornPayBackPer / 100.0), 1);
+ }
+
+
+ items = CommonFunc.ChangeToItemList(payBack1);
+ var info2 = Language.Get("herocard44", rebornAwakeHeroMaxCount - awakeRebirthCnt);
+ var payBackMoney = HeroQualityAwakeConfig.GetQualityAwakeConfig(hero.Quality, hero.awakeLevel).RebirthCostMoney + costCnt;
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ if (UIHelper.GetMoneyCnt(payBackMoneyType) < payBackMoney)
+ {
+ ItemTipUtility.ShowMoneyTip(payBackMoneyType);
+ return;
+ }
+ //鍙戝寘
+ SendReborn(hero);
+ }
+ }, info2, "", payBackMoney, payBackMoneyType, $"( {rebornPayBackPer}% )");
+
+ }
+
+ }
+
+ void SendReborn(HeroInfo hero)
+ {
+ var pack = new CB239_tagCSHeroRebirth();
+ pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+ GameNetSystem.Instance.SendInfo(pack);
+
+ lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculatePower(false));
+
+ }
}
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
index 02be11e..8302b51 100644
--- a/Main/System/HeroUI/HeroUIManager.Talent.cs
+++ b/Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -148,7 +148,7 @@
}
}
- giftBaseCells[i].Init(giftID, giftLV, null, state);
+ giftBaseCells[i].Init(giftID, giftLV, state, hero.heroId, i, hero.awakeLevel);
}
else
{
@@ -166,8 +166,7 @@
}
else
{
- int index = i;
- giftBaseCells[i].Init(-1, 0, null, hero.heroId, index);
+ giftBaseCells[i].Init(-1, 0, 0, hero.heroId, i);
}
}
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index f68c4f4..679d42d 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -1,6 +1,7 @@
锘縰sing System;
using System.Collections;
using System.Collections.Generic;
+using LitJson;
using UnityEngine;
@@ -38,7 +39,16 @@
var config = FuncConfigConfig.Get("HeroRebirth");
payBackMoneyType = int.Parse(config.Numerical1);
rebornAwakeHeroMaxCount = int.Parse(config.Numerical2);
+ rebornFormula = config.Numerical3;
+ rebornPayBackPer = int.Parse(config.Numerical4);
+ deletePayBackPer = int.Parse(config.Numerical5);
+
ParseGiftConfig();
+
+ config = FuncConfigConfig.Get("HeroBook");
+ var arr = JsonMapper.ToObject<int[]>(config.Numerical1);
+ bookMoneyType = arr[0];
+ bookMoneyValue = arr[1];
}
public void OnBeforePlayerDataInitialize()
@@ -235,8 +245,8 @@
public bool IsNewHero(int heroID)
{
- var bookInfo = GetHeroBookInfo(heroID);
- if (bookInfo != null)
+ HB122_tagSCHeroInfo.tagSCHero bookInfo;
+ if (TryGetHeroBookInfo(heroID, out bookInfo))
{
if (bookInfo.BookInitState < 2)
{
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index 9554382..dccc0b9 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -261,7 +261,7 @@
{
return 0;
}
- return HeroUIManager.Instance.bookPer;
+ return HeroUIManager.Instance.allHeroBookPer;
}
int GetCountryPer(int attrType)
@@ -348,11 +348,11 @@
}
if (config.showType == 1)
{
- fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, propertyFormula);
+ fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, propertyFormula);
}
else
{
- fightPowerVariables[config.Parameter] = (ulong)GetPropertyVaule(config.ID, hero, fightPropertyFormula);
+ fightPowerVariables[config.Parameter] = GetPropertyVaule(config.ID, hero, fightPropertyFormula);
}
}
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index baa25c4..4bcb172 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -24,7 +24,9 @@
//姝﹀皢鍗�
public const int HeroCardRedpoint = 200;
- public Redpoint HeroCardRedpoint1 = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
+ public Redpoint HeroListRedpoint = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
+ public const int HeroCardCollectRedpoint = 201;
+ public Redpoint HeroCollectRedpoint = new Redpoint(MainHerosRedpoint, HeroCardCollectRedpoint);
#region 閭欢绾㈢偣
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index f763ca2..9a214a9 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -258,6 +258,7 @@
public static string generalItemTip2;
public static List<Item> getItems { get; private set; }
+ public static string replaceItemName;
/// <summary>
/// 澶氱墿鍝佺‘璁ゆ
/// </summary>
@@ -270,7 +271,7 @@
/// <param name="moneyCnt"></param>
/// <param name="type"></param>
public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func,
- string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0)
+ string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0, string itemName = "")
{
getItems = items;
generalTitle = tiltle;
@@ -280,6 +281,7 @@
OnPopConfirmClickEvent = func;
moneyType = type;
moneyNeedCount = moneyCnt;
+ replaceItemName = itemName;
if (!UIManager.Instance.IsOpened<ItemsConfirmWin>())
{
UIManager.Instance.OpenWindow<ItemsConfirmWin>();
diff --git a/Main/System/Tip/ItemsConfirmCell.cs b/Main/System/Tip/ItemsConfirmCell.cs
index b4b6e85..9415abc 100644
--- a/Main/System/Tip/ItemsConfirmCell.cs
+++ b/Main/System/Tip/ItemsConfirmCell.cs
@@ -6,7 +6,7 @@
[SerializeField] ItemCell itemCell;
[SerializeField] Text itemName;
- public void Display(int index)
+ public void Display(int index, string replaceItemName)
{
int itemID = ConfirmCancel.getItems[index].id;
itemCell.Init(new ItemCellModel(itemID, false, ConfirmCancel.getItems[index].countEx));
@@ -14,6 +14,6 @@
{
ItemTipUtility.Show(itemID);
});
- itemName.text = ItemConfig.Get(itemID).ItemName;
+ itemName.text = string.IsNullOrEmpty(replaceItemName) ? ItemConfig.Get(itemID).ItemName : replaceItemName;
}
}
diff --git a/Main/System/Tip/ItemsConfirmWin.cs b/Main/System/Tip/ItemsConfirmWin.cs
index d05234e..f4b53d0 100644
--- a/Main/System/Tip/ItemsConfirmWin.cs
+++ b/Main/System/Tip/ItemsConfirmWin.cs
@@ -24,8 +24,8 @@
m_ConfirmBtn.AddListener(ConfirmBtn);
m_CancleBtn.AddListener( ()=>
{
- ConfirmCancel.OnPopConfirmClickEvent?.Invoke(false);
CloseWindow();
+ ConfirmCancel.OnPopConfirmClickEvent?.Invoke(false);
});
}
@@ -68,15 +68,15 @@
private void ConfirmBtn()
{
- ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
CloseWindow();
+ ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
}
void OnRefreshCell(ScrollerDataType type, CellView cell)
{
var _cell = cell as ItemsConfirmCell;
- _cell?.Display(cell.index);
+ _cell?.Display(cell.index, ConfirmCancel.replaceItemName);
}
void CreateScroller()
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index db04251..55bf242 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -88,7 +88,7 @@
}
else
{
- Debug.LogError("MoneyDisplayModel 涓洪厤缃揣甯佺被鍨嬶細" + moneyType);
+ Debug.LogError("MoneyDisplayModel 鏈厤缃揣甯佺被鍨嬶細" + moneyType);
return "";
}
}
--
Gitblit v1.8.0