|
@@ -1,4 +1,5 @@
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using Core.Language;
|
|
|
using Excel2Json;
|
|
|
using Fort23.Core;
|
|
@@ -15,10 +16,15 @@ namespace Fort23.Mono
|
|
|
|
|
|
List<SentimentEffectWidget> sentimentEffectWidgets = new List<SentimentEffectWidget>();
|
|
|
|
|
|
+ private List<SentimentEffectConfig> _sentimentEffectConfigs;
|
|
|
+
|
|
|
+ private List<SentimentEffectConfig> currentGroupSentimentEffectConfigs;
|
|
|
+
|
|
|
private void Init()
|
|
|
{
|
|
|
isAddStack = false;
|
|
|
isPopUi = true;
|
|
|
+ IsShowAppBar = false;
|
|
|
}
|
|
|
|
|
|
protected override void AddEvent()
|
|
@@ -32,11 +38,37 @@ namespace Fort23.Mono
|
|
|
public override void AddButtonEvent()
|
|
|
{
|
|
|
Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
|
|
|
+ Btn_LingWu.onClick.AddListener(() =>
|
|
|
+ {
|
|
|
+ if (curretnSentimentProperty == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (curretnSentimentProperty.level >= currentGroupSentimentEffectConfigs.Count)
|
|
|
+ {
|
|
|
+ TipMessagePanel.OpenTipMessagePanel("已经达到最大等级");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
|
|
|
+ int conFigId = curretnSentimentProperty.groupId * 100 + level;
|
|
|
+ SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
+
|
|
|
+ //扣除道具
|
|
|
+ // sentimentEffectConfig.upConstItemId.
|
|
|
+ // s
|
|
|
+
|
|
|
+ curretnSentimentProperty.level++;
|
|
|
+
|
|
|
+ AccountFileInfo.Instance.SavePlayerData();
|
|
|
+ UpdateUi();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public async override CTask<bool> AsyncInit(object[] uiData)
|
|
|
{
|
|
|
sentimentData = uiData[0] as AccountFileInfo.SentimentData;
|
|
|
+ _sentimentEffectConfigs = ConfigComponent.Instance.GetAll<SentimentEffectConfig>().ToList();
|
|
|
SentimentEffectWidget sentimentEffectWidget = await UIManager.Instance.CreateGComponentForObject<SentimentEffectWidget>(MainSentimentEffectWidget, null);
|
|
|
sentimentEffectWidget.CustomInit(sentimentData.mainSentiment);
|
|
|
sentimentEffectWidget.OnClick = OnClick;
|
|
@@ -51,21 +83,23 @@ namespace Fort23.Mono
|
|
|
return await base.AsyncInit(uiData);
|
|
|
}
|
|
|
|
|
|
- // private void UpdateUi(SentimentEffectConfig sentimentEffectConfig)
|
|
|
- // {
|
|
|
- //
|
|
|
- // }
|
|
|
+ private void UpdateUi()
|
|
|
+ {
|
|
|
+ int level = curretnSentimentProperty.level <= 0 ? 1 : curretnSentimentProperty.level;
|
|
|
+ int conFigId = curretnSentimentProperty.groupId * 100 + level;
|
|
|
+ SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
+ currentGroupSentimentEffectConfigs = _sentimentEffectConfigs.Where(se => se.groupId == sentimentEffectConfig.groupId).ToList();
|
|
|
+ Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
|
|
|
+ Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge), sentimentEffectConfig.effectVale);
|
|
|
+ Text_Level.text = $"当前层 ;{curretnSentimentProperty.level}/{currentGroupSentimentEffectConfigs.Count}";
|
|
|
+ }
|
|
|
|
|
|
private void OnClick(ItemWidgetBasic obj)
|
|
|
{
|
|
|
SentimentEffectWidget sentimentEffectWidget = obj as SentimentEffectWidget;
|
|
|
curretnSentimentProperty = sentimentEffectWidget.sentimentProperty;
|
|
|
- int conFigId = sentimentEffectWidget.sentimentProperty.groupId * 100 + sentimentEffectWidget.sentimentProperty.level;
|
|
|
- SentimentEffectConfig sentimentEffectConfig = ConfigComponent.Instance.Get<SentimentEffectConfig>(conFigId);
|
|
|
- Text_Name.text = LanguageManager.Instance.Text(sentimentEffectConfig.name);
|
|
|
- Text_Desc.text = UtilTools.GetString(LanguageManager.Instance.Text(sentimentEffectConfig.massge), sentimentEffectConfig.effectVale);
|
|
|
- Text_Level.text = $"当前层 ;{curretnSentimentProperty.level}/{5}";
|
|
|
- // UpdateUi(sentimentEffectConfig);
|
|
|
+
|
|
|
+ UpdateUi();
|
|
|
}
|
|
|
|
|
|
public static async CTask OpenPanel(AccountFileInfo.SentimentData sentimentData)
|
|
@@ -79,6 +113,7 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
UIManager.Instance.DormancyGComponent(sentimentEffectWidget);
|
|
|
}
|
|
|
+
|
|
|
sentimentEffectWidgets.Clear();
|
|
|
|
|
|
base.Close();
|