private void OnDailyTaskNty(short state, DailyTaskNty down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } DailyTask dailyTask = this.mDailyList.Find((DailyTask e) => e.taskId == down.dailyTask.taskId); if (dailyTask != null) { this.mDailyList.Remove(dailyTask); this.mDailyList.Add(down.dailyTask); } this.totalActivity = down.totalActivity; EventDispatcher.Broadcast(EventNames.DailyTaskNty); this.CheckTownDailyTaskPoint(); }
public void OnPushFundInfo(short state, PushFundInfo msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (msg == null) { return; } this.hasBuy = msg.hasBuy; this.hasGet = msg.hasGet; this.itemList.Clear(); this.itemList.AddRange(msg.items); this.CheckInvestTips(); EventDispatcher.Broadcast(EventNames.OnInvestPushInfo); }
private void OnJoinedRoom() { if (_gamestate == Gamestate.Game || _gamestate == Gamestate.Postgame) { return; } Debug.Log($"Connected to Room: {PhotonNetwork.room.Name}"); EventDispatcher.Broadcast(NetworkEvent, NetEvent.JoinedRoom); EventDispatcher.Broadcast(NetRoomEvent, RoomEvent.PlayerJoined, PhotonNetwork.room.PlayerCount.ToString()); _lastRoom = PhotonNetwork.room.Name; if (PhotonNetwork.room.PlayerCount == PhotonNetwork.room.MaxPlayers) { OnRoomFilled(); } }
private void OnChallengeDungeonRes(short state, ChallengeDungeonRes down = null) { if (state == 0) { UIStackManager.Instance.PopUIIfTarget("InstanceDetailUI"); InstanceManager.ChangeInstanceManager(down.dungeonId, false); InstanceManager.SimulateEnterField(InstanceManager.CurrentInstanceData.type, null); InstanceManager.SimulateSwicthMap(InstanceManager.CurrentInstanceData.scene, LocalInstanceHandler.Instance.CreateSelfInfo(InstanceManager.CurrentInstanceData.type, InstanceManager.CurrentInstanceDataID, InstanceManager.CurrentInstanceData.scene, 0, 0, null, null, null), null, 0); BattleDmgCollectManager.Instance.ClearData(); EventDispatcher.Broadcast <bool>(EventNames.ChallengeDungeonResult, true); } else { StateManager.Instance.StateShow(state, 0); EventDispatcher.Broadcast <bool>(EventNames.ChallengeDungeonResult, false); } WaitUI.CloseUI(0u); }
public void BroadcastTipsEvent() { bool arg = false; using (Dictionary <int, AchievementItemInfo> .ValueCollection.Enumerator enumerator = this.AllIdList.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { AchievementItemInfo current = enumerator.get_Current(); if (current.isAccept == 1) { arg = true; break; } } } EventDispatcher.Broadcast <string, bool>(EventNames.OnTipsStateChange, TipsEvents.ButtonTipsModuleAchievement, arg); }
private void OnRefreshTramcarRes(short state, RefreshTramcarRes down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); } if (down != null && down.curQuality > 0) { int curQuality = this.CurQuality; this.CurQuality = down.curQuality; EventDispatcher.Broadcast <bool>(EventNames.RefreshTramcarUI, curQuality != this.CurQuality); Debug.LogFormat("护送矿车地图ID:{0}, 矿车品质:{1}", new object[] { this.CurMapId, this.CurQuality }); } }
private void OnGetGoldBuyChangedNty(short state, GoldBuyChangedNty down) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { this.mRemainingBuyTimes = down.remainingBuyTimes; this.mRemainingFreeTimes = down.remainingFreeTimes; EventDispatcher.Broadcast(EventNames.GoldBuyChangedNty); } else { Debuger.Info("down == null GoldBuyChangedNty", new object[0]); } }
private void OnOpenTramcarPanelRes(short state, OpenTramcarPanelRes down = null) { WaitUI.CloseUI(0u); if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } this.TramcarRewards = down.item; this.CurQuality = down.curQuality; this.CurMapId = down.mapId; EventDispatcher.Broadcast(EventNames.OpenTramcarUI); Debug.LogFormat("护送矿车地图ID:{0}, 矿车品质:{1}", new object[] { this.CurMapId, this.CurQuality }); }
private void OnGetBuyGoldRes(short state, BuyGoldRes down) { if (state != 0) { StateManager.Instance.StateShow(state, 0); EventDispatcher.Broadcast(EventNames.GoldBuyFail); return; } if (down != null) { this.mExtPrize = down.extPrize; EventDispatcher.Broadcast(EventNames.OnGetBuyGoldRes); } else { Debuger.Info("down == null OnGetBuyGoldRes", new object[0]); } }
public void OnStartLoad(int sceneID, List <MapObjInfo> otherObjs) { if (this.action_allResource_loaded_timer_id > 0u) { TimerHeap.DelTimer(this.action_allResource_loaded_timer_id); this.action_allResource_loaded_timer_id = 0u; } SoundManager.Instance.StopBGM(null); EntityWorld.Instance.ClearAllMapObjects(); NPCManager.Instance.ClearAllNPCs(); EventDispatcher.Broadcast <int, int>(SceneManagerEvent.UnloadScene, MySceneManager.Instance.CurSceneID, sceneID); if (!this.IsWorldMapSwitch(sceneID)) { if (InstanceManager.CurrentInstanceType == InstanceType.Arena) { UIManagerControl.Instance.HideAllExcept(new string[] { "LoadingUI", "PVPVSUI" }); } else { UIManagerControl.Instance.HideAllExcept(new string[] { "LoadingUI" }); } LoadingUIView.Open(false); this.isCurrentHasLoading = true; this.TrulyStartLoad(sceneID, otherObjs); } else { this.isCurrentHasLoading = false; FXSpineManager.Instance.ShowBattleStart1(sceneID, delegate { AssetLoader.UnloadUnusedAssets(delegate { this.TrulyStartLoad(sceneID, otherObjs); }); }); } }
public override void ShowBattleUI() { if (base.InstanceResult != null) { return; } this.mBattleUI = LinkNavigationManager.OpenBattleUI(); this.mBattleUI.BtnQuitAction = delegate { DungeonManager.Instance.shouldNotShowLoseUI = true; UIManagerControl.Instance.OpenUI("GlobalBattleDialogUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush); GlobalBattleDialogUIViewModel.Instance.ShowAsOKCancel_as(GameDataUtils.GetNoticeText(100), GameDataUtils.GetNoticeText(101), delegate { InstanceManager.TryPause(); }, delegate { InstanceManager.TryResume(); LinkNavigationManager.OpenBattleUI(); }, delegate { InstanceManager.TryResume(); EventDispatcher.Broadcast("GuideManager.InstanceExit"); LocalInstanceHandler.Instance.Finish(false); }, GameDataUtils.GetNoticeText(103), GameDataUtils.GetNoticeText(102), "button_orange_1", "button_yellow_1", null); GlobalBattleDialogUIView.Instance.isClick = false; }; this.mBattleUI.ResetAllInstancePart(); this.mBattleUI.ShowBattleTimeUI(true); this.mBattleUI.IsPauseCheck = false; this.mBattleUI.IsInAuto = (base.InstanceData.autoFight == 0); if (!UIManagerControl.Instance.IsOpen("TaskProgressUI")) { this.mProgressUI = (UIManagerControl.Instance.OpenUI("TaskProgressUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as TaskProgressUI); } if (DungeonManager.Instance.DungeonInstanceType == DungeonManager.InsType.WEAPON) { this.mProgressUI.PlayWeaponEffect(DungeonManager.Instance.WeaponModelId); TimerHeap.AddTimer(4000u, 0, delegate { BattleTimeManager.Instance.ClientSetBattleTime(base.InstanceData.time); LocalInstanceHandler.Instance.Start(); }); } }
private void OnSkillConfigInfoChangeNty(short state, SkillConfigInfoChangeNty down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null && down.infos.get_Count() > 0) { for (int i = 0; i < down.infos.get_Count(); i++) { if (i > 1) { break; } SkillConfigInfo skillConfigInfo = down.infos.get_Item(i); if (this.skillNotchDic.ContainsKey(1)) { this.skillNotchDic.set_Item(1, skillConfigInfo.notch1); } else { this.skillNotchDic.Add(1, skillConfigInfo.notch1); } if (this.skillNotchDic.ContainsKey(2)) { this.skillNotchDic.set_Item(2, skillConfigInfo.notch2); } else { this.skillNotchDic.Add(2, skillConfigInfo.notch2); } if (this.skillNotchDic.ContainsKey(3)) { this.skillNotchDic.set_Item(3, skillConfigInfo.notch3); } else { this.skillNotchDic.Add(3, skillConfigInfo.notch3); } } EventDispatcher.Broadcast(EventNames.OnSkillConfigInfoChangeNty); } }
public void RemoveFirstChat() { if (this.teamChatList != null && this.teamChatList.get_Count() > 0) { this.teamChatList.RemoveAt(0); if (this.teamChatList.get_Count() > 0) { this.HandleToShowFirstChat(); } else { EventDispatcher.Broadcast <ChatManager.ChatInfo>(EventNames.UpdateTeamChatTip, null); } } else { EventDispatcher.Broadcast <ChatManager.ChatInfo>(EventNames.UpdateTeamChatTip, null); } }
public override void Relive(BattleAction_Relive data, bool isServerData) { base.Relive(data, isServerData); if (this.owner.Actor) { AvatarModel avatarModel = DataReader <AvatarModel> .Get(this.owner.FixModelID); this.owner.InitBillboard((float)avatarModel.height_HP, avatarModel.bloodBar); WaveBloodManager.Instance.AddWaveBloodControl(this.owner.Actor.FixTransform, (float)avatarModel.height_Damage, this.owner.ID); if (!this.owner.IsPlayerMate) { EventDispatcher.Broadcast <int, Transform>(CameraEvent.PlayerBorn, this.owner.TypeID, this.owner.Actor.FixTransform); } } else { Debuger.Error("Relive No Actor", new object[0]); } }
public override void ClientHandleSkillByID(int skillID) { Skill skill = DataReader <Skill> .Get(skillID); if (skill == null) { return; } if (XInputManager.IsDragging && (skill.type3 == 1 || !string.IsNullOrEmpty(skill.attAction))) { this.ownerActor.ForceSetDirection(XInputManager.Instance.CurrentDragDirection); this.ownerActor.ApplyMovingDirAsForward(); } base.ClientHandleSkillByID(skillID); if (skill.cameraCorrection_x.get_Count() > 0) { EventDispatcher.Broadcast <int>(CameraEvent.RoleNormalAttack, skillID); } }
private void TrulyStartLoad(int sceneID, List <MapObjInfo> otherObjs) { if (EntityWorld.Instance.EntSelf != null) { EntityWorld.Instance.EntSelf.CheckWeaponSlot(); if (!EntityWorld.Instance.EntSelf.IsInBattle) { InstanceManager.ChangeInstanceManager(CityInstance.Instance, false); } } if (EntityWorld.Instance.ActSelf != null) { EntityWorld.Instance.ActSelf.ResetController(); } EventDispatcher.Broadcast <int, int>(SceneManagerEvent.LoadSceneStart, MySceneManager.Instance.CurSceneID, sceneID); AOIService.Instance.SetMapArrivedObj(otherObjs); this.isLoading = true; this.EnterPreloadResource(sceneID); }
private void OnGetGangFightPersonalInfo(short state, GangFightPersonalInfo down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { this.combatWin = down.combatWin; this.topCombatWin = down.topCombatWin; this.totalWin = down.totalWin; this.historyCombatWin = down.historyCombatWin; this.openTime = down.openTime; this.closeTime = down.closeTime; this.SetGangFightOpenTime(); EventDispatcher.Broadcast(EventNames.OnGetGangFightPersonalInfo); } }
public override void ChangeCamp(BattleAction_ChangeCamp data, bool isServerData) { if (data.soldierId != this.owner.ID) { return; } this.owner.Camp = data.camp; if (this.owner.Actor) { if (this.owner.IsPlayerMate) { EventDispatcher.Broadcast <Transform>(CameraEvent.MonsterDie, this.owner.Actor.FixTransform); } else { EventDispatcher.Broadcast <int, Transform>(CameraEvent.MonsterBorn, this.owner.TypeID, this.owner.Actor.FixTransform); } } }
private void DoEquipWingOn(int wingId, WingBody dataWing) { if (this.ActorTarget == null) { this.mWingId = 0; this.mCacheWingId = wingId; return; } this.mWingId = wingId; this.mCacheWingId = 0; this.InstantiateEquipWing(wingId, dataWing, delegate(bool isSuccess) { if (isSuccess) { EventDispatcher.Broadcast("EquipCustomization.ACTSELF_CHANGE_WEAPON"); this.EquipWingSuccess(); } }); }
public void OnGetBossLabelInfoRes(short state, GetBossLabelInfoRes msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (msg == null) { return; } BossItemInfo bossItemInfo = this.GetBossItemInfo(msg.labelId); if (bossItemInfo != null) { bossItemInfo.UpdateInfo(msg.bossLabelInfo); } EventDispatcher.Broadcast <int>(EventNames.BossBookItemUpdate, msg.labelId); }
// Updates public void SendInputFrame(InputFrame iframe) { if (Models.Get <IOptionsUIModel>().IsOpen) { return; } EventDispatcher.Broadcast(PlayerMovement, iframe.Move); EventDispatcher.Broadcast(CameraLook, iframe.Look); while (iframe.Keys.Count > 0) { var key = iframe.Keys.Dequeue(); EventDispatcher.Broadcast(Action, key); } EventDispatcher.Broadcast(CameraZoom, iframe.Scroll); }
private void OnGetOpenServerActRewardRes(short state, GetOpenServerActRewardRes msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (msg == null) { return; } if (this.activityTargetTaskDic != null && this.activityTargetTaskDic.ContainsKey((int)msg.activityType)) { List <TargetTaskInfo> list = this.activityTargetTaskDic.get_Item((int)msg.activityType); if (list != null) { for (int i = 0; i < list.get_Count(); i++) { int targetID = list.get_Item(i).targetID; if (targetID == msg.targetID) { list.get_Item(i).status = TargetTaskInfo.GetRewardStatus.HadGet; } } } } List <int> list2 = new List <int>(); List <long> list3 = new List <long>(); for (int j = 0; j < msg.rewards.get_Count(); j++) { list2.Add(msg.rewards.get_Item(j).cfgId); list3.Add(msg.rewards.get_Item(j).count); } if (list2 != null && list2.get_Count() > 0) { RewardUI rewardUI = LinkNavigationManager.OpenRewardUI(UINodesManager.MiddleUIRoot); rewardUI.SetRewardItem(GameDataUtils.GetChineseContent(513164, false), list2, list3, true, false, null, null); rewardUI.get_transform().SetAsLastSibling(); } this.UpdateCheckAcTypeCanGetRewardDic((int)msg.activityType); EventDispatcher.Broadcast <int>(EventNames.OnGetOpenServerActRewardRes, msg.targetID); }
private void OnChallengeBatchInfoNty(short state, ChallengeBatchInfoNty down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { this.BattleCurrentBatch = down.batch; this.BattleCurrentStage = down.stage; BattleUI battleUI = UIManagerControl.Instance.GetUIIfExist("BattleUI") as BattleUI; if (battleUI != null) { battleUI.ShowBoss(DataReader <TiaoZhanBoCi> .Get(down.batch).bossId > 0); } EventDispatcher.Broadcast(EventNames.SetProgress); } }
public void SetState(Gamestate state) { if (State != state) { State = state; EventDispatcher.Broadcast(StateChanged, State); if (State == Gamestate.Game && !Models.Get <IOptionsUIModel>().IsOpen) { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } else { Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } } }
private void OnFlyShoeTransportRes(short state, FlyShoeTransportRes down = null) { if (state != 0) { this.NeedDelayEnterNPC = false; StateManager.Instance.StateShow(state, 0); EventDispatcher.Broadcast <bool>(EventNames.FlyShoeTransportRes, false); return; } EventDispatcher.Broadcast <bool>(EventNames.FlyShoeTransportRes, true); if (this.NeedSwitchCity) { InstanceManager.ChangeInstanceManager(CityInstance.Instance, true); } else if (EntityWorld.Instance.EntSelf != null) { EntityWorld.Instance.EntSelf.Actor.SendPrecisePos(); } }
private void OnEnterMapUiRes(short state, EnterMapUiRes down = null) { if (state != 0) { this.CurRoomCD = 0; TimerHeap.DelTimer(this.CurRoomCDId); StateManager.Instance.StateShow(state, 0); return; } this.MapId = this.mTempId[0]; this.AreaId = this.mTempId[1]; this.AreaType = this.mTempId[3]; switch (this.AreaType) { case 1: this.NormalRoomInfos = down.roomUiInfo; TimerHeap.DelTimer(this.mNormalRoomCDId); this.mNormalRoomCDId = TimerHeap.AddTimer(1000u, 1000, new Action(this.NormalRoomTick)); break; case 2: this.ChaosRoomInfos = down.roomUiInfo; TimerHeap.DelTimer(this.mChaosRoomCDId); this.mChaosRoomCDId = TimerHeap.AddTimer(1000u, 1000, new Action(this.ChaosRoomTick)); break; case 3: this.VipRoomInfos = down.roomUiInfo; TimerHeap.DelTimer(this.mVipRoomCDId); this.mVipRoomCDId = TimerHeap.AddTimer(1000u, 1000, new Action(this.VipRoomTick)); break; } Debug.Log(string.Concat(new object[] { "返回区域[<color=#ffffff>", this.MapId, "-", this.AreaId, "</color>]房间列表" })); EventDispatcher.Broadcast(EventNames.GetHuntRoomList); }
public override void SetCommonLogic() { if (EntityWorld.Instance.EntSelf == null) { return; } bool flag = false; if (!this.HasEnteredCityBefore) { this.HasEnteredCityBefore = true; EventDispatcher.Broadcast("ReTriggerTaskOfLogin"); if (Application.get_isMobilePlatform() && EntityWorld.Instance.EntSelf.Lv == 1) { flag = true; } } Action action = delegate { FXSpineManager.Instance.ShowBattleStart2(delegate { LoadingUIView.Close(); TownUI.IsOpenAnimationOn = true; this.ShowTownUI(); if (EntityWorld.Instance.EntSelf.IsNavigating) { EventDispatcher.Broadcast(EventNames.BeginNav); } MySceneManager.Instance.PlayBGM(); EventDispatcher.BroadcastAsync(CityManagerEvent.EnteredCity); }); }; if (flag) { ClientApp.Instance.PlayCGMovie(action); } else { action.Invoke(); } }
private void OnGetDailyTaskPrizeRes(short state, GetDailyTaskPrizeRes down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } DailyTask dailyTask = this.mDailyList.Find((DailyTask e) => e.taskId == this.mLastFindTaskId); if (dailyTask != null) { dailyTask.canFindTimes -= this.mLastFindTimes; if (dailyTask.canFindTimes < 0) { dailyTask.canFindTimes = 0; } EventDispatcher.Broadcast(EventNames.DailyTaskFindRes); this.CheckTownDailyTaskPoint(); } }
private void JustOnMaskScreen() { if (GuideManager.Instance.step_attempt_lock) { return; } if (GuideManager.Instance.mintime_lock) { return; } if (GuideManager.Instance.finger_move_lock) { return; } if (GuideUIView.IsTriggerNextStep) { this.Show(false); EventDispatcher.Broadcast("GuideManager.NextStep"); } }
public void SendExitDungeonReq() { EventDispatcher.Broadcast("GuideManager.InstanceExit"); if (MultiPlayerInstance.Instance.isMulti) { MultiPlayerManager.Instance.SendPveExitBattleReq(); } else if (this.DungeonInstanceType == DungeonManager.InsType.FIELD) { NetworkManager.Send(new ExitChallengeReq { pos = Pos.FromScenePos(EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position()) }, ServerType.Data); } else { NetworkManager.Send(new ExitChallengeReq(), ServerType.Data); } Debug.Log("退出挑战请求" + MultiPlayerInstance.Instance.isMulti); }