private void OnRefreshEquip(GameEventTypes eventType, object[] args) { if (GameConvert.IntConvert(args[0]) == 0) { SetInfo(); } }
private void OutputInfo() { string content = ""; listTrans.Clear(); int i = 0; for (i = 0; i < ballerGrid.transform.childCount; i++) { Transform child = ballerGrid.transform.GetChild(i); listTrans.Add(child); } listTrans.Sort(CompareItem); for (i = 0; i < listTrans.Count; i++) { Transform child = listTrans[i]; string vector = ""; float pox = child.transform.localPosition.x; float poy = child.transform.localPosition.y; vector = GameConvert.IntConvert(pox) + "," + GameConvert.IntConvert(poy); content += vector + ";"; } Debug.Log("-------POS-----: " + content); }
private void SetGemInfo() { GameObject child_gem; int gem_state; string gem_data_info = select_equip.gem1 + ";" + select_equip.gem2 + ";" + select_equip.gem3;; string[] gem_data_arr = gem_data_info.Split(';'); for (int i = 0; i < 3; i++) { child_gem = panel.gemInfo.GetChild(i).gameObject; gem_state = GameConvert.IntConvert(gem_data_arr[i]); GameObject suo = child_gem.transform.FindChild("suo").gameObject; UITexture icon = child_gem.transform.FindChild("icon").GetComponent <UITexture>(); suo.SetActive(gem_state == -1); icon.transform.gameObject.SetActive(gem_state > 0); if (gem_state > 0) { LoadSprite.LoaderItem(icon, gem_state.ToString(), false); } } }
/// <summary> /// 是否材料足够 /// </summary> private bool IsMaterials() { EquipStar star_info = EquipStarConfig.GetEquipStarInfo(cur_equip_info.id, cur_star_num); if (star_info == null || string.IsNullOrEmpty(star_info.cost)) { return(false); } string[] need_str_arr = star_info.cost.Split(';'); for (int i = 0; i < need_str_arr.Length; i++) { string[] info_arr = need_str_arr[i].Split(':'); int item_id = GameConvert.IntConvert(info_arr[0]); int need_num = GameConvert.IntConvert(info_arr[1]); int total_num = ItemManager.GetBagItemCount(item_id.ToString()); if (need_num > total_num) { return(false); } } return(true); }
//捐钱成功 public void onGuildDonateSucc(object val, Dictionary <string, object> data) { GuildMainMediator.mMyGuild.guildFunds = GameConvert.IntConvert(val); GuildMemberInfo info = ChangeMemberData(data); for (int i = 0; i < GuildMainMediator.mMyGuild.memberList.Count; i++) { GuildMemberInfo item = GuildMainMediator.mMyGuild.memberList[i]; if (item.id == info.id) { GuildMainMediator.mMyGuild.memberList.Remove(item); GuildMainMediator.mMyGuild.memberList.Add(info); } } if (GUIManager.HasView("guildmainpanel")) { GuildMainMediator.guildmainMediator.SetGuildFunds(); } if (GUIManager.HasView("guilddonationpanel")) { GuildDonationMediator.guilddonationMediator.SetDayDonateData(); GuildDonationMediator.guilddonationMediator.SetDonationInfo(); } }
//获取当前装备星级和强化等级 public void getStarAndStrongLv(object obj, object data) { int star = GameConvert.IntConvert(obj); int level = GameConvert.IntConvert(data); EquipMediator.equipMediator.RefreshOpenFunc(star, level); }
/// <summary> /// 消耗信息 /// </summary> private void SetCostInfo() { EquipStar star_info = EquipStarConfig.GetEquipStarInfo(cur_equip_info.id, cur_star_num); if (star_info == null || string.IsNullOrEmpty(star_info.cost)) { return; } string[] need_str_arr = star_info.cost.Split(';'); // 默认打开球队卡牌界面 List <object> listObj = new List <object>(); for (int i = 0; i < need_str_arr.Length; i++) { EquipCostInfo info = new EquipCostInfo(); string[] info_arr = need_str_arr[i].Split(':'); info.item_id = GameConvert.IntConvert(info_arr[0]); info.need_num = GameConvert.IntConvert(info_arr[1]); if (info.item_id == 0) { continue; } listObj.Add(info); } panel.costGrid.AddCustomDataList(listObj); }
//强化成功 public void strongUpEquipSucc(object val, Dictionary <string, object> list) { int card_id = GameConvert.IntConvert(val); EquipItemInfo info = new EquipItemInfo(); info.uuid = list["UUID"].ToString(); info.itemID = list["itemID"].ToString(); info.star = GameConvert.IntConvert(list["star"]); info.strongLevel = GameConvert.IntConvert(list["strongLevel"]); info.gem1 = GameConvert.IntConvert(list["gem1"]); info.gem2 = GameConvert.IntConvert(list["gem2"]); info.gem3 = GameConvert.IntConvert(list["gem3"]); EquipMediator.cur_equip = info; EquipConfig.RefreshEquipData(card_id, info); EquipStrongMediator.equipStrongMediator.SetInfo(info.star, info.strongLevel); GUIManager.SetPromptInfo(TextManager.GetUIString("UI2024"), null); //GetquipList(card_id); EquipMediator.equipMediator.RefreshOpenFunc(info.star, info.strongLevel); EquipMediator.equipMediator.SetEquipGridInfo(card_id); }
//公会开除 public void onKictOutSucc(object val) { int roleId = GameConvert.IntConvert(val); for (int i = 0; i < GuildMainMediator.mMyGuild.memberList.Count; i++) { GuildMemberInfo info = GuildMainMediator.mMyGuild.memberList[i]; if (info.id == roleId) { GuildMainMediator.mMyGuild.memberList.Remove(info); } } if (GUIManager.HasView("guildofficepanel")) { GuildOfficeMediator.guildOfficeMediator.SetMemberGridData(); } if (GUIManager.HasView("guilddonationpanel")) { GuildDonationMediator.guilddonationMediator.SetDayDonateData(); GuildDonationMediator.guilddonationMediator.SetDonationInfo(); } if (GUIManager.HasView("guildinteractpanel")) { GuildInteractMediator.guildinteractMediator.SetPowerGridDate(); } }
/// <summary> /// 装备继承返回 /// </summary> /// <param name="obj"></param> /// <param name="list"></param> public void returnInheritResult(object obj, List <object> list) { EquipItemInfo info = null; //id == 0 背包装备 id>0玩家装备 int card_id = GameConvert.IntConvert(obj); int play_id = 0; for (int i = 0; i < list.Count; ++i) { info = new EquipItemInfo(); Dictionary <string, object> Info = list[i] as Dictionary <string, object>; info.uuid = Info["UUID"].ToString(); info.itemID = Info["itemID"].ToString(); info.star = GameConvert.IntConvert(Info["star"]); info.strongLevel = GameConvert.IntConvert(Info["strongLevel"]); info.gem1 = GameConvert.IntConvert(Info["gem1"]); info.gem2 = GameConvert.IntConvert(Info["gem2"]); info.gem3 = GameConvert.IntConvert(Info["gem3"]); play_id = i == 0 ? card_id : 0; EquipConfig.RefreshEquipData(play_id, info); if (i == 0) { EquipMediator.cur_equip = info; } EquipMediator.equipMediator.SetEquipGridInfo(play_id); } EquipMediator.equipMediator.RefreshOpenFunc(info.star, info.strongLevel); }
//宝石镶嵌开槽卸下结果返回 public void returnGemResult(object obj, List <object> list) { EquipItemInfo info = null; //id == 0 背包装备 id>0玩家装备 int card_id = GameConvert.IntConvert(obj); for (int i = 0; i < list.Count; ++i) { info = new EquipItemInfo(); Dictionary <string, object> Info = list[i] as Dictionary <string, object>; info.uuid = Info["UUID"].ToString(); info.itemID = Info["itemID"].ToString(); info.star = GameConvert.IntConvert(Info["star"]); info.strongLevel = GameConvert.IntConvert(Info["strongLevel"]); info.gem1 = GameConvert.IntConvert(Info["gem1"]); info.gem2 = GameConvert.IntConvert(Info["gem2"]); info.gem3 = GameConvert.IntConvert(Info["gem3"]); } EquipConfig.RefreshEquipData(card_id, info); EquipMediator.cur_equip = info; EquipMediator.equipMediator.RefreshOpenFunc(info.star, info.strongLevel); Facade.SendNotification(NotificationID.GemChoose_Hide); }
/// <summary> /// 获取属性增加数据 /// </summary> /// <returns></returns> private List <EquipAddInfo> GetPropAddList() { EquipAddInfo info = null; string[] prop_arr = Define.EquipPropStr.Split(','); List <EquipAddInfo> list = new List <EquipAddInfo>(); for (int i = 0; i < prop_arr.Length; i++) { string prop_str = prop_arr[i]; int prop_value = GameConvert.IntConvert(cur_equip_info.GetType().GetField(prop_str).GetValue(cur_equip_info)); if (prop_value == 0) { continue; } info = new EquipAddInfo(); info.prop_name = prop_str; info.prop_base_value = prop_value; list.Add(info); } return(list); }
/// <summary> /// 设置属性信息 /// </summary> private void SetPropInfo() { float fight = 0; List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, int.Parse(select_equip.itemID), select_equip.star, select_equip.strongLevel); for (int i = 0; i < prop_list.Count; i++) { EquipAddInfo info = prop_list[i]; PropFightInfo prop_fight = PropChangeFightConfig.GetEquipInfo(info.prop_name); string prop_name_label = string.Format("prop_name_{0}", i.ToString()); UILabel prop_name = UtilTools.GetChild <UILabel>(panel.equipProp, prop_name_label); prop_name.text = TextManager.GetUIString(info.prop_name); string prop_txt_label = string.Format("prop_value_{0}", i.ToString()); UILabel cur_prop_txt = UtilTools.GetChild <UILabel>(panel.equipProp, prop_txt_label); float prop_value = GameConvert.FloatConvert((info.prop_base_value + info.prop_star_value + info.prop_strong_value)); //cur_prop_txt.text = prop_fight.IsPercent==0?prop_value.ToString():string.Format("{0}%", prop_value*100); cur_prop_txt.text = prop_value.ToString(); fight += PropChangeFightConfig.GetPropForFightValue(info.prop_name, prop_value); } UILabel fight_txt = UtilTools.GetChild <UILabel>(panel.equipProp, "fight_value"); fight_txt.text = GameConvert.IntConvert(fight).ToString(); }
/// <summary> /// 刷新可能合成晶体 /// </summary> /// <param name="notification"></param> private void GemRefresh(INotification notification) { if (GUIManager.HasView("gemcompoundpanel")) { int type = GameConvert.IntConvert((notification.Body as List <object>)[0]); Item data = (notification.Body as List <object>)[1] as Item; Item item = GetListItemData(data); if (item == null) { return; } BagChangeType change_type = (BagChangeType)Enum.Parse(typeof(Equip_Pos), (type).ToString()); ItemInfo info = ItemManager.GetItemInfo(item.itemID); if (info.tabType != (int)ItemType.Gem) { return; } if (item.amount < 3 || change_type == BagChangeType.Remove) { panel.chooseGrid.DeleteCustomData(item, true); } else if (change_type == BagChangeType.Update && item.amount > 2) { panel.chooseGrid.UpdateCustomData(item); } else if (change_type == BagChangeType.Add) { panel.chooseGrid.AddCustomData(item); panel.chooseGrid.UpdateCustomView(); } } }
//公会保护购买成功 public void onBuyGuildProtectSucc(object val) { GuildMainMediator.mMyGuild.protectTime = GameConvert.IntConvert(val); if (GuildTacticMediator.guildtacticMediator != null) { GuildTacticMediator.guildtacticMediator.SetCutOffTime(); } }
//公会顾问友好度 private GuildAdviser ChangeGuildAdviserData(Dictionary <string, object> data) { GuildAdviser info = new GuildAdviser(); info.id = GameConvert.IntConvert(data["dbid"]); info.friendliness = GameConvert.IntConvert(data["friendliness"]); return(info); }
//已经申请过的 公会ID public void onApplyGuildIDList(List <object> list) { GuildBaseConfig.mApplyGuildIdList.Clear(); for (int i = 0; i < list.Count; i++) { int guildId = GameConvert.IntConvert(list[i]); GuildBaseConfig.mApplyGuildIdList.Add(guildId); } GuildListMediator.guildlistMediator.RefreshApplyItem(); }
/// <summary> /// 脱掉装备成功 /// </summary> /// <param name="obj"></param> public void takeOffEquipSucc(object obj) { int card_id = GameConvert.IntConvert(obj); //GUIManager.SetPromptInfo(TextManager.GetUIString("UI2050"), null); Facade.SendNotification(NotificationID.EquipInformation_Hide); GetquipList(0); GetquipList(card_id); }
//公会刷新公会资金 public void onClientGuildFunds(object val) { int funds = GameConvert.IntConvert(val); GuildMainMediator.mMyGuild.guildFunds = funds; if (GUIManager.HasView("guildmainpanel")) { GuildMainMediator.guildmainMediator.SetGuildFunds(); } }
//顾问公会好友度转换 private AdviserGuildInfo ChangeAdviserGuildData(Dictionary <string, object> data) { AdviserGuildInfo info = new AdviserGuildInfo(); info.guildID = GameConvert.IntConvert(data["guildID"]); info.guildName = GameConvert.StringConvert(data["guildName"]); info.friendliness = GameConvert.IntConvert(data["friendliness"]); return(info); }
/// <summary> /// 刷新材料 /// </summary> /// <param name="notification"></param> private void RefreshBag(INotification notification) { if (GUIManager.HasView("equipmakepanel")) { int type = GameConvert.IntConvert((notification.Body as List <object>)[0]); if (type == (int)BagChangeType.Update || type == (int)BagChangeType.Remove) { SetCostInfo(); } } }
private void SetFuncs() { string uistring = "UI_Guildoffice" + GameConvert.IntConvert(mCurType); panel.state_label.text = TextManager.GetUIString(uistring); panel.applygrid.gameObject.SetActive(mCurType == Func_type.Apply); panel.membergrid.gameObject.SetActive(mCurType == Func_type.Member); panel.postgrid.gameObject.SetActive(mCurType == Func_type.Official); panel.menmber.gameObject.SetActive(mCurType == Func_type.Member); panel.apply.gameObject.SetActive(mCurType == Func_type.Apply); }
public override bool OnLoad(XmlNode node) { if (!base.OnLoad(node)) { return(false); } musicId = GameConvert.IntConvert(GetProp("MusicID")); return(true); }
//申请数据转换 private GuildApplyInfo ChangeApplyData(Dictionary <string, object> data) { GuildApplyInfo apply = new GuildApplyInfo(); apply.id = GameConvert.IntConvert(data["dbid"]); apply.playerName = GameConvert.StringConvert(data["playerName"]); apply.offical = GameConvert.IntConvert(data["offical"]); apply.level = GameConvert.IntConvert(data["level"]); apply.applyTime = GameConvert.DoubleConvert(data["applyTime"]); return(apply); }
//公会数据转换 private GuildInfo ChangeGuildInfo(Dictionary <string, object> data) { GuildInfo info = new GuildInfo(); info.id = GameConvert.IntConvert(data["dbid"]); info.guildName = GameConvert.StringConvert(data["guildName"]); info.camp = GameConvert.IntConvert(data["camp"]); info.level = GameConvert.IntConvert(data["level"]); info.count = GameConvert.IntConvert(data["count"]); info.leader = GameConvert.StringConvert(data["leader"]); return(info); }
//顾问数据转换 private AdviserInfo changeAdviserData(Dictionary <string, object> data) { AdviserInfo info = new AdviserInfo(); info.dbid = GameConvert.IntConvert(data["dbid"]); info.guildDBID = GameConvert.IntConvert(data["guidDBID"]); info.configID = GameConvert.IntConvert(data["configID"]); info.guilidName = GameConvert.StringConvert(data["guildName"]); info.friendliness = GameConvert.IntConvert(data["friendliness"]); return(info); }
//设置装备宝石信息 private void SetGemInfo() { m_holdInfo_list.Clear(); GameObject child_gem; int gem_state = -1; string[] gem_data_arr = gem_data_info.Split(';'); string[] need_hold_arr = cur_equip_info.needOpenHold.Split(';'); for (int i = 0; i < m_max_gem_num; i++) { child_gem = panel.gemInfo.GetChild(i).gameObject; gem_state = GameConvert.IntConvert(gem_data_arr[i]); string[] hold_need_data = need_hold_arr[i].Split(':'); HoldInfo hold_info = new HoldInfo(); hold_info.m_gem_id = gem_state; hold_info.m_index = i + 1; hold_info.m_info = gem_state > 0 ? GemItemConfig.GetGemItem(gem_state) : null; if (gem_state > 0) { hold_info.m_type = Hold_STATE.EQUIP; } else if (gem_state == 0) { hold_info.m_type = Hold_STATE.EMPTY; } else { int need_num = GameConvert.IntConvert(hold_need_data[1]); int has_num = ItemManager.GetBagItemCount(hold_need_data[0]); HoldInfo previous_info = null; if (i - 1 >= 0) { previous_info = m_holdInfo_list[i - 1]; } if (previous_info == null || previous_info.m_type == Hold_STATE.EQUIP || previous_info.m_type == Hold_STATE.EMPTY) { hold_info.m_type = has_num > need_num ? Hold_STATE.CAN_OPEN : Hold_STATE.MATERIAL_LOCK; } else { hold_info.m_type = Hold_STATE.NOT_OPEN_LOCK;//上一个孔没开启 } } SetGemItemInfo(child_gem, hold_info); m_holdInfo_list.Add(hold_info); } }
//公会升级成功 public void onGuildUpgradeSucc(object val, object val1) { int level = GameConvert.IntConvert(val); GuildMainMediator.mMyGuild.level = level; GuildMainMediator.mMyGuild.reputation = GameConvert.IntConvert(val1);; GUIManager.SetJumpText(TextManager.GetSystemString("ui_system_guild10")); if (GUIManager.HasView("guildmainpanel")) { GuildMainMediator.guildmainMediator.SetGuildReputation(); } }
//返回公会建筑信息 public void onClientGuildBuildInfo(Dictionary <string, object> data) { int id = GameConvert.IntConvert(data["id"]); GuildBuildInfo info = GuildBuildConfig.GetGuildBuildInfo(id); info.id = id; info.level = GameConvert.IntConvert(data["level"]); info.state = GameConvert.IntConvert(data["state"]); info.endTimes = GameConvert.LongConvert(data["endTime"]); if (GUIManager.HasView("guildmainpanel")) { GuildMainMediator.guildmainMediator.SetBuildInfo(info); } }
//成员数据转换 private GuildMemberInfo ChangeMemberData(Dictionary <string, object> data) { GuildMemberInfo info = new GuildMemberInfo(); info.id = GameConvert.IntConvert(data["dbid"]); info.playerName = GameConvert.StringConvert(data["playerName"]); info.power = GameConvert.IntConvert(data["power"]); info.level = GameConvert.IntConvert(data["level"]); info.offical = GameConvert.IntConvert(data["offical"]); info.dayDonate = GameConvert.IntConvert(data["dayDonate"]); info.weekDonate = GameConvert.IntConvert(data["weekDonate"]); info.sumDonate = GameConvert.IntConvert(data["sumDonate"]); info.onlineState = GameConvert.IntConvert(data["onlineState"]); return(info); }