public void OnClose(ButtonScript obj, object args, int param1, int param2) { OpenPanelAnimator.CloseOpenAnimation(this.panel, () => { FriendSystem.Instance().isOpenFried = false; Hide(); }); }
public void OnFriendCell(ButtonScript obj, object args, int param1, int param2) { obj.GetComponent <UISprite>().MarkOff(); //recomPane.gameObject.SetActive (false); blackPane.gameObject.SetActive(false); chatLisPane.gameObject.SetActive(true); if (_selectFriendBtn != null) { _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlan"; } _selectFriendBtn = obj.gameObject; _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlanliang"; if (obj.GetComponent <FriendItem> ().ContactInfo == null) { return; } _selectFriend = obj.GetComponent <FriendItem> ().ContactInfo; if (FriendSystem.Instance().NoChatDict.ContainsKey(_selectFriend.name_)) { offTabBtn.GetComponentInChildren <UISprite>().MarkOff(); FriendSystem.Instance().NoChatDict.Remove(_selectFriend.name_); } //if(obj.GetComponent<FriendItem> ().red.gameObject.activeSelf) //{ //obj.GetComponent<FriendItem> ().red.gameObject.SetActive(false); UpdateChatList(_selectFriend); //} }
private void OnAddFriendList(ButtonScript obj, COM_ContactInfo info) { if (info == null) { return; } if (FriendSystem.Instance().GetFriend(info.instId_) != null) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("alreadyhave"), null, true); return; } if (FriendSystem.Instance().friends_.Count >= 100) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addfriend").Replace("{n}", info.name_), () => { NetConnection.Instance.addFriend(info.instId_); }); }
private void OnAddFriendFun(ButtonScript obj, object args, int param1, int param2) { funPane.gameObject.SetActive(false); if (_selectFriend == null) { return; } if (FriendSystem.Instance().GetFriend(_selectFriend.instId_) != null) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("alreadyhave"), null, true); return; } int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addfriend").Replace("{n}", _selectFriend.name_), () => { NetConnection.Instance.addFriend(_selectFriend.instId_); }); }
void OnClickJHY(ButtonScript obj, object args, int param1, int param2) { if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Friend)) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyouWeikai")); } else if (!(((PlayerInst.openSubSystemFlag_) & (0x1 << (int)OpenSubSystemFlag.OSSF_Friend)) != 0)) { PopText.Instance.Show(LanguageManager.instance.GetValue("Duifanghaoyou")); } else { if (FriendSystem.Instance().IsmyFriend((int)PlayerInst.instId_)) { PopText.Instance.Show(LanguageManager.instance.GetValue("alreadyhave")); } else { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } NetConnection.Instance.addFriend((uint)PlayerInst.instId_); } gameObject.SetActive(false); } }
void OnClickAddBtn(ButtonScript obj, object args, int param1, int param2) { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } NetConnection.Instance.addFriend(WishingTreeSystem._Wish.playerInstId_); }
public void UpdataBlackList() { if (!leftPane.gameObject.activeSelf) { return; } foreach (GameObject o in friendCellList) { friendGrild.RemoveChild(o.transform); o.transform.parent = null; GameObject.Destroy(o); } friendCellList.Clear(); friendGrild.RemoveChild(blackBtn.transform); blackBtn.transform.parent = null; friendGrild.AddChild(blackBtn.transform, 1); //blackBtn.transform.parent = friendGrild.transform; blackBtn.SetActive(true); blackBtn.transform.localScale = Vector3.one; UIManager.SetButtonEventHandler(blackBtn.gameObject, EnumButtonEvent.OnClick, OnInitBlack, 0, 0); int indx = friendGrild.GetIndex(blackBtn.transform); foreach (COM_ContactInfo f in FriendSystem.Instance().blacks_) { GameObject obj = Object.Instantiate(friendCell.gameObject) as GameObject; obj.SetActive(true); FriendItem cellUI = obj.GetComponent <FriendItem>(); cellUI.ContactInfo = f; if (FriendSystem.Instance().ChatDict.ContainsKey(f.name_)) { cellUI.red.gameObject.SetActive(true); } else { cellUI.red.gameObject.SetActive(false); } cellUI.IsBlack(true); cellUI.delCallBack = OnCellDelBlack; friendGrild.AddChild(obj.transform, ++indx); friendCellList.Add(obj); obj.transform.localScale = Vector3.one; } friendGrild.Reposition(); }
protected override void DoHide() { FriendSystem.Instance().UpdateFriend -= OnUpdataFriendList; FriendSystem.Instance().UpdateBlack -= OnUpdataBlackList; FriendSystem.Instance().FriendChat -= OnFriendChat; FriendSystem.Instance().FindFriendOkEvent -= FindFriendOk; FriendSystem.Instance().FindFriendFail -= FindFriendFail; FriendSystem.Instance().UpdateOffen -= OnUpdateOffens; FriendSystem.Instance().recommendEvent -= OnRecommendEvent; ChartsSystem.QueryPlayerEventOk -= OnQueryPlayer; FriendSystem.Instance().friendOnLineEvent -= OnLineEvent; base.DoHide(); }
private void OnAddBlackList(ButtonScript obj, COM_ContactInfo info) { if (info == null) { return; } if (FriendSystem.Instance().GetBlack(info.instId_) != null) { MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("alreadyhaveback"), null, true); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addback").Replace("{n}", info.name_), () => { NetConnection.Instance.addBlacklist(info.instId_); }); }
private void OnFriendBtn(ButtonScript obj, object args, int param1, int param2) { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addfriend").Replace("{n}", PlayerInfo.instName_), () => { NetConnection.Instance.addFriend(PlayerInfo.instId_); }); }
public override void Destroyobj() { hasDestroy_ = true; TeamSystem.OnChangejoinL -= ShowUIPanel; TeamSystem.OnExitIteam -= ExitIteamOk; TeamSystem.OnCreateTeam -= CreateTeamOk; TeamSystem.OnChangeTeam -= ChangeTeamOk; TeamSystem.OnUpdateTeamMB -= UpdateTeamMBOk; TeamSystem.OnLeaderChange -= changeLeaderOk; TeamSystem.OnDelMenber -= DeTeamMunber; FriendSystem.Instance().UpdateFriend -= OnUpdataFriendList; TeamSystem.OnUpdateMemStateUI -= UpdatememberState; //UpdateMemberPositionUIOk = null; //AssetInfoMgr.Instance.DecRefCount(GlobalInstanceFunction.Instance.GetAssetsName((int)UIASSETS_ID.UIASSETS_TeamPanel, AssetLoader.EAssetType.ASSET_UI), true); }
void OnRecommendEvent(int id) { if (_findFriendCellList.Count > 0) { foreach (GameObject i in _findFriendCellList) { recomGrid.RemoveChild(i.transform); i.gameObject.transform.parent = null; i.gameObject.SetActive(false); _findFriendCellPool.Add(i); } _findFriendCellList.Clear(); } COM_ContactInfo[] rcmfriends = FriendSystem.Instance().RecommendFriends; foreach (COM_ContactInfo req in rcmfriends) { GameObject objCell = null; if (_findFriendCellPool.Count > 0) { objCell = _findFriendCellPool[0]; //objCell.SetActive(true); FriendRecommendCell cellUI = objCell.GetComponent <FriendRecommendCell>(); _findFriendCellPool.Remove(objCell); } else { objCell = Object.Instantiate(recomCell.gameObject) as GameObject; } if (objCell != null) { FriendRecommendCell cellUI1 = objCell.GetComponent <FriendRecommendCell>(); cellUI1.ContactInfo = req; cellUI1.level_.text = req.level_.ToString(); //cellUI1.icon.spriteName = req //recomGrid.AddChild(objCell.transform); objCell.transform.parent = recomGrid.transform; objCell.SetActive(true); cellUI1.callBack = OnAddFriendList; objCell.transform.localScale = Vector3.one; _findFriendCellList.Add(objCell); } } recomGrid.Reposition(); }
private void OnClickJHY(ButtonScript obj, object args, int param1, int param2) { if (FriendSystem.Instance().IsmyFriend((int)SimplePInst.instId_)) { PopText.Instance.Show(LanguageManager.instance.GetValue("AlreadyUrFirend")); } else { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } NetConnection.Instance.addFriend(SimplePInst.instId_); } }
void OnClickHy(ButtonScript obj, object args, int param1, int param2) { if (FriendSystem.Instance().IsmyFriend(uId)) { PopText.Instance.Show(LanguageManager.instance.GetValue("alreadyhave")); } else { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } NetConnection.Instance.addFriend((uint)uId); } gameObject.SetActive(false); }
void OnClickHy(ButtonScript obj, object args, int param1, int param2) { COM_SimplePlayerInst _player = TeamSystem.GetTeamMemberByInsId(param1); if (FriendSystem.Instance().IsmyFriend((int)_player.instId_)) { LanguageManager.instance.GetValue("alreadyhave"); } else { int fMax = 0; GlobalValue.Get(Constant.C_FriendMax, out fMax); if (FriendSystem.Instance().friends_.Count >= fMax) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } NetConnection.Instance.addFriend(_player.instId_); } }
private void OnFunBtn(GameObject obj, COM_ContactInfo info) { if (info == null) { return; } if (_selectFriendBtn != null) { _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlan"; } _selectFriendBtn = obj; _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlanliang"; _selectFriend = info; if (FriendSystem.Instance().offens_.Contains(_selectFriend) && !FriendSystem.Instance().friends_.Contains(_selectFriend)) { funAddFriend.gameObject.SetActive(true); } else { funAddFriend.gameObject.SetActive(false); } funPane.gameObject.SetActive(true); if (TeamSystem.IsInTeam() && TeamSystem.IsTeamLeader()) { ctlTeamBtn.gameObject.GetComponentInChildren <UILabel>().text = LanguageManager.instance.GetValue("yaoqingrudui"); } else { if (TeamSystem.IsInTeam()) { ctlTeamBtn.gameObject.GetComponentInChildren <UILabel>().text = LanguageManager.instance.GetValue("haoyoushenqingrudui");; } } funBtns.transform.position = new Vector3(funBtns.transform.position.x, obj.gameObject.transform.position.y, 0f); }
void Start() { //setdepth (); item.SetActive(false); btns.Add(HaoYouBtn); btns.Add(JiaZuBtn); btns.Add(FuJinBtn); UIManager.SetButtonEventHandler(HaoYouBtn.gameObject, EnumButtonEvent.OnClick, OnClicHaoY, 0, 0); UIManager.SetButtonEventHandler(FuJinBtn.gameObject, EnumButtonEvent.OnClick, OnClicHaoY, 2, 0); UIManager.SetButtonEventHandler(JiaZuBtn.gameObject, EnumButtonEvent.OnClick, OnClicHaoY, 1, 0); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnClicClose, 0, 0); foreach (COM_ContactInfo cinfo in FriendSystem.Instance().friends_) { friendList.Add(cinfo); } foreach (Avatar op in Prebattle.Instance.otherAvatarContainer_.Values) { otherPlayer.Add(op); } TabsSelect(0); SwitchMembers(0); }
private void UpdateLatelyList() { foreach (GameObject o in _offCellList) { offGrid.RemoveChild(o.transform); // o.transform.transform = null; GameObject.Destroy(o); } _offCellList.Clear(); foreach (COM_ContactInfo f in FriendSystem.Instance().offens_) { GameObject obj = Object.Instantiate(friendCell.gameObject) as GameObject; obj.SetActive(true); FriendItem cellUI = obj.GetComponent <FriendItem>(); cellUI.ContactInfo = f; if (FriendSystem.Instance().NoChatDict.ContainsKey(f.name_)) { //cellUI.red.gameObject.SetActive(true); cellUI.GetComponent <UISprite>().MarkOn(UISprite.MarkAnthor.MA_RightTop, -20, -130); } else { cellUI.GetComponent <UISprite>().MarkOff(); //cellUI.red.gameObject.SetActive(false); } cellUI.IsBlack(false); UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnFriendCell, 0, 0); cellUI.callBack = OnFunBtn; offGrid.AddChild(obj.transform); _offCellList.Add(obj); obj.transform.localScale = Vector3.one; } offGrid.Reposition(); }
private void OnCtlBlackBtn(ButtonScript obj, object args, int param1, int param2) { if (_selectFriend == null) { return; } if (FriendSystem.Instance().blacks_.Count >= 100) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } if (FriendSystem.Instance().blacks_.Count >= 100) { PopText.Instance.Show(LanguageManager.instance.GetValue("haoyoumax")); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addback").Replace("{n}", _selectFriend.name_), () => { NetConnection.Instance.addBlacklist(_selectFriend.instId_); }); funPane.gameObject.SetActive(false); }
void InitPlayerInfo() { nameLab.text = _splayerInst.instName_; levelLab.text = _splayerInst.properties_[(int)PropertyType.PT_Level] + ""; zhiyeb.text = Profession.get((JobType)_splayerInst.properties_[(int)PropertyType.PT_Profession], (int)_splayerInst.properties_[(int)PropertyType.PT_ProfessionLevel]).jobName_; int weapon = GlobalInstanceFunction.Instance.WeaponID(_splayerInst); int weaponAssetid = 0; ItemData wep = ItemData.GetData(weapon); if (wep != null) { weaponAssetid = wep.weaponEntityId_; } GameManager.Instance.GetActorClone((ENTITY_ID)_splayerInst.properties_[(int)PropertyType.PT_AssetId], (ENTITY_ID)weaponAssetid, EntityType.ET_Player, AssetLoadCallBack, null, "UI", GlobalInstanceFunction.Instance.GetDressId(_splayerInst.equips_)); float idd = _splayerInst.properties_ [(int)PropertyType.PT_AssetId]; for (int i = 0; i < eql.Count; i++) { if (eql[i] != null) { eql[i].SetActive(false); // UITexture te = equips[i].GetComponent<UITexture>(); // te.mainTexture = null; } } for (int i = 0; i < _splayerInst.equips_.Length; i++) { if (_splayerInst.equips_[i] != null) { HeroEquipCellUI hec = eql[_splayerInst.equips_[i].slot_].GetComponent <HeroEquipCellUI>(); hec.Equip = _splayerInst.equips_[i]; // UITexture te = equips[_splayerInst.equips_[i].slot_].GetComponent<UITexture>(); // HeadIconLoader.Instance.LoadIcon (ItemData.GetData((int)_splayerInst.equips_[i].itemId_).icon_, te); } else { //equips[i].gameObject.SetActive(false); } } for (int i = 0; i < employes.Count; i++) { employes[i].gameObject.SetActive(false); } for (int i = 0; i < babeis.Count; i++) { babeis[i].gameObject.SetActive(false); } for (int i = 0; i < _splayerInst.battleEmps_.Length; i++) { //nas = = employes[i].gameObject.SetActive(true); employes[i].transform.Find("icon").GetComponent <UISprite>().spriteName = EmployessSystem.instance.GetQualityBack((int)_splayerInst.battleEmps_[i].quality_); employes[i].transform.Find("name").GetComponent <UILabel>().text = _splayerInst.battleEmps_[i].instName_; UISprite sp = employes[i].transform.FindChild("icon").FindChild("zhiye").GetComponent <UISprite>(); sp.spriteName = Profession.get((JobType)_splayerInst.battleEmps_[i].properties_[(int)PropertyType.PT_Profession], (int)_splayerInst.battleEmps_[i].properties_[(int)PropertyType.PT_ProfessionLevel]).jobtype_.ToString(); //employes[i].transform.Find("pross").GetComponent<UILabel>().text = LanguageManager.instance.GetValue(((JobType)_splayerInst.battleEmps_[i].properties_[(int)PropertyType.PT_Profession]).ToString()); UITexture tex1 = employes[i].transform.Find("icon").Find("icon").GetComponent <UITexture>(); HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)_splayerInst.battleEmps_[i].properties_[(int)PropertyType.PT_AssetId]).assetsIocn_, tex1); } for (int i = 0; i < _splayerInst.babies1_.Length; i++) { babeis[i].gameObject.SetActive(true); UITexture tex = babeis[i].transform.FindChild("icon").GetComponent <UITexture>(); HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)_splayerInst.babies1_[i].properties_[(int)PropertyType.PT_AssetId]).assetsIocn_, tex); UITexture tex1 = babeis[i].transform.FindChild("zhongzuIocn").GetComponent <UITexture>(); HeadIconLoader.Instance.LoadIcon(BabyData.GetData((int)_splayerInst.babies1_[i].properties_[(int)PropertyType.PT_TableId])._RaceIcon, tex1); babeis[i].transform.FindChild("Label").GetComponent <UILabel>().text = _splayerInst.babies1_[i].properties_[(int)PropertyType.PT_Level].ToString(); } if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Friend)) { haoyouBtn.gameObject.SetActive(false); } if (_splayerInst.instId_ == GamePlayer.Instance.InstId) { haoyouBtn.gameObject.SetActive(false); } if (FriendSystem.Instance().IsmyFriend((int)_splayerInst.instId_)) { haoyouBtn.gameObject.SetActive(false); } }
void OnLineEvent(bool line) { if (string.IsNullOrEmpty(friendChatLab.text.Trim())) { PopText.Instance.Show(LanguageManager.instance.GetValue("bunengweikong")); return; } if (!line) { PopText.Instance.Show(LanguageManager.instance.GetValue("frinedonline")); return; } else if (chat_com != null) { chat_com.ck_ = ChatKind.CK_Friend; Filt(ref chat_com.content_, 0, 1); NetConnection.Instance.sendChat(chat_com, _selectFriend.name_); if (chat_com.content_.Length > 30) { //PopText.Instance.Show(LanguageManager.instance.GetValue("chatLineMax")); //return; } //COM_Chat comC = new COM_Chat(); chat_com.ck_ = ChatKind.CK_Friend; chat_com.content_ = friendChatLab.text; chat_com.isMe = true; // NetConnection.Instance.sendChat (comC,_selectFriend.name_); GameObject tf = null; tf = GameObject.Instantiate(_GridItem) as GameObject; cGrid.AddChild(tf.transform); tf.transform.localScale = Vector3.one; tf.gameObject.SetActive(true); ChatMaxCell cmi = tf.gameObject.GetComponent <ChatMaxCell>(); COM_ChatInfo info = new COM_ChatInfo(); // (COM_ChatInfo)comC ; info.playerName_ = GamePlayer.Instance.InstName; info.content_ = friendChatLab.text; Filt(ref info.content_, 0, 1); info.ck_ = ChatKind.CK_Friend; info.assetId_ = (ushort)GamePlayer.Instance.GetIprop(PropertyType.PT_AssetId); cmi.Info = info; cmi._LChatKindBackground.gameObject.SetActive(false); cmi._RChatKindBackground.gameObject.SetActive(false); chat_com = null; FriendSystem.Instance().addMyChat(_selectFriend.name_, chat_com); chatCellList.Add(tf); friendChatLab.text = ""; chatInput.value = ""; } else { if (string.IsNullOrEmpty(friendChatLab.text.Trim())) { PopText.Instance.Show(LanguageManager.instance.GetValue("bunengweikong")); return; } if (friendChatLab.text.Length > 30) { //PopText.Instance.Show(LanguageManager.instance.GetValue("chatLineMax")); //return; } COM_Chat comC = new COM_Chat(); comC.ck_ = ChatKind.CK_Friend; comC.content_ = friendChatLab.text; Filt(ref comC.content_, 0, 1); NetConnection.Instance.sendChat(comC, _selectFriend.name_); GameObject tf = null; tf = GameObject.Instantiate(_GridItem) as GameObject; cGrid.AddChild(tf.transform); tf.transform.localScale = Vector3.one; tf.gameObject.SetActive(true); ChatMaxCell cmi = tf.gameObject.GetComponent <ChatMaxCell>(); COM_ChatInfo info = new COM_ChatInfo(); info.playerName_ = GamePlayer.Instance.InstName; info.content_ = friendChatLab.text; Filt(ref info.content_, 0, 1); info.ck_ = ChatKind.CK_Friend; info.assetId_ = (ushort)GamePlayer.Instance.GetIprop(PropertyType.PT_AssetId); cmi.Info = info; cmi._LChatKindBackground.gameObject.SetActive(false); cmi._RChatKindBackground.gameObject.SetActive(false); comC.isMe = true; friendChatLab.text = ""; chatInput.value = ""; FriendSystem.Instance().addMyChat(_selectFriend.name_, comC); chatCellList.Add(tf); } cGrid.Reposition(); scrollBar.value = 1; }
void Start() { UIManager.SetButtonEventHandler(close_.gameObject, EnumButtonEvent.OnClick, OnClose, 0, 0); UIManager.SetButtonEventHandler(closeFindBtn.gameObject, EnumButtonEvent.OnClick, OnCloseFind, 0, 0); UIManager.SetButtonEventHandler(blackBtn.gameObject, EnumButtonEvent.OnClick, OnInitBlack, 0, 0); UIManager.SetButtonEventHandler(addFriendBtn.gameObject, EnumButtonEvent.OnClick, OnAddFriend, 0, 0); UIManager.SetButtonEventHandler(addBlackBtn.gameObject, EnumButtonEvent.OnClick, OnAddBlack, 0, 0); UIManager.SetButtonEventHandler(funCloseBtn.gameObject, EnumButtonEvent.OnClick, OnCloseFun, 0, 0); UIManager.SetButtonEventHandler(findFriendName.gameObject, EnumButtonEvent.OnClick, OnfindFriend, 0, 0); UIManager.SetButtonEventHandler(findBlackBtn.gameObject, EnumButtonEvent.OnClick, OnFindBlack, 0, 0); UIManager.SetButtonEventHandler(sendChatBtn.gameObject, EnumButtonEvent.OnClick, OnSendChat, 0, 0); UIManager.SetButtonEventHandler(friendTabBtn.gameObject, EnumButtonEvent.OnClick, OnFriendTabBtn, 0, 0); UIManager.SetButtonEventHandler(offTabBtn.gameObject, EnumButtonEvent.OnClick, OnOffTabBtn, 0, 0); UIManager.SetButtonEventHandler(huanBtn.gameObject, EnumButtonEvent.OnClick, OnHuanBtn, 0, 0); UIManager.SetButtonEventHandler(funCloseBack.gameObject, EnumButtonEvent.OnClick, OnCloseFun, 0, 0); UIManager.SetButtonEventHandler(funAddFriend.gameObject, EnumButtonEvent.OnClick, OnAddFriendFun, 0, 0); UIManager.SetButtonEventHandler(faceBtn.gameObject, EnumButtonEvent.OnClick, OnfaceBtn, 0, 0); //选择好友操作按钮. UIManager.SetButtonEventHandler(ctlSendBtn.gameObject, EnumButtonEvent.OnClick, OnCtlSendBtn, 0, 0); UIManager.SetButtonEventHandler(ctlLookBtn.gameObject, EnumButtonEvent.OnClick, OnCtlLookBtn, 0, 0); UIManager.SetButtonEventHandler(ctlTeamBtn.gameObject, EnumButtonEvent.OnClick, OnCtlTeamBtn, 0, 0); UIManager.SetButtonEventHandler(ctlDelBtn.gameObject, EnumButtonEvent.OnClick, OnCtlDelBtn, 0, 0); UIManager.SetButtonEventHandler(ctlBlackBtn.gameObject, EnumButtonEvent.OnClick, OnCtlBlackBtn, 0, 0); UIEventListener.Get(_VoiceBtn.gameObject).onPress = OnPrassVoice; //事件. FriendSystem.Instance().UpdateFriend += new UpdateFriendHandler(OnUpdataFriendList); FriendSystem.Instance().UpdateBlack += new UpdateBlackHandler(OnUpdataBlackList); FriendSystem.Instance().UpdateOffen += new UpdateOffenHandler(OnUpdateOffens); FriendSystem.Instance().FriendChat += new FriendChatHandler(OnFriendChat); FriendSystem.Instance().FindFriendOkEvent += new RequestEventHandler <COM_ContactInfo> (FindFriendOk); FriendSystem.Instance().FindFriendFail += new FindFriendFailHandler(FindFriendFail); FriendSystem.Instance().recommendEvent += new RequestEventHandler <int> (OnRecommendEvent); FriendSystem.Instance().friendOnLineEvent += new RequestEventHandler <bool> (OnLineEvent); NetConnection.Instance.requestFriendList(); ChartsSystem.QueryPlayerEventOk += OnQueryPlayer; GuideManager.Instance.RegistGuideAim(addFriendBtn.gameObject, GuideAimType.GAT_FriendAddBtn); OpenPanelAnimator.PlayOpenAnimation(this.panel, () => { friendGrild.AddChild(friendBtn.transform, 0); //friendBtn.transform.parent = friendGrild.transform; friendBtn.SetActive(true); friendBtn.transform.localScale = Vector3.one; UIManager.SetButtonEventHandler(friendBtn.gameObject, EnumButtonEvent.OnClick, OnClickFirend, 0, 0); friendGrild.AddChild(blackBtn.transform, 1); //blackBtn.transform.parent = friendGrild.transform; blackBtn.SetActive(true); blackBtn.transform.localScale = Vector3.one; UIManager.SetButtonEventHandler(blackBtn.gameObject, EnumButtonEvent.OnClick, OnInitBlack, 0, 0); //friendGrild.Reposition(); friendTabBtn.isEnabled = false; //UpdataFriendList (); FriendSystem.Instance().isOpenFried = true; if (FriendSystem.Instance().offens_.Count > 0) { foreach (COM_ContactInfo f in FriendSystem.Instance().offens_) { if (FriendSystem.Instance().NoChatDict.ContainsKey(f.name_)) { //offTabBtn.GetComponentInChildren<UISprite>().MarkOff(); offTabBtn.GetComponentInChildren <UISprite>().MarkOn(UISprite.MarkAnthor.MA_RightTop, -10, -10); break; } } } GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_ClickMainFriend); }); audioSO = gameObject.GetComponentInParent <AudioSource> (); InitFace(); if (FriendSystem.Instance().friends_.Count <= 0) { selectChatLab.gameObject.SetActive(false); } }
private void UpdateChatList(COM_ContactInfo contact) { List <COM_Chat> strArr = FriendSystem.Instance().ChatCache(contact); for (int i = 0; i < chatCellList.Count; i++) { //chatGrid.RemoveChild(chatCellList[i].transform); cGrid.RemoveChild(chatCellList[i].transform); chatCellList[i].transform.parent = null; chatCellList[i].gameObject.SetActive(false); GameObject.Destroy(chatCellList[i]); } chatCellList.Clear(); // return; //} if (strArr != null && strArr.Count > 0) { for (int i = 0; i < strArr.Count; i++) { if (!strArr[i].isMe) { GameObject tf = null; tf = GameObject.Instantiate(_GridItem) as GameObject; cGrid.AddChild(tf.transform); tf.transform.localScale = Vector3.one; tf.gameObject.SetActive(true); ChatMaxCell cmi = tf.gameObject.GetComponent <ChatMaxCell>(); COM_ChatInfo info = new COM_ChatInfo(); Filt(ref strArr[i].content_, 0, 1); info.content_ = strArr[i].content_; info.ck_ = ChatKind.CK_Friend; info.playerName_ = contact.name_; info.assetId_ = (ushort)contact.assetId_; cmi.Info = info; cmi._LChatKindBackground.gameObject.SetActive(false); cmi._RChatKindBackground.gameObject.SetActive(false); chatCellList.Add(tf); } else { GameObject tf = null; tf = GameObject.Instantiate(_GridItem) as GameObject; cGrid.AddChild(tf.transform); tf.transform.localScale = Vector3.one; tf.gameObject.SetActive(true); ChatMaxCell cmi = tf.gameObject.GetComponent <ChatMaxCell>(); COM_ChatInfo info = new COM_ChatInfo(); Filt(ref strArr[i].content_, 0, 1); info.content_ = strArr[i].content_; info.ck_ = ChatKind.CK_Friend; info.playerName_ = GamePlayer.Instance.InstName; info.assetId_ = (ushort)GamePlayer.Instance.GetIprop(PropertyType.PT_AssetId); cmi.Info = info; cmi._LChatKindBackground.gameObject.SetActive(false); cmi._RChatKindBackground.gameObject.SetActive(false); chatCellList.Add(tf); } } } cGrid.Reposition(); scrollBar.value = 1; //FriendSystem.Instance ().ChatDict.Remove(contact.name_); }
void OnFriendChat(COM_ContactInfo contact, COM_Chat msg) { if (_selectFriend != null && contact.instId_ == _selectFriend.instId_) { /*GameObject obj = Object.Instantiate(chatCell.gameObject) as GameObject; * obj.SetActive(true); * FriendItem cellUI = obj.GetComponent<FriendItem>(); * cellUI._chatInfo = msg; * if(msg.audio_ != null && msg.audio_.Length > 0) * { * // obj.transform.Find ("info").GetComponent<UILabel> ().gameObject.SetActive(false); * obj.transform.Find ("vButton").GetComponent<UIButton> ().gameObject.SetActive(true); * } * else * { * obj.transform.Find ("vButton").GetComponent<UIButton> ().gameObject.SetActive(false); * } * //obj.transform.Find ("info").GetComponent<UILabel> ().text = msg.content_; * * //cellUI.SetInfoBack(msg.content_); * cellUI.ParseSymbol(msg.content_); * * HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_, obj.transform.Find ("icon").Find ("Sprite").GetComponent<UITexture>()); * if(!_icons.Contains(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_)) * { * _icons.Add(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_); * } * * cellUI.name_.text = contact.name_; * //cellUI.level_.text = contact.level_.ToString (); * chatGrid.AddChild(obj.transform); * obj.transform.localScale = Vector3.one; */ GameObject tf = null; tf = GameObject.Instantiate(_GridItem) as GameObject; cGrid.AddChild(tf.transform); tf.transform.localScale = Vector3.one; tf.gameObject.SetActive(true); ChatMaxCell cmi = tf.gameObject.GetComponent <ChatMaxCell>(); COM_ChatInfo info = new COM_ChatInfo(); Filt(ref msg.content_, 0, 1); info.content_ = msg.content_; info.ck_ = ChatKind.CK_Friend; info.playerName_ = contact.name_; info.assetId_ = (ushort)contact.assetId_; cmi.Info = info; cmi._LChatKindBackground.gameObject.SetActive(false); cmi._RChatKindBackground.gameObject.SetActive(false); chatCellList.Add(tf); } else { foreach (var x in friendCellList) { if (x.GetComponent <FriendItem>().ContactInfo.instId_ == contact.instId_) { //x.GetComponent<FriendItem>().red.gameObject.SetActive(true); x.GetComponent <UISprite>().MarkOn(); //UISprite.MarkAnthor.MA_RightTop,0,0); break; } } foreach (COM_ContactInfo f in FriendSystem.Instance().offens_) { if (f.instId_ == contact.instId_) { offTabBtn.GetComponentInChildren <UISprite>().MarkOn(UISprite.MarkAnthor.MA_RightTop, -10, -10); break; } } } }
void Start() { hasDestroy_ = false; NetConnection.Instance.requestFriendList(); InitUIText(); guideAnimator_ = gameObject.GetComponent <Animator>(); RestMemberCellUI(); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnClickClose, 0, 0); UIManager.SetButtonEventHandler(cerateTeamBtn.gameObject, EnumButtonEvent.OnClick, OnClickCreate, 0, 0); UIManager.SetButtonEventHandler(BianjieBtn.gameObject, EnumButtonEvent.OnClick, OnClickBianjie, 0, 0); HidenMaxMenberSizeUI(); if (!TeamSystem.IsInTeam()) { GameManager.Instance.GetActorClone((ENTITY_ID)GamePlayer.Instance.Properties[(int)PropertyType.PT_AssetId], (ENTITY_ID)GamePlayer.Instance.WeaponAssetID, EntityType.ET_Player, AssetLoadSelfCallBack, new ParamData(GamePlayer.Instance.InstId, 0, (int)GamePlayer.Instance.Properties[(int)PropertyType.PT_AssetId]), "UI", GamePlayer.Instance.DressID); uint[] bemps = GamePlayer.Instance.GetEmployeesBattles((int)GamePlayer.Instance.CurEmployeesBattleGroup); for (int i = 0; i < bemps.Length; i++) { if (bemps[i] == 0) { continue; } //index=i; Employee emp = GamePlayer.Instance.GetEmployeeById((int)bemps[i]); GameManager.Instance.GetActorClone((ENTITY_ID)GamePlayer.Instance.GetEmployeeById((int)bemps[i]).GetIprop(PropertyType.PT_AssetId), (ENTITY_ID)0, EntityType.ET_Emplyee, AssetLoadEmployeeCallBack, new ParamData((int)bemps[i], i, GamePlayer.Instance.GetEmployeeById((int)bemps[i]).GetIprop(PropertyType.PT_AssetId)), "UI"); } datingObj.SetActive(true); mubiaoObj.SetActive(false); teamnameObj.SetActive(false); tuichuBtn.gameObject.SetActive(false); } else { ResTeamLeaderBtnState(); tuichuBtn.gameObject.SetActive(true); datingObj.SetActive(false); teamCellsState(); UIManager.SetButtonEventHandler(tuichuBtn.gameObject, EnumButtonEvent.OnClick, OnClickTuichu, 0, 0); } if (huobanBtn.gameObject.activeSelf) { UIManager.SetButtonEventHandler(huobanBtn.gameObject, EnumButtonEvent.OnClick, OnClickHuoban, 0, 0); } SceneLoaded(); TeamSystem.OnChangejoinL += ShowUIPanel; TeamSystem.OnExitIteam += ExitIteamOk; TeamSystem.OnCreateTeam += CreateTeamOk; TeamSystem.OnChangeTeam += ChangeTeamOk; TeamSystem.OnUpdateTeamMB += UpdateTeamMBOk; TeamSystem.OnLeaderChange += changeLeaderOk; TeamSystem.OnDelMenber += DeTeamMunber; FriendSystem.Instance().UpdateFriend += new UpdateFriendHandler(OnUpdataFriendList); TeamSystem.OnUpdateMemStateUI += UpdatememberState; //UpdateMemberPositionUIOk = openOrOffBtn; //UpdateUI (); //teamInfo_ = TeamSystem._MyTeamInfo; GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_MainTeamUI); // if guide index int idx = 0; GlobalValue.Get(Constant.C_TeamGuideStep1, out idx); if (!GuideManager.Instance.IsFinish(idx)) { guideAnimator_.SetTrigger("Step1"); CreateMask(); GuideManager.Instance.SetFinish(idx); } }