From cf0229def36f6b98c26ec2241dfbedb8eadb7693 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 25 九月 2018 14:57:09 +0800
Subject: [PATCH] 3815【前端】法宝潜力选择和红点优化
---
System/Treasure/TreasurePotentialPanel.cs | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/System/Treasure/TreasurePotentialPanel.cs b/System/Treasure/TreasurePotentialPanel.cs
index 9b91016..4a83448 100644
--- a/System/Treasure/TreasurePotentialPanel.cs
+++ b/System/Treasure/TreasurePotentialPanel.cs
@@ -595,7 +595,7 @@
{
var levelUpConfig = GetPotentialLevelUpConfig();
m_SuccessRatio.text = StringUtility.Contact((levelUpConfig.rate * 0.01f).ToString("f0"), "%");
- m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0);
+ m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0 && levelUpConfig.materilaKind > 1);
m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0
? TextColType.DarkGreen : TextColType.LightYellow);
m_UpgradeImage.gray = levelUpConfig.rate == 0 && model.selectedPotentialBook == 0;
@@ -622,14 +622,25 @@
private void OnSpNeedItem()
{
var levelUpConfig = GetPotentialLevelUpConfig();
- if (levelUpConfig.rate < 10000 || model.selectedPotentialBook != 0)
+ if (levelUpConfig.rate >= 10000)
+ {
+ SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
+ return;
+ }
+ if (model.selectedPotentialBook == 0)
{
WindowCenter.Instance.Open<PotentialItemUseWin>();
}
else
{
- SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
- //DesignDebug.Log("鎴愬姛鐜囧凡缁忓楂樹簡锛屼笉闇�瑕佸啀澧炲姞姒傜巼浜嗭紒");
+ if (levelUpConfig.materilaKind > 1)
+ {
+ WindowCenter.Instance.Open<PotentialItemUseWin>();
+ }
+ else
+ {
+ ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
+ }
}
}
@@ -642,7 +653,7 @@
{
m_PotentialBook.gameObject.SetActive(_potentialBookId != 0);
m_PotentialCount.gameObject.SetActive(_potentialBookId != 0);
- m_RemoveBook.gameObject.SetActive(_potentialBookId != 0);
+ m_RemoveBook.gameObject.SetActive(false);
m_AddBookSign.gameObject.SetActive(_potentialBookId == 0);
if (_potentialBookId != 0)
{
@@ -653,6 +664,7 @@
bool satisfy = levelUpConfig.own >= levelUpConfig.need;
m_PotentialCount.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(satisfy ?
TextColType.LightYellow : TextColType.Red, levelUpConfig.own.ToString()), "/", levelUpConfig.need);
+ m_RemoveBook.gameObject.SetActive(levelUpConfig.materilaKind > 1);
}
DisplaySuccessRatio();
@@ -762,11 +774,11 @@
var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
if (config == null)
{
- return new PotentialLevelUpConfig(0, 0, 0, 0);
+ return new PotentialLevelUpConfig(0, 0, 0, 0, 0);
}
if (model.selectedPotentialBook == 0)
{
- return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0);
+ return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0, 0);
}
else
{
@@ -784,7 +796,7 @@
var need = config.MeterialNum2[index];
var ratio = own >= need ? config.Rate[index] : config.InitialRate;
- return new PotentialLevelUpConfig(ratio, index + 1, own, need);
+ return new PotentialLevelUpConfig(ratio, index + 1, own, need, config.Meterial2ID.Length);
}
}
@@ -1050,13 +1062,15 @@
public int rate;
public int need;
public int own;
+ public int materilaKind;
- public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need)
+ public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need,int materilaKind)
{
this.rate = _rate;
this.materilaIndex = _materilaIndex;
this.need = _need;
this.own = _own;
+ this.materilaKind = materilaKind;
}
}
[Serializable]
--
Gitblit v1.8.0