public void OnSureBtnClick() { if (string.IsNullOrEmpty(InputLabel.value)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_EMPTY")); //MenuManager.Warning("ID_INPUT_EMPTY"); return; } if (InputLabel.value.IndexOf(" ") >= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_CONTAINS_SPACE")); //MenuManager.Warning("ID_INPUT_CONTAINS_SPACE"); return; } if (InputLabel.value.IndexOf("\n") >= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_CONTAINS_NEWLINE")); //MenuManager.Warning("ID_INPUT_CONTAINS_NEWLINE"); return; } if (InputLabel.value.Equals(LTGameSettingController.GetPlayerName())) { MessageTemplateManager.ShowMessage(901023); return; } if (isHadRename && BalanceResourceUtil.GetUserDiamond() < (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("changeNameCost")) { BalanceResourceUtil.HcLessMessage(); return; } if (!isRandomName && (!EB.ProfanityFilter.Test(InputLabel.value) || !IsNormalName(InputLabel.value))) { MessageDialog.Show(EB.Localizer.GetString("ID_MESSAGE_TITLE_STR"), EB.Localizer.GetString("ID_NAME_ILLEGEL"), EB.Localizer.GetString("ID_MESSAGE_BUTTON_STR"), null, false, true, true, null, NGUIText.Alignment.Center); return; } LoadingSpinner.Show(); var req = controller.transform.GetComponent <UIServerRequest>(); req.parameters[0].parameter = InputLabel.value; req.SendRequest(); }
public override void SetMenuData(object param) { base.SetMenuData(param); Hashtable ht = param as Hashtable; mAddWay = (eFriendAddWay)ht["addWay"]; mUid = (long)ht["uid"]; mCallback = (System.Action)ht["callback"]; VerifyLabel.text = EB.Localizer.GetString("ID_codefont_in_FriendApplyController_724") + LTGameSettingController.GetPlayerName(); }
public void OnSearchBtnClick() { string str = string.Empty; if (string.IsNullOrEmpty(InputLabel.value)) { str = EB.Localizer.GetString("ID_INPUT_EMPTY"); } if (InputLabel.value.IndexOf(" ") >= 0) { str = EB.Localizer.GetString("ID_INPUT_CONTAINS_SPACE"); } if (InputLabel.value.IndexOf("\n") >= 0) { str = EB.Localizer.GetString("ID_INPUT_CONTAINS_NEWLINE"); } if (!string.IsNullOrEmpty(str)) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_4, str); return; } if (InputLabel.value.IndexOf('#') == 0 && InputLabel.value.Length >= 2) { int uid; int.TryParse(InputLabel.value.Substring(1), out uid); long localUid = AllianceUtil.GetLocalUid(); if (uid == localUid) { MessageTemplateManager.ShowMessage(FriendManager.CodeCouldNotFindSelf); return; } } else if (InputLabel.value == LTGameSettingController.GetPlayerName()) { MessageTemplateManager.ShowMessage(FriendManager.CodeCouldNotFindSelf); return; } FriendManager.Instance.Search(InputLabel.value, delegate(Hashtable result) { if (result != null && result.Count > 0) { object searchResult = EB.Dot.Object("friendsInfo.search", result, null); if (searchResult != null) { List <RecommendFriendData> searchList = new List <RecommendFriendData>(); searchList = Hotfix_LT.EBCore.Dot.List <RecommendFriendData, long>(null, searchResult, searchList, delegate(object value, long uid) { RecommendFriendData friend = new RecommendFriendData(); friend.Uid = EB.Dot.Long("uid", value, friend.Uid); friend.Name = EB.Dot.String("name", value, friend.Name); friend.Level = EB.Dot.Integer("level", value, friend.Level); friend.Head = EB.Dot.String("portrait", value, friend.Head); friend.Skin = EB.Dot.Integer("skin", value, friend.Skin); friend.Frame = EB.Dot.String("headFrame", value, friend.Frame); friend.Fight = EB.Dot.Integer("battleRating", value, friend.Fight); friend.AlliName = EB.Dot.String("allianceName", value, friend.AlliName); friend.OfflineTime = EB.Dot.Single("offlineTime", value, friend.OfflineTime); friend.IsFriend = EB.Dot.Bool("isFriend", value, friend.IsFriend); friend.Desc = EB.Dot.String("desc", value, friend.Desc); return(friend); }); RecommendDynamicScroll.SetItemDatas(searchList.ToArray()); SearchTipLabel.text = SearchTipLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_codefont_in_ShowFriendSearchContent_4033"); } } else { MessageTemplateManager.ShowMessage(FriendManager.CodeHasNotPlayer); } }); }