/// <summary> /// 判断当前装备位置是不是可以强化 /// </summary> /// <param name="pos"></param> /// <returns></returns> public bool JudgeEquipPosCanStrengthen(GameCmd.EquipPos pos) { //部位的当前强化等级<主角当前等级 bool isStrengthMax = emgr.IsGridStrengthenMax(pos); bool moneyEnough = false; bool itemEnough = false; EquipDefine.LocalGridStrengthenData next = emgr.GetNextStrengthDataByPos(pos); if (next != null) { ClientMoneyType type = (ClientMoneyType)next.MoneyCostData.ID; uint num = next.MoneyCostData.Num; moneyEnough = MainPlayerHelper.GetMoneyNumByType(type) >= num; //满足下面要求的 道具 的数量 int matchItemNum = 0; for (int i = 0; i < next.ItemCostDatas.Count; i++) { uint itemID = next.ItemCostDatas[i].ID; uint itemNum = next.ItemCostDatas[i].Num; int holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(itemID); if (holdNum >= itemNum) { matchItemNum++; } } itemEnough = matchItemNum == next.ItemCostDatas.Count; } return(itemEnough && moneyEnough); }
public void OnPropetyClick(ClientMoneyType nType) { switch (nType) { case ClientMoneyType.Wenqian: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ExchangeMoneyPanel, data: nType); break; case ClientMoneyType.YuanBao: ReturnBackUIData[] returnData = new ReturnBackUIData[1]; returnData[0] = new ReturnBackUIData(); returnData[0].msgid = UIMsgID.eNone; returnData[0].panelid = this.m_currPanelID; returnData[0].param = null; UIPanelBase.PanelJumpData jumpData = new UIPanelBase.PanelJumpData(); jumpData.Tabs = new int[1]; jumpData.Tabs[0] = (int)(GameCmd.CommonStore) 4; DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MallPanel, jumpData: jumpData); break; case ClientMoneyType.Gold: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ExchangeMoneyPanel, data: nType); break; case ClientMoneyType.YinLiang: DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ExchangeMoneyPanel, data: nType); break; default: break; } }
public void Init(int nType) { m_nType = (ClientMoneyType)nType; string spriteName = ""; switch (m_nType) { case ClientMoneyType.Gold: spriteName = "tubiao_tong"; break; case ClientMoneyType.Wenqian: spriteName = "tubiao_yin"; break; case ClientMoneyType.YuanBao: spriteName = "tubiao_jin"; break; case ClientMoneyType.YinLiang: spriteName = "tubiao_yinliang"; break; } m_spriteIcon.spriteName = spriteName; m_spriteIcon.MakePixelPerfect(); // UIAtlas atlas = DataManager.Manager<UIManager>().GetAtlasByIconName(spriteName); // if (atlas != null) // { // m_spriteIcon.atlas = atlas; // // } Refersh(); }
public static int GetMoneyNumByType(ClientMoneyType type) { IPlayer player = ClientGlobal.Instance().MainPlayer; int num = 0; if (player != null) { switch (type) { case ClientMoneyType.Wenqian: num = player.GetProp((int)PlayerProp.Money); break; case ClientMoneyType.Gold: num = player.GetProp((int)PlayerProp.Coupon); break; case ClientMoneyType.YuanBao: num = player.GetProp((int)PlayerProp.Cold); break; case ClientMoneyType.FishingMoney: num = player.GetProp((int)PlayerProp.FishingMoney); break; case ClientMoneyType.YinLiang: num = player.GetProp((int)PlayerProp.YinLiang); break; } } return(num); }
public static uint GetItemIDByClientMoneyType(ClientMoneyType type) { switch (type) { case ClientMoneyType.Gold: return(60001); case ClientMoneyType.Wenqian: return(60002); case ClientMoneyType.YuanBao: return(60003); case ClientMoneyType.JiFen: return(60008); case ClientMoneyType.ShengWang: return(60005); case ClientMoneyType.ChengJiuDian: return(600012); case ClientMoneyType.ZhenYingZhanJiFen: return(60011); case ClientMoneyType.YinLiang: return(60016); default: return(0); } }
public static int GetNum(ClientMoneyType nType) { Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; if (player == null) { return(0); } int type = 0; if (nType == ClientMoneyType.Wenqian) { type = (int)Client.PlayerProp.Money; } else if (nType == ClientMoneyType.Gold) { type = (int)Client.PlayerProp.Coupon; } else if (nType == ClientMoneyType.YuanBao) { type = (int)Client.PlayerProp.Cold; } else if (nType == ClientMoneyType.JiFen) { type = (int)Client.PlayerProp.Score; } else if (nType == ClientMoneyType.ShengWang) { type = (int)Client.PlayerProp.Reputation; } else if (nType == ClientMoneyType.YinLiang) { type = (int)Client.PlayerProp.YinLiang; } else if (nType == ClientMoneyType.FishingMoney) { type = (int)Client.PlayerProp.FishingMoney; } else if (nType == ClientMoneyType.HuntingCoin) { type = (int)Client.PlayerProp.ShouLieScore; } else if (nType == ClientMoneyType.ChengJiuDian) { type = (int)Client.PlayerProp.AchievePoint; } else if (nType == ClientMoneyType.ZhenYingZhanJiFen) { type = (int)Client.PlayerProp.CampCoin; } if (type == 0) { return(0); } return(player.GetProp(type)); }
public void ShowExchange(string des, ClientMoneyType nType, string title = "", string confirmTxt = "", string cancelTxt = "") { TipsManager.Instance.ShowTipWindow(Client.TipWindowType.CancelOk , des , () => { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ExchangeMoneyPanel, data: nType); } , null, null , title, confirmTxt, cancelTxt); }
protected override void OnShow(object data) { base.OnShow(data); if (data != null) { CostMoneyType = ClientMoneyType.YuanBao; if (data is ClientMoneyType) { ShowByMoneyType((ClientMoneyType)data); } } }
protected override void OnJump(UIPanelBase.PanelJumpData jumpData) { if (null == jumpData) { jumpData = new PanelJumpData(); } if (null != jumpData.Param && jumpData.Param is uint) { uint type = (uint)jumpData.Param; ToMoneyType = (ClientMoneyType)type; ShowByMoneyType(ToMoneyType); } }
public static bool IsHasEnoughMoney(uint type, uint needMoney, bool bShowTips = true) { ClientMoneyType ct = (ClientMoneyType)Enum.ToObject(typeof(ClientMoneyType), type); if (ct != null) { return(IsHasEnoughMoney(ct, needMoney, bShowTips)); } else { Log.Error("ClientMoneyType enum parse error type is{0}", type.ToString()); } return(false); //EntitySystem.EntityHelper.GetEntity(0); }
public static CurrencyIconData GetCurrencyIconByMoneyType(ClientMoneyType type) { if (null == m_dicCacheIconData) { m_dicCacheIconData = new Dictionary <int, CurrencyIconData>(); } int moneyType = (int)type; CurrencyIconData data = null; if (!m_dicCacheIconData.TryGetValue(moneyType, out data)) { string stringKeys = GameTableManager.Instance.GetGlobalConfig <string>(CONST_CURRENCY_ICON, ((uint)type).ToString()); if (!string.IsNullOrEmpty(stringKeys)) { string[] args = stringKeys.Split('|'); if (args.Length != 2 || string.IsNullOrEmpty(args[0])) { Engine.Utility.Log.Error("全局配置表中的货币图标参数无法解析"); } else { data = new CurrencyIconData(); data.type = type; data.smallIconName = args[0]; data.SmallIconAtlasID = DataManager.Manager <UIManager>().GetResIDByFileName(true, args[0]); if (args[1] != "") { uint itemID = 0; if (uint.TryParse(args[1], out itemID)) { ItemDataBase item = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemID); if (item != null) { data.itemID = itemID; data.bigIconName = item.itemIcon; data.BigIconAtlasID = DataManager.Manager <UIManager>().GetResIDByFileName(true, item.itemIcon); } } } m_dicCacheIconData.Add(moneyType, data); } } } return(data); }
public static string GetMoneyIconByType(ClientMoneyType type) { if (type == ClientMoneyType.Wenqian) { return("tubiao_huobi_yin"); } else if (type == ClientMoneyType.Gold) { return("tubiao_huobi_tong"); } else if (type == ClientMoneyType.YuanBao) { return("tubiao_huobi_jin"); } else if (type == ClientMoneyType.YinLiang) { return("tubiao_huobi_yinliang"); } return("tubiao_huobi_jin"); }
void CostByMoneyType(ClientMoneyType type) { CostMoneyType = type; UpdatePurchaseNum(1); int haveYuanBaoNum = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.YuanBao); int haveWenQianNum = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.Wenqian); int haveYinLiangNum = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.YinLiang); CurrencyIconData iconData = CurrencyIconData.GetCurrencyIconByMoneyType(type); if (iconData != null) { UIManager.GetAtlasAsyn(iconData.smallIconName, ref m_priceAsynSeed, () => { if (null != m_sprite_CostIcon) { m_sprite_CostIcon.atlas = null; } }, m_sprite_CostIcon); } m_btn_YuanBao.GetComponent <UIToggle>().value = type == ClientMoneyType.YuanBao; m_btn_YinLiang.GetComponent <UIToggle>().value = type == ClientMoneyType.YinLiang; }
public void ShowByMoneyType(ClientMoneyType type) { m_trans_ChangeGoldRoot.gameObject.SetActive(type == ClientMoneyType.Gold); MaxInputNum = type == ClientMoneyType.Gold ? MaxYuanBaoToGold : MaxYuanBaoToYinLiang; CurrencyIconData iconData = CurrencyIconData.GetCurrencyIconByMoneyType(type); if (iconData != null) { UIManager.GetAtlasAsyn(iconData.smallIconName, ref m_priceAsynSeed_2, () => { if (null != m_sprite_MoneyIcon) { m_sprite_MoneyIcon.atlas = null; } }, m_sprite_MoneyIcon); } ToMoneyType = type; if (type == ClientMoneyType.YinLiang) { m_label_name.text = "兑换银两"; CostMoneyType = ClientMoneyType.YuanBao; } else if (type == ClientMoneyType.Wenqian) { m_label_name.text = "兑换绑元"; CostMoneyType = ClientMoneyType.YuanBao; } else { m_label_name.text = "兑换金币"; CostMoneyType = ClientMoneyType.YuanBao; } CostByMoneyType(CostMoneyType); }
public void ShowExchange(uint errorNo, ClientMoneyType nType, string title = "", string confirmTxt = "", string cancelTxt = "") { ShowExchange(DataManager.Manager <TextManager>().GetLocalText((int)errorNo) , nType, title, confirmTxt, cancelTxt); }
void SetSelectGrid(int index) { if (index < m_lstTransfers.Count) { TransferData m_data = m_lstTransfers[index]; if (m_data != null) { if (m_data.isNpc) { TransferDatabase transferdata = GameTableManager.Instance.GetTableItem <TransferDatabase>(m_data.tabID); if (!KHttpDown.Instance().SceneFileExists(transferdata.mapid)) { //打开下载界面 DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel); HideSelf(); return; } NetService.Instance.Send(new stDialogSelectScriptUserCmd_C() { step = m_data.step, dwChose = m_data.btnIndex, }); } else { TransferDatabase transferdata = GameTableManager.Instance.GetTableItem <TransferDatabase>(m_data.tabID); if (transferdata == null) { return; } string strMsg = string.Format("是否花费 [ff0000]{0}{1}[-] 传送到{2}", transferdata.costValue, ((ClientMoneyType)transferdata.costType).GetEnumDescription(), transferdata.strTransmitMap); TipsManager.Instance.ShowTipWindow(Client.TipWindowType.CancelOk, strMsg, delegate() { DataManager.Manager <TeamDataManager>().TeamMemberCheckAndCancelFollow();//取消队员跟随 Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem(); if (cs != null) { cs.GetCombatRobot().Stop();// 停止挂机 } ClientMoneyType montype = (ClientMoneyType)transferdata.costType; if (MainPlayerHelper.IsHasEnoughMoney(montype, transferdata.costValue)) { Client.IMapSystem mapsys = Client.ClientGlobal.Instance().GetMapSystem(); if (mapsys != null) { if (mapsys.GetMapID() == transferdata.mapid) { //你就在这个场景 TipsManager.Instance.ShowTipsById(514); return; } //httpdown if (!KHttpDown.Instance().SceneFileExists(transferdata.mapid)) { //打开下载界面 DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel); return; } mapsys.RequestEnterMap(transferdata.mapid, 1); HideSelf(); } } }); } } } }
public static bool IsHasEnoughMoney(ClientMoneyType type, uint needMoney, bool bShowTips = true) { IPlayer player = ClientGlobal.Instance().MainPlayer; if (player != null) { if (type == ClientMoneyType.Wenqian) { int num = player.GetProp((int)PlayerProp.Money); if (num >= needMoney) { return(true); } else { if (bShowTips) { TipsManager.Instance.ShowTipsById(3); } } } else if (type == ClientMoneyType.Gold) { int num = player.GetProp((int)PlayerProp.Coupon); if (num >= needMoney) { return(true); } else { if (bShowTips) { TipsManager.Instance.ShowTipsById(4); } } } else if (type == ClientMoneyType.YuanBao) { int num = player.GetProp((int)PlayerProp.Cold); if (num >= needMoney) { return(true); } else { if (bShowTips) { TipsManager.Instance.ShowTipsById(5); } } } else if (type == ClientMoneyType.YinLiang) { int num = player.GetProp((int)PlayerProp.YinLiang); if (num >= needMoney) { return(true); } else { if (bShowTips) { TipsManager.Instance.ShowTipsById(5); } } } } return(false); }