using Snxxz.UI;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.Linq;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
public class BuyEquipTip : MonoBehaviour
|
{
|
#region TopUI
|
[SerializeField]
|
Button closeBtn;
|
[SerializeField]
|
Text titleText;
|
[SerializeField]
|
Text equipScoreDes;
|
[SerializeField]
|
Text equipScoreValue;
|
[SerializeField]
|
Text needLvDes;
|
[SerializeField]
|
Text needLvValue;
|
[SerializeField]
|
List<Text> needPointTextlist = new List<Text>();
|
[SerializeField]
|
List<Text> needPointNumlist = new List<Text>();
|
[SerializeField]
|
Text dateText;
|
[SerializeField]
|
ItemCell itemCell;
|
[SerializeField]
|
Text realmTitleText;
|
[SerializeField] Image realmImg;
|
#endregion
|
|
#region MidUI
|
[SerializeField]
|
RectTransform attrContent;
|
[SerializeField]
|
ScrollRect scrollRect;
|
[SerializeField]
|
LayoutElement scrollLayout;
|
|
[SerializeField]
|
GameObject basicAttr;
|
[SerializeField]
|
Text basicTitleText;
|
[SerializeField]
|
Text basicAttrDes;
|
|
[SerializeField]
|
GameObject exhaustedAttr;
|
[SerializeField]
|
Text exhaustedTitleText;
|
[SerializeField]
|
Text exhaustedAttrDes;
|
|
[SerializeField]
|
GameObject legendAttr;
|
[SerializeField]
|
Text legendTitleText;
|
[SerializeField]
|
Text legendCntPreview;
|
[SerializeField]
|
Text legendAttrDes;
|
|
[SerializeField]
|
GameObject washAttr;
|
[SerializeField]
|
Text washTitleText;
|
[SerializeField]
|
Text washAttrDes;
|
|
[SerializeField]
|
GameObject gemAttr;
|
[SerializeField]
|
Text gemTitleText;
|
[SerializeField]
|
List<GemElementObj> gemObjlist = new List<GemElementObj>();
|
|
[SerializeField]
|
GameObject suitAttr;
|
[SerializeField]
|
Text suitTitleText;
|
[SerializeField]
|
ScrollerController suirAttrCtrl;
|
[SerializeField] List<GameObject> attrCutLinelist = new List<GameObject>();
|
#endregion
|
|
#region BottomUI
|
[SerializeField]
|
GameObject bottomPart;
|
|
[SerializeField]
|
EquipSource equipSource;
|
|
[SerializeField]
|
private RectTransform _numberGo;
|
|
[SerializeField]
|
Text vipInfoText;
|
|
[SerializeField]
|
Text buyCountText;
|
|
[SerializeField]
|
Text buyPriceText;
|
|
[SerializeField]
|
RectTransform moneyRect;
|
|
[SerializeField]
|
Image moneyIcon;
|
|
[SerializeField]
|
Button reduceBtn;
|
|
[SerializeField]
|
Button plusBtn;
|
|
[SerializeField]
|
Button buyCountBtn;
|
|
[SerializeField]
|
RectTransform btnGroup;
|
[SerializeField]
|
GameObject operateBtn;
|
#endregion
|
|
[SerializeField] Text buyBtnText;
|
|
[SerializeField]
|
NumKeyBoard numKeyboard;
|
|
[SerializeField]
|
CanvasGroup tipAlpha;
|
|
Dictionary<PropertyType, int> needPointDict = new Dictionary<PropertyType, int>();
|
|
ItemTipsModel _itemTipsModel;
|
ItemTipsModel itemTipsModel
|
{
|
get
|
{
|
return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
|
}
|
}
|
|
StoreModel _storeModel;
|
StoreModel m_storeModel
|
{
|
get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
}
|
ItemAttrData itemAttrData;
|
BuyItemPopModel buyItem;
|
BuyShopItemLimit shopItemLimit;
|
int canBuyCnt = 0;
|
int buyCnt = 0;
|
int curVipIndex = -1;
|
bool isVipBuy = false;
|
|
Color32 conditionColor = new Color32(255, 244, 205, 255);
|
private int curAttrTypeNum = 0;
|
public void InitModel(ItemAttrData attrData)
|
{
|
curAttrTypeNum = 0;
|
itemAttrData = attrData;
|
buyItem = BuyItemPopModel.Instance;
|
shopItemLimit = m_storeModel.GetBuyShopLimit((uint)buyItem.storeConfig.ID);
|
InitUI();
|
closeBtn.AddListener(OnClickCloseBtn);
|
reduceBtn.onClick.AddListener(OnClickReduceBuyNum);
|
plusBtn.onClick.AddListener(OnClickPlusBuyNum);
|
buyCountBtn.onClick.AddListener(OnClickCountBtn);
|
numKeyboard.onConfirm.AddListener(OnClickConfirmBtn);
|
numKeyboard.onValueChange.AddListener(OnClickNum);
|
}
|
|
private void OnEnable()
|
{
|
bottomPart.gameObject.SetActive(false);
|
StartCoroutine(SetScrollSize());
|
}
|
|
IEnumerator SetScrollSize()
|
{
|
yield return null;
|
yield return null;
|
attrContent.anchoredPosition3D = new Vector3(attrContent.anchoredPosition3D.x, 0, 0);
|
SetMidUIHeight(attrContent.rect.height);
|
StartCoroutine(ShowBottomPart());
|
}
|
|
IEnumerator ShowBottomPart()
|
{
|
yield return null;
|
bottomPart.gameObject.SetActive(true);
|
SetBottomUI();
|
StartCoroutine(SetPanelScale());
|
}
|
|
IEnumerator SetPanelScale()
|
{
|
yield return null;
|
itemTipsModel.SetCurTips(this.GetComponent<RectTransform>());
|
//this.transform.localScale = Vector3.one;
|
tipAlpha.alpha = 1;
|
}
|
|
private void InitUI()
|
{
|
#region 设置TopUI
|
titleText.text = itemTipsModel.GetItemTipsTitle(itemAttrData);
|
titleText.color = UIHelper.GetUIColor(itemAttrData.itemConfig.ItemColor);
|
ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId,itemAttrData.isPreview, (ulong)itemAttrData.count
|
,itemAttrData.guid,itemAttrData.packType,itemAttrData.isCompare, itemAttrData.useDataDict);
|
itemCell.Init(cellModel);
|
equipScoreDes.text = Language.Get("EquipWin_EquipPointText_1");
|
equipScoreValue.text = itemAttrData.score.ToString();
|
CheckUselimit();
|
if (itemAttrData.itemConfig.ExpireTime > 0)
|
{
|
SetDateLimitUI(itemAttrData.itemConfig.ExpireTime);
|
}
|
else
|
{
|
dateText.gameObject.SetActive(false);
|
}
|
#endregion
|
|
#region 设置MidUI
|
SetBasicAttrUI();
|
SetExhaustedAttrUI();
|
SetLegendAttrUI();
|
SetGemAttrUI();
|
for (int i = 0; i < attrCutLinelist.Count; i++)
|
{
|
if (i == curAttrTypeNum - 1)
|
{
|
attrCutLinelist[curAttrTypeNum - 1].SetActive(false);
|
}
|
else
|
{
|
attrCutLinelist[i].SetActive(true);
|
}
|
}
|
#endregion
|
|
CreateFuncBtn();
|
}
|
|
private void OnDisable()
|
{
|
closeBtn.RemoveAllListeners();
|
reduceBtn.RemoveAllListeners();
|
plusBtn.RemoveAllListeners();
|
buyCountBtn.RemoveAllListeners();
|
numKeyboard.onConfirm.RemoveAllListeners();
|
numKeyboard.onValueChange.RemoveAllListeners();
|
}
|
|
private void CheckUselimit()
|
{
|
int[] uselimits = itemAttrData.itemConfig.UseCondiType;
|
if (uselimits == null) return;
|
|
needLvValue.gameObject.SetActive(false);
|
needLvDes.gameObject.SetActive(false);
|
realmTitleText.gameObject.SetActive(false);
|
realmImg.gameObject.SetActive(false);
|
for (int i = 0; i < needPointTextlist.Count; i++)
|
{
|
needPointTextlist[i].gameObject.SetActive(false);
|
needPointNumlist[i].gameObject.SetActive(false);
|
}
|
for (int i = 0; i < uselimits.Length; i++)
|
{
|
switch (uselimits[i])
|
{
|
case 0:
|
if (itemAttrData.itemConfig.UseLV > 1)
|
{
|
needLvValue.gameObject.SetActive(true);
|
needLvDes.gameObject.SetActive(true);
|
}
|
needLvDes.text = Language.Get("KnapS110");
|
if (itemAttrData.isHavePutLimit)
|
{
|
needLvValue.text = itemAttrData.itemConfig.UseLV.ToString();
|
if (PlayerDatas.Instance.baseData.LV >= itemAttrData.itemConfig.UseLV)
|
{
|
needLvValue.color = conditionColor;
|
needLvDes.color = conditionColor;
|
}
|
else
|
{
|
needLvValue.color = UIHelper.GetUIColor(TextColType.Red);
|
needLvDes.color = UIHelper.GetUIColor(TextColType.Red);
|
}
|
}
|
else
|
{
|
needLvValue.text = 1.ToString();
|
needLvDes.color = conditionColor;
|
needLvValue.color = conditionColor;
|
}
|
|
break;
|
case 1:
|
if(itemAttrData.isHavePutLimit)
|
{
|
realmTitleText.gameObject.SetActive(true);
|
realmImg.gameObject.SetActive(true);
|
realmTitleText.text = Language.Get("RealmLimit1");
|
RealmConfig realmConfig = RealmConfig.Get(itemAttrData.itemConfig.RealmLimit);
|
if (itemAttrData.itemConfig.RealmLimit <= 0)
|
{
|
realmImg.SetSprite("NoRealm");
|
}
|
else
|
{
|
if (realmConfig != null)
|
{
|
realmImg.SetSprite(realmConfig.Img);
|
}
|
}
|
realmImg.SetNativeSize();
|
if (PlayerDatas.Instance.baseData.realmLevel >= itemAttrData.itemConfig.RealmLimit)
|
{
|
realmTitleText.color = conditionColor;
|
}
|
else
|
{
|
realmTitleText.color = UIHelper.GetUIColor(TextColType.Red);
|
}
|
}
|
|
break;
|
case 2:
|
RefreshNeedPointUI();
|
break;
|
}
|
}
|
|
}
|
|
private void SetDateLimitUI(double time)
|
{
|
dateText.gameObject.SetActive(true);
|
TimeSpan t = TimeSpan.FromSeconds(time);
|
if (t.TotalDays > 1)
|
{
|
dateText.text = Language.Get("EquipInfo_OverdueDay", (int)t.TotalDays);
|
}
|
else if (t.TotalHours > 1)
|
{
|
dateText.text = Language.Get("EquipInfo_OverdueHour", (int)t.TotalHours);
|
}
|
else if (t.TotalMinutes > 1)
|
{
|
dateText.text = Language.Get("EquipInfo_OverdueMin", (int)t.TotalMinutes);
|
}
|
else if (t.TotalMinutes > 0)
|
{
|
dateText.text = Language.Get("EquipInfo_OverdueMin", 1);
|
}
|
else if (t.TotalSeconds <= 0)
|
{
|
dateText.text = Language.Get("EquipInfo_Overdued");
|
}
|
}
|
|
private void RefreshNeedPointUI()
|
{
|
needPointDict.Clear();
|
if (itemAttrData.itemConfig.LimitSTR > 0)
|
{
|
needPointDict.Add(PropertyType.POWER, itemAttrData.itemConfig.LimitSTR);
|
}
|
|
if (itemAttrData.itemConfig.LimitPHY > 0)
|
{
|
needPointDict.Add(PropertyType.AGILITY, itemAttrData.itemConfig.LimitPHY);
|
}
|
|
if (itemAttrData.itemConfig.LimitPNE > 0)
|
{
|
needPointDict.Add(PropertyType.MENTALITY, itemAttrData.itemConfig.LimitPNE);
|
}
|
|
List<PropertyType> needlist = needPointDict.Keys.ToList();
|
|
int i = 0;
|
float offset = 0;
|
for (i = 0; i < needPointTextlist.Count; i++)
|
{
|
if (i < needlist.Count)
|
{
|
needPointTextlist[i].gameObject.SetActive(true);
|
needPointNumlist[i].gameObject.SetActive(true);
|
offset = needPointDict[needlist[i]] - UIHelper.GetPropertyValue(needlist[i]);
|
switch (needlist[i])
|
{
|
case PropertyType.POWER:
|
if (itemAttrData.isHavePutLimit)
|
{
|
SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS113"));
|
}
|
else
|
{
|
SetNeedPointUI(1, 0, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS113"));
|
}
|
break;
|
case PropertyType.AGILITY:
|
if (itemAttrData.isHavePutLimit)
|
{
|
SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS112"));
|
}
|
else
|
{
|
SetNeedPointUI(1, 0, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS112"));
|
}
|
|
break;
|
case PropertyType.MENTALITY:
|
if (itemAttrData.isHavePutLimit)
|
{
|
SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS111"));
|
}
|
else
|
{
|
SetNeedPointUI(1, 0, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS111"));
|
}
|
break;
|
}
|
|
}
|
else
|
{
|
needPointTextlist[i].gameObject.SetActive(false);
|
needPointNumlist[i].gameObject.SetActive(false);
|
}
|
}
|
|
}
|
|
private void SetNeedPointUI(float needPoint, float offset, Text needPoinText, Text needPoinNum, string msg)
|
{
|
if (offset > 0)
|
{
|
needPoinNum.text = UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(needPoint, Language.Get("KnapS118", offset)));
|
needPoinText.text = UIHelper.AppendColor(TextColType.Red, msg);
|
}
|
else
|
{
|
needPoinNum.color = conditionColor;
|
needPoinText.color = conditionColor;
|
needPoinNum.text = needPoint.ToString();
|
needPoinText.text = msg;
|
}
|
}
|
|
#region 设置属性UI
|
private void SetBasicAttrUI()
|
{
|
curAttrTypeNum = 1;
|
basicAttr.SetActive(true);
|
basicTitleText.text = Language.Get("RolePanel_BaseAttrText_1");
|
basicAttrDes.text = itemTipsModel.GetBasicAttr(itemAttrData);
|
}
|
|
private void SetExhaustedAttrUI()
|
{
|
if(itemAttrData.exhaustedMaxDataDict == null)
|
{
|
exhaustedAttr.SetActive(false);
|
return;
|
}
|
curAttrTypeNum = 2;
|
exhaustedAttr.SetActive(true);
|
exhaustedTitleText.text = Language.Get("EquipWin_ExtinctPropObj_Text_1");
|
exhaustedAttrDes.text = itemTipsModel.GetExhaustedAtrr(itemAttrData);
|
}
|
|
private void SetLegendAttrUI()
|
{
|
if(itemAttrData.legendDataDict == null)
|
{
|
legendAttr.SetActive(false);
|
return;
|
}
|
curAttrTypeNum = 3;
|
legendAttr.SetActive(true);
|
legendTitleText.text = Language.Get("EquipWin_LegendPropObj_Text_1");
|
legendAttrDes.text = itemTipsModel.GetLegendAttr(itemAttrData);
|
|
if (itemAttrData.isPreview)
|
{
|
legendCntPreview.gameObject.SetActive(true);
|
switch (itemAttrData.itemConfig.EquipPlace)
|
{
|
case 101:
|
case 102:
|
case 103:
|
case 104:
|
case 105:
|
legendCntPreview.text = itemTipsModel.GetDogzLegendAttrCntPreview(itemAttrData);
|
break;
|
}
|
}
|
else
|
{
|
legendCntPreview.gameObject.SetActive(false);
|
}
|
}
|
|
private void SetGemAttrUI()
|
{
|
var packType = GeneralDefine.GetPackTypeByItemType(itemAttrData.itemConfig.Type);
|
int[] gemOpenLvs = itemTipsModel.gemOpenLvs;
|
|
if (itemAttrData.itemConfig.LV < gemOpenLvs[0])
|
{
|
gemAttr.SetActive(false);
|
return;
|
}
|
switch (itemAttrData.itemConfig.EquipPlace)
|
{
|
case 101:
|
case 102:
|
case 103:
|
case 104:
|
case 105:
|
gemAttr.SetActive(false);
|
return;
|
}
|
curAttrTypeNum = 5;
|
gemAttr.SetActive(true);
|
gemTitleText.text = Language.Get("EquipWin_GemPropObj_Text_1");
|
int cnt = 0;
|
int vipCnt = 0;
|
if (itemAttrData.itemConfig.LV >= gemOpenLvs[0])
|
{
|
cnt++;
|
}
|
|
if (itemAttrData.itemConfig.LV >= gemOpenLvs[1])
|
{
|
cnt++;
|
}
|
|
if (itemAttrData.itemConfig.LV >= gemOpenLvs[2])
|
{
|
cnt++;
|
}
|
|
if (PlayerDatas.Instance.baseData.VIPLv >= itemTipsModel.gemOpenVipLv)
|
{
|
vipCnt++;
|
}
|
|
int i = 0;
|
for (i = 0; i < gemObjlist.Count; i++)
|
{
|
int stoneId = 0;
|
if (itemAttrData.stones != null)
|
{
|
if(i < itemAttrData.stones.Length)
|
{
|
stoneId = (int)itemAttrData.stones[i];
|
}
|
}
|
|
if(i < gemObjlist.Count - 1)
|
{
|
if (i < cnt)
|
{
|
|
gemObjlist[i].gameObject.SetActive(true);
|
gemObjlist[i].InitModel(stoneId, i, itemAttrData.itemConfig.EquipPlace, false);
|
}
|
else
|
{
|
gemObjlist[i].InitModel(stoneId, i, itemAttrData.itemConfig.EquipPlace, true);
|
gemObjlist[i].gameObject.SetActive(false);
|
}
|
|
}
|
else
|
{
|
if (vipCnt != 0)
|
{
|
gemObjlist[i].InitModel(stoneId, i, itemAttrData.itemConfig.EquipPlace, false);
|
}
|
else
|
{
|
gemObjlist[i].InitModel(stoneId, i, itemAttrData.itemConfig.EquipPlace,true);
|
}
|
}
|
}
|
}
|
|
private void SetMidUIHeight(float midHeight)
|
{
|
scrollRect.enabled = false;
|
|
if (midHeight < itemTipsModel.equipMidHeights[0])
|
{
|
scrollLayout.preferredHeight = itemTipsModel.equipMidHeights[0];
|
}
|
else if (midHeight > itemTipsModel.equipMidHeights[1])
|
{
|
scrollRect.enabled = true;
|
scrollLayout.preferredHeight = itemTipsModel.equipMidHeights[1];
|
}
|
else
|
{
|
scrollLayout.preferredHeight = midHeight;
|
}
|
}
|
#endregion
|
|
private void SetBottomUI()
|
{
|
SetBottomText(equipSource);
|
numKeyboard.gameObject.SetActive(false);
|
curVipIndex = -1;
|
int nextVipIndex = -1;
|
isVipBuy = buyItem.CheckIsVipBuy(buyItem.storeConfig, out curVipIndex, out nextVipIndex);
|
canBuyCnt = 0;
|
int addBuyCnt = 0;
|
bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
bool isReachUpper = false;
|
buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
if (isVipBuy)
|
{
|
if (nextVipIndex != -1)
|
{
|
vipInfoText.gameObject.SetActive(true);
|
vipInfoText.text = Language.Get("StoreWin108", canBuyCnt, StringUtility.Contact("V", buyItem.storeConfig.VIPLV[nextVipIndex]), addBuyCnt);
|
}
|
else
|
{
|
vipInfoText.gameObject.SetActive(false);
|
}
|
|
if (curVipIndex != -1)
|
{
|
btnGroup.gameObject.SetActive(true);
|
}
|
else
|
{
|
btnGroup.gameObject.SetActive(false);
|
buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
}
|
}
|
else
|
{
|
vipInfoText.gameObject.SetActive(false);
|
btnGroup.gameObject.SetActive(true);
|
}
|
|
buyCountText.text = buyCnt.ToString();
|
RefreshBuyPrice(buyCnt);
|
moneyIcon.SetIconWithMoneyType(buyItem.storeConfig.MoneyType);
|
m_storeModel.SetBuyCnt(buyCnt);
|
}
|
|
private void CreateFuncBtn()
|
{
|
btnGroup.anchoredPosition3D = Vector3.zero;
|
if (itemAttrData.tipsFuncBtnDic.Count > 0)
|
{
|
foreach (ItemOperateType key in itemAttrData.tipsFuncBtnDic.Keys)
|
{
|
Button btn = OnGUIButton(btnGroup.gameObject, operateBtn, key.ToString(), Language.Get(StringUtility.Contact("ItemHandle_", key.ToString())));
|
btn.RemoveAllListeners();
|
btn.onClick.AddListener(() => {
|
OnClickCloseBtn();
|
itemAttrData.tipsFuncBtnDic[key](key, "");
|
});
|
}
|
}
|
}
|
|
private Button OnGUIButton(GameObject parent, GameObject sourceBtn, string btnName, string textName)
|
{
|
GameObject go = Instantiate(sourceBtn);
|
go.name = btnName;
|
go.transform.SetParent(parent.transform);
|
go.transform.Find("BtnText").GetComponent<Text>().text = textName;
|
go.transform.localPosition = Vector3.zero;
|
go.transform.localScale = Vector3.one;
|
Button btn = go.GetComponent<Button>();
|
go.SetActive(true);
|
KnapSackEventMgr.Instance.SetEquipWinTempObj(go);
|
return btn;
|
}
|
|
private void SetBottomText(EquipSource source)
|
{
|
source.jobTitleText.text = Language.Get("EquipWin_JobTitleText_1");
|
source.jobText.text = itemTipsModel.GetEquipJobName(itemAttrData);
|
source.partTitleText.text = Language.Get("EquipWin_PartTitleText_1");
|
source.partText.text = StringUtility.Contact(FuncConfigConfig.GetEquipTipsAreaName(itemAttrData.itemConfig.EquipPlace) + itemAttrData.itemConfig.LV, Language.Get("L1047"));
|
}
|
|
private ulong _price;
|
private void RefreshBuyPrice(int buyCnt)
|
{
|
if (buyCnt < 1)
|
{
|
_price = (ulong)buyItem.storeConfig.MoneyNumber;
|
}
|
else
|
{
|
_price = (ulong)buyItem.GetBuyPrice(buyItem.storeConfig, buyCnt);
|
}
|
|
if (!m_storeModel.MoneyIsEnough(buyItem.storeConfig.MoneyType, _price))
|
{
|
buyPriceText.text = UIHelper.AppendColor(TextColType.Red, _price.ToString());
|
}
|
else
|
{
|
buyPriceText.text = UIHelper.AppendColor(TextColType.Green, _price.ToString());
|
}
|
|
if (_price <= 0)
|
{
|
moneyRect.gameObject.SetActive(false);
|
buyBtnText.text = Language.Get("MailReceive");
|
}
|
else
|
{
|
moneyRect.gameObject.SetActive(true);
|
buyBtnText.text = Language.Get("ItemHandle_buy");
|
}
|
|
if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
{
|
_numberGo.gameObject.SetActive(false);
|
|
}
|
else
|
{
|
_numberGo.gameObject.SetActive(true);
|
|
}
|
}
|
|
#region 点击事件
|
private void OnClickCountBtn()
|
{
|
numKeyboard.gameObject.SetActive(true);
|
}
|
|
private void OnClickNum()
|
{
|
bool isReachUpper = false;
|
buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
RefreshBuyPrice(buyCnt);
|
numKeyboard.Value = buyCnt.ToString();
|
if (isReachUpper)
|
{
|
ServerTipDetails.DisplayNormalTip(Language.Get("StoreWin109"));
|
}
|
}
|
|
private void OnClickConfirmBtn(bool arg0)
|
{
|
if (arg0)
|
{
|
buyCountText.text = buyCnt.ToString();
|
numKeyboard.gameObject.SetActive(false);
|
m_storeModel.SetBuyCnt(buyCnt);
|
}
|
}
|
|
private void OnClickPlusBuyNum()
|
{
|
buyCnt += 1;
|
bool isReachUpper = false;
|
buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
buyCountText.text = buyCnt.ToString();
|
RefreshBuyPrice(buyCnt);
|
m_storeModel.SetBuyCnt(buyCnt);
|
if (isReachUpper)
|
{
|
ServerTipDetails.DisplayNormalTip(Language.Get("StoreWin109"));
|
}
|
|
}
|
|
private void OnClickReduceBuyNum()
|
{
|
buyCnt -= 1;
|
bool isReachUpper = false;
|
buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
buyCountText.text = buyCnt.ToString();
|
RefreshBuyPrice(buyCnt);
|
m_storeModel.SetBuyCnt(buyCnt);
|
}
|
|
private void OnClickCloseBtn()
|
{
|
KnapSackEventMgr.Instance.HideItemPopWin();
|
}
|
#endregion
|
|
}
|
}
|
|
|