void removeAllEvent() { LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_PACKAGE); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_SIGNIN); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_LUCKDRAW); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_LOBBY_PANEL); }
public void OnClickOnlineModeBtn() { LobbyEvent.s_V2VShowLobbyPanel lp; lp.from = LobbyEvent.LOBBY_PANEL.LOBBY_LOBBY_PANEL; lp.to = LobbyEvent.LOBBY_PANEL.LOBBY_PLAZAROOM_PANEL; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_LOBBY_PANEL, (object)lp); }
//--------------------------一些操作------------------------------------------------------ void addAllEvent() { LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_PACKAGE, onUpdatePackage); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_SIGNIN, onUpdateSignIn); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_LUCKDRAW, onUpdateLuckDraw); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_LOBBY_PANEL, onShowLobbyPanel); }
void OnRespOpenTalentslot(Message msg) { ViewManagerEvent.EM().InvokeEvent(ViewManagerEvent.EVENT.SHOW_LOADING_ANI, false); msgRespOpenTalentslot resp = msgRespOpenTalentslot.deserialize(msg); if (resp.result == msgRespOpenTalentslot.eOpenTalentslotResultType.OPEN_SUCCESS) { //开槽成功 //refresh ui //CommonUtil.Util.showDialog ("温馨提示","开槽成功,当前槽数为:"+resp.currentOpenedCnt); Account.setUserGold(resp.currentGold); Account.setUserDiamond(resp.currentDiamond); LobbyEvent.s_C2V_UpdateTalentForOpenSlot utfos; utfos.gold = resp.currentGold; utfos.diamond = resp.currentDiamond; utfos.ret = CommonDefine.eRespResultType.SUCCESS; utfos.currentTalentNum = resp.currentOpenedCnt; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.RESP_OPEN_TALENTSLOT, (object)utfos); } else if (resp.result == msgRespOpenTalentslot.eOpenTalentslotResultType.OPEN_FAIL_LESS_DIAMOND) { CommonUtil.Util.showDialog("温馨提示", "开槽失败,您的晶核不足,请充值"); } else if (resp.result == msgRespOpenTalentslot.eOpenTalentslotResultType.OPEN_FAIL_LESS_GOLG) { CommonUtil.Util.showDialog("温馨提示", "开槽失败,您的金币不足,请充值"); } else if (resp.result == msgRespOpenTalentslot.eOpenTalentslotResultType.OPEN_FAIL_MAX_SLOT) { CommonUtil.Util.showDialog("温馨提示", "您的天赋槽已全部打开!"); } }
void checkIsGettingAllAward() { bool hasAllGotten = true; if (_hasGettingAllAward) { for (int i = 0; i < _emailList.Count; i++) { if (_emailList [i].getContent().hasAward && !_emailList [i].getContent().hasGottenAward) { LobbyEvent.sV2C_ReqUpdateEmail re2; re2.id = _emailList [i].getEmailID(); re2.type = CommonDefine.eUpdateEmailType.GET_AWARD; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.REQ_UPDATE_EMAIL, (object)re2); hasAllGotten = false; break; } } if (hasAllGotten) { _hasGettingAllAward = false; } } checkAllAwardBtnCanShow(); }
//--------------------------一些操作------------------------------------------------------ void addAllEvent() { LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_PRIVATEMSG, onUpdateEmail); //刷新邮件列表 LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_UPDATE_EMAIL_RESULT, onShowUpdateEmailResult); //显示邮件操作结果 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_PRIVATE_MSG, null); }
public void addAllEvent() { AccountEvent.EM().AddEvent(AccountEvent.EVENT.LOGIN_SUCCESS, onAccountLoginSuccess); //子界面或独立界面刷新事件,请参考store LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_USER_INFO, onEventShowUserInfo); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_PLAZA, onEventShowPlaza); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_LUCKDRAW, onEventShowLuckDraw); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_PACKAGE, onEventShowPackage); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_PRIVATE_MSG, onEventShowPrivateMsg); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_SIGNIN, onEventShowSignIn); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_STORE, onEventShowStore); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_FRIEND, onEventShowFriend); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_RANK, onEventShowRank); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.REQ_UPDATE_EMAIL, onEventReqUpdateEmail); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.REQ_FEEDBACK, onEventReqFeedback); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.REQ_OPEN_TALENTSLOT, onEventReqOpenTalentslot); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_USER_TALENT, onEventUpdateUserTalent); //声音 LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.OPEN_CLOSE_BG_SND, onEventBgSndSwitch); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.OPEN_CLOSE_EFFECT_SND, onEventEffectSndSwitch); ProtocolManager.getInstance().addPushMsgEventListener(LobbyProtocol.P_LOBBY_AWARD_EMAIL, OnAwardEmail); }
public void onEventShowUserInfo(object data) { SelfData self = Account.getSelfData(); //已经可以更新用户相关界面信息 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.UPDATE_USER_INFO, (object)self); }
void OnEnable() { addAllEvent(); initTalentPanel(); LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_USER_INFO, null); }
public void showPopup(CommonDefine.ePopupType type) { hideAllPopups(); switch (type) { case CommonDefine.ePopupType.EMAIL: _email.gameObject.SetActive(true); break; case CommonDefine.ePopupType.FEEDBACK: _feedback.gameObject.SetActive(true); break; case CommonDefine.ePopupType.RANK: _rank.gameObject.SetActive(true); break; case CommonDefine.ePopupType.SETTING: _setting.gameObject.SetActive(true); break; case CommonDefine.ePopupType.TALENT: LobbyEvent.s_V2VShowLobbyPanel lp; lp.from = LobbyEvent.LOBBY_PANEL.LOBBY_LOBBY_PANEL; lp.to = LobbyEvent.LOBBY_PANEL.LOBBY_TALENT_PANEL; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_LOBBY_PANEL, (object)lp); break; } }
void OnEnable() { //may be add all event again LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_STORE, onUpdateStore); //通知c界面显示,需要更新商城 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_STORE, null); }
//--------------------------一些操作------------------------------------------------------ void addAllEvent() { LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_USER_INFO, onUpdataUserInfo); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_HAS_EMAIL, onShowHasUnReadEmail); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_SYSMSG, onUpdateSysMsg); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_SYSMSG, onShowSysMsg); LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.SHOW_POPUP, onShowPopup); }
public void OnClickBackBtn() { // //切换到主大厅界面 LobbyEvent.s_V2VShowLobbyPanel lp; lp.from = LobbyEvent.LOBBY_PANEL.LOBBY_TALENT_PANEL; lp.to = LobbyEvent.LOBBY_PANEL.LOBBY_LOBBY_PANEL; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_LOBBY_PANEL, (object)lp); }
void removeAllEvent() { LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_USER_INFO); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_HAS_EMAIL); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_SYSMSG); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_SYSMSG); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_POPUP); }
void removeAllEvent() { LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_PLAZA); RoomEvent.EM().RemoveEvent(RoomEvent.EVENT.UPDATE_LEAVE_ROOM); RoomEvent.EM().RemoveEvent(RoomEvent.EVENT.UPDATE_ROOMRULE); RoomEvent.EM().RemoveEvent(RoomEvent.EVENT.PLAER_ENTER); RoomEvent.EM().RemoveEvent(RoomEvent.EVENT.UPDATE_PLAER_STATE); RoomEvent.EM().RemoveEvent(RoomEvent.EVENT.UPDATE_DISSOLVE_ROOM); }
public void OnClickGetAwardBtn() { // if (_currentSelectEmailID != -1) { LobbyEvent.sV2C_ReqUpdateEmail re; re.id = _emailList[_currentSelectEmailID].getEmailID(); re.type = CommonDefine.eUpdateEmailType.GET_AWARD; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.REQ_UPDATE_EMAIL, (object)re); } }
public void OnClickTalentLockBtn(int id) { //开槽 _openSlotId = id; LobbyEvent.sV2C_OpenTalentslot ot; ot.type = CommonDefine.eOpenByType.OPEN_BY_DIAMOND; //默认只能钻石开槽。如果需要别的,这里需要弹窗,并在选择后请求 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.REQ_OPEN_TALENTSLOT, (object)ot); }
//--------------------------一些操作------------------------------------------------------ void addAllEvent() { LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_RANK, onUpdateRank); //请求显示界面 LobbyEvent.RankScopeType rst; rst.scope = LobbyEvent.RankScopeType.RANK_SCOPE_TYPE.RANK_AREA; rst.type = LobbyEvent.RankScopeType.RANK_TYPE.RANK_GOLD; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_RANK, (object)rst); }
void OnEnable() { for (int i = 0; i < 4; i++) { // _realPlayer [i] = null; } addAllEvent(); LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_PLAZA, null); }
public void OnClickEffSndBtn(bool on){ if (on) { _effSndSelectedBg.transform.localPosition = _effSndOn.transform.localPosition; _effSndOnText.gameObject.SetActive (false); _effSndOffText.gameObject.SetActive (true); } else { _effSndSelectedBg.transform.localPosition = _effSndOff.transform.localPosition; _effSndOnText.gameObject.SetActive (true); _effSndOffText.gameObject.SetActive (false); } LobbyEvent.EM ().InvokeEvent (LobbyEvent.EVENT.OPEN_CLOSE_EFFECT_SND,on); }
public void OnClickSubmitBtn() { if (_inputText.text.Length != 0 && _inputText.text.Length <= 200) { //发送反馈 LobbyEvent.sV2C_Feedback fb; fb.type = _feedType; fb.content = _inputText.text; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.REQ_FEEDBACK, (object)fb); } this.gameObject.SetActive(false); }
//--------------------------一些操作------------------------------------------------------ void addAllEvent() { LobbyEvent.EM().AddEvent(LobbyEvent.EVENT.UPDATE_PLAZA, onUpdatePlaza); RoomEvent.EM().AddEvent(RoomEvent.EVENT.UPDATE_LEAVE_ROOM, onPlayerLeave); RoomEvent.EM().AddEvent(RoomEvent.EVENT.UPDATE_ROOMRULE, onUpdateRoomRule); RoomEvent.EM().AddEvent(RoomEvent.EVENT.PLAER_ENTER, onPlayerEnter); RoomEvent.EM().AddEvent(RoomEvent.EVENT.UPDATE_PLAER_STATE, onPlayerState); //RoomEvent.EM ().AddEvent (RoomEvent.EVENT.SHOW_TALK_MSG, onShowTalkMsg); RoomEvent.EM().AddEvent(RoomEvent.EVENT.UPDATE_LEAVE_ROOM, onPlayerLeave); RoomEvent.EM().AddEvent(RoomEvent.EVENT.UPDATE_DISSOLVE_ROOM, onDissolve); }
void checkIfHasUnReadEmail() { for (int i = 0; i < Lobby.Lobby.privateMsgList.Count; i++) { if (Lobby.Lobby.privateMsgList [i].has_read == 0) { //通知显示提示标示 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_HAS_EMAIL, true); return; } } LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_HAS_EMAIL, false); }
public void onEventShowPlaza(object data) { //过滤掉经典模式 List <LobbyEvent.Plaza> plazaList = new List <LobbyEvent.Plaza> (); for (int i = 0; i < Lobby.Lobby.plazaList.Count; i++) { if (Lobby.Lobby.plazaList[i].roomType == (int)CommonDefine.eCreateRoomType.ROOM_PLAZA) { plazaList.Add(Lobby.Lobby.plazaList[i]); } } LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.UPDATE_PLAZA, (object)plazaList); }
public void onEventShowPrivateMsg(object data) { if (Lobby.Lobby.privateMsgList.Count != 0) { //此处把系统公告也插进去 LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.UPDATE_PRIVATEMSG, (object)(Lobby.Lobby.privateMsgList)); } /*else { * msgReqPrivateMsgList primsg = new msgReqPrivateMsgList (); * primsg.game = GameType.GAME_LIANQI; * primsg.begin = 0; * primsg.cnt = 20; * ProtocolManager.getInstance ().sendMsg (LobbyProtocol.P_LOBBY_REQ_PRIVATEMSG, primsg, OnRespPrivateMsgList); * }*/ }
void OnAwardEmail(Message msg) { msgAwardEmail ae = msgAwardEmail.deserialize(msg); // if (ae.type == SYS_OR_PRIVATE_MSG_TYPE.TYPE_MSG_PRIVATE) { //个人消息,这种是私人消息,比如队伍之间,非系统下发 //待完成 } else if (ae.type == SYS_OR_PRIVATE_MSG_TYPE.TYPE_MSG_SYS) { //系统下发消息,多是奖励信息,如果有必要则添加到邮件 if (ae.needAdd2Email) { LobbyEvent.PrivateMsg psm; psm.author = ae.author; psm.content = ae.content; psm.end_time = ae.end_time; psm.has_read = ae.has_read; psm.id = ae.id; psm.send_time = ae.send_time; psm.title = ae.title; Lobby.Lobby.privateMsgList.Insert(0, psm); onEventShowPrivateMsg(null); checkIfHasUnReadEmail(); } else { //如果不需要添加到邮件,则仅仅弹窗提示即可 //show dialog } } else if (ae.type == SYS_OR_PRIVATE_MSG_TYPE.TYPE_MSG_NOTICE) { //系统公告性质的消息,也就是要走跑马灯 LobbyEvent.SysMsg sm; sm.id = 0; sm.content = ae.content; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.SHOW_SYSMSG, (object)sm); } }
void OnRespSysMsgList(Message msg) { // msgRespSysMsgList sml = msgRespSysMsgList.deserialize(msg); List <LobbyEvent.SysMsg> sysMsgList = new List <LobbyEvent.SysMsg>(); for (int i = 0; i < sml.sysMsgList.Count; i++) { LobbyEvent.SysMsg sm; sm.content = sml.sysMsgList [i].content; sm.id = sml.sysMsgList [i].id; sysMsgList.Add(sm); } LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.UPDATE_SYSMSG, (object)(sysMsgList)); }
public void OnClickGetAllAwardBtn() { //这里记录 是否在一键领取 _hasGettingAllAward = true; for (int i = 0; i < _emailList.Count; i++) { if (_emailList [i].getContent().hasAward && !_emailList [i].getContent().hasGottenAward) { LobbyEvent.sV2C_ReqUpdateEmail re; re.id = _emailList [i].getEmailID(); re.type = CommonDefine.eUpdateEmailType.GET_AWARD; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.REQ_UPDATE_EMAIL, (object)re); break; } } _allAwardBtn.interactable = false; }
public void saveTalentCfg(bool sholudRefreshUserTalent) { //"2#1#1,4#2#2,..." string cfg = ""; for (int i = 0; i < _talentSlotList.Count; i++) { cfg = cfg + (int)_talentSlotList[i].talentType + "#" + _talentSlotList[i].id + "#" + (int)_talentSlotList[i].btnState + ","; } if (cfg == "") { return; } cfg = cfg.Substring(0, cfg.Length - 1); CommonUtil.Util.setPlayerPrefs(CommonDefine.CONST.TALENT_SLOT_STATE, cfg); if (sholudRefreshUserTalent) { LobbyEvent.s_V2C_UpdateUserTalent uut; List <CommonDefine.eTalentType> tl = new List <CommonDefine.eTalentType>(); for (int i = 0; i < _talentSlotList.Count; i++) { if (_talentSlotList [i].btnState == CommonDefine.TalentSlotState.TALENT_INSTALLED) { tl.Add(_talentSlotList [i].talentType); } } uut.talentList = tl; LobbyEvent.EM().InvokeEvent(LobbyEvent.EVENT.UPDATE_USER_TALENT, (object)uut); } }
public void removeAllEvent() { //AccountEvent.EM().RemoveEvent(AccountEvent.EVENT.LOGIN_SUCCESS); //子界面或独立界面刷新事件,请参考store LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_USER_INFO); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_PLAZA); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_LUCKDRAW); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_PACKAGE); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_PRIVATE_MSG); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_SIGNIN); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_STORE); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_FRIEND); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.SHOW_RANK); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.REQ_UPDATE_EMAIL); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.REQ_FEEDBACK); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.REQ_OPEN_TALENTSLOT); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.UPDATE_USER_TALENT); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.OPEN_CLOSE_BG_SND); LobbyEvent.EM().RemoveEvent(LobbyEvent.EVENT.OPEN_CLOSE_EFFECT_SND); ProtocolManager.getInstance().removePushMsgEventListener(LobbyProtocol.P_LOBBY_AWARD_EMAIL); }