| | |
| | | public uint FamilyId; //家族
|
| | | public string FamilyName; //家族名称
|
| | | public uint diamond; //仙玉
|
| | | public uint bindDiamond; //绑玉
|
| | | public uint copper; //铜钱
|
| | | public ulong allCopper { get { return (ulong)copper + (ulong)copperExtend * 100000000; } }
|
| | | public uint FightPoint; //战斗值
|
| | |
| | | FamilyId = _serverInfo.Family;
|
| | | FamilyName = _serverInfo.FamilyName.Trim().Replace(" ", "");
|
| | | diamond = _serverInfo.Gold;
|
| | | bindDiamond = _serverInfo.GoldPaper;
|
| | | copper = _serverInfo.Silver;
|
| | | MapID = _serverInfo.MapID;
|
| | | mainServerMapIdRecord = MapID;
|
| | |
| | | FamilyId = serverInfo.Family;
|
| | | FamilyName = serverInfo.FamilyName.Trim().Replace(" ", "");
|
| | | diamond = serverInfo.Gold;
|
| | | bindDiamond = serverInfo.GoldPaper;
|
| | | copper = serverInfo.Silver;
|
| | | MapID = serverInfo.MapID;
|
| | | if (serverInfo.socketType == ServerType.Main)
|
| | |
| | | baseData.diamond = value;
|
| | | break;
|
| | | case PlayerDataType.GoldPaper:
|
| | | baseData.bindDiamond = value;
|
| | | break;
|
| | | case PlayerDataType.Silver:
|
| | | baseData.copper = value;
|
| | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetProValueTypeStr(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | BlastFurnaceModel gen_to_be_invoked = (BlastFurnaceModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _isPercentage = LuaAPI.xlua_tointeger(L, 2); |
| | | int _value = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | string gen_ret = gen_to_be_invoked.GetProValueTypeStr( _isPercentage, _value ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | try |
| | | { |
| | | return 1; |
| | | } |
| | | catch (System.Exception gen_e) |
| | | { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | |
| | | System.Collections.Generic.List<int> _valuelist = (System.Collections.Generic.List<int>)translator.GetObject(L, 3, typeof(System.Collections.Generic.List<int>)); |
| | | ItemConfig _itemConfig = (ItemConfig)translator.GetObject(L, 4, typeof(ItemConfig)); |
| | | |
| | | string gen_ret = gen_to_be_invoked.GetLegendAttr( _idlist, _valuelist, _itemConfig ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | |
| | | |
| | | |
| | | { |
| | | System.Collections.Generic.List<int> _idlist = (System.Collections.Generic.List<int>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<int>)); |
| | | System.Collections.Generic.List<int> _valuelist = (System.Collections.Generic.List<int>)translator.GetObject(L, 3, typeof(System.Collections.Generic.List<int>)); |
| | | ItemConfig _itemConfig = (ItemConfig)translator.GetObject(L, 4, typeof(ItemConfig)); |
| | | bool _isCustom = LuaAPI.lua_toboolean(L, 5); |
| | | |
| | | string gen_ret = gen_to_be_invoked.GetPreviewLegendAttr( _idlist, _valuelist, _itemConfig, _isCustom ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetProValueTypeStr(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.ItemTipsModel gen_to_be_invoked = (Snxxz.UI.ItemTipsModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | PlayerPropertyConfig _playerproModel = (PlayerPropertyConfig)translator.GetObject(L, 2, typeof(PlayerPropertyConfig)); |
| | | int _value = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | string gen_ret = gen_to_be_invoked.GetProValueTypeStr( _playerproModel, _value ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | try |
| | | { |
| | | return 1; |
| | | } |
| | | catch (System.Exception gen_e) |
| | | { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetProValueTypeStr(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.TreasureEffectModel gen_to_be_invoked = (Snxxz.UI.TreasureEffectModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | PlayerPropertyConfig _playerproModel = (PlayerPropertyConfig)translator.GetObject(L, 2, typeof(PlayerPropertyConfig)); |
| | | int _value = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | string gen_ret = gen_to_be_invoked.GetProValueTypeStr( _playerproModel, _value ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | try |
| | | { |
| | | return 1; |
| | | } |
| | | catch (System.Exception gen_e) |
| | | { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetTreasureFight(RealStatePtr L) |
| | | { |
| | |
| | | |
| | | |
| | | Snxxz.UI.TreasureEffectModel gen_to_be_invoked = (Snxxz.UI.TreasureEffectModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | public string GetProValueTypeStr(int isPercentage, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (isPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (isPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (isPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | |
|
| | | #region 发送请求
|
| | | public void SendMakerDrugQuest(ushort drugId, uint specConfigID)
|
| | | {
|
| | |
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | {
|
| | | int remainBuyTimes = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainBuyNum();
|
| | | price = (ulong)CrossServerOneVsOnePlayerInfo.Instance.GetBuyMatchNumPrice();
|
| | | m_CostRemind.text = Language.Get("TimesBuyLanguage3",price);
|
| | | m_CostRemind.text = Language.Get("TimesBuyLanguage3", price);
|
| | | m_ContainerBuylimit.gameObject.SetActive(remainBuyTimes <= 0);
|
| | | m_BuyTimes.gameObject.SetActive(remainBuyTimes > 0);
|
| | | if(remainBuyTimes > 0)
|
| | | if (remainBuyTimes > 0)
|
| | | {
|
| | | m_TodayBuyTimes.text = Language.Get("TimesBuyLanguage1",UIHelper.AppendColor(TextColType.Green,remainBuyTimes.ToString()), crossServerModel.buyMaxMatchNum);
|
| | | m_TodayBuyTimes.text = Language.Get("TimesBuyLanguage1", UIHelper.AppendColor(TextColType.Green, remainBuyTimes.ToString()), crossServerModel.buyMaxMatchNum);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | if (!crossServerModel.TryGetBuyMatchTimes("CrossMatching21")) return;
|
| | |
|
| | | ulong gold = UIHelper.GetMoneyCnt(1);
|
| | | ulong bindGold = UIHelper.GetMoneyCnt(2);
|
| | | ulong sumGold = gold + bindGold;
|
| | | ulong sumGold = UIHelper.GetMoneyCnt(1);
|
| | | if (sumGold >= price)
|
| | | {
|
| | | if (bindGold < price)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyLand_Func13",
|
| | | PlayerDatas.Instance.baseData.bindDiamond, price, price - bindGold), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | SendBuyTimes();
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | SendBuyTimes();
|
| | | }
|
| | | SendBuyTimes();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | } |
| | | #endregion |
| | | GetItemPathModel _GetItemPath; |
| | | GetItemPathModel GetItemPath |
| | | { |
| | | GetItemPathModel GetItemPath { |
| | | get { return _GetItemPath ?? (_GetItemPath = ModelCenter.Instance.GetModel<GetItemPathModel>()); } |
| | | } |
| | | ResourcesBackModel m_ResourcesBackModel; |
| | |
| | | { |
| | | Close(); |
| | | } |
| | | |
| | | void OnClickConfirmButton() |
| | | { |
| | | if (_isBool) |
| | | { |
| | | int getCostJade = (int)UIHelper.GetMoneyCnt(2); |
| | | if (getCostJade >= NeedCostJade) |
| | | { |
| | | CMRecoverGain(0, resourcesBackModel.ResourcesBackId, number); |
| | | Close(); |
| | | } |
| | | else |
| | | { |
| | | RegardsFairyJadeBack(); |
| | | } |
| | | {
|
| | | RegardsFairyJadeBack(); |
| | | } |
| | | else |
| | | { |
| | | CMRecoverGain(1, resourcesBackModel.ResourcesBackId, number);
|
| | | Close(); |
| | | //int copperCash = (int)UIHelper.GetMoneyCnt(3); ; |
| | | //if (copperCash >= NeedCostCopper) |
| | | //{ |
| | | // CMRecoverGain(1, resourcesBackModel.ResourcesBackId, number); |
| | | // Close(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // GetItemPath.SetChinItemModel(2100); |
| | | //} |
| | | } |
| | | |
| | | } |
| | | |
| | | void RegardsFairyJadeBack( ) |
| | | void RegardsFairyJadeBack() |
| | | { |
| | | int getCostJade = (int)UIHelper.GetMoneyCnt(2);//拥有的绑玉 |
| | | int getJade= (int)UIHelper.GetMoneyCnt(1);//拥有的仙玉 |
| | | int CostJade = NeedCostJade - getCostJade; |
| | | string strLanguage = string.Format(Language.Get("FairyLand_Func13"), getCostJade, NeedCostJade, CostJade); |
| | | int getJade = (int)UIHelper.GetMoneyCnt(1);//拥有的仙玉 |
| | | int CostJade = NeedCostJade; |
| | | string strLanguage = string.Format(Language.Get("FairyLand_Func13"), NeedCostJade, CostJade); |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strLanguage, (bool isOk) => |
| | | { |
| | | if (isOk) |
| | |
| | | WindowCenter.Instance.Open<RechargeTipWin>(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | });
|
| | |
|
| | |
|
| | | } |
| | | |
| | | void OnClickReduceButton() |
| | |
| | | else |
| | | { |
| | | m_ResourceName.text = resourcesBackClass.NameOfActivity + string.Format(Language.Get("ResourceBack_NormalTimes"), resourcesBackClass.RecoverCnt); |
| | | } |
| | | |
| | | |
| | | }
|
| | |
|
| | |
|
| | | m_Slider.minValue = minNumber; |
| | | m_Slider.maxValue = maxNumber; |
| | | number = Mathf.CeilToInt(m_Slider.value); |
| | |
| | | else |
| | | { |
| | | m_RequiredPrice.text = string.Format(Language.Get("ResourceBack_JadeCost"), needFairyJade, resourcesBackClass.NormalCostJade); |
| | | } |
| | | |
| | | }
|
| | |
|
| | | NeedCostJade = needFairyJade; |
| | | } |
| | | private void CopperCashFind(int resourcesBackID) |
| | |
| | | m_Slider.wholeNumbers = true; |
| | | int minNumber = 1; |
| | | int maxNumber = 0; |
| | | maxNumber = resourcesBackClass.RecoverCnt; |
| | | |
| | | maxNumber = resourcesBackClass.RecoverCnt;
|
| | |
|
| | | m_ResourceName.text = resourcesBackClass.NameOfActivity + string.Format(Language.Get("ResourceBack_NormalTimes"), maxNumber); |
| | | number = Mathf.CeilToInt(m_Slider.value); |
| | | m_UpToNumberTxt.text = number.ToString(); |
| | |
| | | IsOpenBool = false; |
| | | } |
| | | needCostCopper = (Mathf.CeilToInt(m_Slider.value)) * resourcesBackClass.CostCopper;
|
| | | m_RequiredPrice.gameObject.SetActive(false); |
| | | // m_RequiredPrice.text = string.Format(Language.Get("ResourceBack_CopperCost"), needCostCopper); |
| | | m_RequiredPrice.gameObject.SetActive(false);
|
| | | // m_RequiredPrice.text = string.Format(Language.Get("ResourceBack_CopperCost"), needCostCopper);
|
| | | NeedCostCopper = needCostCopper; |
| | | } |
| | | |
| | |
| | | ResourcesBackClass resourcesBackClass = resourcesBackModel.ResourcesBackDic[_resourcesBackID];
|
| | | resourcesBackModel.ResourcesBackId = _resourcesBackID;
|
| | | int costCopper = (int)UIHelper.GetMoneyCnt(3);//铜钱
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(2);//绑玉
|
| | | if (isBool)
|
| | | {
|
| | | int costJadeNumber = 0;
|
| | |
| | | else
|
| | | {
|
| | | RecoverGain(1, _resourcesBackID, 1);
|
| | | //if (costCopper >= resourcesBackClass.CostCopper)
|
| | | //{
|
| | | // RecoverGain(1, _resourcesBackID, 1);
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // GetItemPath.SetChinItemModel(2100);
|
| | | //}
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | private void RegardsFairyJadeBack(ResourcesBackClass resourcesBackClass)//关于仙玉找回
|
| | | {
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(2);//绑玉
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (resourcesBackClass.RecoverCnt != 0)
|
| | | {
|
| | | if (CostJade >= resourcesBackClass.NormalCostJade)
|
| | |
| | | ResourcesBackModel m_ResourcesBackModel;
|
| | | ResourcesBackModel resourcesBackModel { get { return m_ResourcesBackModel ?? (m_ResourcesBackModel = ModelCenter.Instance.GetModel<ResourcesBackModel>()); } }
|
| | | GetItemPathModel _GetItemPath;
|
| | | GetItemPathModel GetItemPath
|
| | | {
|
| | | GetItemPathModel GetItemPath {
|
| | | get { return _GetItemPath ?? (_GetItemPath = ModelCenter.Instance.GetModel<GetItemPathModel>()); }
|
| | | }
|
| | | public static event Action IsAccordingRedPoint;
|
| | |
| | | }
|
| | | private void OnEnable()
|
| | | {
|
| | | |
| | |
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
|
| | | ResourcesBackModel.ResourcesBackUpdateEvent += OnResourcesBackUpdate;
|
| | | IsFindOneKey();
|
| | |
| | | NeedFairyJade += ResourcesBack.RecoverCnt * ResourcesBack.NormalCostJade;
|
| | | }
|
| | | }
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(2);//绑玉
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | string strLanguage = string.Empty;
|
| | | if (CostJade >= NeedFairyJade)
|
| | | {
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if ((int)UIHelper.GetMoneyCnt(2) + (int)UIHelper.GetMoneyCnt(1) >= NeedFairyJade)
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= NeedFairyJade)
|
| | | {
|
| | | RecoverGain(2);
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | private void FindAKeyFairyJade()//一键找仙玉
|
| | | {
|
| | | int NeedFairyJade = 0;
|
| | |
| | | NeedFairyJade += ResourcesBack.ExtraCnt * ResourcesBack.VipCostJade;
|
| | | }
|
| | | }
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(2);//绑玉
|
| | | int CostJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | string strLanguage = string.Empty;
|
| | | if (CostJade >= NeedFairyJade)
|
| | | {
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if ((int)UIHelper.GetMoneyCnt(2) + (int)UIHelper.GetMoneyCnt(1) >= NeedFairyJade)
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= NeedFairyJade)
|
| | | {
|
| | | RecoverGain(0);
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | private void FindAKeyCoins()//一键找铜钱
|
| | | {
|
| | | RecoverGain(1);//免费找回
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | //int NeedCoinsNumber = 0;
|
| | | //foreach (int key in resourcesBackModel.ResourcesBackDic.Keys)
|
| | | //{
|
| | | // var ResourcesBack = resourcesBackModel.ResourcesBackDic[key];
|
| | | // if (ResourcesBack.RecoverCnt > 0)
|
| | | // {
|
| | | // NeedCoinsNumber += ResourcesBack.RecoverCnt * ResourcesBack.CostCopper;
|
| | | // }
|
| | | //}
|
| | | //int costCopper = (int)UIHelper.GetMoneyCnt(3); ;//铜钱
|
| | | //string strLanguage = string.Format(Language.Get("NewResourceBack2"), packItemLogicUtility.Instance.OnChangeCoinsUnit((ulong)NeedCoinsNumber));
|
| | | //ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strLanguage, (bool isOk) =>
|
| | | //{
|
| | | // if (isOk)
|
| | | // {
|
| | | // if (costCopper >= NeedCoinsNumber)
|
| | | // {
|
| | | // RecoverGain(1);
|
| | | // m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // GetItemPath.SetChinItemModel(2100);
|
| | | // }
|
| | | // }
|
| | | //});
|
| | | }
|
| | |
|
| | | List<byte> indexList = new List<byte>();
|
| | |
| | | if (havex.CompareTo(havey) != 0) return -havex.CompareTo(havey);
|
| | | if (xPack.ID.CompareTo(yPack.ID) != 0) return xPack.ID.CompareTo(yPack.ID);
|
| | |
|
| | |
|
| | | return 1;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | int Compare(ResourcesBackClass x, ResourcesBackClass y)//铜钱数组排列
|
| | |
| | |
|
| | | private void ToggleSelected()//Toggle选中
|
| | | {
|
| | | if (resourcesBackModel.ResourcesBackDic.Count <=0)
|
| | | if (resourcesBackModel.ResourcesBackDic.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | |
|
| | | private void ClickGoldHelp()
|
| | | {
|
| | | ulong haveMoney = UIHelper.GetMoneyCnt(1) + UIHelper.GetMoneyCnt(2);
|
| | | ulong haveMoney = UIHelper.GetMoneyCnt(1);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),Language.Get("DungeonAssist131",assistModel.goldAssistPlayer),
|
| | | (bool isOk)=>
|
| | | {
|
| | |
| | | {
|
| | | if (remainNum > 0)
|
| | | {
|
| | | ulong haveBindGold = UIHelper.GetMoneyCnt(2);
|
| | | if (haveBindGold < (ulong)assistModel.refreshCostMoney)
|
| | | ulong money = UIHelper.GetMoneyCnt(1);
|
| | | if (money < (ulong)assistModel.refreshCostMoney)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DungeonAssist130", assistModel.refreshCostMoney),
|
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | ulong haveGold = UIHelper.GetMoneyCnt(1);
|
| | | if (haveGold >= (ulong)assistModel.refreshCostMoney)
|
| | | {
|
| | | assistModel.SendAssistRefresh();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | Equation.Instance.AddKeyValue("hasBuyCnt", dungeonRecord.buyTimes);
|
| | | model.TryGetBuyCountCost(model.currentDungeon.mapId, out costFormula);
|
| | | int _cost = Equation.Instance.Eval<int>(costFormula);
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond + PlayerDatas.Instance.baseData.diamond >= _cost)
|
| | | if (PlayerDatas.Instance.baseData.diamond >= _cost)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond < _cost)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyLand_Func13",
|
| | | PlayerDatas.Instance.baseData.bindDiamond, _cost, _cost - PlayerDatas.Instance.baseData.bindDiamond), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | model.RequestBuyEnterCount(model.currentDungeon.mapId);
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | model.RequestBuyEnterCount(model.currentDungeon.mapId);
|
| | | }
|
| | | model.RequestBuyEnterCount(model.currentDungeon.mapId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | //CloseImmediately();
|
| | | }
|
| | |
|
| | | private bool CheckSpecialDungeon()
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond + PlayerDatas.Instance.baseData.diamond >= dungeonEnter.clearCoolDownCost)
|
| | | if ( PlayerDatas.Instance.baseData.diamond >= dungeonEnter.clearCoolDownCost)
|
| | | {
|
| | | model.RequestClearEnterCD(dungeonEnter.mapId);
|
| | | }
|
| | |
| | | switch (fairyInspireConfig.InspireType)
|
| | | {
|
| | | case 1:
|
| | | money += PlayerDatas.Instance.baseData.diamond;
|
| | | break;
|
| | | case 2:
|
| | | money += PlayerDatas.Instance.baseData.bindDiamond;
|
| | | break;
|
| | | case 5:
|
| | | money = PlayerDatas.Instance.baseData.bindDiamond + PlayerDatas.Instance.baseData.diamond;
|
| | | money += PlayerDatas.Instance.baseData.diamond;
|
| | | break;
|
| | | }
|
| | | var cost = model.GetDungeonInspireCost(fairyInspireConfig);
|
| | |
| | | var dataMapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | var isDouble = dataMapId == DemonJarModel.DEMONJAR_MAPID && demonJarModel.isDoubleAward;
|
| | |
|
| | | bool mix = fairyInspireConfig.InspireType == 5 && PlayerDatas.Instance.baseData.bindDiamond < cost
|
| | | && PlayerDatas.Instance.baseData.bindDiamond > 0;
|
| | | var fairyCost = fairyInspireConfig.InspireType == 5 ? cost - PlayerDatas.Instance.baseData.bindDiamond : cost;
|
| | | bool mix = fairyInspireConfig.InspireType == 5 && PlayerDatas.Instance.baseData.diamond < cost
|
| | | && PlayerDatas.Instance.baseData.diamond > 0;
|
| | |
|
| | | var fairyCost = fairyInspireConfig.InspireType == 5 ? cost - PlayerDatas.Instance.baseData.diamond : cost;
|
| | | fairyCost *= isDouble ? 2 : 1;
|
| | |
|
| | | if (fairyCost > 0 && (!model.inspireRemindEffective || !model.inspireNoRemind))
|
| | | {
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"),
|
| | | mix ? Language.Get("InspireRemind1", fairyCost, PlayerDatas.Instance.baseData.bindDiamond)
|
| | | mix ? Language.Get("InspireRemind1", fairyCost, PlayerDatas.Instance.baseData.diamond)
|
| | | : Language.Get("InspireRemind2", fairyCost),
|
| | | Language.Get("InspireNoMention"), (bool isOk, bool toggle) =>
|
| | | {
|
| | |
| | | if (own < lackItem.count)
|
| | | {
|
| | | var moneyNeed = GetUnitPrice(lackType) * (lackItem.count - own);
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond;
|
| | | if (moneyOwn < moneyNeed)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | |
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond < moneyNeed)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | GetBindJadeLackTip(lackType, moneyNeed, (int)PlayerDatas.Instance.baseData.bindDiamond),
|
| | | (bool _ok) =>
|
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | ConfirmTodo(lackType);
|
| | | }
|
| | | }
|
| | | );
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmTodo(lackType);
|
| | | }
|
| | | ConfirmTodo(lackType);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond ;
|
| | | if (moneyNeed > moneyOwn)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond ;
|
| | | if (moneyNeed > moneyOwn)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | |
| | | {
|
| | | foreach (var _key in _dict.Keys)
|
| | | {
|
| | | if (_key == 2
|
| | | && PlayerDatas.Instance.baseData.bindDiamond >= _dict[_key].MoneyNumber)
|
| | | {
|
| | | model.liquidStoreConfigs.Add(_dict[_key]);
|
| | | break;
|
| | | }
|
| | | else if (_key == 1)
|
| | | if (_key == 1)
|
| | | {
|
| | | model.liquidStoreConfigs.Add(_dict[_key]);
|
| | | break;
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | int Money = (int)UIHelper.GetMoneyCnt(1) + (int)UIHelper.GetMoneyCnt(2);
|
| | | int Money = (int)UIHelper.GetMoneyCnt(1) ;
|
| | | if (Money >= iceCrystalVeinModel.SweepingNeedMoney)
|
| | | {
|
| | | model.RequestSweep(model.selectedKylinDungeon);
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | int GoldPaper = (int)UIHelper.GetMoneyCnt(2)+ (int)UIHelper.GetMoneyCnt(1);
|
| | | if (GoldPaper >= iceCrystalVeinModel.Cost)
|
| | | int diamond = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (diamond >= iceCrystalVeinModel.Cost)
|
| | | {
|
| | | EnterTheCopy();
|
| | | }
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond;
|
| | | if (moneyNeed > moneyOwn)
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | |
| | |
|
| | | private void AccomplishTask()
|
| | | {
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= _requireNumber || (int)UIHelper.GetMoneyCnt(2) >= _requireNumber)
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= _requireNumber )
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskID);
|
| | | taskmodel.FairyAuBool = true;
|
| | |
| | | int freeCnt = Mathf.Max(0, model.freeNotifyCount - (int)PlayerDatas.Instance.fairyData.fairy.Extra3);
|
| | | if (freeCnt < 1)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.diamond < model.changeNotifyCost
|
| | | && PlayerDatas.Instance.baseData.bindDiamond < model.changeNotifyCost)
|
| | | if (PlayerDatas.Instance.baseData.diamond < model.changeNotifyCost)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | |
| | | [SerializeField] Button creationConfirm;
|
| | |
|
| | | private FairyModel m_Model;
|
| | | private FairyModel model
|
| | | {
|
| | | get
|
| | | {
|
| | | private FairyModel model {
|
| | | get {
|
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<FairyModel>());
|
| | | }
|
| | | }
|
| | |
| | | ServerTipDetails.DisplayNormalTip(Language.Get("L1005"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(creationInput.text))
|
| | | {
|
| | | ServerTipDetails.DisplayNormalTip(Language.Get("L1015"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (DirtyWordConfig.IsDirtWord(creationInput.text) || UIHelper.HasSpecialCharac(creationInput.text)
|
| | | || DirtyNameConfig.IsDirtName(creationInput.text))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FamilyNameChangeUnlegal");
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond + PlayerDatas.Instance.baseData.diamond >= model.createFairyCost)
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.diamond >= model.createFairyCost)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond < model.createFairyCost)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyLand_Func36",
|
| | | PlayerDatas.Instance.baseData.bindDiamond, model.createFairyCost, model.createFairyCost - PlayerDatas.Instance.baseData.bindDiamond), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CA404_tagCGPyCreatFamily creatPack = new CA404_tagCGPyCreatFamily();
|
| | | creatPack.Name = creationInput.text;
|
| | | creatPack.FakeID = 0;
|
| | | GameNetSystem.Instance.SendInfo(creatPack);
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | CA404_tagCGPyCreatFamily creatPack = new CA404_tagCGPyCreatFamily();
|
| | | creatPack.Name = creationInput.text;
|
| | | creatPack.FakeID = 0;
|
| | | GameNetSystem.Instance.SendInfo(creatPack);
|
| | | }
|
| | | CA404_tagCGPyCreatFamily creatPack = new CA404_tagCGPyCreatFamily();
|
| | | creatPack.Name = creationInput.text;
|
| | | creatPack.FakeID = 0;
|
| | | GameNetSystem.Instance.SendInfo(creatPack);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | string attrSB = string.Empty;
|
| | | if (attrConfig.Name.Contains("%s"))
|
| | | {
|
| | | attrSB = attrConfig.Name.Replace("%s", tipsModel.GetProValueTypeStr(attrConfig, attrValue));
|
| | | attrSB = attrConfig.Name.Replace("%s", PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | }
|
| | | else
|
| | | {
|
| | | attrSB = StringUtility.Contact(attrConfig.Name, "+", tipsModel.GetProValueTypeStr(attrConfig, attrValue));
|
| | | attrSB = StringUtility.Contact(attrConfig.Name, "+", PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | }
|
| | | attrText.text = attrSB;
|
| | | }
|
| | |
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | |
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
| | | int sumNum = fashionModel.fashoinDressCount;
|
| | | int activateNum = activateIds.Count;
|
| | | string actvivateNumSB = string.Empty;
|
| | | if(activateNum > 0)
|
| | | if (activateNum > 0)
|
| | | {
|
| | | actvivateNumSB = UIHelper.AppendColor(TextColType.Green,activateNum.ToString());
|
| | | actvivateNumSB = UIHelper.AppendColor(TextColType.Green, activateNum.ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | actvivateNumSB = UIHelper.AppendColor(TextColType.Red, activateNum.ToString());
|
| | | }
|
| | | activateNumText.text = StringUtility.Contact(actvivateNumSB, "/",sumNum);
|
| | | activateNumText.text = StringUtility.Contact(actvivateNumSB, "/", sumNum);
|
| | | Dictionary<int, int> attrDict = GetActivateAttr();
|
| | | if(attrDict != null && attrDict.Count > 0)
|
| | | if (attrDict != null && attrDict.Count > 0)
|
| | | {
|
| | | noneActivate.SetActive(false);
|
| | | List<int> attrIds = attrDict.Keys.ToList();
|
| | | for(int i = 0; i < activateAttrObjs.Count; i++)
|
| | | for (int i = 0; i < activateAttrObjs.Count; i++)
|
| | | {
|
| | | var attrObj = activateAttrObjs[i];
|
| | | attrObj.SetActive(i < attrIds.Count);
|
| | | if(i < attrIds.Count)
|
| | | if (i < attrIds.Count)
|
| | | {
|
| | | var attrText = activateAttrs[i];
|
| | | int attrId = attrIds[i];
|
| | | int attrValue = attrDict[attrId];
|
| | | var attrConfig = PlayerPropertyConfig.Get(attrId);
|
| | | string attrSB = string.Empty;
|
| | | string attrValueSB = UIHelper.AppendColor(TextColType.Green, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
|
| | | string attrValueSB = UIHelper.AppendColor(TextColType.Green, PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | if (attrConfig.Name.Contains("%s"))
|
| | | {
|
| | | attrSB = attrConfig.Name.Replace("%s",attrValueSB);
|
| | | attrSB = attrConfig.Name.Replace("%s", attrValueSB);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrSB = StringUtility.Contact(attrConfig.Name, "+",attrValueSB);
|
| | | attrSB = StringUtility.Contact(attrConfig.Name, "+", attrValueSB);
|
| | | }
|
| | | attrText.text = attrSB;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private Dictionary<int,int> GetActivateAttr()
|
| | | private Dictionary<int, int> GetActivateAttr()
|
| | | {
|
| | | var sumAttrDict = new Dictionary<int, int>();
|
| | | List<int> fashionIds = null;
|
| | | bool isActivate = fashionModel.TryGetActiveFashionDress(out fashionIds);
|
| | | if(isActivate)
|
| | | if (isActivate)
|
| | | {
|
| | | foreach(var id in fashionIds)
|
| | | foreach (var id in fashionIds)
|
| | | {
|
| | | int fashionLevel = fashionModel.GetFashionDressLevel(id);
|
| | | Dictionary<int, int> attrDict = null;
|
| | | bool isAttr = fashionModel.TryGetFashionDressProperty(id,fashionLevel,out attrDict);
|
| | | if(isAttr)
|
| | | bool isAttr = fashionModel.TryGetFashionDressProperty(id, fashionLevel, out attrDict);
|
| | | if (isAttr)
|
| | | {
|
| | | foreach(var attrId in attrDict.Keys)
|
| | | foreach (var attrId in attrDict.Keys)
|
| | | {
|
| | | var attrValue = attrDict[attrId];
|
| | | if(!sumAttrDict.ContainsKey(attrId))
|
| | | if (!sumAttrDict.ContainsKey(attrId))
|
| | | {
|
| | | sumAttrDict.Add(attrId,attrValue);
|
| | | sumAttrDict.Add(attrId, attrValue);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | wardrobeLevelSB = UIHelper.AppendColor(TextColType.Red, wardrobeLevel.ToString());
|
| | | }
|
| | | wardrobeLvText.text = Language.Get("FashionDress106",wardrobeLevelSB);
|
| | | wardrobeLvText.text = Language.Get("FashionDress106", wardrobeLevelSB);
|
| | | Dictionary<int, int> attrDict = null;
|
| | | fashionModel.TryGetCabinetProperty(fashionModel.cabinetLevel, out attrDict);
|
| | | if (attrDict != null && attrDict.Count > 0)
|
| | |
| | | int attrValue = attrDict[attrId];
|
| | | var attrConfig = PlayerPropertyConfig.Get(attrId);
|
| | | string attrSB = string.Empty;
|
| | | string attrValueSB = UIHelper.AppendColor(TextColType.Green, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
|
| | | string attrValueSB = UIHelper.AppendColor(TextColType.Green, PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | if (attrConfig.Name.Contains("%s"))
|
| | | {
|
| | | attrSB = attrConfig.Name.Replace("%s", attrValueSB);
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond;
|
| | | if (moneyOwn < moneyNeed)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | |
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond ;
|
| | | if (moneyOwn < moneyNeed)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | |
| | | [SerializeField] Button m_Cancel;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | GatherSoulDungeonModel model
|
| | | {
|
| | | GatherSoulDungeonModel model {
|
| | | get { return ModelCenter.Instance.GetModel<GatherSoulDungeonModel>(); }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void Confirm()
|
| | | {
|
| | | var mission=model.mission;
|
| | | var mission = model.mission;
|
| | | if (mission.hasRefreshBoss == 1)
|
| | | {
|
| | | if (m_AutoGenerate.isOn == (mission.isAuto == 1))
|
| | |
| | | }
|
| | | if (m_AutoGenerate.isOn)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) + UIHelper.GetMoneyCnt(2) >= (ulong)model.generateBossCost)
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)model.generateBossCost)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | Language.Get("GathetSoulAotuRemind",
|
| | | UIHelper.GetMoneyCnt(2), UIHelper.GetMoneyCnt(1), model.generateBossCost),
|
| | | Language.Get("GathetSoulAotuRemind", UIHelper.GetMoneyCnt(1), model.generateBossCost),
|
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(2) >= (ulong)cost)
|
| | | {
|
| | | CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction();
|
| | | pak.ActionType = 2;
|
| | | pak.ActionInfo = m_AutoGenerate.isOn ? (uint)1 : 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | CloseClick();
|
| | | }
|
| | | else if (UIHelper.GetMoneyCnt(1) + UIHelper.GetMoneyCnt(2) >= (ulong)cost)
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)cost)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | Language.Get("GenerateBossCostConfirm",
|
| | | cost, UIHelper.GetMoneyCnt(2), (ulong)cost - UIHelper.GetMoneyCnt(2)),
|
| | | Language.Get("GenerateBossCostConfirm", cost, (ulong)cost),
|
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | |
| | | int suitType = suitTypes[i];
|
| | | JadeDynastyEquipModel.JadeDynastyStoneSuitAttrData curAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastyStoneSuitAttrData nextAttrData = null;
|
| | | equipModel.TryGetStoneSumSuitAttr(suitType,out curAttrData, out nextAttrData);
|
| | | equipModel.TryGetStoneSumSuitAttr(suitType, out curAttrData, out nextAttrData);
|
| | | if (isNext)
|
| | | {
|
| | | if (nextAttrData != null)
|
| | |
| | | isNoneActive = false;
|
| | | }
|
| | | }
|
| | | suitAttr.SetDisplay(suitType,isNext);
|
| | | suitAttr.SetDisplay(suitType, isNext);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | JadeDynastyEquipModel equipModel { get { return ModelCenter.Instance.GetModel<JadeDynastyEquipModel>(); } }
|
| | |
|
| | | public void SetDisplay(int suitType,bool isNext)
|
| | | public void SetDisplay(int suitType, bool isNext)
|
| | | {
|
| | | JadeDynastyEquipModel.JadeDynastyStoneSuitAttrData curAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastyStoneSuitAttrData nextAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastyStoneSuitAttrData suitAttrData = null;
|
| | | equipModel.TryGetStoneSumSuitAttr(suitType,out curAttrData,out nextAttrData);
|
| | | equipModel.TryGetStoneSumSuitAttr(suitType, out curAttrData, out nextAttrData);
|
| | | suitAttrData = isNext ? nextAttrData : curAttrData;
|
| | | if(suitAttrData == null)
|
| | | if (suitAttrData == null)
|
| | | {
|
| | | attrTypeObj.SetActive(false);
|
| | | return;
|
| | |
| | | {
|
| | | attrTypeObj.SetActive(true);
|
| | | string suitName = Language.Get(StringUtility.Contact("JadeDynastyEquipStoneSuit_", suitType));
|
| | | suitTypeText.text = StringUtility.Contact(suitName,"Lv." + suitAttrData.suitLv);
|
| | | suitTypeText.text = StringUtility.Contact(suitName, "Lv." + suitAttrData.suitLv);
|
| | | }
|
| | | int[] ids = suitAttrData.suitAttrConfig.attrIDList;
|
| | | int[] values = suitAttrData.suitAttrConfig.attrValueList;
|
| | | var equipPlaces = equipModel.suitTypeDict[suitType];
|
| | | int activeStoneNum = 0;
|
| | | bool isActive = equipModel.TryGetIsActiveStoneSuit(suitType,suitAttrData.suitLv,out activeStoneNum);
|
| | | bool isActive = equipModel.TryGetIsActiveStoneSuit(suitType, suitAttrData.suitLv, out activeStoneNum);
|
| | | bool isShowActiveObj = !isActive;
|
| | | activeObj.SetActive(isShowActiveObj);
|
| | | if(isShowActiveObj)
|
| | | if (isShowActiveObj)
|
| | | {
|
| | | string equipsName = string.Empty;
|
| | | for(int i = 0; i < equipPlaces.Count; i++)
|
| | | for (int i = 0; i < equipPlaces.Count; i++)
|
| | | {
|
| | | var place = equipPlaces[i];
|
| | | string equipName = Language.Get(((RoleEquipType)place).ToString());
|
| | |
| | | }
|
| | | }
|
| | | string activeGemNum = string.Empty;
|
| | | if(activeStoneNum > 0)
|
| | | if (activeStoneNum > 0)
|
| | | {
|
| | | activeGemNum = StringUtility.Contact(UIHelper.AppendColor(TextColType.Green, activeStoneNum.ToString()), "/", equipModel.gemResonanceNum);
|
| | | }
|
| | |
| | | {
|
| | | activeGemNum = StringUtility.Contact(activeStoneNum, "/", equipModel.gemResonanceNum);
|
| | | }
|
| | | string conditionSB = Language.Get("JadeDynastyEquip7", equipsName,equipModel.gemResonanceNum,suitAttrData.suitLv,activeGemNum);
|
| | | string conditionSB = Language.Get("JadeDynastyEquip7", equipsName, equipModel.gemResonanceNum, suitAttrData.suitLv, activeGemNum);
|
| | | activeText.text = conditionSB;
|
| | | }
|
| | | for (int i = 0; i < attrObjlist.Count; i++)
|
| | | {
|
| | | var attrObj = attrObjlist[i];
|
| | | attrObj.SetActive(i < ids.Length);
|
| | | if(i < ids.Length)
|
| | | if (i < ids.Length)
|
| | | {
|
| | | var attrId = ids[i];
|
| | | var attrValue = values[i];
|
| | | var attrText = attrTextlist[i];
|
| | | var attrConfig = PlayerPropertyConfig.Get(attrId);
|
| | | string attrSB = string.Empty;
|
| | | string attrValueSB = tipsModel.GetProValueTypeStr(attrConfig, attrValue);
|
| | | string attrValueSB = PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue);
|
| | | if (attrConfig.Name.Contains("%s"))
|
| | | {
|
| | | attrSB = attrConfig.Name.Replace("%s", attrValueSB);
|
| | |
| | |
|
| | | JadeDynastyEquipModel equipModel { get { return ModelCenter.Instance.GetModel<JadeDynastyEquipModel>(); } }
|
| | | int itemId = 0;
|
| | | public void SetDisplay(PackType type,bool isNext = false,int equipPlace = 0,int _itemId = 0)
|
| | | public void SetDisplay(PackType type, bool isNext = false, int equipPlace = 0, int _itemId = 0)
|
| | | {
|
| | | this.itemId = _itemId;
|
| | | if(equipPlace == 0)
|
| | | if (equipPlace == 0)
|
| | | {
|
| | | UpdateSumSuitAttr(type, isNext);
|
| | | }
|
| | | else
|
| | | else
|
| | | {
|
| | | UpdateEquipSuitAttr(type,isNext,equipPlace);
|
| | | UpdateEquipSuitAttr(type, isNext, equipPlace);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateEquipSuitAttr(PackType type,bool isNext,int equipPlace)
|
| | | private void UpdateEquipSuitAttr(PackType type, bool isNext, int equipPlace)
|
| | | {
|
| | | bool isNoneActive = true;
|
| | | bool isMaxSuitLv = true;
|
| | | int suitType = 0;
|
| | | bool isSuit = equipModel.TryGetSuitType(equipPlace,out suitType);
|
| | | for(int i = 0; i < suitAttrs.Count; i++)
|
| | | bool isSuit = equipModel.TryGetSuitType(equipPlace, out suitType);
|
| | | for (int i = 0; i < suitAttrs.Count; i++)
|
| | | {
|
| | | var suitAttr = suitAttrs[i];
|
| | | if(i > 0)
|
| | | if (i > 0)
|
| | | {
|
| | | suitAttr.attrTypeObj.SetActive(false);
|
| | | }
|
| | |
| | | suitAttr.attrTypeObj.SetActive(true);
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData curAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData nextAttrData = null;
|
| | | equipModel.TryGetSumSuitAttr(suitType, type, out curAttrData, out nextAttrData,itemId);
|
| | | equipModel.TryGetSumSuitAttr(suitType, type, out curAttrData, out nextAttrData, itemId);
|
| | | if (isNext)
|
| | | {
|
| | | if (nextAttrData != null)
|
| | |
| | | isNoneActive = false;
|
| | | }
|
| | | }
|
| | | suitAttr.SetDisplay(suitType, type, isNext,itemId);
|
| | | suitAttr.SetDisplay(suitType, type, isNext, itemId);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateSumSuitAttr(PackType type,bool isNext)
|
| | | private void UpdateSumSuitAttr(PackType type, bool isNext)
|
| | | {
|
| | | if (!isNext)
|
| | | {
|
| | |
| | | int suitType = suitTypes[i];
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData curAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData nextAttrData = null;
|
| | | equipModel.TryGetSumSuitAttr(suitType, type, out curAttrData, out nextAttrData,this.itemId);
|
| | | equipModel.TryGetSumSuitAttr(suitType, type, out curAttrData, out nextAttrData, this.itemId);
|
| | | if (isNext)
|
| | | {
|
| | | if (nextAttrData != null)
|
| | |
| | | isNoneActive = false;
|
| | | }
|
| | | }
|
| | | suitAttr.SetDisplay(suitType, type, isNext,itemId);
|
| | | suitAttr.SetDisplay(suitType, type, isNext, itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | JadeDynastyEquipModel equipModel { get { return ModelCenter.Instance.GetModel<JadeDynastyEquipModel>(); } }
|
| | |
|
| | | public void SetDisplay(int suitType,PackType type,bool isNext,int itemId)
|
| | | public void SetDisplay(int suitType, PackType type, bool isNext, int itemId)
|
| | | {
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData curAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData nextAttrData = null;
|
| | | JadeDynastyEquipModel.JadeDynastySuitAttrData suitAttrData = null;
|
| | | equipModel.TryGetSumSuitAttr(suitType,type,out curAttrData,out nextAttrData,itemId);
|
| | | equipModel.TryGetSumSuitAttr(suitType, type, out curAttrData, out nextAttrData, itemId);
|
| | | suitAttrData = isNext ? nextAttrData : curAttrData;
|
| | | if(suitAttrData == null)
|
| | | if (suitAttrData == null)
|
| | | {
|
| | | attrTypeObj.SetActive(false);
|
| | | return;
|
| | |
| | | {
|
| | | attrTypeObj.SetActive(true);
|
| | | string suitName = Language.Get(StringUtility.Contact("JadeDynastyEquipSuit_", suitType));
|
| | | suitTypeText.text = StringUtility.Contact(suitName,"Lv." + suitAttrData.suitLv);
|
| | | suitTypeText.text = StringUtility.Contact(suitName, "Lv." + suitAttrData.suitLv);
|
| | | }
|
| | | int[] ids = suitAttrData.suitAttrConfig.attrIDList;
|
| | | int[] values = suitAttrData.suitAttrConfig.attrValueList;
|
| | | var equipPlaces = equipModel.suitTypeDict[suitType];
|
| | | int equipPlace = equipPlaces[0];
|
| | | List<int> activeEquips = null;
|
| | | bool isActive = equipModel.TryGetIsActiveSuit(equipPlace,suitAttrData.suitLv,out activeEquips);
|
| | | bool isActive = equipModel.TryGetIsActiveSuit(equipPlace, suitAttrData.suitLv, out activeEquips);
|
| | | bool isShowActiveObj = !isActive || type == PackType.JadeDynastyItem;
|
| | | activeObj.SetActive(isShowActiveObj);
|
| | | if(isShowActiveObj)
|
| | | if (isShowActiveObj)
|
| | | {
|
| | | string equipsName = string.Empty;
|
| | | for(int i = 0; i < equipPlaces.Count; i++)
|
| | | for (int i = 0; i < equipPlaces.Count; i++)
|
| | | {
|
| | | var place = equipPlaces[i];
|
| | | string equipName = Language.Get(((RoleEquipType)place).ToString());
|
| | | if (activeEquips.Contains(place) && type == PackType.JadeDynastyEquip)
|
| | | {
|
| | | equipName = UIHelper.AppendColor(TextColType.Green,equipName);
|
| | | equipName = UIHelper.AppendColor(TextColType.Green, equipName);
|
| | | }
|
| | | if (i == 0)
|
| | | {
|
| | |
| | | equipsName = StringUtility.Contact(equipsName, " ", equipName);
|
| | | }
|
| | | }
|
| | | string conditionSB = Language.Get("JadeDynastyEquip1",equipsName,suitAttrData.suitLv);
|
| | | string conditionSB = Language.Get("JadeDynastyEquip1", equipsName, suitAttrData.suitLv);
|
| | | activeText.text = conditionSB;
|
| | | }
|
| | | for (int i = 0; i < attrObjlist.Count; i++)
|
| | | {
|
| | | var attrObj = attrObjlist[i];
|
| | | attrObj.SetActive(i < ids.Length);
|
| | | if(i < ids.Length)
|
| | | if (i < ids.Length)
|
| | | {
|
| | | var attrId = ids[i];
|
| | | var attrValue = values[i];
|
| | | var attrText = attrTextlist[i];
|
| | | var attrConfig = PlayerPropertyConfig.Get(attrId);
|
| | | string attrSB = string.Empty;
|
| | | string attrValueSB = tipsModel.GetProValueTypeStr(attrConfig, attrValue); ;
|
| | | string attrValueSB = PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue); ;
|
| | | if (attrConfig.Name.Contains("%s"))
|
| | | {
|
| | | attrSB = attrConfig.Name.Replace("%s", attrValueSB);
|
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class BoxGetItemModel : Model,IBeforePlayerDataInitialize
|
| | | public class BoxGetItemModel : Model, IBeforePlayerDataInitialize
|
| | | {
|
| | | public string guid { get; private set; }
|
| | | public int itemId { get; private set;}
|
| | | public int itemId { get; private set; }
|
| | | public BoxShowType showType { get; private set; }
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | public Dictionary<int, int> selectDict;
|
| | |
|
| | |
| | |
|
| | | #region 处理服务器数据
|
| | |
|
| | | public BoxGetItemInfo[] getItems { get; private set;}
|
| | | public BoxGetItemInfo[] getItems { get; private set; }
|
| | | public int getCoinsType { get; private set; }
|
| | | public long getCoinsCnt { get; private set; }
|
| | | public event Action<int,int,BoxGetItemInfo[]> RefreshGetItemAct;
|
| | | public event Action<int, int, BoxGetItemInfo[]> RefreshGetItemAct;
|
| | | public void SetGetBoxItemInfo(HA810_tagMCNotifyUseItemGetItem boxItemInfo)
|
| | | {
|
| | | getItems = JsonMapper.ToObject<BoxGetItemInfo[]>(boxItemInfo.GetItemData);
|
| | | getCoinsType = boxItemInfo.MoneyType;
|
| | | getCoinsCnt = boxItemInfo.MoneyCount;
|
| | | if(!NewBieCenter.Instance.inGuiding)
|
| | | if (!NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | switch (showType)
|
| | | {
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (RefreshGetItemAct != null)
|
| | | {
|
| | | RefreshGetItemAct((int)boxItemInfo.UseItemID,(int)boxItemInfo.UseCount,getItems);
|
| | | RefreshGetItemAct((int)boxItemInfo.UseItemID, (int)boxItemInfo.UseCount, getItems);
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | public void SetModel(string guid,int itemId)
|
| | | public void SetModel(string guid, int itemId)
|
| | | {
|
| | | ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | | this.guid = guid;
|
| | |
| | | if (guid == "" || chestsConfig == null) return;
|
| | |
|
| | | ItemConfig boxConfig = ItemConfig.Get(itemId);
|
| | | if(PlayerDatas.Instance.baseData.LV < boxConfig.UseLV)
|
| | | if (PlayerDatas.Instance.baseData.LV < boxConfig.UseLV)
|
| | | {
|
| | | ServerTipDetails.DisplayNormalTip(Language.Get("MakeUseItem101",boxConfig.UseLV));
|
| | | ServerTipDetails.DisplayNormalTip(Language.Get("MakeUseItem101", boxConfig.UseLV));
|
| | | return;
|
| | | }
|
| | |
|
| | | CheckBoxShowType(chestsConfig.OpenShow, guid);
|
| | | }
|
| | |
|
| | | public void CheckOpenBoxCondi(string guid, int itemId,int useCnt = 1)
|
| | | public void CheckOpenBoxCondi(string guid, int itemId, int useCnt = 1)
|
| | | {
|
| | | ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | | if (chestsConfig == null) return;
|
| | |
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (!IsEnoughTools(chestsConfig.ExpendItemID, chestsConfig.ExpendCount*useCnt))
|
| | | if (!IsEnoughTools(chestsConfig.ExpendItemID, chestsConfig.ExpendCount * useCnt))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("OpenBoxToolNoEnough", itemConfig.ItemName);
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckOpenMoney(chestsConfig, boxConfig,useCnt);
|
| | | CheckOpenMoney(chestsConfig, boxConfig, useCnt);
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckOpenMoney(chestsConfig, boxConfig,useCnt);
|
| | | CheckOpenMoney(chestsConfig, boxConfig, useCnt);
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckOpenMoney(ChestsConfig chestsConfig, ItemConfig boxConfig,int useCnt)
|
| | | public void CheckOpenMoney(ChestsConfig chestsConfig, ItemConfig boxConfig, int useCnt)
|
| | | {
|
| | | if (!IsEnoughMoney(chestsConfig.OpenMoney*useCnt))
|
| | | if (!IsEnoughMoney(chestsConfig.OpenMoney * useCnt))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("BoxOpenCostMoney", 1);
|
| | | return;
|
| | |
| | | {
|
| | | if (chestsConfig.OpenMoney > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("OpenBoxGold", chestsConfig.OpenMoney*useCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CheckOtherCondi(chestsConfig,boxConfig,useCnt);
|
| | | }
|
| | | });
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("OpenBoxGold", chestsConfig.OpenMoney * useCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CheckOtherCondi(chestsConfig, boxConfig, useCnt);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckOtherCondi(chestsConfig, boxConfig,useCnt);
|
| | | CheckOtherCondi(chestsConfig, boxConfig, useCnt);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckOtherCondi(ChestsConfig chestsConfig,ItemConfig boxConfig,int useCnt)
|
| | | public void CheckOtherCondi(ChestsConfig chestsConfig, ItemConfig boxConfig, int useCnt)
|
| | | {
|
| | |
|
| | | if (boxConfig.MaxSkillCnt > 0 && GetUseCntByID(itemId) >= boxConfig.MaxSkillCnt)
|
| | |
| | | ItemModel itemModel = playerPack.GetItemByGuid(guid);
|
| | | if (itemModel != null)
|
| | | {
|
| | | ItemOperateUtility.Instance.UseItem(itemModel.gridIndex,useCnt);
|
| | | ItemOperateUtility.Instance.UseItem(itemModel.gridIndex, useCnt);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckOpenBoxCondition(int itemId,out bool isBox)
|
| | | public bool CheckOpenBoxCondition(int itemId, out bool isBox)
|
| | | {
|
| | | isBox = false;
|
| | | ChestsConfig chestsConfig = ChestsConfig.Get(itemId);
|
| | |
| | | {
|
| | | ulong haveMoney = UIHelper.GetMoneyCnt(1);
|
| | | DebugEx.Log("IsEnoughMoney" + haveMoney);
|
| | | if(haveMoney >= (ulong)moneyCnt)
|
| | | if (haveMoney >= (ulong)moneyCnt)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private bool IsEnoughTools(int itemId,int toolCnt)
|
| | | private bool IsEnoughTools(int itemId, int toolCnt)
|
| | | {
|
| | | int count = playerPack.GetItemCountByID(PackType.Item,itemId);
|
| | | if(count >= toolCnt)
|
| | | int count = playerPack.GetItemCountByID(PackType.Item, itemId);
|
| | | if (count >= toolCnt)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | #region 得到宝箱选择的物品
|
| | | Dictionary<int, List<int>> jobReplaceDic = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, int> selectlistDict = null;
|
| | | public bool IsSelectItemByID(int boxId,out Dictionary<int,int> selectDict)
|
| | | public bool IsSelectItemByID(int boxId, out Dictionary<int, int> selectDict)
|
| | | {
|
| | | selectDict = new Dictionary<int, int>();
|
| | | jobReplaceDic.Clear();
|
| | | ChestsAwardConfig awardConfig = ChestsAwardConfig.GetChestsAwardByID(boxId);
|
| | | if(string.IsNullOrEmpty(awardConfig.SelectList))
|
| | | if (string.IsNullOrEmpty(awardConfig.SelectList))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | selectlistDict = ConfigParse.GetDic<int, int>(awardConfig.SelectList);
|
| | | selectlistDict = ConfigParse.GetDic<int, int>(awardConfig.SelectList);
|
| | | JsonData jsonData = JsonMapper.ToObject(awardConfig.JobItem);
|
| | | if(jsonData.IsArray)
|
| | | if (jsonData.IsArray)
|
| | | {
|
| | | for(int i = 0; i < jsonData.Count; i++)
|
| | | for (int i = 0; i < jsonData.Count; i++)
|
| | | {
|
| | | List<int> idlist = new List<int>();
|
| | | jobReplaceDic.Add(i,idlist);
|
| | | if(jsonData[i].IsArray)
|
| | | jobReplaceDic.Add(i, idlist);
|
| | | if (jsonData[i].IsArray)
|
| | | {
|
| | | for(int j = 0;j < jsonData[i].Count; j++)
|
| | | for (int j = 0; j < jsonData[i].Count; j++)
|
| | | {
|
| | | int itemId = int.Parse(jsonData[i][j].ToString());
|
| | | idlist.Add(itemId);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | foreach(var itemId in selectlistDict.Keys)
|
| | |
|
| | | foreach (var itemId in selectlistDict.Keys)
|
| | | {
|
| | | int id = itemId; |
| | | foreach(var index in jobReplaceDic.Keys)
|
| | | int id = itemId;
|
| | | foreach (var index in jobReplaceDic.Keys)
|
| | | {
|
| | | if(jobReplaceDic[index].Contains(itemId))
|
| | | if (jobReplaceDic[index].Contains(itemId))
|
| | | {
|
| | | int replaceIndex = PlayerDatas.Instance.baseData.Job - 1;
|
| | | id = jobReplaceDic[index][replaceIndex];
|
| | | break;
|
| | | }
|
| | | }
|
| | | selectDict.Add(id,selectlistDict[itemId]);
|
| | | selectDict.Add(id, selectlistDict[itemId]);
|
| | | }
|
| | |
|
| | | return true;
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void CheckBoxShowType(int openShow,string guid)
|
| | | private void CheckBoxShowType(int openShow, string guid)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemByGuid(guid);
|
| | | if (itemModel == null) return;
|
| | |
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | if (key == (int)AttrEnum.MinAtk)
|
| | | {
|
| | | playerProModel = PlayerPropertyConfig.Get((int)AttrEnum.ATK);
|
| | | atkStr = StringUtility.Contact(playerProModel.Name, ":", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
| | | atkStr = StringUtility.Contact(playerProModel.Name, ":", PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]));
|
| | | }
|
| | | else if (key == (int)AttrEnum.MaxAtk)
|
| | | {
|
| | | playerProModel = PlayerPropertyConfig.Get((int)AttrEnum.ATK);
|
| | | atkStr = StringUtility.Contact(atkStr, "-", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
| | | atkStr = StringUtility.Contact(atkStr, "-", PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]));
|
| | | if (attrData.strengthDataDict != null)
|
| | | {
|
| | | if (attrData.strengthDataDict.ContainsKey((int)AttrEnum.ATK))
|
| | | {
|
| | | atkStr = StringUtility.Contact(atkStr, Language.Get("KnapS116", GetProValueTypeStr(playerProModel, attrData.strengthDataDict[(int)AttrEnum.ATK])));
|
| | | atkStr = StringUtility.Contact(atkStr, Language.Get("KnapS116", PlayerPropertyConfig.GetPropertyDescription(key, attrData.strengthDataDict[(int)AttrEnum.ATK])));
|
| | | }
|
| | | }
|
| | | if (attrSB.Length <= 0)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | otherStr = StringUtility.Contact(playerProModel.Name, ":", GetProValueTypeStr(playerProModel, itemEffectDict[key]));
|
| | | otherStr = StringUtility.Contact(playerProModel.Name, ":", PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]));
|
| | | if (attrData.strengthDataDict != null)
|
| | | {
|
| | | if (attrData.strengthDataDict.ContainsKey(key))
|
| | | {
|
| | | otherStr = StringUtility.Contact(otherStr, Language.Get("KnapS116", GetProValueTypeStr(playerProModel, attrData.strengthDataDict[key])));
|
| | | otherStr = StringUtility.Contact(otherStr, Language.Get("KnapS116", PlayerPropertyConfig.GetPropertyDescription(key, attrData.strengthDataDict[key])));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | string rangeStr = "";
|
| | | if (key == 23)
|
| | | {
|
| | | rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, itemEffectDict[key]);
|
| | | rangeStr = playerProModel.Name + "+" + PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]);
|
| | | }
|
| | | else if (key == 6)
|
| | | {
|
| | |
| | | curHp = itemEffectDict[key];
|
| | | }
|
| | |
|
| | | rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, curHp) + "[" + GetProValueTypeStr(playerProModel, itemEffectDict[key]) + "-" + GetProValueTypeStr(playerProModel, maxHp) + "]";
|
| | | rangeStr = playerProModel.Name + "+"
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, curHp) + "["
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]) + "-"
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, maxHp) + "]";
|
| | | }
|
| | | else if (key == 19)
|
| | | {
|
| | |
| | | {
|
| | | curHurt = itemEffectDict[key];
|
| | | }
|
| | | rangeStr = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, curHurt) + "[" + GetProValueTypeStr(playerProModel, itemEffectDict[key]) + "-" + GetProValueTypeStr(playerProModel, maxHurt) + "]";
|
| | | rangeStr = playerProModel.Name + "+"
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, curHurt) + "["
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, itemEffectDict[key]) + "-"
|
| | | + PlayerPropertyConfig.GetPropertyDescription(key, maxHurt) + "]";
|
| | | }
|
| | |
|
| | | if (rangeStr != "")
|
| | |
| | | return description;
|
| | | }
|
| | |
|
| | | //即将丢弃
|
| | | public string GetLegendAttr(List<int> idlist, List<int> valuelist, ItemConfig itemConfig)
|
| | | {
|
| | | return SetLegendAttr(idlist, valuelist, itemConfig);
|
| | | }
|
| | |
|
| | | //即将丢弃
|
| | | public string GetPreviewLegendAttr(List<int> idlist, List<int> valuelist, ItemConfig itemConfig, bool isCustom)
|
| | | {
|
| | | return SetLegendAttr(idlist, valuelist, itemConfig, true, isCustom);
|
| | | }
|
| | |
|
| | | private string SetLegendAttr(List<int> idlist, List<int> valuelist, ItemConfig itemConfig, bool isPreview = false, bool isCustom = false)
|
| | | {
|
| | | if (idlist == null)
|
| | |
| | | SetJadeDynastyLengend(itemConfig, attrId);
|
| | | break;
|
| | | default:
|
| | | SetNormalPackLengend(itemConfig, attrId, isCustom, isPreview);
|
| | | break;
|
| | | }
|
| | | }
|
| | | return attrSB.ToString();
|
| | | }
|
| | |
|
| | | private void SetNormalPackLengend(ItemConfig itemConfig, int attrId, bool isCustom, bool isPreview)
|
| | | {
|
| | | playerProModel = PlayerPropertyConfig.Get(attrId);
|
| | | if (playerProModel != null)
|
| | | {
|
| | | string s = "";
|
| | | if (playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | if (!isPreview)
|
| | | {
|
| | | s = playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[attrId]));
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemConfig.EquipPlace != (int)RoleEquipType.Wing)
|
| | | {
|
| | | if (isCustom || itemConfig.StarLevel >= 3)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[attrId])));
|
| | | }
|
| | | else
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[attrId])));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (isCustom)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[attrId])));
|
| | | }
|
| | | else
|
| | | {
|
| | | var count = LegendPropertyUtility.GetWingPropertyCount(itemConfig.LV);
|
| | | if (count > 0)
|
| | | {
|
| | | int minValue = LegendPropertyUtility.GetWingPropertyMinValue(itemConfig.LV, attrId);
|
| | | int maxValue = LegendPropertyUtility.GetWingPropertyMaxValue(itemConfig.LV, attrId);
|
| | | var minDescription = GetProValueTypeStr(playerProModel, minValue);
|
| | | var maxDescription = GetProValueTypeStr(playerProModel, maxValue);
|
| | | var description = StringUtility.Contact("[", minDescription, "~", maxDescription, "]");
|
| | | if (count > 1)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name.Replace("%s", description));
|
| | | }
|
| | | else
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name.Replace("%s", description));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!isPreview)
|
| | | {
|
| | | s = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, attrDict[attrId]);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemConfig.EquipPlace != (int)RoleEquipType.Wing)
|
| | | {
|
| | | if (isCustom || itemConfig.StarLevel >= 3)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrDict[attrId]));
|
| | | }
|
| | | else
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrDict[attrId]));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (isCustom)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrDict[attrId]));
|
| | | }
|
| | | else
|
| | | {
|
| | | var count = LegendPropertyUtility.GetWingPropertyCount(itemConfig.LV);
|
| | | if (count > 0)
|
| | | {
|
| | | int minValue = LegendPropertyUtility.GetWingPropertyMinValue(itemConfig.LV, attrId);
|
| | | int maxValue = LegendPropertyUtility.GetWingPropertyMaxValue(itemConfig.LV, attrId);
|
| | | var minDescription = GetProValueTypeStr(playerProModel, minValue);
|
| | | var maxDescription = GetProValueTypeStr(playerProModel, maxValue);
|
| | | var description = StringUtility.Contact("[+", minDescription, "~", maxDescription, "]");
|
| | | if (count > 1)
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Must"), playerProModel.Name, description);
|
| | | }
|
| | | else
|
| | | {
|
| | | s = StringUtility.Contact(Language.Get("LegendAttPreview_Might"), playerProModel.Name, description);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | switch (itemConfig.EquipPlace)
|
| | | {
|
| | | case 11:
|
| | | s = string.Format("<color=#{0}>{1}</color>", LegendPropertyUtility.GetWingPropertyColor(attrId, attrDict[attrId]), s);
|
| | | break;
|
| | | case 101:
|
| | | case 102:
|
| | | case 103:
|
| | | case 104:
|
| | | case 105:
|
| | | s = GetTextColorByLegendType(GetDogzLegendType(attrId), s);
|
| | | break;
|
| | | }
|
| | |
|
| | | if (attrSB.Length <= 0)
|
| | | {
|
| | | attrSB.Append(s);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrSB.Append("\n" + s);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetJadeDynastyLengend(ItemConfig itemConfig, int attrId)
|
| | |
| | | string s = "";
|
| | | if (playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | s = playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrDict[attrId]));
|
| | | s = playerProModel.Name.Replace("%s", PlayerPropertyConfig.GetPropertyDescription(attrId, attrDict[attrId]));
|
| | | }
|
| | | else
|
| | | {
|
| | | s = playerProModel.Name + "+" + GetProValueTypeStr(playerProModel, attrDict[attrId]);
|
| | | s = playerProModel.Name + "+" + PlayerPropertyConfig.GetPropertyDescription(attrId, attrDict[attrId]);
|
| | | }
|
| | | int colorType = 0;
|
| | | TryGetJadeDyanastyLegendColorType(attrId, attrDict[attrId], out colorType);
|
| | |
| | | string s = "";
|
| | | if (playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | s = playerProModel.Name.Replace("%s", GetProValueTypeStr(playerProModel, attrData.washDataDict[attr]));
|
| | | s = playerProModel.Name.Replace("%s", PlayerPropertyConfig.GetPropertyDescription(attr, attrData.washDataDict[attr]));
|
| | | }
|
| | | else
|
| | | {
|
| | | s = StringUtility.Contact(playerProModel.Name, "+", GetProValueTypeStr(playerProModel, attrData.washDataDict[attr]));
|
| | | s = StringUtility.Contact(playerProModel.Name, "+", PlayerPropertyConfig.GetPropertyDescription(attr, attrData.washDataDict[attr]));
|
| | | }
|
| | |
|
| | | if (attrSB.Length <= 0)
|
| | |
| | | return maxLv;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (playerproModel.ISPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | |
|
| | | Dictionary<int, int> GetItemEffectDict(ItemConfig config)
|
| | | {
|
| | |
| | | attrName = playerProModel.Name;
|
| | | if (contanctStr == "")
|
| | | {
|
| | | attrValueStr = GetProValueTypeStr(playerProModel, attrValue);
|
| | | attrValueStr = PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | attrValueStr = StringUtility.Contact(contanctStr, "-", GetProValueTypeStr(playerProModel, attrValue));
|
| | | attrValueStr = StringUtility.Contact(contanctStr, "-", PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SetWingsRefineMat(List<int> ids, List<int> nums)
|
| | | {
|
| | | wingsRefineMatDict = null;
|
| | |
| | | }
|
| | | SetLegendData(legendIdlist, legendValuelist);
|
| | | SetExhaustedData(exhaustedIdlist, exhaustedValuelist);
|
| | | //SetSuitData(appointItemConfig.SuiteLv);
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
| | | if (attrConfig != null)
|
| | | {
|
| | | int value = attrDict[id] * useNum;
|
| | | string valueStr = StringUtility.Contact("+", UIHelper.AppendColor(TextColType.Green, GetProValueTypeStr(attrConfig, value), true));
|
| | | string valueStr = StringUtility.Contact("+", UIHelper.AppendColor(TextColType.Green, PlayerPropertyConfig.GetPropertyDescription(id, value), true));
|
| | | string attrStr = StringUtility.Contact(attrConfig.Name, valueStr);
|
| | | if (attrSB.Length != 0)
|
| | | {
|
| | |
| | | {
|
| | | if (type != PackType.Item || id != itemId) return;
|
| | | RefreshUI();
|
| | | }
|
| | |
|
| | | public string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (playerproModel.ISPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | |
|
| | | private void ClickMakeUseBtn()
|
| | |
| | | private int nextActiveCnt = 0;
|
| | |
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack
|
| | | {
|
| | | PackModel playerPack {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | attrStr.Length = 0;
|
| | | nowNoActObj.SetActive(false);
|
| | | nowActObj.SetActive(true);
|
| | | nowStarNumText.text = Language.Get("KnapS123").Replace("{0}",activeStarsConfig.countNeed.ToString());
|
| | | nowStarNumText.text = Language.Get("KnapS123").Replace("{0}", activeStarsConfig.countNeed.ToString());
|
| | | int i = 0;
|
| | | for (i = 0; i < activeStarsConfig.attType.Length; i++)
|
| | | {
|
| | | _playerProModel = PlayerPropertyConfig.Get(activeStarsConfig.attType[i]);
|
| | | if (_playerProModel != null)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(_playerProModel, activeStarsConfig.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(_playerProModel, activeStarsConfig.attValue[i]) + "\n");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | nowActObj.SetActive(false);
|
| | | }
|
| | |
|
| | | if(nextActiveStarsConfig != null)
|
| | | if (nextActiveStarsConfig != null)
|
| | | {
|
| | | nextActObj.SetActive(true);
|
| | | nextNoActObj.SetActive(false);
|
| | |
| | | _playerProModel = PlayerPropertyConfig.Get(nextActiveStarsConfig.attType[i]);
|
| | | if (_playerProModel != null)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(_playerProModel, nextActiveStarsConfig.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(_playerProModel, nextActiveStarsConfig.attValue[i]) + "\n");
|
| | | }
|
| | |
|
| | | }
|
| | | nextAttrText.text = attrStr.ToString();
|
| | | if(nextActiveStarsConfig.countNeed <= serverActiveCnt)
|
| | | if (nextActiveStarsConfig.countNeed <= serverActiveCnt)
|
| | | {
|
| | | RefreshActiveBtnUI(false);
|
| | | nextEffectText.text = Language.Get("BagWin_NextText_1", Language.Get("KnapS143"));
|
| | |
| | | }
|
| | |
|
| | | int addAttrStarsNum = 0;
|
| | | List<int> addIdlist = playerPack.GetAddAttrIdByStars(_curStarsCount,out addAttrStarsNum);
|
| | | if(addIdlist.Count > 0)
|
| | | List<int> addIdlist = playerPack.GetAddAttrIdByStars(_curStarsCount, out addAttrStarsNum);
|
| | | if (addIdlist.Count > 0)
|
| | | {
|
| | | addAttrText.gameObject.SetActive(true);
|
| | | string addAttr = "";
|
| | | for(int i = 0; i < addIdlist.Count; i++)
|
| | | for (int i = 0; i < addIdlist.Count; i++)
|
| | | {
|
| | | PlayerPropertyConfig propertyConfig = PlayerPropertyConfig.Get(addIdlist[i]);
|
| | | if(propertyConfig != null)
|
| | | if (propertyConfig != null)
|
| | | {
|
| | | addAttr = StringUtility.Contact(addAttr, propertyConfig.Name);
|
| | | }
|
| | | }
|
| | | addAttrText.text = Language.Get("KnapS148",addAttrStarsNum,addAttr);
|
| | | addAttrText.text = Language.Get("KnapS148", addAttrStarsNum, addAttr);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | private void ClickActivityBtn()
|
| | | {
|
| | | playerPack.SendActiveAttrQuest(1,nextActiveCnt);
|
| | | playerPack.SendActiveAttrQuest(1, nextActiveCnt);
|
| | | successEffect.Play();
|
| | | }
|
| | |
|
| | |
| | | if (starslist == null || starslist.Count < 1) return serverActiveCnt;
|
| | |
|
| | | int realActiveStars = _curStarsCount > serverActiveCnt ? serverActiveCnt : _curStarsCount;
|
| | | for (int i = starslist.Count - 1; i > -1 ; i--)
|
| | | for (int i = starslist.Count - 1; i > -1; i--)
|
| | | {
|
| | | if (i == 0 && starslist[i] > realActiveStars)
|
| | | {
|
| | |
| | | activeStarsConfig = null;
|
| | | nextActiveStarsConfig = RoleEquipStarsConfig.GetEquipStarsModel(starslist[0]);
|
| | | }
|
| | | else
|
| | | else
|
| | | {
|
| | | int nextActiveStars = 0;
|
| | | for (int i = 0; i < starslist.Count; i++)
|
| | | {
|
| | | if(starslist[i] > realActiveStars)
|
| | | if (starslist[i] > realActiveStars)
|
| | | {
|
| | | nextActiveStars = starslist[i];
|
| | | break;
|
| | |
| | | return realActiveStars;
|
| | | }
|
| | |
|
| | | //判断属性是否百分比显示
|
| | | public string SetIsPercentShow(PlayerPropertyConfig _playerProModel, int proValue)
|
| | | string GetValueDescription(PlayerPropertyConfig _playerProModel, int proValue)
|
| | | {
|
| | | string strPro = "";
|
| | | var valueDescription = PlayerPropertyConfig.GetPropertyDescription(_playerProModel.ID, proValue);
|
| | | if (!_playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + proValue + "</color>";
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + (float)Math.Round(proValue / 100f, 1) + "%" + "</color>";
|
| | | }
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + valueDescription + "</color>";
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", proValue.ToString());
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", (float)Math.Round(proValue / 100f, 1) + "%");
|
| | | }
|
| | | strPro = _playerProModel.Name.Replace("%s", valueDescription);
|
| | | }
|
| | |
|
| | | return strPro;
|
| | |
| | | private ItemPlusSumAttrConfig nextActiveSTRConfig = null;
|
| | | private int nextActiveCnt = 0;
|
| | |
|
| | | StrengthenModel m_StrengthengModel;
|
| | | StrengthenModel strengthengmodel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_StrengthengModel ?? (m_StrengthengModel = ModelCenter.Instance.GetModel<StrengthenModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | | StrengthenModel strengthengmodel { get { return ModelCenter.Instance.GetModel<StrengthenModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | |
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | _curStrengthLv = 0;
|
| | | foreach (var value in _haveStrengthInfoDict.Values)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip,value.EquipIndex);
|
| | | if(itemModel != null)
|
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip, value.EquipIndex);
|
| | | if (itemModel != null)
|
| | | {
|
| | | _curStrengthLv += value.EquipPartStarLV;
|
| | | }
|
| | |
| | | int i = 0;
|
| | | for (i = 0; i < activeSTRConfig.attType.Length; i++)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(activeSTRConfig.attType[i], activeSTRConfig.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(activeSTRConfig.attType[i], activeSTRConfig.attValue[i]) + "\n");
|
| | | }
|
| | | nowAttrText.text = attrStr.ToString();
|
| | | }
|
| | |
| | | int i = 0;
|
| | | for (i = 0; i < nextActiveSTRConfig.attType.Length; i++)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(nextActiveSTRConfig.attType[i], nextActiveSTRConfig.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(nextActiveSTRConfig.attType[i], nextActiveSTRConfig.attValue[i]) + "\n");
|
| | | }
|
| | | nextAttrText.text = attrStr.ToString();
|
| | | nextEffectText.text = Language.Get("BagWin_NextText_1", Language.Get("KnapS144"));
|
| | |
| | | else
|
| | | {
|
| | | RefreshActiveBtnUI(false);
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | for (int i = strenlist.Count - 1; i > -1; i--)
|
| | | {
|
| | |
|
| | | if(i == 0 && int.Parse(strenlist[i]) > _curStrengthLv)
|
| | | if (i == 0 && int.Parse(strenlist[i]) > _curStrengthLv)
|
| | | {
|
| | | activeCnt = 0;
|
| | | break;
|
| | |
| | | activeCnt = int.Parse(strenlist[i]);
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | int nextActiveSTR = 0;
|
| | | for (int i = 0; i < strenlist.Count; i++)
|
| | | {
|
| | | if ( int.Parse(strenlist[i]) == activeCnt)
|
| | | if (int.Parse(strenlist[i]) == activeCnt)
|
| | | {
|
| | | if (i < strenlist.Count - 1)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //判断属性是否百分比显示
|
| | | public string SetIsPercentShow(int proId, int proValue)
|
| | | string GetValueDescription(int proId, int proValue)
|
| | | {
|
| | | _playerProModel = PlayerPropertyConfig.Get(proId);
|
| | | string strPro = "";
|
| | |
| | | return "";
|
| | | }
|
| | |
|
| | | var valueDescription = PlayerPropertyConfig.GetPropertyDescription(_playerProModel.ID, proValue);
|
| | | if (!_playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + proValue + "</color>";
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + (float)Math.Round(proValue / 100f, 1) + "%" + "</color>";
|
| | | }
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + valueDescription + "</color>";
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", proValue.ToString());
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", (float)Math.Round(proValue / 100f, 1) + "%");
|
| | | }
|
| | | strPro = _playerProModel.Name.Replace("%s", valueDescription);
|
| | | }
|
| | |
|
| | | return strPro;
|
| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class TreasureEffectModel : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize,IPlayerLoginOk
|
| | | public class TreasureEffectModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public List<int> treasureAddAtklist { get; private set; }
|
| | | public List<string> treasureIdlist { get; private set; }
|
| | | public Dictionary<int, Dictionary<int, int>> treasureSignDict { get; private set; }
|
| | | TreasureModel m_Model;
|
| | | TreasureModel model
|
| | | {
|
| | | TreasureModel model {
|
| | | get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>()); }
|
| | | }
|
| | |
|
| | |
| | | FuncConfigConfig addExp = FuncConfigConfig.Get("VIPAddAtkEXP");
|
| | | int[] addExpIds = ConfigParse.GetMultipleStr<int>(addExp.Numerical2);
|
| | | treasureAddAtklist = new List<int>();
|
| | | for(int i = 0; i < addExpIds.Length;i++)
|
| | | for (int i = 0; i < addExpIds.Length; i++)
|
| | | {
|
| | | treasureAddAtklist.Add(addExpIds[i]);
|
| | | }
|
| | |
| | | JsonData signAttrData = JsonMapper.ToObject(MWSignDayAttr.Numerical1);
|
| | | treasureSignDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | treasureSignDict.Add(treasureId,attrDict);
|
| | | treasureSignDict.Add(treasureId, attrDict);
|
| | | foreach (var id in signAttrData.Keys)
|
| | | {
|
| | | attrDict.Add(int.Parse(id),int.Parse(signAttrData[id].ToString()));
|
| | | attrDict.Add(int.Parse(id), int.Parse(signAttrData[id].ToString()));
|
| | | }
|
| | | |
| | |
|
| | | treasureIdlist = TreasureConfig.GetKeys();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | public bool CheckIsTreasure(int id)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public int treasureId { get; private set;}
|
| | | public int vipLv { get; private set;}
|
| | | public int treasureId { get; private set; }
|
| | | public int vipLv { get; private set; }
|
| | | public StringBuilder effectDesSB = new StringBuilder();
|
| | | public int killNpcAtk { get; private set; }
|
| | | public int showType;
|
| | | |
| | |
|
| | | public void SetTreasureID(int id, int vipLv = 0)
|
| | | {
|
| | | this.treasureId = id;
|
| | |
| | | {
|
| | | killNpcAtk = killConfig.MaxAtk;
|
| | | }
|
| | | string des = treasureConfig.Verse[0].Replace("{0}",killNpcAtk.ToString());
|
| | | string des = treasureConfig.Verse[0].Replace("{0}", killNpcAtk.ToString());
|
| | | effectDesSB.Append(des);
|
| | | return;
|
| | | }
|
| | |
|
| | | if(treasureSignDict.ContainsKey(treasureId))
|
| | | if (treasureSignDict.ContainsKey(treasureId))
|
| | | {
|
| | | Dictionary<int, int> attrDict = treasureSignDict[treasureId];
|
| | | Treasure treasure;
|
| | |
| | | foreach (var id in attrDict.Keys)
|
| | | {
|
| | | PlayerPropertyConfig propertyConfig = PlayerPropertyConfig.Get(id);
|
| | | string des = string.Format(treasureConfig.Verse[0], GetProValueTypeStr(propertyConfig, attrDict[id]), propertyConfig.Name);
|
| | | string des = string.Format(treasureConfig.Verse[0], PlayerPropertyConfig.GetPropertyDescription(id, attrDict[id]), propertyConfig.Name);
|
| | | effectDesSB.Append(des);
|
| | | if (signInModel.totalSignInCount > 0)
|
| | | {
|
| | |
| | | int addAtk = signInModel.totalSignInCount * attrDict[id];
|
| | | if (isHaveTreasure)
|
| | | {
|
| | | des = string.Format(treasureConfig.Verse[2], Language.Get("TreasureEffect105", GetProValueTypeStr(propertyConfig, addAtk)));
|
| | | des = string.Format(treasureConfig.Verse[2], Language.Get("TreasureEffect105", PlayerPropertyConfig.GetPropertyDescription(id, addAtk)));
|
| | | }
|
| | | else
|
| | | {
|
| | | des = string.Format(treasureConfig.Verse[2], Language.Get("TreasureEffect104", GetProValueTypeStr(propertyConfig, addAtk)));
|
| | | des = string.Format(treasureConfig.Verse[2], Language.Get("TreasureEffect104", PlayerPropertyConfig.GetPropertyDescription(id, addAtk)));
|
| | | }
|
| | | effectDesSB.Append(StringUtility.Contact("\n", des));
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if(effectDesSB.Length <= 0)
|
| | | if (effectDesSB.Length <= 0)
|
| | | {
|
| | | type = 3;
|
| | | effectDesSB.Append(treasureConfig.Verse[0]);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | public string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (playerproModel.ISPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | |
|
| | | Dictionary<int, int> atkDict = new Dictionary<int, int>();
|
| | |
| | | if (killConfig != null)
|
| | | {
|
| | | atkDict.Clear();
|
| | | atkDict.Add(67,killConfig.MinAtk);
|
| | | atkDict.Add(68,killConfig.MaxAtk);
|
| | | atkDict.Add(67, killConfig.MinAtk);
|
| | | atkDict.Add(68, killConfig.MaxAtk);
|
| | | fight += UIHelper.GetFightPower(atkDict);
|
| | | }
|
| | | break;
|
| | |
| | | public ulong count { get; private set; }
|
| | | public int score { get; private set; }
|
| | | public bool isCompare { get; private set; }
|
| | | public ItemConfig itemConfig { get; private set; }
|
| | | public ItemConfig itemConfig { get { return ItemConfig.Get(itemId); } }
|
| | | public PackType packType { get; private set; }
|
| | | public Dictionary<int, List<int>> useDataDic { get; private set; }
|
| | |
|
| | |
| | | var propertyConfig = PlayerPropertyConfig.Get(key);
|
| | | if (propertyConfig != null)
|
| | | {
|
| | | string attrDes = StringUtility.Contact(propertyConfig.Name, "+", GetProValueTypeStr(propertyConfig, attrValue));
|
| | | string attrDes = StringUtility.Contact(propertyConfig.Name, "+", PlayerPropertyConfig.GetPropertyDescription(key, attrValue));
|
| | | switch(propertyConfig.type)
|
| | | {
|
| | | case 2:
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (playerproModel.ISPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | private List<RoleEquipStarsConfig> _tagEquipStarsModellist;
|
| | |
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack
|
| | | {
|
| | | PackModel playerPack {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | |
| | | _playerProModel = PlayerPropertyConfig.Get(_tagEquipStarsModel.attType[i]);
|
| | | if (_playerProModel != null)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(_playerProModel, _tagEquipStarsModel.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(_playerProModel, _tagEquipStarsModel.attValue[i]) + "\n");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | _playerProModel = PlayerPropertyConfig.Get(_tagEquipStarsModel.attType[i]);
|
| | | if (_playerProModel != null)
|
| | | {
|
| | | attrStr.Append(SetIsPercentShow(_playerProModel, _tagEquipStarsModel.attValue[i]) + "\n");
|
| | | attrStr.Append(GetValueDescription(_playerProModel, _tagEquipStarsModel.attValue[i]) + "\n");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | }
|
| | |
|
| | |
|
| | | //判断属性是否百分比显示
|
| | | public string SetIsPercentShow(PlayerPropertyConfig _playerProModel, int proValue)
|
| | | string GetValueDescription(PlayerPropertyConfig _playerProModel, int proValue)
|
| | | {
|
| | |
|
| | | string strPro = "";
|
| | | string description = "";
|
| | | var valueDescription = PlayerPropertyConfig.GetPropertyDescription(_playerProModel.ID, proValue);
|
| | | if (!_playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name + "+" + proValue;
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name + "+" + (float)Math.Round(proValue / 100f, 1) + "%";
|
| | | }
|
| | | description = _playerProModel.Name + "<color=#109D06FF>" + " +" + valueDescription + "</color>";
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", proValue.ToString());
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", (float)Math.Round(proValue / 100f, 1) + "%");
|
| | | }
|
| | | description = _playerProModel.Name.Replace("%s", valueDescription);
|
| | | }
|
| | |
|
| | | return strPro;
|
| | | return description;
|
| | | }
|
| | |
|
| | | } |
| | |
| | | using Snxxz.UI;
|
| | | using System.Collections;
|
| | |
|
| | | public class RoleEquipStrengthTips : MonoBehaviour
|
| | | public class RoleEquipStrengthTips : MonoBehaviour
|
| | | {
|
| | | #region 成员变量
|
| | | [SerializeField]
|
| | |
| | | _nextStrengthText = transform.Find("NextStrength/TargetNextText").GetComponent<Text>();
|
| | | _nextAttrValueText = transform.Find("NextStrength/ActNextText").GetComponent<Text>();
|
| | | _noOpenText = transform.Find("CurrentStrength/NoOpenText").GetComponent<Text>();
|
| | | |
| | |
|
| | | }
|
| | | StrengthenModel m_StrengthengModel;
|
| | | StrengthenModel strengthengmodel
|
| | | {
|
| | | get
|
| | | {
|
| | | StrengthenModel strengthengmodel {
|
| | | get {
|
| | | return m_StrengthengModel ?? (m_StrengthengModel = ModelCenter.Instance.GetModel<StrengthenModel>());
|
| | | }
|
| | | }
|
| | |
| | | if (_roleStrengthInfoDict.Count < 2)
|
| | | return;
|
| | | List<int> strengthLvs = _roleStrengthInfoDict.Keys.ToList();
|
| | | _curStrengthText.text = Language.Get("KnapS121").Replace("{0}",strengthLvs[0].ToString());
|
| | | _curStrengthText.text = Language.Get("KnapS121").Replace("{0}", strengthLvs[0].ToString());
|
| | | StringBuilder curAttrStr = new StringBuilder();
|
| | | RectTransform size = _haveStrengthText.GetComponent<RectTransform>();
|
| | | foreach (int pro in _roleStrengthInfoDict[strengthLvs[0]].Keys)
|
| | | {
|
| | | curAttrStr.Append(SetIsPercentShow(pro, _roleStrengthInfoDict[strengthLvs[0]][pro]) + "\n");
|
| | | curAttrStr.Append(GetValueDescription(pro, _roleStrengthInfoDict[strengthLvs[0]][pro]) + "\n");
|
| | | }
|
| | | |
| | | if(curAttrStr.Length < 1)
|
| | |
|
| | | if (curAttrStr.Length < 1)
|
| | | {
|
| | | _noOpenText.gameObject.SetActive(true);
|
| | | _curStrengthText.gameObject.SetActive(false);
|
| | |
| | | StringBuilder nextAttrStr = new StringBuilder();
|
| | | foreach (int pro in _roleStrengthInfoDict[strengthLvs[1]].Keys)
|
| | | {
|
| | | nextAttrStr.Append(SetIsPercentShow(pro, _roleStrengthInfoDict[strengthLvs[1]][pro]) + "\n");
|
| | | nextAttrStr.Append(GetValueDescription(pro, _roleStrengthInfoDict[strengthLvs[1]][pro]) + "\n");
|
| | | }
|
| | | _nextStrengthText.text = Language.Get("KnapS121").Replace("{0}", _roleStrengthInfoDict.Keys.ToList()[1].ToString());
|
| | | _nextAttrValueText.text = nextAttrStr.ToString();
|
| | |
|
| | | _curStrengthLv = 0;
|
| | | foreach(var value in _haveStrengthInfoDict.Values)
|
| | | foreach (var value in _haveStrengthInfoDict.Values)
|
| | | {
|
| | | _curStrengthLv += value.EquipPartStarLV;
|
| | | }
|
| | | _haveStrengthText.text = Language.Get("KnapS122").Replace("{0}",_curStrengthLv.ToString());
|
| | | _haveStrengthText.text = Language.Get("KnapS122").Replace("{0}", _curStrengthLv.ToString());
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | //判断属性是否百分比显示
|
| | | public string SetIsPercentShow(int proId, int proValue)
|
| | | string GetValueDescription(int proId, int proValue)
|
| | | {
|
| | | _playerProModel = PlayerPropertyConfig.Get(proId);
|
| | | string strPro = "";
|
| | |
| | | return "";
|
| | | }
|
| | |
|
| | | var valueDescription = PlayerPropertyConfig.GetPropertyDescription(_playerProModel.ID, proValue);
|
| | | if (!_playerProModel.Name.Contains("%s"))
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name + "+" + proValue;
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name + "+" + (float)Math.Round(proValue / 100f, 1) + "%";
|
| | | }
|
| | | strPro = _playerProModel.Name + "<color=#109D06FF>" + " +" + valueDescription + "</color>";
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_playerProModel.ISPercentage == 0)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", proValue.ToString());
|
| | | }
|
| | | else if (_playerProModel.ISPercentage == 1)
|
| | | {
|
| | | strPro = _playerProModel.Name.Replace("%s", (float)Math.Round(proValue / 100f, 1) + "%");
|
| | | }
|
| | | strPro = _playerProModel.Name.Replace("%s", valueDescription);
|
| | | }
|
| | |
|
| | | return strPro;
|
| | |
| | | [SerializeField] private Image m_SortImage;
|
| | | [SerializeField] private Text m_TimeCountDown;
|
| | | [SerializeField] private Text m_Copper;
|
| | | [SerializeField] private Text m_BindDiamond;
|
| | | [SerializeField] private Text m_Diamond;
|
| | |
|
| | | #endregion
|
| | |
| | | void UpdateMoney()
|
| | | {
|
| | | m_Copper.text = PlayerDatas.Instance.baseData.diamond.ToString();
|
| | | m_BindDiamond.text = PlayerDatas.Instance.baseData.bindDiamond.ToString();
|
| | | m_Diamond.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(PlayerDatas.Instance.baseData.allCopper);
|
| | | }
|
| | |
|
| | |
| | | void AccomplishTask()
|
| | | {
|
| | |
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= _requireNumber || (int)UIHelper.GetMoneyCnt(2) >= _requireNumber)
|
| | | if ((int)UIHelper.GetMoneyCnt(1) >= _requireNumber )
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskID);
|
| | | taskmodel.BountyMotionBool = true;
|
| | |
| | | #endregion
|
| | | private void OnclickOKButton()
|
| | | {
|
| | | int NeedMoney = (int)UIHelper.GetMoneyCnt(1) + (int)UIHelper.GetMoneyCnt(2);
|
| | | int NeedMoney = (int)UIHelper.GetMoneyCnt(1) ;
|
| | | if (NeedMoney >= 1)
|
| | | {
|
| | | switch (useEnvironment)
|
| | |
| | | {
|
| | | if (mainModel.IsFlyShoseBool)
|
| | | {
|
| | | int NeedMoney = (int)UIHelper.GetMoneyCnt(1) + (int)UIHelper.GetMoneyCnt(2);
|
| | | int NeedMoney = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (NeedMoney >= 1)
|
| | | {
|
| | | HeroAIRecorder.ClearRecord();
|
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class InformationTipsWin : Window |
| | | { |
| | |
| | | public Toggle _Toggle_Tips;//toggle 按钮 |
| | | public Text _Text_Extend;//信息条 |
| | | |
| | | private int _Gold = 0;//获取流动仙玉 |
| | | private int _GoldPaper = 0;//获取绑定仙玉 |
| | | TaskModel m_TaskModel; |
| | | TaskModel taskmodel |
| | | { |
| | | get |
| | | { |
| | | return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); |
| | | } |
| | | } |
| | | TaskModel taskmodel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | _CloseBtn.onClick.AddListener(CloseButton); |
| | | _Btn_Cancel.onClick.AddListener(CancelButton); |
| | | _Btn_Sure.onClick.AddListener(SureButton); |
| | | _Toggle_Tips.onValueChanged.AddListener( |
| | | |
| | | delegate(bool _bool){ Toggle(); }); |
| | | _Toggle_Tips.onValueChanged.AddListener((bool _bool) => { Toggle(); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | _Gold = (int)PlayerDatas.Instance.baseData.diamond; |
| | | _GoldPaper = (int)PlayerDatas.Instance.baseData.bindDiamond; |
| | | DoubleToReceive(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | void DoubleToReceive()//是否能够领取双倍奖励 |
| | | void DoubleToReceive()//是否能够领取双倍奖励 |
| | | { |
| | | |
| | | |
| | | string _requireNumberStr = FuncConfigConfig.Get("TaskExpend").Numerical1; |
| | | int _requireNumber = int.Parse(_requireNumberStr); |
| | | _Text_Extend.text = string.Format(Language.Get("Z1070"), _requireNumberStr); |
| | | |
| | | |
| | | return; |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | |
| | | {
|
| | | if (fairyGrabBossModel.flyToGrabBossRemind)
|
| | | {
|
| | | var money = (int)UIHelper.GetMoneyCnt(1) + (int)UIHelper.GetMoneyCnt(2);
|
| | | var money = (int)UIHelper.GetMoneyCnt(1) ;
|
| | | if (money >= 1)
|
| | | {
|
| | | FlyShoesUseCallback();
|
| | |
| | | private int _TaskId = 0;//获取任务ID
|
| | | private int _NpcID = 0;//获取NPCID
|
| | | private int _Gold = 0;//获取流动仙玉
|
| | | private int _GoldPaper = 0;//获取绑定仙玉
|
| | | private string StrConversa = null;//对话内容接收
|
| | | Dictionary<int, MissionDetailDates> _AllMissionDict;//任务初始化接收字典
|
| | | private List<RewardAnalysis.RewardInfo> rewardList = new List<RewardAnalysis.RewardInfo>();
|
| | |
| | |
|
| | | _TextTaskDescription.text = "";
|
| | | _Gold = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | _GoldPaper = (int)PlayerDatas.Instance.baseData.bindDiamond;
|
| | | _BtnRewards.gameObject.SetActive(false);
|
| | | _AllMissionDict = taskmodel.allMissionDict;
|
| | | _TaskId = taskmodel._TaskNow;
|
| | |
| | | {
|
| | | int NeedFairyJade = DomesticateNumber* 10;
|
| | |
|
| | | int gold = (int)UIHelper.GetMoneyCnt(1)+ (int)UIHelper.GetMoneyCnt(2);
|
| | | int gold = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (NeedFairyJade > 0 && gold >= NeedFairyJade)
|
| | | {
|
| | | IsFairy = true;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | DungeonModel _dungeonModel;
|
| | | DungeonModel dungeonModel {
|
| | | get { return _dungeonModel ?? (_dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); }
|
| | | }
|
| | |
|
| | | StoreModel _storeModel;
|
| | | StoreModel m_storeModel {
|
| | | get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | |
|
| | | PackModel _playerPack;
|
| | | PackModel playerPack {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | ActivityModel activityModel { get { return ModelCenter.Instance.GetModel<ActivityModel>(); } }
|
| | |
|
| | | private DungeonOpenTimeConfig _dungeonOpenTimeModel;
|
| | |
| | |
|
| | | public bool IsCanInplaceReborn(int rebornPrice)
|
| | | {
|
| | | playerCoins = (int)PlayerDatas.Instance.baseData.diamond + (int)PlayerDatas.Instance.baseData.bindDiamond;
|
| | | playerCoins = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | if (playerCoins >= rebornPrice)
|
| | | return true;
|
| | | else
|
| | |
| | |
|
| | | private bool TestBuyTime(out int _error)
|
| | | {
|
| | | //1.绑玉和仙玉之和不足;2.仙玉不足;3.次数不足
|
| | | //1.仙玉不足;
|
| | | var moneyNeed = GeneralDefine.runeTowerSweepBuyPrice;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond + PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.diamond ;
|
| | | if (moneyOwn < moneyNeed)
|
| | | {
|
| | | _error = 1;
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.bindDiamond < moneyNeed)
|
| | | {
|
| | | _error = 2;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | case 1:
|
| | | CloseClick();
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | break;
|
| | | case 2:
|
| | | var moneyNeed = GeneralDefine.runeTowerSweepBuyPrice;
|
| | | var moneyOwn = PlayerDatas.Instance.baseData.bindDiamond;
|
| | | var moneyLack = moneyNeed - moneyOwn;
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | Language.Get("RuneTower21", moneyNeed, moneyOwn, moneyLack),
|
| | | (bool _ok) =>
|
| | | {
|
| | | if (_ok)
|
| | | {
|
| | | CloseClick();
|
| | | dungeonModel.RequestSweep(new Dungeon(RuneTowerModel.RUNETOWER_MAPID, 0));
|
| | | }
|
| | | }
|
| | | );
|
| | | break;
|
| | | case 3:
|
| | | break;
|
| | |
| | |
|
| | | using Snxxz.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class BagStoreWin : StoreUIBasic
|
| | | {
|
| | |
| | | private Text _sliverText;
|
| | | #endregion
|
| | |
|
| | | StoreModel _storeModel;
|
| | | StoreModel m_storeModel
|
| | | {
|
| | | get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | | StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
|
| | | int shopId = 0;
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | if (AchievementGoto.guideAchievementId != 0)
|
| | | {
|
| | | SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
|
| | | var successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
|
| | | if (successConfig.Type == 96)
|
| | | {
|
| | | p_shopItemlist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
|
| | |
| | |
|
| | | public void InitModel()
|
| | | {
|
| | | CreateShopItemCell(_shopCtrl,2);
|
| | | CreateShopItemCell(_shopCtrl, 2);
|
| | | }
|
| | |
|
| | | protected override void CreateShopItemCell(ScrollerController shopCtrl, int row)
|
| | |
| | | shopItemCell.stateImage.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | ItemConfig chinModel = ItemConfig.Get(m_storeModel.GetReplaceId(shopInfo.ID,shopInfo.ItemID));
|
| | | ItemConfig chinModel = ItemConfig.Get(m_storeModel.GetReplaceId(shopInfo.ID, shopInfo.ItemID));
|
| | | if (chinModel != null)
|
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(chinModel.ID, true, 0);
|
| | |
| | | shopItemCell.vipText.gameObject.SetActive(true);
|
| | | shopItemCell.vipText.text = Language.Get("StoreWin101", shopInfo.VIPLV[nextVipIndex]);
|
| | | shopItemCell.sellImage.gameObject.SetActive(false);
|
| | | shopItemCell.itemNameText.color = UIHelper.GetUIColor(TextColType.Red,true);
|
| | | shopItemCell.vipText.color = UIHelper.GetUIColor(TextColType.Red,true);
|
| | | shopItemCell.itemNameText.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | shopItemCell.vipText.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | isShowBuyPrice = false;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | shopItemCell.itemNameText.color = UIHelper.GetUIColor(chinModel.ItemColor, true);
|
| | | shopItemCell.vipText.color = UIHelper.GetUIColor(TextColType.Black,true);
|
| | | shopItemCell.vipText.color = UIHelper.GetUIColor(TextColType.Black, true);
|
| | | }
|
| | |
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID,shopId);
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID, shopId);
|
| | | }
|
| | |
|
| | | shopItemCell.ShopCellBtn.RemoveAllListeners();
|
| | | shopItemCell.ShopCellBtn.AddListener(() => {
|
| | | shopItemCell.ShopCellBtn.AddListener(() =>
|
| | | {
|
| | | if (shopInfo.ID == shopId)
|
| | | {
|
| | | shopId = 0;
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID,shopId);
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID, shopId);
|
| | | }
|
| | | m_storeModel.OnClickShopCell(shopInfo);
|
| | | });
|
| | | shopItemCell.buyBtn.RemoveAllListeners();
|
| | | shopItemCell.buyBtn.AddListener(()=> {
|
| | | if(shopInfo.ID == shopId)
|
| | | shopItemCell.buyBtn.AddListener(() =>
|
| | | {
|
| | | if (shopInfo.ID == shopId)
|
| | | {
|
| | | shopId = 0;
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID,shopId);
|
| | | shopItemCell.LoadGuidEffectCtrl(shopInfo.ID, shopId);
|
| | | }
|
| | | m_storeModel.SendBuyShopItem(shopInfo,1);
|
| | | m_storeModel.SendBuyShopItem(shopInfo, 1);
|
| | | });
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | public void OnFrenshMoneyInfo()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData != null)
|
| | | {
|
| | | _goldText.text = PlayerDatas.Instance.baseData.diamond.ToString();
|
| | | _goldPaperText.text = PlayerDatas.Instance.baseData.bindDiamond.ToString();
|
| | | _sliverText.text = ItemLogicUtility.Instance.OnChangeCoinsUnit(PlayerDatas.Instance.baseData.allCopper);
|
| | | }
|
| | | else
|
| | |
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] Text valueText;
|
| | | [SerializeField] RectTransform rect;
|
| | | |
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | SetEndMovePos(rect.anchoredPosition3D.y);
|
| | |
| | | alphaTween.Play();
|
| | | }
|
| | |
|
| | | public void SetModel(int attrId,int attrValue)
|
| | | public void SetModel(int attrId, int attrValue)
|
| | | {
|
| | | PlayerPropertyConfig propertyConfig = PlayerPropertyConfig.Get(attrId);
|
| | | var propertyConfig = PlayerPropertyConfig.Get(attrId);
|
| | | nameText.text = StringUtility.Contact(propertyConfig.Name, ":");
|
| | | valueText.text = StringUtility.Contact("+", GetProValueTypeStr(propertyConfig,attrValue));
|
| | | valueText.text = StringUtility.Contact("+", PlayerPropertyConfig.GetPropertyDescription(attrId, attrValue));
|
| | | }
|
| | |
|
| | | private void SetEndMovePos(float posY)
|
| | | {
|
| | | moveTween.from = new Vector3(moveTween.from.x,posY,0);
|
| | | moveTween.from = new Vector3(moveTween.from.x, posY, 0);
|
| | | moveTween.to = new Vector3(moveTween.to.x, posY, 0);
|
| | | }
|
| | |
|
| | | public string GetProValueTypeStr(PlayerPropertyConfig playerproModel, int value)
|
| | | {
|
| | | string s = "";
|
| | | if (playerproModel.ISPercentage == 0)
|
| | | {
|
| | | s = value.ToString();
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 1)
|
| | | {
|
| | | s = (float)Math.Round(value / 100f, 1) + "%";
|
| | | }
|
| | | else if (playerproModel.ISPercentage == 2)
|
| | | {
|
| | | s = ((float)Math.Round(value / 100f, 1)).ToString();
|
| | | }
|
| | | return s;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (own < lackItem.count)
|
| | | {
|
| | | var moneyNeed = GetUnitPrice(lackType) * (lackItem.count - own);
|
| | | if (PlayerDatas.Instance.baseData.diamond < moneyNeed
|
| | | && PlayerDatas.Instance.baseData.bindDiamond < moneyNeed)
|
| | | if (PlayerDatas.Instance.baseData.diamond < moneyNeed)
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var moneyType = PlayerDatas.Instance.baseData.bindDiamond < moneyNeed ? 1 : 2;
|
| | | ConfirmTodo(lackType, moneyType);
|
| | | ConfirmTodo(lackType, 1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | private void GetMoney()
|
| | | {
|
| | | m_FairyJadeText.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_TieTheJadeText.text = UIHelper.GetMoneyCnt(2).ToString();
|
| | | }
|
| | |
|
| | |
|
| | | private void SelectButton()
|
| | | {
|
| | |
| | | {
|
| | | [SerializeField] RechargeBehaviour[] m_Recharges;
|
| | | [SerializeField] Text m_GoldValue;
|
| | | [SerializeField] Text m_GoldPaperValue;
|
| | | [SerializeField] Button m_SpecialRechargeBtn;
|
| | |
|
| | | VipModel m_Model;
|
| | |
| | | void UpdateGoldValue()
|
| | | {
|
| | | m_GoldValue.text = UIHelper.ReplaceLargeNum(PlayerDatas.Instance.baseData.diamond);
|
| | | m_GoldPaperValue.text = UIHelper.ReplaceLargeNum(PlayerDatas.Instance.baseData.bindDiamond);
|
| | | }
|
| | |
|
| | | private void RechargeCountEvent(int _id)
|
| | |
| | | }
|
| | | private void OnEnable()
|
| | | {
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | }
|
| | | private void OnDisable()
|
| | | {
|
| | |
| | | sequence.Kill();
|
| | | transform.localRotation = Quaternion.Euler(0, 0, -Angle);
|
| | | m_CheckDisplay.ShowSelected(wheelOfFortuneModel.Lattice);
|
| | | int money = ((int)UIHelper.GetMoneyCnt(2) - FairyJade);
|
| | | int money = ((int)UIHelper.GetMoneyCnt(1) - FairyJade);
|
| | | string str=UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName);
|
| | | if (money>=BindJadeWheelNotice)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("BindJadeNotice", str, money);
|
| | | }
|
| | |
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (IsButtonShow != null)
|
| | | {
|
| | | IsButtonShow(true);
|
| | |
| | | IsButtonShow(true);
|
| | | }
|
| | | m_CheckDisplay.ShowSelected(wheelOfFortuneModel.Lattice);
|
| | | int money = ((int)UIHelper.GetMoneyCnt(2) - FairyJade);
|
| | | int money = ((int)UIHelper.GetMoneyCnt(1) - FairyJade);
|
| | | string str = UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName);
|
| | | if (money >= BindJadeWheelNotice)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("BindJadeNotice", str, money);
|
| | | }
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | });
|
| | | IsRotateBool = false;
|
| | | }
|
| | |
| | | [SerializeField] Text m_RemainingDays;//剩余天数
|
| | | [SerializeField] Button m_GoToVipBoss;
|
| | | [SerializeField] Text m_FairyJadeText;//仙玉
|
| | | [SerializeField] Text m_TieTheJadeText;//绑玉
|
| | | VipInvestModel _investModel;
|
| | | VipInvestModel investModel { get { return _investModel ?? (_investModel = ModelCenter.Instance.GetModel<VipInvestModel>()); } }
|
| | | ItemTipsModel _tipsModel;
|
| | |
| | | private void GetFairyJade()
|
| | | {
|
| | | m_FairyJadeText.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_TieTheJadeText.text = UIHelper.GetMoneyCnt(2).ToString();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } |
| | | WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } }
|
| | | private int remainingTimes = 0;//剩余次数 |
| | | private int FairyJade = 0;//获取当前绑玉
|
| | | private int FairyJade = 0;
|
| | | bool IsSend = true;
|
| | | public float Second = 1f;
|
| | | private float timeType = 0f; |
| | |
| | | protected override void OnPreOpen() |
| | | {
|
| | | IsSend = true;
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | Money1_Text.text = FairyJade.ToString();
|
| | | Money2_Text.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_NeedMoney_Text.text = wheelOfFortuneModel.NeedJade.ToString();
|
| | | m_RotatePointer.Init();
|
| | | m_LotteryBtn.interactable = true;
|
| | |
| | | if (IsSend)
|
| | | {
|
| | | m_CheckDisplay.CloseAll();
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | Money1_Text.text = FairyJade.ToString();
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖
|
| | | IsSend = false;
|
| | |
| | | {
|
| | | var temp = Math.Floor(value);
|
| | | Money1_Text.text = temp + "";
|
| | | }, FairyJade, (int)UIHelper.GetMoneyCnt(2), RollingTime));
|
| | | }, FairyJade, (int)UIHelper.GetMoneyCnt(1), RollingTime));
|
| | | mScoreSequence.AppendCallback(() =>
|
| | | {
|
| | | Money1_Text.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | m_RotationTween.enabled = false;
|
| | |
|
| | | });
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | } |
| | | |
| | | private void LackOfVIP()//VIP 不足
|
| | |
| | | {
|
| | | return PlayerDatas.Instance.baseData.diamond;
|
| | | }
|
| | | case 2:
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.bindDiamond;
|
| | | }
|
| | | case 3:
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.allCopper;
|