|
|
@@ -17,6 +17,8 @@ namespace Fort23.Mono
|
|
|
|
|
|
private DaoyouModelConfig _daoyouModelConfig;
|
|
|
|
|
|
+ private WidgetItem currentSelectWidgetItem;
|
|
|
+
|
|
|
List<WidgetItem> widgetItems = new List<WidgetItem>();
|
|
|
List<WidgetItem> giveWidgetItems = new List<WidgetItem>();
|
|
|
List<DaoYouLevelWidget> _daoYouLevelWidgets = new List<DaoYouLevelWidget>();
|
|
|
@@ -43,16 +45,10 @@ namespace Fort23.Mono
|
|
|
|
|
|
public override void AddButtonEvent()
|
|
|
{
|
|
|
- Btn_CiZuiHelp.onClick.AddListener(() =>
|
|
|
- {
|
|
|
- HelpTipPanel.OpenTipMessagePanel(10791);
|
|
|
- });
|
|
|
-
|
|
|
- Btn_SongLiHelp.onClick.AddListener(() =>
|
|
|
- {
|
|
|
- HelpTipPanel.OpenTipMessagePanel(10790);
|
|
|
- });
|
|
|
-
|
|
|
+ Btn_CiZuiHelp.onClick.AddListener(() => { HelpTipPanel.OpenTipMessagePanel(10791); });
|
|
|
+
|
|
|
+ Btn_SongLiHelp.onClick.AddListener(() => { HelpTipPanel.OpenTipMessagePanel(10790); });
|
|
|
+
|
|
|
Btn_Emotion.onClick.AddListener((() => { ShowMessage(); }));
|
|
|
|
|
|
Btn_Facorability.onClick.AddListener(() =>
|
|
|
@@ -117,6 +113,7 @@ namespace Fort23.Mono
|
|
|
Btn_Back.onClick.AddListener(() =>
|
|
|
{
|
|
|
ClosePoolGive();
|
|
|
+ currentSelectWidgetItem = null;
|
|
|
GiveGite.gameObject.SetActive(false);
|
|
|
AppBarPanel.OpenPanel(this);
|
|
|
});
|
|
|
@@ -164,13 +161,14 @@ namespace Fort23.Mono
|
|
|
//喜好礼物翻倍
|
|
|
if (_daoyouModelConfig.PreferGiftID.Contains(daoyouGiftConfig.ItemID))
|
|
|
{
|
|
|
- daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f * PlayerManager.Instance.gameConstantConfig.daolvfavoratePara * 0.01f);
|
|
|
+ daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f *
|
|
|
+ PlayerManager.Instance.gameConstantConfig.daolvfavoratePara *
|
|
|
+ 0.01f);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -225,7 +223,8 @@ namespace Fort23.Mono
|
|
|
Text_message.text = LanguageManager.Instance.Text(emotionConfig.des);
|
|
|
ShowMessage();
|
|
|
Icon_bodyIcon.icon_name = _daoyouModelConfig.bodyIcon;
|
|
|
- Icon_bodyIcon.GetComponent<RectTransform>().anchoredPosition = new Vector2(_daoyouModelConfig.bodyPos[0],_daoyouModelConfig.bodyPos[1]);
|
|
|
+ Icon_bodyIcon.GetComponent<RectTransform>().anchoredPosition =
|
|
|
+ new Vector2(_daoyouModelConfig.bodyPos[0], _daoyouModelConfig.bodyPos[1]);
|
|
|
await UpdateUI();
|
|
|
return await base.AsyncInit(uiData);
|
|
|
}
|
|
|
@@ -283,7 +282,7 @@ namespace Fort23.Mono
|
|
|
Btn_Eveent.gameObject.SetActive(false);
|
|
|
}
|
|
|
|
|
|
- Slider_Emotion.fillAmount = daoYouData.emotionValue / 100;
|
|
|
+ Slider_Emotion.fillAmount = daoYouData.emotionValue / 100f;
|
|
|
|
|
|
HeroPowerUpConfig heroPowerUpConfig =
|
|
|
ConfigComponent.Instance.Get<HeroPowerUpConfig>(PlayerManager.Instance.GetDaoYouLevel(daoYouData));
|
|
|
@@ -323,7 +322,9 @@ namespace Fort23.Mono
|
|
|
Text_CurrentName.text = LanguageManager.Instance.Text(currentDaoyouLevelupConfig.name);
|
|
|
Text_CurrentLevel.text = daoYouData.favorabilityLv.ToString();
|
|
|
Slider_LeveUp.maxValue = currentDaoyouLevelupConfig.exp;
|
|
|
- if (daoYouData.favorabilityLv >= _daoYouLevelWidgets.Count)
|
|
|
+
|
|
|
+ DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
|
|
|
+ if (daoYouData.favorabilityLv >= configs.Length)
|
|
|
{
|
|
|
Text_Exp.text = $"{daoYouData.exp}/MAX";
|
|
|
}
|
|
|
@@ -332,7 +333,7 @@ namespace Fort23.Mono
|
|
|
Text_Exp.text = $"{daoYouData.exp}/{currentDaoyouLevelupConfig.exp}";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
Slider_LeveUp.value = daoYouData.exp;
|
|
|
|
|
|
if (_daoyouModelConfig.PreferGiftID != null)
|
|
|
@@ -366,7 +367,6 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
|
|
|
|
|
|
- DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
|
|
|
foreach (var daoyouLevelupConfig in configs)
|
|
|
{
|
|
|
DaoYouLevelWidget daoYouLevelWidget =
|
|
|
@@ -442,9 +442,17 @@ namespace Fort23.Mono
|
|
|
giveWidgetItems.Add(widgetItem);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (giveWidgetItems.Count > 0)
|
|
|
{
|
|
|
- giveWidgetItems[0].OnPointerClick();
|
|
|
+ if (currentSelectWidgetItem != null)
|
|
|
+ {
|
|
|
+ currentSelectWidgetItem.OnPointerClick();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ giveWidgetItems[0].OnPointerClick();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -455,6 +463,7 @@ namespace Fort23.Mono
|
|
|
private async void OnClick(ItemWidgetBasic obj)
|
|
|
{
|
|
|
WidgetItem widgetItem = obj as WidgetItem;
|
|
|
+ currentSelectWidgetItem = widgetItem;
|
|
|
if (widgetItem1 == null)
|
|
|
{
|
|
|
widgetItem1 = await UIManager.Instance.CreateGComponent<WidgetItem>(null, WidgetItemRoot);
|