Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | 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;
|
| | |
| | | GActor _npc = GAMgr.Instance.GetCloserNPC(_hero.Pos, npcID);
|
| | | if (_npc != null)
|
| | | {
|
| | | //Debug.LogFormat(" |-- 在视野内");
|
| | | _destPostion = _npc.Pos;
|
| | |
|
| | | NpcID = npcID;
|
| | | MapTransferDoType = E_MapTransferDoType.Npc;
|
| | |
|
| | | _hero.MoveToPosition(_destPostion);
|
| | | yield break;
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | { |
| | | var _refreshEvent = new EventRefreshNPCHandler(); |
| | | _refreshEvent.Init(_event as Evt_RefreshMonster); |
| | | m_EventHandlerDict.Add(_refreshEvent.GetEventID(), _refreshEvent); |
| | | if (!m_EventHandlerDict.ContainsKey(_refreshEvent.GetEventID())) |
| | | { |
| | | m_EventHandlerDict.Add(_refreshEvent.GetEventID(), _refreshEvent); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | float _y = 0; |
| | | if (m_StartPos.y > _p.position.y) |
| | | { |
| | | _y = Constants.hurtAniCurve.animationCurve.Evaluate(m_InCreaseTime) * (m_StartPos.y - _p.position.y) + (1 - m_InCreaseTime) * (m_StartPos.y - _p.position.y); |
| | | var _offset = m_StartPos.y - _p.position.y; |
| | | _y = Constants.hurtAniCurve.animationCurve.Evaluate(m_InCreaseTime) * _offset + (1 - m_InCreaseTime) * _offset; |
| | | } |
| | | else |
| | | { |
| | |
| | | [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); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count
|
| | | , "", PackType.Deleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(serverItem.ItemID, false, (ulong)serverItem.Count,
|
| | | "", PackType.Deleted, false, ConfigParse.Analysis(serverItem.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | ShowItemDetails(serverItem);
|
| | | });
|
| | |
| | | {
|
| | | if (!string.IsNullOrEmpty(guid))
|
| | | {
|
| | | var sourcelist = betterModel.GetUseDataModel((int)ItemUseDataKey.source);
|
| | | var sourcelist = betterModel.GetUseData((int)ItemUseDataKey.source);
|
| | | if (sourcelist != null && sourcelist[0] == 4)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_DelayRefreshBetterEquip(guid));
|
| | |
| | | if (!string.IsNullOrEmpty(tempGuid))
|
| | | {
|
| | | var itemModel = playerPack.GetItemByGuid(tempGuid);
|
| | | var sourcelist = itemModel.GetUseDataModel((int)ItemUseDataKey.source);
|
| | | var sourcelist = itemModel.GetUseData((int)ItemUseDataKey.source);
|
| | | if (sourcelist != null && sourcelist[0] == 4)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_DelayRefreshBetterEquip(tempGuid));
|
| | |
| | | }
|
| | | #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)
|
| | | {
|
| | |
| | | fireChooseCell.itemCell.countText.gameObject.SetActive(true);
|
| | | fireChooseCell.nameText.text = chinItemModel.ItemName;
|
| | | fireChooseCell.addSuccessRateText.text = effectStr;
|
| | | fireChooseCell.itemCell.cellBtn.RemoveAllListeners();
|
| | | fireChooseCell.itemCell.cellBtn.AddListener(() =>
|
| | | fireChooseCell.itemCell.button.RemoveAllListeners();
|
| | | fireChooseCell.itemCell.button.AddListener(() =>
|
| | | {
|
| | | itemPathModel.SetChinItemModel(matId);
|
| | | });
|
| | |
| | | itemCell.countText.text = UIHelper.AppendColor(TextColType.Red, haveMaterCount.ToString()) + "/" + materialNum;
|
| | | }
|
| | |
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() => |
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(() => |
| | | {
|
| | | itemPathModel.SetChinItemModel(materialId);
|
| | | });
|
| | |
| | | }
|
| | |
|
| | | _addSpecMatItemCell.reducebtn.gameObject.SetActive(true);
|
| | | _addSpecMatItemCell.reducebtn.RemoveAllListeners();
|
| | |
|
| | | _addSpecMatItemCell.reducebtn.AddListener(() => { OnClickReduceBtn(); });
|
| | | _addSpecMatItemCell.reducebtn.SetListener(() => { OnClickReduceBtn(); });
|
| | |
|
| | | _addSpecMatBtn.onClick.AddListener(() => { ChooseWin.gameObject.SetActive(true); });
|
| | | CreateRandomLineCell();
|
| | |
| | | fullImg.SetActive(false);
|
| | | }
|
| | |
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemId);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | itemBaisc.gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(itemId,false,0);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemId,false,0);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(prayModel.itemId,false,1);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(prayModel.itemId,false,1);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(itemModel.itemId,false,(ulong)itemCount);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(() =>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | if (selectImg.activeInHierarchy)
|
| | | {
|
| | |
| | | ItemConfig itemCfg = ItemConfig.Get((int)_item.itemId);
|
| | | _itemCell.items[i].Init(_item);
|
| | | _itemCell.itemEquips[i].gameObject.SetActive(_item.packType == PackType.Equip);
|
| | | _itemCell.items[i].cellBtn.onClick.RemoveAllListeners();
|
| | | _itemCell.items[i].cellBtn.onClick.AddListener(() =>
|
| | | _itemCell.items[i].button.onClick.RemoveAllListeners();
|
| | | _itemCell.items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnItemClick(_item);
|
| | | });
|
| | |
| | | bool isShow = model.config.ExpireTime > 0;
|
| | | if (isShow)
|
| | | {
|
| | | List<int> itemEffectTime = model.GetUseDataModel((int)ItemUseDataKey.createTime);
|
| | | List<int> itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
|
| | | seconds = model.config.ExpireTime;
|
| | | if (itemEffectTime != null && itemEffectTime[0] != 0 && model.guid != "")
|
| | | {
|
| | |
| | | {
|
| | | bool isShowMat = itemId != 0 || itemModel != null ? true : false;
|
| | | itemCell.gameObject.SetActive(isShowMat);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.reducebtn.RemoveAllListeners();
|
| | | if (isShowMat)
|
| | | {
|
| | | if (itemModel != null)
|
| | | {
|
| | | itemCell.Init(itemModel);
|
| | | itemCell.cellBtn.AddListener(ClickItemCell);
|
| | | itemCell.button.SetListener(ClickItemCell);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | ItemCellModel cellModel = new ItemCellModel(itemId);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.AddListener(ClickItemCell);
|
| | | itemCell.button.SetListener(ClickItemCell);
|
| | | }
|
| | |
|
| | | switch(matType)
|
| | |
| | | case NeedMatType.unfixedItem:
|
| | | case NeedMatType.addItem:
|
| | | itemCell.reducebtn.gameObject.SetActive(true);
|
| | | itemCell.reducebtn.AddListener(ClickReduce);
|
| | | itemCell.reducebtn.SetListener(ClickReduce);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | remainTimeText.gameObject.SetActive(isShow);
|
| | | if (isShow)
|
| | | {
|
| | | List<int> itemEffectTime = itemModel.GetUseDataModel((int)ItemUseDataKey.createTime);
|
| | | List<int> itemEffectTime = itemModel.GetUseData((int)ItemUseDataKey.createTime);
|
| | | double remianTime = itemModel.config.ExpireTime;
|
| | | if (itemEffectTime != null && itemEffectTime[0] != 0 && itemModel.guid != "")
|
| | | {
|
| | |
| | | bool isRefineMat = false;
|
| | | foreach (var model in unfixedDic.Values)
|
| | | {
|
| | | if (model.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | if (model.GetUseData((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | {
|
| | | isRefineMat = true;
|
| | | break;
|
| | |
| | | {
|
| | | var matCell = fixedAndUnfixeds[fixedDisplay - 1];
|
| | | int fixedId = fixedIds[i];
|
| | | var bindIcon = matCell.itemCell.bindIcon;
|
| | | var bindIcon = matCell.itemCell.auctionIcon;
|
| | | bindIcon.gameObject.SetActive(false);
|
| | | //if (isBind)
|
| | | //{
|
| | |
| | | bool isShow = model.config.ExpireTime > 0;
|
| | | if (isShow)
|
| | | {
|
| | | List<int> itemEffectTime = model.GetUseDataModel((int)ItemUseDataKey.createTime);
|
| | | List<int> itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
|
| | | seconds = model.config.ExpireTime;
|
| | | if (itemEffectTime != null && itemEffectTime[0] != 0 && model.guid != "")
|
| | | {
|
| | |
| | | }
|
| | | 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
|
| | | {
|
| | |
| | | var awardItem = awardItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(awardItem.itemId, true, (ulong)awardItem.itemCount);
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | itemBasic.button.RemoveAllListeners();
|
| | | itemBasic.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(awardItem.itemId, true, (ulong)awardItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(List[i].id, true, (ulong)List[i].count);
|
| | | _ItemCell.Init(cellModel);
|
| | | int type = i;
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | _ItemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(List[type].id, false, (ulong)List[type].count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(List[i].ItemId, true, (ulong)List[i].ItemNumber);
|
| | | _ItemCell.Init(cellModel);
|
| | | int type = i;
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | _ItemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(List[type].ItemId, false, (ulong)List[type].ItemNumber);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | ItemCell _ItemCell = ObjChild.GetComponent<ItemCell>();
|
| | | ItemCellModel cellModel = new ItemCellModel(itemClass.ItemId, true, (ulong)itemClass.ItemNumber);
|
| | | _ItemCell.Init(cellModel);
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | _ItemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemClass.ItemId, false, (ulong)itemClass.ItemNumber);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | } |
| | | #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;
|
| | | }
|
| | |
| | | public void Display(ItemModel model)
|
| | | {
|
| | | itemBaisc.Init(model);
|
| | | itemBaisc.bindIcon.gameObject.SetActive(false);
|
| | | itemBaisc.auctionIcon.gameObject.SetActive(false);
|
| | | int strenLv = 0;
|
| | | if(model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | if(model.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | strenLv = model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | strenLv = model.GetUseData((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | | if (strenLv > 0)
|
| | | {
|
| | |
| | | {
|
| | | strengLvTxt.gameObject.SetActive(false);
|
| | | }
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | tipsModel.SetItemTipsModel(model.packType,model.guid,false,false);
|
| | | tipsModel.SetDogzEquipBtn(tipsModel.curAttrData);
|
| | |
| | | }
|
| | | DebugEx.Log("model:"+ model.itemId);
|
| | | int strenLv = 0;
|
| | | if (model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | if (model.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | strenLv = model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | strenLv = model.GetUseData((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | | if (strenLv > 0)
|
| | | {
|
| | |
| | | itemBaisc.stateIcon.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | itemBaisc.bindIcon.gameObject.SetActive(false);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.auctionIcon.gameObject.SetActive(false);
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | tipsModel.SetItemTipsModel(model.packType, model.guid, false, true);
|
| | | tipsModel.SetDogzItemBtn(tipsModel.curAttrData);
|
| | |
| | | y = end.equipScore;
|
| | | if (x.CompareTo(y) != 0) return -x.CompareTo(y);
|
| | |
|
| | | List<int> strenglist = start.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | List<int> strenglist = start.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | x = strenglist != null ? strenglist[0] : 0;
|
| | | strenglist = end.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | strenglist = end.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | y = strenglist != null ? strenglist[0] : 0;
|
| | | if (x.CompareTo(y) != 0) return -x.CompareTo(y);
|
| | |
|
| | |
| | | else
|
| | | {
|
| | | int putStrenLv = 0;
|
| | | if (itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | if (itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | putStrenLv = itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | putStrenLv = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | |
|
| | | int selectStrenLv = 0;
|
| | | if (selectModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | if (selectModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | selectStrenLv = selectModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | selectStrenLv = selectModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | |
|
| | | if (itemModel.config.ItemColor < selectModel.config.ItemColor
|
| | |
| | | nameTex.text = model.config.ItemName;
|
| | | nameTex.color = UIHelper.GetUIColor(model.config.ItemColor,true);
|
| | | itemBaisc.Init(model);
|
| | | itemBaisc.bindIcon.gameObject.SetActive(false);
|
| | | itemBaisc.auctionIcon.gameObject.SetActive(false);
|
| | | int strenLv = 0;
|
| | | if (model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | if (model.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | strenLv = model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | strenLv = model.GetUseData((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | | if (strenLv > 0)
|
| | | {
|
| | |
| | | _achievement.m_ItemCell.gameObject.SetActive(true);
|
| | | ItemCellModel _itemCellModel = new ItemCellModel(presentAchieve.rewardItem[0].id, false, (ulong)presentAchieve.rewardItem[0].count);
|
| | | _achievement.m_ItemCell.Init(_itemCellModel);
|
| | | _achievement.m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | _achievement.m_ItemCell.cellBtn.onClick.AddListener(() =>
|
| | | _achievement.m_ItemCell.button.RemoveAllListeners();
|
| | | _achievement.m_ItemCell.button.onClick.AddListener(() =>
|
| | | {
|
| | | if (presentAchieve.rewardItem != null && presentAchieve.rewardItem.Length > 0)
|
| | | {
|
| | |
| | | {
|
| | | _achievement.m_ContainerUnComplete.gameObject.SetActive(false);
|
| | | _achievement.m_ContainerComplete.gameObject.SetActive(true);
|
| | | _achievement.m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | _achievement.m_ItemCell.button.RemoveAllListeners();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | 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)=>
|
| | | {
|
| | |
| | | var awards = GeneralDefine.ancientKingAwards;
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | m_Items[i].button.RemoveAllListeners();
|
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(award.id, true, (ulong)award.count);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | m_Items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(award.id, true, (ulong)award.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | {
|
| | | 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) =>
|
| | | {
|
| | |
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | cellBtn.AddListener(ShowItemTip);
|
| | | button.AddListener(ShowItemTip);
|
| | | RequestSfx();
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | cellBtn.RemoveAllListeners();
|
| | | button.RemoveAllListeners();
|
| | | RecycleSfx();
|
| | | }
|
| | |
|
| | |
| | | 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();
|
| | | }
|
| | |
| | | ItemCell _ItemCell = ObjChild.GetComponent<ItemCell>();
|
| | | ItemCellModel cellModel = new ItemCellModel(key, true, (ulong)IceCrystalVeinMiddleDic[key]);
|
| | | _ItemCell.Init(cellModel);
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | _ItemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(key, false, (ulong)IceCrystalVeinMiddleDic[key]);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(IceLode.ItemID, true, (ulong)IceLode.ItemCount);
|
| | | _ItemCell.Init(cellModel);
|
| | | int type = i;
|
| | | _ItemCell.cellBtn.SetListener(() =>
|
| | | _ItemCell.button.SetListener(() =>
|
| | | {
|
| | | if (StarAll >= IceLode.Star && !_bool)
|
| | | {
|
| | |
| | | trialExchangeId = 0;
|
| | | return;
|
| | | }
|
| | | m_Item.cellBtn.RemoveAllListeners();
|
| | | m_Item.button.RemoveAllListeners();
|
| | | m_Item.gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(model.GetExchangeItemByJob(config), true, (ulong)config.exchangeItemCount);
|
| | | m_Item.Init(cellModel);
|
| | | m_Item.cellBtn.AddListener(() =>
|
| | | m_Item.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(model.GetExchangeItemByJob(config), true, (ulong)config.exchangeItemCount, -1, true);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | {
|
| | | 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 item in items) |
| | | { |
| | | if (item.isBind == 0) |
| | | if (!item.isAuction) |
| | | { |
| | | candidateEquips.Add(new CandidateEquip(item.guid)); |
| | | } |
| | |
| | |
|
| | | 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;
|
| | |
| | | Button _button = go.transform.GetComponent<Button>();
|
| | | ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)rewardList[i].num);
|
| | | itemcell.Init(cellModel);
|
| | | itemcell.cellBtn.RemoveAllListeners();
|
| | | itemcell.button.RemoveAllListeners();
|
| | | int tab = i;
|
| | | itemcell.cellBtn.AddListener(() =>
|
| | | itemcell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(rewardList[tab].itemCfg.ID, false, (ulong)rewardList[tab].num);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(AwardItemList[i].id, true, Number);
|
| | | itemCell.Init(cellModel);
|
| | | int tab = i;
|
| | | itemCell.cellBtn.SetListener(()=> |
| | | itemCell.button.SetListener(()=> |
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(AwardItemList[tab].id, false, Number);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | beginBtn.onClick.AddListener(OnBeginBtn);
|
| | | m_GetWayBtn.onClick.AddListener(OnFoodGetWay);
|
| | | m_HandIn.onClick.AddListener(HandIn);
|
| | | m_FairyFood.cellBtn.AddListener(OnFoodGetWay);
|
| | | m_FairyFood.button.AddListener(OnFoodGetWay);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | 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
|
| | | {
|
| | |
| | | model.TryGetDropItems(model.selectBoss, out dropItems);
|
| | | for (int i = 0; i < m_DropItems.Length; i++)
|
| | | {
|
| | | m_DropItems[i].cellBtn.RemoveAllListeners();
|
| | | m_DropItems[i].button.RemoveAllListeners();
|
| | | if (dropItems != null && i < dropItems.Count)
|
| | | {
|
| | | m_DropItems[i].gameObject.SetActive(true);
|
| | | var item = dropItems[i];
|
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_DropItems[i].Init(itemCellModel);
|
| | | m_DropItems[i].cellBtn.AddListener(() =>
|
| | | m_DropItems[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.id, true, (ulong)item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | itemList[i].gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(_itemArray[0], false, (ulong)_itemArray[1]);
|
| | | itemList[i].Init(cellModel);
|
| | | itemList[i].cellBtn.onClick.RemoveAllListeners();
|
| | | itemList[i].cellBtn.onClick.AddListener(() =>
|
| | | itemList[i].button.onClick.RemoveAllListeners();
|
| | | itemList[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | model.ViewKingFairyChest(_itemArray[0], _itemArray[1], _itemArray[2]);
|
| | | //ItemAttrData itemAttrData = new ItemAttrData(_itemArray[0], false, (ulong)_itemArray[1], -1, _itemArray[2]);
|
| | |
| | | m_FinalityBtn.onClick.AddListener(OnFinalityBtn);
|
| | | m_GuideBtn.onClick.AddListener(OnGuideBtn);
|
| | | m_SalaryBtn.onClick.AddListener(OnSalaryBtn);
|
| | | m_PrivilegeItem.cellBtn.onClick.AddListener(OnPrivilegeItem);
|
| | | m_PrivilegeItem.button.onClick.AddListener(OnPrivilegeItem);
|
| | | for (int i = 0; i < m_SalaryItemList.Count; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_SalaryItemList[i].cellBtn.onClick.AddListener(()=> |
| | | m_SalaryItemList[i].button.onClick.AddListener(()=> |
| | | {
|
| | | OnSalaryItem(_index);
|
| | | });
|
| | |
| | | buyPriceText.text = storeConfig.MoneyNumber.ToString();
|
| | | ItemCellModel fireModel = new ItemCellModel(storeConfig.ItemID,true,(ulong)storeConfig.ItemCnt);
|
| | | fireItem.Init(fireModel);
|
| | | fireItem.cellBtn.AddListener(() =>
|
| | | fireItem.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(storeConfig.ItemID,true, (ulong)storeConfig.ItemCnt);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | FairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(() =>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | FairylandCeremonyModel.AwardItem itemData = list[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | baiscs[i].Init(cellModel);
|
| | | baiscs[i].cellBtn.RemoveAllListeners();
|
| | | baiscs[i].cellBtn.AddListener(() =>
|
| | | baiscs[i].button.RemoveAllListeners();
|
| | | baiscs[i].button.AddListener(() =>
|
| | | {
|
| | | switch(itemData.itemId)
|
| | | {
|
| | |
| | | FairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId,true, (ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(()=>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | FairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(() =>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | 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;
|
| | | }
|
| | |
| | | selectObj.SetActive(_isSelect);
|
| | | var decomposeModel = FashionDecomposeModel.Instance;
|
| | | itemBaisc.Init(itemModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | decomposeModel.UpdateDecomposeItem(itemModel.guid, !selectObj.activeInHierarchy);
|
| | | selectObj.SetActive(!selectObj.activeInHierarchy);
|
| | |
| | | }
|
| | | 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)
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel((int)itemModel.ItemID, false, (ulong)itemModel.Count,
|
| | | "", PackType.Deleted, false, ConfigParse.Analysis(itemModel.UserData));
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.onClick.RemoveAllListeners();
|
| | | itemCell.cellBtn.onClick.AddListener(() =>
|
| | | itemCell.button.onClick.RemoveAllListeners();
|
| | | itemCell.button.onClick.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData((int)itemModel.ItemID, false, (ulong)itemModel.Count, -1, true, PackType.Deleted, "", ConfigParse.Analysis(itemModel.UserData));
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | [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)
|
| | |
| | | XBGetItemCell itemBasic = item.transform.Find("CommonItemCell").GetComponent<XBGetItemCell>();
|
| | | ItemCellModel cellModel = new ItemCellModel(xbItem.itemId, false, (ulong)xbItem.count);
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | itemBasic.button.RemoveAllListeners();
|
| | | itemBasic.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(xbItem.itemId, false, (ulong)xbItem.count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | { |
| | | itemCell.gameObject.SetActive(true); |
| | | itemCell.Init(itemModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => { ClickItemCell(itemModel); }); |
| | | itemCell.button.RemoveAllListeners(); |
| | | itemCell.button.AddListener(() => { ClickItemCell(itemModel); }); |
| | | } |
| | | else |
| | | { |
| | |
| | | nameText.text = itemConfig.ItemName;
|
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor,false);
|
| | | }
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemId,true,(ulong)count);
|
| | | itemTips.SetItemTipsModel(attrData);
|
| | |
| | | item.gameObject.SetActive(true); |
| | | item.InitModel(heavenModel.campVicRewardDict[id], id); |
| | | GetList.Add(item); |
| | | item.cellBtn.RemoveAllListeners(); |
| | | item.cellBtn.AddListener(() => |
| | | item.button.RemoveAllListeners(); |
| | | item.button.AddListener(() => |
| | | { |
| | | ClickRewardCell(itemId); |
| | | }); |
| | |
| | | item.gameObject.SetActive(true); |
| | | item.InitModel(heavenModel.campFailRewardDict[id], id); |
| | | GetList.Add(item); |
| | | item.cellBtn.RemoveAllListeners(); |
| | | item.cellBtn.AddListener(() => |
| | | item.button.RemoveAllListeners(); |
| | | item.button.AddListener(() => |
| | | { |
| | | ClickRewardCell(itemId); |
| | | }); |
| | |
| | | var baseInfo = new BaseInfo() |
| | | { |
| | | itemId = item.itemId, |
| | | isAuction = item.isBind == 1, |
| | | isAuction = item.isAuction , |
| | | isEquiped = equipModel.GetEquip(item.config.LV, item.config.EquipPlace) == guid, |
| | | score = item.equipScore, |
| | | auctionSurplusTime = item.auctionSurplusTime, |
| | |
| | | var data = new LegendProperty(); |
| | | data.isPreview = false; |
| | | |
| | | var ids = item.GetUseDataModel(17); |
| | | var values = item.GetUseDataModel(19); |
| | | var ids = item.GetUseData(17); |
| | | var values = item.GetUseData(19); |
| | | if (!ids.IsNullOrEmpty() && values.IsNullOrEmpty()) |
| | | { |
| | | var properties = new List<Int2>(); |
| | |
| | | model.TryGetDropItems(model.selectBossId, out dropItems);
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | m_Items[i].button.RemoveAllListeners();
|
| | | if (dropItems != null && i < dropItems.Count)
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | var item = dropItems[i];
|
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | m_Items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.id, true, (ulong)item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | CommonItemBaisc itemBasic = item.transform.Find("CommonItemCell").GetComponent<CommonItemBaisc>();
|
| | | ItemCellModel cellModel = new ItemCellModel(matInfo.itemId, false, (ulong)matInfo.itemCount);
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | itemBasic.button.RemoveAllListeners();
|
| | | itemBasic.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(matInfo.itemId, false, (ulong)matInfo.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | |
|
| | | public void SetDisplay(ItemModel itemModel,List<string> selectGuids)
|
| | | {
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | equipLvObj.SetActive(false);
|
| | | if (itemModel == null || selectGuids == null)
|
| | | {
|
| | |
| | | string equipLvSB = Language.Get(StringUtility.Contact("Num_CHS_", itemModel.config.LV));
|
| | | equipLvText.text = Language.Get("L1091", equipLvSB);
|
| | | }
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | if (selectObj.activeInHierarchy)
|
| | | {
|
| | |
| | | lockText.gameObject.SetActive(false);
|
| | | lockObj.SetActive(islock);
|
| | | equipBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.button.RemoveAllListeners();
|
| | | equipLvObj.SetActive(false);
|
| | | composeImg.SetActive(false);
|
| | | if(islock)
|
| | |
| | | equipLvObj.SetActive(true);
|
| | | nameText.gameObject.SetActive(false);
|
| | | itemCell.Init(itemModel);
|
| | | itemCell.cellBtn.AddListener(() => { ClickItemCell(itemModel); });
|
| | | itemCell.button.AddListener(() => { ClickItemCell(itemModel); });
|
| | | string equipLvSB = Language.Get(StringUtility.Contact("Num_CHS_", itemModel.config.LV));
|
| | | equipLvText.text = Language.Get("L1091",equipLvSB);
|
| | | }
|
| | |
| | | equipLvText.text = Language.Get("L1091", equipLvSB);
|
| | | }
|
| | |
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(()=>
|
| | | {
|
| | | equipModel.ClearLookItemModel();
|
| | | tipsModel.SetItemTipsModel(itemModel.packType,itemModel.guid,false,true);
|
| | |
| | | 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()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(itemInfo.ItemID, false, (ulong)itemInfo.Count,
|
| | | "", type, false, ConfigParse.Analysis(itemInfo.UserData));
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | itemBasic.button.RemoveAllListeners();
|
| | | itemBasic.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemInfo.ItemID, false, (ulong)itemInfo.Count, -1,
|
| | | false, type, "", ConfigParse.Analysis(itemInfo.UserData));
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(matInfo.ItemID, false, (ulong)matInfo.Count,
|
| | | "", PackType.Deleted, false, ConfigParse.Analysis(matInfo.UserData));
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | itemBasic.button.RemoveAllListeners();
|
| | | itemBasic.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(matInfo.ItemID, false, (ulong)matInfo.Count, -1,
|
| | | false, PackType.Deleted, "", ConfigParse.Analysis(matInfo.UserData));
|
| | |
| | | {
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | itemBaisc.Init(model,true);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>ClickItem(model));
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>ClickItem(model));
|
| | | if (playerPack.selectDevourlist.Contains(model))
|
| | | {
|
| | | selectImg.SetActive(true);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(matInfo.ItemID, false, (ulong)matInfo.Count,
|
| | | "", PackType.Deleted, false, ConfigParse.Analysis(matInfo.UserData));
|
| | | getMatlist[i].Init(cellModel);
|
| | | getMatlist[i].cellBtn.RemoveAllListeners();
|
| | | getMatlist[i].cellBtn.AddListener(() =>
|
| | | getMatlist[i].button.RemoveAllListeners();
|
| | | getMatlist[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(matInfo.ItemID, false, (ulong)matInfo.Count,-1,
|
| | | false, PackType.Deleted, "", ConfigParse.Analysis(matInfo.UserData));
|
| | |
| | | {
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | StartCoroutine(SetScrollSize());
|
| | | DebugEx.Log("分支测试");
|
| | | }
|
| | |
|
| | | IEnumerator SetScrollSize()
|
| | |
| | | |
| | | private void SetGetBetterEquipEvent(ItemModel model) |
| | | { |
| | | List<int> itemEffectTime = model.GetUseDataModel((int)ItemUseDataKey.createTime); |
| | | if (itemEffectTime != null) |
| | | if (model.isAuction)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime); |
| | | if (!itemEffectTime.IsNullOrEmpty() && itemEffectTime.Count > 0) |
| | | { |
| | | if (itemEffectTime[0] != 0) |
| | | { |
| | | ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.guid); |
| | | var cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.guid); |
| | | double remainTime = 0; |
| | | if (cool != null) |
| | | { |
| | |
| | | } |
| | | |
| | | int isFightUp = IsFightUp(model.itemId, model.equipScore); |
| | | int equipPlace = model.config.EquipPlace; |
| | | if (isFightUp == 1) |
| | | { |
| | | switch (equipPlace) |
| | | { |
| | | case 9: |
| | | break; |
| | | default: |
| | | if (model.packType == PackType.Item) |
| | | { |
| | | var equipItemModel = playerPack.GetItemByIndex(PackType.Equip, model.config.EquipPlace); |
| | | if (PlayerDatas.Instance.baseData.LV >= 200) |
| | | { |
| | | if (model.config.EquipPlace > (int)RoleEquipType.Weapon2 && model.config.EquipPlace < (int)RoleEquipType.Neck) |
| | | { |
| | | if (equipItemModel != null && equipItemModel.config.ItemColor > model.config.ItemColor) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | if (isFightUp != 1)
|
| | | {
|
| | | return;
|
| | | } |
| | | |
| | | if (GetBetterEquipEvent != null) |
| | | { |
| | | GetBetterEquipEvent(model.guid); |
| | | } |
| | | |
| | | if (GetBetterEquipEvent != null)
|
| | | {
|
| | | GetBetterEquipEvent(model.guid);
|
| | | } |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | var putOnlimitList = item.GetUseDataModel((int)ItemUseDataKey.cancelUseLimit); |
| | | var putOnlimitList = item.GetUseData((int)ItemUseDataKey.cancelUseLimit); |
| | | if (!putOnlimitList.IsNullOrEmpty()) |
| | | { |
| | | if (putOnlimitList[0] == 1) |
| | |
| | | public int itemId { get { return itemInfo == null ? 0 : itemInfo.itemId; } }
|
| | | public int count { get { return itemInfo == null ? 0 : itemInfo.count; } }
|
| | | public int gridIndex { get { return itemInfo == null ? 0 : itemInfo.index; } }
|
| | | public int isBind { get { return itemInfo == null ? 0 : itemInfo.isBind; } }
|
| | | public bool isAuction { get { return itemInfo == null ? false : itemInfo.isAuction == 1; } }
|
| | | public int preItemCount { get; private set; }
|
| | | public int auctionSurplusTime {
|
| | | get {
|
| | |
| | | }
|
| | |
|
| | | this.equipScore = ItemLogicUtility.Instance.GetEquipScore(packType, itemId, useDataDict);
|
| | | if (GetUseDataModel((int)ItemUseDataKey.itemCount) != null)
|
| | | if (GetUseData((int)ItemUseDataKey.itemCount) != null)
|
| | | {
|
| | | itemInfo.count = GetUseDataModel((int)ItemUseDataKey.itemCount)[0];
|
| | | itemInfo.count = GetUseData((int)ItemUseDataKey.itemCount)[0];
|
| | | }
|
| | |
|
| | | var itemEffectTime = GetUseDataModel((int)ItemUseDataKey.createTime);
|
| | | var itemEffectTime = GetUseData((int)ItemUseDataKey.createTime);
|
| | | if (config.ExpireTime > 0 && !itemEffectTime.IsNullOrEmpty() && itemEffectTime[0] != 0)
|
| | | {
|
| | | switch ((EquipReduceType)config.EndureReduceType)
|
| | |
| | | itemInfo.count = count;
|
| | | }
|
| | |
|
| | | public List<int> GetUseDataModel(int key)
|
| | | public List<int> GetUseData(int key)
|
| | | {
|
| | | List<int> list = null;
|
| | | if (useDataDict != null)
|
| | |
| | |
|
| | | public int count; //物品数量
|
| | |
|
| | | public int isBind;//是否绑定
|
| | | public int isAuction;//是否拍品
|
| | |
|
| | | public int remainHour; //剩余时间(小时)
|
| | |
|
| | |
| | | remainHour = (int)serverItem.RemainHour;
|
| | | userData = serverItem.UserData;
|
| | | guid = serverItem.ItemGUID;
|
| | | isBind = serverItem.IsBind;
|
| | | isAuction = serverItem.IsBind;
|
| | | }
|
| | |
|
| | | public ItemInfo(H0704_tagRolePackRefresh serverItem)
|
| | |
| | | remainHour = (int)serverItem.RemainHour;
|
| | | userData = serverItem.UserData;
|
| | | guid = serverItem.ItemGUID;
|
| | | isBind = serverItem.IsBind;
|
| | | isAuction = serverItem.IsBind;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return; |
| | | } |
| | | |
| | | var putOnLimits = selectedItem.GetUseDataModel((int)ItemUseDataKey.cancelUseLimit); |
| | | var putOnLimits = selectedItem.GetUseData((int)ItemUseDataKey.cancelUseLimit); |
| | | if (putOnLimits != null && putOnLimits[0] == 1) |
| | | { |
| | | PutOnEquip(selectedItem.equipPlace, selectedItem.guid); |
| | |
| | | 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()
|
| | |
| | | switch ((EquipReduceType)itemModel.config.EndureReduceType) |
| | | { |
| | | case EquipReduceType.Def_EquipReduceType_Time: |
| | | List<int> itemEffectTime = itemModel.GetUseDataModel((int)ItemUseDataKey.createTime); |
| | | List<int> itemEffectTime = itemModel.GetUseData((int)ItemUseDataKey.createTime); |
| | | if (itemEffectTime != null && itemEffectTime[0] != 0) |
| | | { |
| | | if (cool == null || cool.GetRemainTime() <= 0) |
| | |
| | | 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;
|
| | |
| | | {
|
| | | gridCell.itemCellBtn.OnOneParaClick = (int info) =>
|
| | | {
|
| | | if (itemModel.itemInfo.isBind== 1)
|
| | | if (itemModel.itemInfo.isAuction== 1)
|
| | | {
|
| | | AuctionHelpModel auctionHelpModel = ModelCenter.Instance.GetModel<AuctionHelpModel>();
|
| | | auctionHelpModel.ItemModel = itemModel;
|
| | |
| | | {
|
| | | public class CommonItemBaisc : MonoBehaviour
|
| | | {
|
| | | Image _bgIcon;
|
| | | Image m_BgIcon;
|
| | | public Image bgIcon {
|
| | | get {
|
| | | if (_bgIcon == null)
|
| | | if (m_BgIcon == null)
|
| | | {
|
| | | var _trans = transform.Find("EquipBG");
|
| | | _bgIcon = _trans != null ? _trans.GetComponent<Image>() : null;
|
| | | m_BgIcon = this.transform.GetComponent<Image>("EquipBG");
|
| | | }
|
| | | return _bgIcon;
|
| | | return m_BgIcon;
|
| | | }
|
| | | }
|
| | |
|
| | | Image _itemIcon;
|
| | | Image m_ItemIcon;
|
| | | public Image itemIcon {
|
| | | get {
|
| | | if (_itemIcon == null)
|
| | | if (m_ItemIcon == null)
|
| | | {
|
| | | var _trans = transform.Find("ItemIcon");
|
| | | _itemIcon = _trans != null ? _trans.GetComponent<Image>() : null;
|
| | | m_ItemIcon = this.transform.GetComponent<Image>("ItemIcon");
|
| | | }
|
| | | return _itemIcon;
|
| | | return m_ItemIcon;
|
| | | }
|
| | | }
|
| | |
|
| | | Image _bindIcon;
|
| | | public Image bindIcon {
|
| | | Image m_AuctionIcon;
|
| | | public Image auctionIcon {
|
| | | get {
|
| | | if (_bindIcon == null)
|
| | | if (m_AuctionIcon == null)
|
| | | {
|
| | | var _trans = transform.Find("BindBG");
|
| | | _bindIcon = _trans != null ? _trans.GetComponent<Image>() : null;
|
| | | m_AuctionIcon = this.transform.GetComponent<Image>("BindBG");
|
| | | }
|
| | | return _bindIcon;
|
| | | return m_AuctionIcon;
|
| | | }
|
| | | }
|
| | |
|
| | | Image _stateIcon;
|
| | | Image m_StateIcon;
|
| | | public Image stateIcon {
|
| | | get {
|
| | | if (_stateIcon == null)
|
| | | if (m_StateIcon == null)
|
| | | {
|
| | | var _trans = transform.Find("stateIcon");
|
| | | _stateIcon = _trans != null ? _trans.GetComponent<Image>() : null;
|
| | | m_StateIcon = this.transform.GetComponent<Image>("stateIcon");
|
| | | }
|
| | | return _stateIcon;
|
| | | return m_StateIcon;
|
| | | }
|
| | | }
|
| | |
|
| | | Text _countText;
|
| | | Text m_CountText;
|
| | | public Text countText {
|
| | | get {
|
| | | if (_countText == null)
|
| | | if (m_CountText == null)
|
| | | {
|
| | | var _trans = transform.Find("CountText");
|
| | | _countText = _trans != null ? _trans.GetComponent<Text>() : null;
|
| | | m_CountText = this.transform.GetComponent<Text>("CountText");
|
| | | }
|
| | | return _countText;
|
| | | return m_CountText;
|
| | | }
|
| | | }
|
| | |
|
| | | GameObject _starlist;
|
| | | public GameObject starlist {
|
| | | Button m_Button;
|
| | | public Button button {
|
| | | get {
|
| | | if (_starlist == null)
|
| | | if (m_Button == null)
|
| | | {
|
| | | var _trans = transform.Find("StarList");
|
| | | _starlist = _trans != null ? _trans.gameObject : null;
|
| | | m_Button = this.GetComponent<Button>();
|
| | | }
|
| | | return _starlist;
|
| | | }
|
| | | }
|
| | |
|
| | | Button _cellBtn;
|
| | | public Button cellBtn {
|
| | | get {
|
| | | if (_cellBtn == null)
|
| | | _cellBtn = this.GetComponent<Button>();
|
| | | return _cellBtn;
|
| | | return m_Button;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public virtual void Init(ItemModel model, bool isCompare = false, int compareScore = 0)
|
| | | {
|
| | | itemConfig = model.config;
|
| | | InitUI(model.guid, model.itemId, (ulong)model.count, model.equipScore, model.isBind, model.packType, isCompare, model.useDataDict, compareScore);
|
| | | InitUI(model.guid, model.itemId, (ulong)model.count, model.equipScore, model.isAuction, model.packType, isCompare, model.useDataDict, compareScore);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public virtual void Init(ItemCellModel model, int compareScore = 0)
|
| | | {
|
| | | itemConfig = model.itemConfig;
|
| | | InitUI(model.guid, model.itemId, model.count, model.score, 0, model.packType, model.isCompare, model.useDataDic, compareScore);
|
| | | InitUI(model.guid, model.itemId, model.count, model.score, false, model.packType, model.isCompare, model.useDataDic, compareScore);
|
| | | }
|
| | |
|
| | | private void InitUI(string guid, int itemId, ulong count, int score, int bind, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic, int compareScore = 0)
|
| | | private void InitUI(string guid, int itemId, ulong count, int score, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic, int compareScore = 0)
|
| | | {
|
| | | if (itemConfig == null) return;
|
| | |
|
| | |
| | | itemIcon.SetSprite(itemConfig.IconKey);
|
| | | bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
|
| | |
|
| | | int i = 0;
|
| | | for (i = 0; i < starlist.transform.childCount; i++)
|
| | | {
|
| | | Image starIcon = starlist.transform.GetChild(i).GetComponent<Image>();
|
| | | starIcon.SetSprite("Stars_a");
|
| | | starIcon.gameObject.SetActive(false);
|
| | | }
|
| | | auctionIcon.gameObject.SetActive(isAuction);
|
| | |
|
| | | bindIcon.gameObject.SetActive(bind == 1);
|
| | |
|
| | | countText.text = UIHelper.ReplaceLargeNum((double)count);
|
| | | countText.gameObject.SetActive(count > 1);
|
| | | if (count > 1)
|
| | | {
|
| | | countText.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | countText.gameObject.SetActive(false);
|
| | | countText.text = UIHelper.ReplaceLargeNum((double)count);
|
| | | }
|
| | |
|
| | | int compareReslut = Compare(type, itemId, score, isCompare, compareScore, guid);
|
| | |
| | | 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; }
|
| | |
|
| | | public Dictionary<int, int> specAttrDic { get; private set; }
|
| | |
|
| | | public ItemCellModel(int itemId, bool isPreview = false, ulong count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
|
| | | {
|
| | | specAttrDic = new Dictionary<int, int>();
|
| | | this.itemId = AdjustItemId(itemId);
|
| | | this.guid = guid;
|
| | | this.itemId = itemId;
|
| | | this.count = count;
|
| | | this.itemConfig = ItemConfig.Get(itemId);
|
| | | this.isCompare = isCompare;
|
| | | this.useDataDic = useDataDic;
|
| | | this.packType = type;
|
| | | if (CheckIsCustomItem())
|
| | | {
|
| | | this.itemId = itemConfig.EffectValueA1;
|
| | | this.itemConfig = ItemConfig.Get(this.itemId);
|
| | | }
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(type, itemId, useDataDic, isPreview);
|
| | | }
|
| | |
|
| | | public bool CheckIsCustomItem()
|
| | | public ItemCellModel(int itemId)
|
| | | {
|
| | | if (itemConfig == null) return false;
|
| | |
|
| | | if (itemConfig.Effect1 == 220)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | this.itemId = AdjustItemId(itemId);
|
| | | this.guid = "";
|
| | | this.count = 0;
|
| | | this.isCompare = false;
|
| | | this.useDataDic = null;
|
| | | this.packType = PackType.Deleted;
|
| | | this.score = 0;
|
| | | }
|
| | |
|
| | | public ItemCellModel(int itemId, bool isPreview, ulong count)
|
| | | {
|
| | | this.itemId = AdjustItemId(itemId);
|
| | | this.guid = "";
|
| | | this.count = count;
|
| | | this.isCompare = false;
|
| | | this.useDataDic = null;
|
| | | this.packType = PackType.Deleted;
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(PackType.Deleted, itemId, null, isPreview);
|
| | | }
|
| | |
|
| | | int AdjustItemId(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config != null && config.Effect1 == 220)
|
| | | {
|
| | | return config.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | | return itemId;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | m_AddEquip.gameObject.SetActive(false);
|
| | | m_ItemCell.gameObject.SetActive(true);
|
| | | m_ItemCell.Init(item);
|
| | | m_ItemCell.cellBtn.SetListener(ShowEquipTip);
|
| | | m_ItemCell.button.SetListener(ShowEquipTip);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | EquipTip equipTip; |
| | | [SerializeField] |
| | | BuyEquipTip buyTip; |
| | | [SerializeField] |
| | | UnionWarehouseEquipTip unionTip; |
| | | [SerializeField] GetEquipPathTips getEquipPathTip; |
| | | [SerializeField] |
| | | CanvasGroup equipTipAlpha; |
| | |
| | | } |
| | | equipTip.gameObject.SetActive(false); |
| | | buyTip.gameObject.SetActive(false); |
| | | unionTip.gameObject.SetActive(false); |
| | | getEquipPathTip.gameObject.SetActive(false); |
| | | TempCreatelist.Clear(); |
| | | } |
| | |
| | | case ItemTipChildType.Buy: |
| | | buyTip.InitModel(itemTipsModel.curAttrData); |
| | | buyTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.UnionWarehouseDonation: |
| | | unionTip.InitModel(itemTipsModel.curAttrData); |
| | | unionTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.UnionWarehouseExchange: |
| | | unionTip.InitModel(itemTipsModel.curAttrData); |
| | | unionTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.GetEquipPath: |
| | | getEquipPathTip.InitModel(itemTipsModel.curAttrData); |
| | |
| | | buyTip.InitModel(itemTipsModel.curAttrData); |
| | | equipTip.InitModel(itemTipsModel.compareAttrData); |
| | | buyTip.gameObject.SetActive(true); |
| | | equipTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.UnionWarehouseDonation: |
| | | unionTip.InitModel(itemTipsModel.curAttrData); |
| | | equipTip.InitModel(itemTipsModel.compareAttrData); |
| | | unionTip.gameObject.SetActive(true); |
| | | equipTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.UnionWarehouseExchange: |
| | | unionTip.InitModel(itemTipsModel.curAttrData); |
| | | equipTip.InitModel(itemTipsModel.compareAttrData); |
| | | unionTip.gameObject.SetActive(true); |
| | | equipTip.gameObject.SetActive(true); |
| | | break; |
| | | case ItemTipChildType.GetEquipPath: |
| | |
| | | //pdr ToDo |
| | | ItemCellModel cellModel = new ItemCellModel(_chinItemModel.ID); |
| | | _itemCell.Init(cellModel); |
| | | _itemCell.cellBtn.RemoveAllListeners(); |
| | | _itemCell.cellBtn.onClick.AddListener(()=> |
| | | _itemCell.button.RemoveAllListeners(); |
| | | _itemCell.button.onClick.AddListener(()=> |
| | | { |
| | | ItemAttrData attrData = new ItemAttrData(_chinItemModel.ID); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | |
| | | { |
| | | public class ItemCell : CommonItemBaisc |
| | | { |
| | | private Button _reducebtn; |
| | | public Button reducebtn |
| | | { |
| | | get |
| | | { |
| | | if (_reducebtn == null) |
| | | private Button m_Reducebtn; |
| | | public Button reducebtn { |
| | | get { |
| | | if (m_Reducebtn == null) |
| | | { |
| | | var _trans = transform.Find("Reducebtn"); |
| | | _reducebtn = _trans != null ? _trans.GetComponent<Button>() : null; |
| | | m_Reducebtn = this.transform.GetComponent<Button>("Reducebtn"); |
| | | } |
| | | return _reducebtn; |
| | | return m_Reducebtn; |
| | | } |
| | | } |
| | | |
| | | public override void Init(ItemModel model,bool isCompare = false, int compareScore = 0) |
| | | public override void Init(ItemModel model, bool isCompare = false, int compareScore = 0) |
| | | { |
| | | base.Init(model, isCompare,compareScore); |
| | | base.Init(model, isCompare, compareScore); |
| | | reducebtn.gameObject.SetActive(false); |
| | | } |
| | | |
| | | public override void Init(ItemCellModel model, int compareScore = 0) |
| | | { |
| | | base.Init(model,compareScore); |
| | | base.Init(model, compareScore); |
| | | reducebtn.gameObject.SetActive(false); |
| | | } |
| | | } |
| | |
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | itemCell.gameObject.SetActive(true);
|
| | | ItemModel itemModel = _oneKeySelllist[cellCount - 1];
|
| | | itemCell.Init(itemModel,true);
|
| | | itemCell.cellBtn.onClick.RemoveAllListeners();
|
| | | itemCell.cellBtn.onClick.AddListener(()=> { OnSingleClickItemCell(itemModel,itemCell.gameObject); });
|
| | | itemCell.button.onClick.RemoveAllListeners();
|
| | | itemCell.button.onClick.AddListener(()=> { OnSingleClickItemCell(itemModel,itemCell.gameObject); });
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | |
|
| | |
| | | if (itemModel != null && itemModel.packType == PackType.Item)
|
| | | {
|
| | | DrawItem(itemModel);
|
| | | List<int> sourcelist = itemModel.GetUseDataModel((int)ItemUseDataKey.source);
|
| | | List<int> sourcelist = itemModel.GetUseData((int)ItemUseDataKey.source);
|
| | | if (sourcelist != null
|
| | | && sourcelist[0] == 4
|
| | | && model.isGetNewItem)
|
| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | | using UnityEngine.UI;
|
| | | //关于Buff面板的设置
|
| | | namespace Snxxz.UI
|
| | |
| | | private ScrollRect _ScrollRect;
|
| | | private Dictionary<int, ObjBuff> objBuffic;
|
| | | private List<int> _SortList = new List<int>();//排序列表
|
| | | BuffModel m_BuffModel;
|
| | | BuffModel Buffmodel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_BuffModel ?? (m_BuffModel = ModelCenter.Instance.GetModel<BuffModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | BuffModel Buffmodel { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | BuffModel.Even_ObjDelBuff -= DelBuff;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | |
|
| | | void UpdateControllerPosition()
|
| | |
| | | {
|
| | | int Type = 0;
|
| | | return Type;
|
| | | int Use_TheSecond = Mathf.FloorToInt((float)(DateTime.Now - objBuffic[BuffID]._dattTime).TotalSeconds);
|
| | | if (objBuffic[BuffID].LastTime - Use_TheSecond > 0)
|
| | | {
|
| | | float time = objBuffic[BuffID].LastTime - Use_TheSecond;
|
| | | if (time >= 86400)//天
|
| | | {
|
| | | return 4;
|
| | | }
|
| | | else if (time < 86400 && time >= 3600)//时
|
| | | {
|
| | | return 3;
|
| | | }
|
| | | else if (time < 3600 && time >= 60)//分
|
| | | {
|
| | | return 2;
|
| | | }
|
| | | else if (time < 60 && time > 0)//秒
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | List<int> Priority()
|
| | |
| | | return _List;
|
| | | }
|
| | |
|
| | | void AddBuff()//buff的增加
|
| | | void AddBuff()
|
| | | {
|
| | |
|
| | | objBuffic = Buffmodel._BuffDic;
|
| | | BuffScheduling();
|
| | | UpdateControllerPosition();
|
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | }
|
| | |
|
| | | void DelBuff()//buff的删除
|
| | | void DelBuff()
|
| | | {
|
| | |
|
| | | objBuffic = Buffmodel._BuffDic;
|
| | | BuffScheduling();
|
| | | UpdateControllerPosition();
|
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | 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;
|
| | |
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)number);
|
| | | itemcell.Init(cellModel);
|
| | | itemcell.cellBtn.RemoveAllListeners();
|
| | | itemcell.button.RemoveAllListeners();
|
| | | int tab = i;
|
| | | itemcell.cellBtn.AddListener(() =>
|
| | | itemcell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(rewardList[tab].itemCfg.ID, false, (ulong)number);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | public void Display(ItemModel _itemModel)
|
| | | {
|
| | | m_GuardItem.Init(_itemModel, true);
|
| | | m_GuardItem.cellBtn.RemoveAllListeners();
|
| | | m_GuardItem.cellBtn.AddListener(() =>
|
| | | m_GuardItem.button.RemoveAllListeners();
|
| | | m_GuardItem.button.AddListener(() =>
|
| | | {
|
| | | if (_itemModel != null)
|
| | | {
|
| | |
| | | #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();
|
| | |
| | | go.transform.localPosition = pos.SetZ(0);
|
| | | ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)rewardList[i].num);
|
| | | itemcell.Init(cellModel);
|
| | | itemcell.cellBtn.RemoveAllListeners();
|
| | | itemcell.button.RemoveAllListeners();
|
| | | int tab = i;
|
| | | itemcell.cellBtn.AddListener(() =>
|
| | | itemcell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(rewardList[tab].itemCfg.ID, true, (ulong)rewardList[tab].num);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | go.transform.localPosition = pos.SetZ(0);
|
| | | ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)rewardList[i].num);
|
| | | itemcell.Init(cellModel);
|
| | | itemcell.cellBtn.RemoveAllListeners();
|
| | | itemcell.button.RemoveAllListeners();
|
| | | int tab = i;
|
| | | itemcell.cellBtn.AddListener(() =>
|
| | | itemcell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(rewardList[tab].itemCfg.ID, true, (ulong)rewardList[tab].num);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | 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;
|
| | |
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(rewardList[i].itemCfg.ID, true, (ulong)number);
|
| | | itemcell.Init(cellModel);
|
| | | itemcell.cellBtn.RemoveAllListeners();
|
| | | itemcell.button.RemoveAllListeners();
|
| | | int tab = i;
|
| | | itemcell.cellBtn.AddListener(() =>
|
| | | itemcell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(rewardList[tab].itemCfg.ID, false, (ulong)number);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | {
|
| | | 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;
|
| | |
| | | buyPriceText.text = storeConfig.MoneyNumber.ToString();
|
| | | ItemCellModel fireModel = new ItemCellModel(storeConfig.ItemID,true,(ulong)storeConfig.ItemCnt);
|
| | | fireItem.Init(fireModel);
|
| | | fireItem.cellBtn.AddListener(() =>
|
| | | fireItem.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(storeConfig.ItemID,true, (ulong)storeConfig.ItemCnt);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | NewYearFairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(() =>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | NewYearFairylandCeremonyModel.AwardItem itemData = list[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | baiscs[i].Init(cellModel);
|
| | | baiscs[i].cellBtn.RemoveAllListeners();
|
| | | baiscs[i].cellBtn.AddListener(() =>
|
| | | baiscs[i].button.RemoveAllListeners();
|
| | | baiscs[i].button.AddListener(() =>
|
| | | {
|
| | | switch(itemData.itemId)
|
| | | {
|
| | |
| | | NewYearFairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId,true, (ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(()=>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | NewYearFairylandCeremonyModel.AwardItem itemData = itemlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(itemData.itemId, true,(ulong)itemData.itemCount);
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(() =>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | m_Items[i].button.RemoveAllListeners();
|
| | | if (recharge != null && i < recharge.items.Count)
|
| | | {
|
| | | var item = recharge.items[i];
|
| | | m_Items[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_Items[i].Init(itemCellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | m_Items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.id, true, (ulong)item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | var luckyItem = autoLuckyItems[index];
|
| | | ItemCellModel itemCellModel = new ItemCellModel(luckyItem.itemId,false,(ulong)luckyItem.itemCount);
|
| | | awardItem.itemBaisc.Init(itemCellModel);
|
| | | awardItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | awardItem.itemBaisc.cellBtn.AddListener(() =>
|
| | | awardItem.itemBaisc.button.RemoveAllListeners();
|
| | | awardItem.itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(luckyItem.itemId, false, (ulong)luckyItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | ItemCellModel model = new ItemCellModel(luckyItem.itemId,false,(ulong)luckyItem.itemCount);
|
| | | itemBaisc.Init(model);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(luckyItem.itemId, false, (ulong)luckyItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | var Item = weekPartyItemClass[0];
|
| | | ItemCellModel cellModel = new ItemCellModel(Item.ItemID, true, (ulong)Item.ItemCnt);
|
| | | m_ItemCell.Init(cellModel);
|
| | | m_ItemCell.cellBtn.SetListener(() =>
|
| | | m_ItemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(Item.ItemID, false, (ulong)Item.ItemCnt);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | m_FlashSaleItems[i].gameObject.SetActive(true);
|
| | | var itemcellmodel = new ItemCellModel(item.itemId, true, (ulong)item.itemCount);
|
| | | m_FlashSaleItems[i].SetItemRare(itemcellmodel, item.isMainItem);
|
| | | m_FlashSaleItems[i].cellBtn.RemoveAllListeners();
|
| | | m_FlashSaleItems[i].cellBtn.AddListener(() =>
|
| | | m_FlashSaleItems[i].button.RemoveAllListeners();
|
| | | m_FlashSaleItems[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(item.itemId, true, (ulong)item.itemCount);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | code = rushToBuyModel.presentFlashShop.dayIndex * 1000 + rushToBuyModel.presentFlashShop.timeIndex * 100 + index;
|
| | | ItemCellModel cellModel = new ItemCellModel(saleItem.itemId,true,(ulong)saleItem.itemCount);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(saleItem.itemId,true, (ulong)saleItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | var _item = _itemList[i];
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | _cell.items[i].SetItemRare(_ItemData, 5);
|
| | | _cell.items[i].cellBtn.RemoveAllListeners();
|
| | | _cell.items[i].cellBtn.AddListener(() =>
|
| | | _cell.items[i].button.RemoveAllListeners();
|
| | | _cell.items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.id, false, (ulong)_item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | |
| | | Item item = list[0];
|
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)item.count);
|
| | | m_ItemCell.Init(cellModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell.cellBtn.AddListener(() =>
|
| | | m_ItemCell.button.RemoveAllListeners();
|
| | | m_ItemCell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | awardCell.itemBaisc.gameObject.SetActive(true);
|
| | | ItemCellModel itemCellModel = new ItemCellModel(treasureItem.itemId,false,(ulong)treasureItem.itemCount);
|
| | | awardCell.itemBaisc.Init(itemCellModel);
|
| | | awardCell.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | awardCell.itemBaisc.cellBtn.AddListener(() =>
|
| | | awardCell.itemBaisc.button.RemoveAllListeners();
|
| | | awardCell.itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(treasureItem.itemId, false, (ulong)treasureItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | ItemCellModel itemCellModel = new ItemCellModel(luckyItem.itemId);
|
| | | luckAward_Item.Init(itemCellModel);
|
| | | luckAward_Item.cellBtn.RemoveAllListeners();
|
| | | luckAward_Item.cellBtn.AddListener(() =>
|
| | | luckAward_Item.button.RemoveAllListeners();
|
| | | luckAward_Item.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(luckyItem.itemId);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | itemBaisc.gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(itemInfo.itemId,false, (ulong)itemInfo.count);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(itemInfo.itemId, false, (ulong)itemInfo.count );
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_Items[i].cellBtn.onClick.AddListener(() =>
|
| | | m_Items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnItemClick(_index);
|
| | | });
|
| | |
| | | var Item = WeekPartyAction.WeekPartyItem[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(Item.ItemID, true, (ulong)Item.ItemCnt);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.SetListener(() =>
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | var attrData = new ItemAttrData(Item.ItemID, false, (ulong)Item.ItemCnt);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(()=>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(wellItem.itemId, true, (ulong)wellItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | Item item = list[i]; |
| | | ItemCellModel cellModel = new ItemCellModel(item.id, true, (ulong)item.count); |
| | | itemCell.Init(cellModel); |
| | | itemCell.cellBtn.RemoveAllListeners(); |
| | | itemCell.cellBtn.AddListener(() => |
| | | itemCell.button.RemoveAllListeners(); |
| | | itemCell.button.AddListener(() => |
| | | { |
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count); |
| | | itemTipsModel.SetItemTipsModel(attrData); |
| | |
| | | var Item = SpringFestival.WeekPartyItem[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(Item.ItemID, true, (ulong)Item.ItemCnt);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.SetListener(() =>
|
| | | itemCell.button.SetListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(Item.ItemID, false, (ulong)Item.ItemCnt);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_Items[i].cellBtn.onClick.AddListener(() =>
|
| | | m_Items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnItemClick(_index);
|
| | | });
|
| | |
| | | {
|
| | | poolItem.bestImg.SetSprite(rareIconKey);
|
| | | }
|
| | | poolItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | poolItem.itemBaisc.cellBtn.AddListener(()=>
|
| | | poolItem.itemBaisc.button.RemoveAllListeners();
|
| | | poolItem.itemBaisc.button.AddListener(()=>
|
| | | {
|
| | | var attrData = new ItemAttrData(info.itemId,true, (ulong)info.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | ItemCellModel cellModel = new ItemCellModel(wellItem.itemId, false, (ulong)wellItem.itemCount);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(() =>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(wellItem.itemId, true, (ulong)wellItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | {
|
| | | awardItem.bestIcon.SetSprite(rareIconKey);
|
| | | }
|
| | | awardItem.itemBaisc.cellBtn.RemoveAllListeners();
|
| | | awardItem.itemBaisc.cellBtn.AddListener(() =>
|
| | | awardItem.itemBaisc.button.RemoveAllListeners();
|
| | | awardItem.itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData((int)wellItem.itemId, true , (ulong)wellItem.itemCount);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | var index = i;
|
| | | m_Items[i].cellBtn.onClick.AddListener(() =>
|
| | | m_Items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnSelectItem(index);
|
| | | });
|
| | |
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.AppendColor(TextColType.Red,0.ToString()),
|
| | | "/", 1);
|
| | | }
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.AddListener(()=>
|
| | | itemCell.button.RemoveAllListeners();
|
| | | itemCell.button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(renameToolId);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < roleEquipList.Count; i++)
|
| | | {
|
| | | RoleEquipType roleEquipType = roleEquipList[i].type;
|
| | | roleEquipList[i].itemCell.cellBtn.onClick.AddListener(() =>
|
| | | roleEquipList[i].itemCell.button.onClick.AddListener(() =>
|
| | | {
|
| | | OnRoleEquipClick(roleEquipType);
|
| | | });
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel(itemId, true, (ulong)count);
|
| | | m_Item.Init(cellModel);
|
| | |
|
| | | m_Item.cellBtn.RemoveAllListeners();
|
| | | m_Item.cellBtn.AddListener(() =>
|
| | | m_Item.button.RemoveAllListeners();
|
| | | m_Item.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(itemId, true);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | |
|
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0);//默认显示不上锁
|
| | | m_ItemCell.Init(ItemModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell.button.RemoveAllListeners();
|
| | | int type = i;
|
| | | m_ItemCell.cellBtn.AddListener(() =>
|
| | | m_ItemCell.button.AddListener(() =>
|
| | | {
|
| | | itemTipsModel.SetItemTipsModel(PackType.DogzEquip, itemModel[type].guid);
|
| | | });
|
| | |
| | | }
|
| | | GainProficiency();//获取熟练度
|
| | | m_BottomBox.SetActive(true);
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | int lv = godBeastModel.QualityLimit[m_DogZItemModel.config.ItemColor];
|
| | |
| | | {
|
| | | if (itemModel.config.Effect1 == 235)
|
| | | {
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | SingleProficiency += itemModel.config.EffectValueA1 * DicAb[key];
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | |
| | | return DogzLv;
|
| | | }
|
| | | int lv = godBeastModel.QualityLimit[m_DogZItemModel.config.ItemColor];
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus.Count > 1)
|
| | | {
|
| | | ToExpTotal += IudetDogzEquipPlus[1];
|
| | |
| | | return;
|
| | | }
|
| | | m_DogZItemModel = ItemModel;
|
| | | var IudetDogzEquipPlus = ItemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = ItemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus.Count > 1)
|
| | | {
|
| | | DogZLv = IudetDogzEquipPlus[0];
|
| | |
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.DogzItem, Index);
|
| | | m_ItemCell.Init(itemModel);
|
| | | m_ItemCell.countText.gameObject.SetActive(false);
|
| | | m_ItemCell.bindIcon.gameObject.SetActive(false);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | m_ItemCell.auctionIcon.gameObject.SetActive(false);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | TextNumber.gameObject.SetActive(false);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | |
| | | }
|
| | | m_itemCell.Init(ItemModel);
|
| | | var itemConfig = ItemConfig.Get(itemModel[i].itemId);
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | m_Item_Text.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus[0] > 0)
|
| | | {
|
| | |
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | | ItemModel item = itemModel[i];
|
| | | var IudetDogzEquipPlus = item.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = item.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | int lv = IudetDogzEquipPlus[0];
|
| | |
| | | {
|
| | | return SiteEnhancementAttributeDic;
|
| | | }
|
| | | var IudetDogzEquipPlus = item.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = item.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null && IudetDogzEquipPlus[0] > 0)
|
| | | {
|
| | | var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(item.config.EquipPlace, IudetDogzEquipPlus[0]);
|
| | |
| | | }
|
| | | int lv = QualityLimit[itemModel.config.ItemColor];//获取最大强化等级
|
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.config.EquipPlace, lv);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | |
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | |
| | | {
|
| | | if (item_Model.config.Effect1 == 235)
|
| | | {
|
| | | var _IudetDogzEquipPlus = item_Model.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var _IudetDogzEquipPlus = item_Model.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | SingleProficiency += item_Model.config.EffectValueA1 * Absorption_Dic[key];
|
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | |
| | |
|
| | | private int GetLV(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[0];
|
| | |
| | | }
|
| | | private int GetProficiency(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[1];
|
| | |
| | | {
|
| | | ItemColor = itemModel[i].config.ItemColor;
|
| | | }
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)//判断是否都满级 满级不可亮红点
|
| | | {
|
| | | Istrue = true;
|
| | |
| | | {
|
| | | ItemModel _itemModel = playerPack.GetItemByIndex(PackType.DogzEquip, RedPointLIst[i]);
|
| | | int MaxLv= QualityLimit[_itemModel.config.ItemColor];//获取最大强化等级
|
| | | var _IudetDogzEquipPlus = _itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);
|
| | | var _IudetDogzEquipPlus = _itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);
|
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | if (_IudetDogzEquipPlus[0]<MaxLv && _IudetDogzEquipPlus[0] < Lv)
|
| | |
| | | godBeastClass.EquipScore = itemModel[i].equipScore;
|
| | | godBeastClass.ItemPlace = itemModel[i].gridIndex;
|
| | | godBeastClass.GodBeastId = key;
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | | godBeastClass.GodBeastLv = 0;
|
| | |
| | | godBeastBagClass.EquipScore = itemModel.equipScore;
|
| | | godBeastBagClass.Part = itemModel.config.EquipPlace;
|
| | | godBeastBagClass.Count = itemModel.count;
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | var IudetDogzEquipPlus = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | | godBeastBagClass.LV = 0;
|
| | |
| | | { |
| | | itemBaisc.gameObject.SetActive(true); |
| | | itemBaisc.Init(itemModel); |
| | | itemBaisc.cellBtn.RemoveAllListeners(); |
| | | itemBaisc.cellBtn.AddListener(()=> |
| | | itemBaisc.button.RemoveAllListeners(); |
| | | itemBaisc.button.AddListener(()=> |
| | | { |
| | | tipsModel.SetItemTipsModel(PackType.Equip,itemModel.guid); |
| | | }); |
| | |
| | | return false; |
| | | } |
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing); |
| | | if (itemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue) != null) |
| | | if (itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue) != null) |
| | | { |
| | | int currentRefining = 0; |
| | | int currentReAll = 0; |
| | | currentRefining = itemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue)[0];//当前精炼度 |
| | | currentRefining = itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue)[0];//当前精炼度 |
| | | if (tegWing.Count <= 0) |
| | | { |
| | | tegWing = WingRefineAttrConfig.GetValues(); |
| | |
| | | _WingButton.Icon.SetSprite(tagItem.IconKey);
|
| | | _WingButton.WingsText.text = UIHelper.AppendColor((TextColType)color, tagItem.ItemName, true);
|
| | | int _currentRefining = 0;//当前精炼度
|
| | | if (WingDic[Index].GetUseDataModel(42) != null)
|
| | | _currentRefining = WingDic[Index].GetUseDataModel(42)[0];
|
| | | if (WingDic[Index].GetUseData(42) != null)
|
| | | _currentRefining = WingDic[Index].GetUseData(42)[0];
|
| | |
|
| | | foreach (var config in refineAttrConfigs)
|
| | | {
|
| | |
| | | SinglePack singlePackModel = packModel.GetSinglePack(PackType.Item); |
| | | Dictionary<int, ItemModel> backpack_dic = singlePackModel.GetAllItems(); |
| | | |
| | | List<int> wingsRefinelist = itemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue); |
| | | List<int> wingsRefinelist = itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue); |
| | | if (wingsRefinelist != null) |
| | | { |
| | | var config = WingRefineExpConfig.Get((int)itemModel.itemId); |
| | |
| | | foreach (var key in _DevourDIc.Keys)
|
| | | {
|
| | | var wingConfig = WingRefineExpConfig.Get(_wingItemDic[key]);
|
| | | if (WingDic[key].GetUseDataModel((int)ItemUseDataKey.wingProgressValue) != null || WingDic[key].GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | if (WingDic[key].GetUseData((int)ItemUseDataKey.wingProgressValue) != null || WingDic[key].GetUseData((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | {
|
| | |
|
| | | Min += wingConfig.EXPlower + GetWingRefiningValue(WingDic[key]); ;
|
| | |
| | | {
|
| | | dicWingUseDateValue.Clear();
|
| | | int GetUseDateValue = 0;
|
| | | if (ItemModel.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID) != null
|
| | | || ItemModel.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemCount) != null)
|
| | | if (ItemModel.GetUseData((int)ItemUseDataKey.wingMaterialItemID) != null
|
| | | || ItemModel.GetUseData((int)ItemUseDataKey.wingMaterialItemCount) != null)
|
| | | {
|
| | | for (int i = 0; i < ItemModel.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID).Count; i++)
|
| | | for (int i = 0; i < ItemModel.GetUseData((int)ItemUseDataKey.wingMaterialItemID).Count; i++)
|
| | | {
|
| | | dicWingUseDateValue.Add(ItemModel.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID)[i], ItemModel.GetUseDataModel((int)ItemUseDataKey.wingMaterialItemCount)[i]);
|
| | | dicWingUseDateValue.Add(ItemModel.GetUseData((int)ItemUseDataKey.wingMaterialItemID)[i], ItemModel.GetUseData((int)ItemUseDataKey.wingMaterialItemCount)[i]);
|
| | | }
|
| | | }
|
| | | if (ItemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue) != null)
|
| | | if (ItemModel.GetUseData((int)ItemUseDataKey.wingProgressValue) != null)
|
| | | {
|
| | | GetUseDateValue += ItemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue)[0];
|
| | | GetUseDateValue += ItemModel.GetUseData((int)ItemUseDataKey.wingProgressValue)[0];
|
| | | }
|
| | | int WingLv1 = ItemModel.config.LV;
|
| | | foreach (var key in dicWingUseDateValue.Keys)
|
| | |
| | |
|
| | | ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | |
|
| | | if (itemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue) != null)
|
| | | if (itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue) != null)
|
| | | {
|
| | | _currentRefining = itemModel.GetUseDataModel((int)ItemUseDataKey.wingProgressValue)[0];//当前精炼度
|
| | | _currentRefining = itemModel.GetUseData((int)ItemUseDataKey.wingProgressValue)[0];//当前精炼度
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | return 0;
|
| | | }
|
| | | var wingConfig = WingRefineExpConfig.Get(_wingItemDic[Index]);
|
| | | if (WingDic[Index].GetUseDataModel((int)ItemUseDataKey.wingProgressValue) != null || WingDic[Index].GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | if (WingDic[Index].GetUseData((int)ItemUseDataKey.wingProgressValue) != null || WingDic[Index].GetUseData((int)ItemUseDataKey.wingMaterialItemID) != null)
|
| | | {
|
| | | Max = wingConfig.EXPupper + GetWingRefiningValue(WingDic[Index]);
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | itemBaisc.countText.text = ConfirmCancel.iconHaveCnt.ToString();
|
| | | }
|
| | |
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(() =>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(ConfirmCancel.iconItemId);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | m_Items[i].gameObject.SetActive(special.items != null && i < special.items.Count);
|
| | | m_Items[i].cellBtn.RemoveAllListeners();
|
| | | m_Items[i].button.RemoveAllListeners();
|
| | | if (special.items != null && i < special.items.Count)
|
| | | {
|
| | | var award = special.items[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(award.id, true, (ulong)award.count);
|
| | | m_Items[i].Init(cellModel);
|
| | | m_Items[i].cellBtn.AddListener(() =>
|
| | | m_Items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(award.id, true, (ulong)award.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(attrData);
|
| | |
| | | float value = 0;
|
| | | if (ContainsProperty(itemConfig, 6, out value))
|
| | | {
|
| | | if (itemModel.GetUseDataModel(42) != null)
|
| | | if (itemModel.GetUseData(42) != null)
|
| | | {
|
| | | value += strengthengmodel.BackpackWings(itemModel.itemId, itemModel.GetUseDataModel(42)[0])[1];
|
| | | value += strengthengmodel.BackpackWings(itemModel.itemId, itemModel.GetUseData(42)[0])[1];
|
| | | }
|
| | | }
|
| | | properties[0].gameObject.SetActive(true);
|
| | |
| | | float value = 0;
|
| | | if (ContainsProperty(itemConfig, 6, out value))
|
| | | {
|
| | | if (itemModel.GetUseDataModel(42) != null)
|
| | | if (itemModel.GetUseData(42) != null)
|
| | | {
|
| | | value += strengthengmodel.BackpackWings(itemModel.itemId, itemModel.GetUseDataModel(42)[0])[1];
|
| | | value += strengthengmodel.BackpackWings(itemModel.itemId, itemModel.GetUseData(42)[0])[1];
|
| | | }
|
| | | }
|
| | | m_PreviewPropretys[0].gameObject.SetActive(true);
|
| | |
| | | private void GetMoney()
|
| | | {
|
| | | m_FairyJadeText.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_TieTheJadeText.text = UIHelper.GetMoneyCnt(2).ToString();
|
| | | }
|
| | |
|
| | |
|
| | | private void SelectButton()
|
| | | {
|
| | |
| | | UI3DModelExhibition.Instance.ShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | ItemCellModel ItemModel = new ItemCellModel(_weaponId,true,0);
|
| | | m_ItemCell.Init(ItemModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell.cellBtn.AddListener(()=> |
| | | m_ItemCell.button.RemoveAllListeners();
|
| | | m_ItemCell.button.AddListener(()=> |
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(_weaponId,false,1);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_Items[i].cellBtn.onClick.AddListener(() =>
|
| | | m_Items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnItemClick(_index);
|
| | | });
|
| | |
| | | var Item = ItemConfig.Get(items[type].itemId);
|
| | | ItemCellModel cellModel = new ItemCellModel(items[type].itemId, true, (ulong)items[type].itemCount);
|
| | | ItemCell.Init(cellModel);
|
| | | ItemCell.cellBtn.RemoveAllListeners();
|
| | | ItemCell.cellBtn.AddListener(() =>
|
| | | ItemCell.button.RemoveAllListeners();
|
| | | ItemCell.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(items[type].itemId, false, (ulong)items[type].itemCount);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | case 0:
|
| | | m_ItemCell_One.gameObject.SetActive(true);
|
| | | m_ItemCell_One.Init(cellModel);
|
| | | m_ItemCell_One.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_One.cellBtn.AddListener(() =>
|
| | | m_ItemCell_One.button.RemoveAllListeners();
|
| | | m_ItemCell_One.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | case 1:
|
| | | m_ItemCell_Two.gameObject.SetActive(true);
|
| | | m_ItemCell_Two.Init(cellModel);
|
| | | m_ItemCell_Two.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_Two.cellBtn.AddListener(() =>
|
| | | m_ItemCell_Two.button.RemoveAllListeners();
|
| | | m_ItemCell_Two.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | case 2:
|
| | | m_ItemCell_Three.gameObject.SetActive(true);
|
| | | m_ItemCell_Three.Init(cellModel);
|
| | | m_ItemCell_Three.cellBtn.RemoveAllListeners();
|
| | | m_ItemCell_Three.cellBtn.AddListener(() =>
|
| | | m_ItemCell_Three.button.RemoveAllListeners();
|
| | | m_ItemCell_Three.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | |
| | | for (int i = 0; i < m_Items.Length; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_Items[i].cellBtn.onClick.AddListener(() =>
|
| | | m_Items[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | OnItemClick(_index);
|
| | | });
|
| | |
| | | {
|
| | | [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;
|
| | |
| | | InvestReward reward = rewardlist[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(reward.id, false, reward.count);
|
| | | itemBaisc.Init(cellModel);
|
| | | itemBaisc.cellBtn.RemoveAllListeners();
|
| | | itemBaisc.cellBtn.AddListener(() =>
|
| | | itemBaisc.button.RemoveAllListeners();
|
| | | itemBaisc.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(reward.id, false, reward.count);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
| | | 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 不足
|
| | |
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(award.id, false, (ulong)award.count);
|
| | | m_Items[index].Init(cellModel);
|
| | | m_Items[index].cellBtn.RemoveAllListeners();
|
| | | m_Items[index].cellBtn.AddListener(() =>
|
| | | m_Items[index].button.RemoveAllListeners();
|
| | | m_Items[index].button.AddListener(() =>
|
| | | {
|
| | | TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
|
| | | ItemConfig itemConfig = ItemConfig.Get(award.id);
|
| | |
| | | m_RebateItems[i].gameObject.SetActive(true);
|
| | | ItemCellModel itemCell = new ItemCellModel(itemDate.itemId, true, (ulong)itemDate.count);
|
| | | m_RebateItems[i].Init(itemCell);
|
| | | m_RebateItems[i].cellBtn.RemoveAllListeners();
|
| | | m_RebateItems[i].cellBtn.AddListener(() =>
|
| | | m_RebateItems[i].button.RemoveAllListeners();
|
| | | m_RebateItems[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(itemDate.itemId, true, (ulong)itemDate.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | |
| | | ItemCellModel cellModel = new ItemCellModel((int)itemModel.ItemID,false ,(ulong)itemModel.Count, "",PackType.Deleted,
|
| | | false,ConfigParse.Analysis(itemModel.UserData));
|
| | | itemBaiscs[i].Init(cellModel);
|
| | | itemBaiscs[i].cellBtn.RemoveAllListeners();
|
| | | itemBaiscs[i].cellBtn.AddListener(()=>
|
| | | itemBaiscs[i].button.RemoveAllListeners();
|
| | | itemBaiscs[i].button.AddListener(()=>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData((int)itemModel.ItemID, false
|
| | | , (ulong)itemModel.Count,-1,false, PackType.Deleted,
|
| | |
| | | var _item = _items[i];
|
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, false, (ulong)_item.count);
|
| | | _cell.items[i].Init(_ItemData);
|
| | | _cell.items[i].cellBtn.RemoveAllListeners();
|
| | | _cell.items[i].cellBtn.AddListener(() =>
|
| | | _cell.items[i].button.RemoveAllListeners();
|
| | | _cell.items[i].button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_item.id, false, (ulong)_item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | |
| | | var _vipAward = model.m_VipItemDict[_cell.index];
|
| | | ItemCellModel _vipDate = new ItemCellModel(_vipAward.item.id, false, (ulong)_vipAward.item.count);
|
| | | _cell.vipItem.Init(_vipDate);
|
| | | _cell.vipItem.cellBtn.RemoveAllListeners();
|
| | | _cell.vipItem.cellBtn.AddListener(() =>
|
| | | _cell.vipItem.button.RemoveAllListeners();
|
| | | _cell.vipItem.button.AddListener(() =>
|
| | | {
|
| | | ItemAttrData _itemPropertyData = new ItemAttrData(_vipAward.item.id, false, (ulong)_vipAward.item.count);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(_itemPropertyData);
|
| | |
| | | var dict = singlePack.GetAllItems();
|
| | | foreach (var model in dict.Values)
|
| | | {
|
| | | var legendIds = model.GetUseDataModel((int)ItemUseDataKey.legendAttrID);
|
| | | var legendValues = model.GetUseDataModel((int)ItemUseDataKey.legendAttrValue);
|
| | | var legendIds = model.GetUseData((int)ItemUseDataKey.legendAttrID);
|
| | | var legendValues = model.GetUseData((int)ItemUseDataKey.legendAttrValue);
|
| | | if (legendIds != null && legendValues != null)
|
| | | {
|
| | | for(int i = 0; i < legendIds.Count; i++)
|
| | |
| | | {
|
| | | return PlayerDatas.Instance.baseData.diamond;
|
| | | }
|
| | | case 2:
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.bindDiamond;
|
| | | }
|
| | | case 3:
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.allCopper;
|