Esempio n. 1
0
        /// <summary>
        /// Scenes the notify init.
        /// </summary>
        public static void SceneNotifyInit()
        {
            Messenger.AddListener <string>(NotifyTypes.GoToScene, (sceneName) => {
                SceneManagerController.GetInstance().ChangeScene(sceneName);
            });

            Messenger.AddListener <string>(NotifyTypes.DealSceneEvent, (eventId) => {
//				EventData eventData = JsonManager.GetInstance().GetMapping<EventData>("AreaEventDatas", eventId);
                EventData eventData = null;
                if (AreaMain.StaticAreaEventsMapping.ContainsKey(eventId))
                {
                    //判断静态事件是否禁用
                    if (!AreaMain.DisableEventIdMapping.ContainsKey(eventId))
                    {
                        eventData = AreaMain.StaticAreaEventsMapping[eventId];
                    }
                }
                else if (AreaMain.ActiveAreaEventsMapping.ContainsKey(eventId))
                {
                    eventData = AreaMain.ActiveAreaEventsMapping[eventId];
                }
                if (eventData != null)
                {
                    string[] fen;
                    switch (eventData.Type)
                    {
                    case SceneEventType.EnterArea:
                        fen = eventData.EventId.Split(new char[] { '_' });
                        if (fen.Length >= 3)
                        {
                            string areaName = fen[0];
                            int x           = int.Parse(fen[1]);
                            int y           = int.Parse(fen[2]);
                            Messenger.Broadcast <string, Vector2, System.Action <UserData> >(NotifyTypes.UpdateUserDataAreaInfo, areaName, new Vector2(x, y), (userData) => {
                                Messenger.Broadcast <string>(NotifyTypes.GoToScene, userData.CurrentAreaSceneName);
                                //清空临时事件
                                Messenger.Broadcast <List <SceneEventType> >(NotifyTypes.ClearDisableEventIdMapping, new List <SceneEventType>()
                                {
                                    SceneEventType.DisablePagoda
                                });
                            });
                        }
                        break;

                    case SceneEventType.Battle:
                    case SceneEventType.Pagoda:
                        Messenger.Broadcast <string>(NotifyTypes.CreateBattle, eventData.EventId);
                        break;

                    case SceneEventType.EnterCity:
                        Messenger.Broadcast <string>(NotifyTypes.UpdateUserDataCityInfo, eventData.EventId);
                        Messenger.Broadcast <System.Action <UserData> >(NotifyTypes.UpdateUserData, (userData) => {
//							Messenger.Broadcast<string>(NotifyTypes.EnterCityScene, userData.CurrentCitySceneId);
                            Messenger.Broadcast <string>(NotifyTypes.EnterCityScene, eventData.EventId);
                        });
                        break;

                    case SceneEventType.Task:
                        Messenger.Broadcast <string>(NotifyTypes.GetTaslDetailInfoData, eventData.EventId);
                        break;

                    case SceneEventType.EatFood:
                        Messenger.Broadcast <int>(NotifyTypes.EatFood, eventData.IntValue);
                        fen = eventData.Id.Split(new char[] { '_' });
                        if (fen.Length >= 3)
                        {
                            string areaName = fen[0];
                            int x           = int.Parse(fen[1]);
                            int y           = int.Parse(fen[2]);
                            //处理静态事件的预禁用操作
                            EventData disableEvent = new EventData();
                            disableEvent.Id        = eventData.Id;
                            disableEvent.Type      = SceneEventType.DisableEvent;
                            disableEvent.X         = x;
                            disableEvent.Y         = y;
                            Messenger.Broadcast <string, EventData>(NotifyTypes.PushDisableEvent, disableEvent.Id, disableEvent);
                        }
                        break;

                    case SceneEventType.Dialog:
                        switch (eventData.EventId)
                        {
                        case "dialog0001":
                            Messenger.Broadcast(NotifyTypes.OpenTowerGuiderPanel);
                            break;

                        default:
                            break;
                        }
                        break;

                    case SceneEventType.Store:
                        DbManager.Instance.GetStoreData(eventData.EventId);
                        break;

                    default:
                        break;
                    }
                }
            });

            Messenger.AddListener(NotifyTypes.FromCitySceneBackToArea, () => {
                if (UserModel.CurrentUserData != null)
                {
                    Messenger.Broadcast <string, Vector2, System.Action <UserData> >(NotifyTypes.UpdateUserDataAreaInfo,
                                                                                     UserModel.CurrentUserData.CurrentAreaSceneName,
                                                                                     new Vector2(UserModel.CurrentUserData.CurrentAreaX, UserModel.CurrentUserData.CurrentAreaY),
                                                                                     (userData) => {
                        UserModel.CurrentFoodNums    = userData.AreaFood.MaxNum;
                        UserModel.CurrentRebornTimes = 0;
                        //播放大地图背景音乐
                        Messenger.Broadcast(NotifyTypes.PlayBgm);
                    }
                                                                                     );
                }
                //清空临时事件
                Messenger.Broadcast <List <SceneEventType> >(NotifyTypes.ClearDisableEventIdMapping, new List <SceneEventType>()
                {
                    SceneEventType.DisablePagoda
                });
            });

            Messenger.AddListener <string>(NotifyTypes.EnterCityScene, (cityId) => {
                DbManager.Instance.CheckEnterCity(cityId);
                DbManager.Instance.GetCitySceneMenuData(cityId);
                Messenger.Broadcast(NotifyTypes.GetTasksInCityScene);
                Messenger.Broadcast(NotifyTypes.MakeTaskListHide);
            });

            Messenger.AddListener(NotifyTypes.GetTasksInCityScene, () => {
                CityScenePanelCtrl.GetTasksInCityScene();
            });

            Messenger.AddListener(NotifyTypes.HideCityScenePanel, () => {
                CityScenePanelCtrl.MakeFadeOut();
            });

            Messenger.AddListener <string>(NotifyTypes.GetStorePanelData, (cityId) => {
                DbManager.Instance.GetStorePanelData(cityId);
            });

            Messenger.AddListener <List <ItemData>, double>(NotifyTypes.GetStorePanelDataEcho, (items, silver) => {
                StorePanelCtrl.Show(items, silver);
            });

            Messenger.AddListener <string>(NotifyTypes.BuyItem, (itemId) => {
                DbManager.Instance.BuyItem(itemId);
            });

            Messenger.AddListener <string, double>(NotifyTypes.BuyItemEcho, (msg, silver) => {
                StorePanelCtrl.MakeBuyItemEcho(msg, silver);
                SoundManager.GetInstance().PushSound("ui0006");
            });

            Messenger.AddListener(NotifyTypes.MakeCheckNewFlags, () => {
                CityScenePanelCtrl.MakeCheckNewFlags();
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Scenes the notify init.
        /// </summary>
        public static void RoleNotifyInit()
        {
            Messenger.AddListener <bool>(NotifyTypes.CallRoleInfoPanelData, (isfighting) => {
                DbManager.Instance.CallRoleInfoPanelData(isfighting);
            });

            Messenger.AddListener <JObject, bool>(NotifyTypes.CallRoleInfoPanelDataEcho, (obj, isfighting) => {
//                RoleInfoPanelCtrl.Show((JArray)obj["data"], isfighting);
                RolesInfoPanelCtrl.Show((JArray)obj["data"]);
                if (!isfighting)
                {
                    Messenger.Broadcast(NotifyTypes.ShowTaskBtnPanel);
                }
            });

            Messenger.AddListener(NotifyTypes.HideRoleInfoPanel, () => {
//                RoleInfoPanelCtrl.MoveDown();
                RolesInfoPanelCtrl.MoveDown();
                Messenger.Broadcast(NotifyTypes.HideTaskBtnPanel);
            });

            Messenger.AddListener(NotifyTypes.MakeRoleInfoPanelRedPointRefresh, () => {
                RolesInfoPanelCtrl.MakeRefreshRedPoint();
            });

            Messenger.AddListener(NotifyTypes.MakeReviewRole, () => {
                RolesInfoPanelCtrl.MakeReviewRole();
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeChangeRoleEnable, (enable) => {
                RoleInfoPanelCtrl.MakeChangeRoleEnable(enable);
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeChangeBookEnable, (enable) => {
                RoleInfoPanelCtrl.MakeChangeBookEnable(enable);
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeRoleInfoPanelDisable, (dis) => {
                RoleInfoPanelCtrl.MakeDisable(dis);
            });

            Messenger.AddListener <string>(NotifyTypes.GetRolesOfWinShopPanelData, (cityId) => {
                DbManager.Instance.GetRolesOfWinShopPanelData(cityId);
            });

            Messenger.AddListener <List <RoleData> >(NotifyTypes.GetRolesOfWinShopPanelDataEcho, (roles) => {
                roles.Sort((a, b) => b.Id.CompareTo(a.Id));
                RolesOfWinShopPanelCtrl.Show(roles);
            });

            Messenger.AddListener(NotifyTypes.GetWeaponsListPanelData, () => {
                DbManager.Instance.GetWeaponsListPanelData();
            });

            Messenger.AddListener <List <WeaponData>, RoleData>(NotifyTypes.GetWeaponsListPanelDataEcho, (weapons, host) => {
                WeaponListPanelCtrl.Show(weapons, host);
            });

            Messenger.AddListener <int, string>(NotifyTypes.ReplaceWeapon, (id, beUsingByRoleId) => {
                DbManager.Instance.ReplaceWeapon(id, beUsingByRoleId);
            });

            Messenger.AddListener <int>(NotifyTypes.TakeOffWeapon, (id => {
                DbManager.Instance.TakeOffWeapon(id);
                SoundManager.GetInstance().PushSound("ui0008");
            }));

            Messenger.AddListener(NotifyTypes.GetBooksListPanelData, () => {
                DbManager.Instance.GetBooksListPanelData();
            });

            Messenger.AddListener <List <BookData> >(NotifyTypes.GetBooksListPanelDataEcho, (books) => {
                BookListPanelCtrl.Show(books);
            });

            Messenger.AddListener <int>(NotifyTypes.UseBook, (id => {
                DbManager.Instance.UseBook(id);
            }));

            Messenger.AddListener <int>(NotifyTypes.UnuseBook, (id => {
                DbManager.Instance.UnuseBook(id);
                SoundManager.GetInstance().PushSound("ui0008");
            }));

            Messenger.AddListener <string>(NotifyTypes.GetBooksOfForbiddenAreaPanelData, (cityId) => {
                DbManager.Instance.GetBooksOfForbiddenAreaPanelData(cityId);
            });

            Messenger.AddListener <List <BookData>, RoleData>(NotifyTypes.GetBooksOfForbiddenAreaPanelDataEcho, (books, host) => {
                BooksOfForbiddenAreaPanelCtrl.Show(books, host);
            });

            Messenger.AddListener <int>(NotifyTypes.InviteRole, (id) => {
//                DbManager.Instance.InviteRole(id);
                DbManager.Instance.InviteRoleWithResources(id);
            });

            Messenger.AddListener <int>(NotifyTypes.ReadBook, (id => {
                DbManager.Instance.ReadBook(id);
            }));

            Messenger.AddListener(NotifyTypes.GetReadyToTravelPanelData, () => {
                DbManager.Instance.GetReadyToTravelPanelData();
            });

            Messenger.AddListener <List <RoleData>, UserData>(NotifyTypes.GetReadyToTravelPanelDataEcho, (roles, user) => {
                Messenger.Broadcast(NotifyTypes.HideRoleInfoPanel);
                roles.Sort(sortReadyToTravelRoles);
                ReadyToTravelPanelCtrl.Show(roles, user);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.MakeSelectRoleInTeam, (role) => {
                ReadyToTravelPanelCtrl.MakeSelectRole(role);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.MakeUnSelectRoleInTeam, (role) => {
                ReadyToTravelPanelCtrl.MakeUnSelectRole(role);
            });

            Messenger.AddListener <JArray>(NotifyTypes.ChangeRolesSeatNo, (ids) => {
                DbManager.Instance.ChangeRolesSeatNo(ids);
            });

            Messenger.AddListener(NotifyTypes.EnterAreaFromCity, () => {
                Messenger.Broadcast(NotifyTypes.HideCityScenePanel);
                Messenger.Broadcast(NotifyTypes.FromCitySceneBackToArea);
                Messenger.Broadcast(NotifyTypes.CallAreaMainPanelData);
                ReadyToTravelPanelCtrl.Hide();
            });

            Messenger.AddListener(NotifyTypes.GetHospitalPanelData, () => {
                DbManager.Instance.GetHospitalPanelData();
            });

            Messenger.AddListener <List <RoleData> >(NotifyTypes.GetHospitalPanelDataEcho, (roles) => {
                roles.Sort((a, b) => b.Injury.CompareTo(a.Injury));
                HospitalPanelCtrl.Show(roles);
            });

            Messenger.AddListener <int>(NotifyTypes.CureRole, (id => {
                DbManager.Instance.CureRole(id);
            }));

            Messenger.AddListener(NotifyTypes.RelieveRoles, () => {
                DbManager.Instance.RelieveRoles();
            });

            Messenger.AddListener(NotifyTypes.GetBagPanelData, () => {
                DbManager.Instance.GetBagPanelData();
            });

            Messenger.AddListener <List <ItemData>, double>(NotifyTypes.GetBagPanelDataEcho, (items, silver) => {
                BagPanelCtrl.Show(items, silver);
            });

            Messenger.AddListener <ItemData, bool>(NotifyTypes.ShowItemDetailPanel, (item, fromBag) => {
                ItemDetailPanelCtrl.Show(item, fromBag);
            });

            Messenger.AddListener(NotifyTypes.GetSellItemsPanelData, () => {
                DbManager.Instance.GetSellItemsPanelData();
            });

            Messenger.AddListener <List <ItemData> >(NotifyTypes.GetSellItemsPanelDataEcho, (items) => {
                SellItemsPanelCtrl.Show(items);
            });

            Messenger.AddListener(NotifyTypes.MakeSelectedItemOfSellItemsPanel, () => {
                SellItemsPanelCtrl.MakeSelectedItem();
            });

            Messenger.AddListener <JArray>(NotifyTypes.SellItems, (ids) => {
                DbManager.Instance.SellItems(ids);
            });

            Messenger.AddListener <double>(NotifyTypes.SellItemsEcho, (silver) => {
                SellItemsPanelCtrl.Hide();
                StorePanelCtrl.MakeChangeSilverNum(silver);
                SoundManager.GetInstance().PushSound("ui0005");
            });

            Messenger.AddListener <int>(NotifyTypes.DiscardItem, (id) => {
                DbManager.Instance.DiscardItem(id);
                SoundManager.GetInstance().PushSound("ui0008");
            });

            Messenger.AddListener <BookData>(NotifyTypes.ShowBookDetailPanel, (book) => {
                BookDetailPanelCtrl.Show(book, DbManager.Instance.GetBookExpAndSecrets(book.Id));
            });

            Messenger.AddListener <WeaponData>(NotifyTypes.ShowWeaponDetailPanel, (weapon) => {
                WeaponDetailPanelCtrl.Show(weapon, DbManager.Instance.GetWeaponLV(weapon.Id));
            });

            Messenger.AddListener <WeaponData>(NotifyTypes.WeaponLVUpgrade, (weapon) => {
                DbManager.Instance.WeaponLVUpgrade(weapon);
            });

            Messenger.AddListener <WeaponLVData>(NotifyTypes.WeaponLVUpgradeEcho, (lvData) => {
                WeaponDetailPanelCtrl.WeaponLVUpgrade(lvData);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.ShowRoleDetailPanel, (role) => {
                RoleDetailPanelCtrl.Show(role, DbManager.Instance.GetSecretsBelongBooks(role.ResourceBookDataIds));
            });

            Messenger.AddListener <List <DropData> >(NotifyTypes.ShowDropsListPanel, (drops) => {
                DropsListPanelCtrl.Show(drops);
                SoundManager.GetInstance().PushSound("ui0004");
            });

            Messenger.AddListener <int>(NotifyTypes.UseItem, (id => {
                DbManager.Instance.UseItem(id);
            }));

            Messenger.AddListener <string>(NotifyTypes.GetInnInCityData, (cityId) => {
                DbManager.Instance.GetInnInCityData(cityId);
            });

            Messenger.AddListener <List <FloydResult> >(NotifyTypes.GetInnInCityDataEcho, (results) => {
                InnPanelCtrl.Show(results);
            });

            Messenger.AddListener <int, int>(NotifyTypes.GoToCity, (fromIndex, toIndex) => {
                DbManager.Instance.GoToCity(fromIndex, toIndex);
            });

            Messenger.AddListener <SceneData>(NotifyTypes.GoToCityEcho, (scene) => {
                string eventId = JsonManager.GetInstance().GetMapping <string>("AreaCityPosDatas", scene.Id);
                string[] fen   = eventId.Split(new char[] { '_' });
                if (fen.Length >= 3)
                {
                    string areaName = fen[0];
                    int x           = int.Parse(fen[1]);
                    int y           = int.Parse(fen[2]);
                    if (UserModel.CurrentUserData != null)
                    {
                        CityScenePanelCtrl.MakeClose();
                        InnPanelCtrl.Hide();
                        UserModel.CurrentUserData.PositionStatu        = UserPositionStatusType.InCity;
                        UserModel.CurrentUserData.CurrentCitySceneId   = scene.Id;
                        UserModel.CurrentUserData.CurrentAreaSceneName = areaName;
                        UserModel.CurrentUserData.CurrentAreaX         = x;
                        UserModel.CurrentUserData.CurrentAreaY         = y;
                        //清空临时事件
                        Messenger.Broadcast <List <SceneEventType> >(NotifyTypes.ClearDisableEventIdMapping, new List <SceneEventType>()
                        {
                            SceneEventType.DisablePagoda
                        });
                        Messenger.Broadcast <System.Action <UserData> >(NotifyTypes.UpdateUserData, null);
                        Messenger.Broadcast <string>(NotifyTypes.GoToScene, areaName);
                    }
                }
            });

            Messenger.AddListener <string>(NotifyTypes.NpcsEventHandler, (npcId) => {
                switch (npcId)
                {
                case "05002001":
                    if (DbManager.Instance.HostData.Occupation == OccupationType.None)
                    {
                        if (!DbManager.Instance.HasAnyTask((new List <string>()
                        {
                            "task_occupation0",
                            "task_occupation1",
                            "task_occupation2",
                            "task_occupation3",
                            "task_occupation4",
                            "task_occupation5"
                        }).ToArray()))
                        {
                            OccupationPanelCtrl.Show();
                        }
                        else
                        {
                            AlertCtrl.Show("去吧去吧,老夫已为你做了引荐");
                        }
                    }
                    else
                    {
                        AlertCtrl.Show(string.Format("你已是{0},可喜可贺啊,哦哈哈哈哈", Statics.GetOccupationDesc(DbManager.Instance.HostData.Occupation)));
                    }
                    break;

                default:
                    break;
                }
            });

            Messenger.AddListener <int>(NotifyTypes.HostRoleUpgrade, (toLv) => {
                DbManager.Instance.HostRoleUpgrade(toLv);
            });

            Messenger.AddListener <RoleData, RoleData>(NotifyTypes.HostRoleUpgradeEcho, (roleData, toData) => {
                RoleUpgradeLvPanelCtrl.Show(roleData, toData);
                SoundManager.GetInstance().PushSound("ui0002");
            });

            Messenger.AddListener(NotifyTypes.OpenRepairBugPanel, () => {
                RepairBugPanelCtrl.Show();
            });

            Messenger.AddListener <BookData, List <SecretData> >(NotifyTypes.GetSecretListPanelData, (book, hasSecrets) => {
                SecretListPanelCtrl.Show(DbManager.Instance.GetEffectiveSecrets(), book, hasSecrets);
            });

            Messenger.AddListener <BookData, List <SecretData> >(NotifyTypes.DealSecretEcho, (book, hasSecrets) => {
                if (RolesInfoPanelCtrl.Ctrl != null)
                {
                    Messenger.Broadcast <bool>(NotifyTypes.CallRoleInfoPanelData, false);
                    Messenger.Broadcast(NotifyTypes.MakeReviewRole);
                }
                Messenger.Broadcast <BookData>(NotifyTypes.ShowBookDetailPanel, book);
                Messenger.Broadcast <BookData, List <SecretData> >(NotifyTypes.GetSecretListPanelData, book, hasSecrets);
            });

            Messenger.AddListener(NotifyTypes.OpenTowerGuiderPanel, () => {
                TowerGuiderPanelCtrl.Show();
                AreaMainPanelCtrl.MakeRefreshDifficultyView();
            });
        }
Esempio n. 3
0
        /// <summary>
        /// Scenes the notify init.
        /// </summary>
        public static void RoleNotifyInit()
        {
            Messenger.AddListener <bool>(NotifyTypes.CallRoleInfoPanelData, (isfighting) => {
                DbManager.Instance.CallRoleInfoPanelData(isfighting);
            });

            Messenger.AddListener <JObject, bool>(NotifyTypes.CallRoleInfoPanelDataEcho, (obj, isfighting) => {
                RoleInfoPanelCtrl.Show((JArray)obj["data"], isfighting);
                if (!isfighting)
                {
                    Messenger.Broadcast(NotifyTypes.ShowTaskBtnPanel);
                }
            });

            Messenger.AddListener(NotifyTypes.HideRoleInfoPanel, () => {
                RoleInfoPanelCtrl.MoveDown();
                Messenger.Broadcast(NotifyTypes.HideTaskBtnPanel);
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeChangeRoleEnable, (enable) => {
                RoleInfoPanelCtrl.MakeChangeRoleEnable(enable);
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeChangeBookEnable, (enable) => {
                RoleInfoPanelCtrl.MakeChangeBookEnable(enable);
            });

            Messenger.AddListener <bool>(NotifyTypes.MakeRoleInfoPanelDisable, (dis) => {
                RoleInfoPanelCtrl.MakeDisable(dis);
            });

            Messenger.AddListener <string>(NotifyTypes.GetRolesOfWinShopPanelData, (cityId) => {
                DbManager.Instance.GetRolesOfWinShopPanelData(cityId);
            });

            Messenger.AddListener <List <RoleData> >(NotifyTypes.GetRolesOfWinShopPanelDataEcho, (roles) => {
                RolesOfWinShopPanelCtrl.Show(roles);
            });

            Messenger.AddListener(NotifyTypes.GetWeaponsListPanelData, () => {
                DbManager.Instance.GetWeaponsListPanelData();
            });

            Messenger.AddListener <List <WeaponData>, RoleData>(NotifyTypes.GetWeaponsListPanelDataEcho, (weapons, host) => {
                WeaponListPanelCtrl.Show(weapons, host);
            });

            Messenger.AddListener <int, string>(NotifyTypes.ReplaceWeapon, (id, beUsingByRoleId) => {
                DbManager.Instance.ReplaceWeapon(id, beUsingByRoleId);
            });

            Messenger.AddListener <int>(NotifyTypes.TakeOffWeapon, (id => {
                DbManager.Instance.TakeOffWeapon(id);
            }));

            Messenger.AddListener(NotifyTypes.GetBooksListPanelData, () => {
                DbManager.Instance.GetBooksListPanelData();
            });

            Messenger.AddListener <List <BookData> >(NotifyTypes.GetBooksListPanelDataEcho, (books) => {
                BookListPanelCtrl.Show(books);
            });

            Messenger.AddListener <int>(NotifyTypes.UseBook, (id => {
                DbManager.Instance.UseBook(id);
            }));

            Messenger.AddListener <int>(NotifyTypes.UnuseBook, (id => {
                DbManager.Instance.UnuseBook(id);
            }));

            Messenger.AddListener <string>(NotifyTypes.GetBooksOfForbiddenAreaPanelData, (cityId) => {
                DbManager.Instance.GetBooksOfForbiddenAreaPanelData(cityId);
            });

            Messenger.AddListener <List <BookData>, RoleData>(NotifyTypes.GetBooksOfForbiddenAreaPanelDataEcho, (books, host) => {
                BooksOfForbiddenAreaPanelCtrl.Show(books, host);
            });

            Messenger.AddListener <int>(NotifyTypes.InviteRole, (id) => {
//                DbManager.Instance.InviteRole(id);
                DbManager.Instance.InviteRoleWithResources(id);
            });

            Messenger.AddListener <int>(NotifyTypes.ReadBook, (id => {
                DbManager.Instance.ReadBook(id);
            }));

            Messenger.AddListener(NotifyTypes.GetReadyToTravelPanelData, () => {
                DbManager.Instance.GetReadyToTravelPanelData();
            });

            Messenger.AddListener <List <RoleData>, ItemData>(NotifyTypes.GetReadyToTravelPanelDataEcho, (roles, food) => {
                Messenger.Broadcast(NotifyTypes.HideRoleInfoPanel);
                ReadyToTravelPanelCtrl.Show(roles, food);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.MakeSelectRoleInTeam, (role) => {
                ReadyToTravelPanelCtrl.MakeSelectRole(role);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.MakeUnSelectRoleInTeam, (role) => {
                ReadyToTravelPanelCtrl.MakeUnSelectRole(role);
            });

            Messenger.AddListener <JArray>(NotifyTypes.ChangeRolesSeatNo, (ids) => {
                DbManager.Instance.ChangeRolesSeatNo(ids);
            });

            Messenger.AddListener(NotifyTypes.ChangeRolesSeatNoEcho, () => {
                Messenger.Broadcast(NotifyTypes.HideCityScenePanel);
                Messenger.Broadcast(NotifyTypes.FromCitySceneBackToArea);
                Messenger.Broadcast(NotifyTypes.CallAreaMainPanelData);
                ReadyToTravelPanelCtrl.Hide();
            });

            Messenger.AddListener(NotifyTypes.GetHospitalPanelData, () => {
                DbManager.Instance.GetHospitalPanelData();
            });

            Messenger.AddListener <List <RoleData> >(NotifyTypes.GetHospitalPanelDataEcho, (roles) => {
                HospitalPanelCtrl.Show(roles);
            });

            Messenger.AddListener <int>(NotifyTypes.CureRole, (id => {
                DbManager.Instance.CureRole(id);
            }));

            Messenger.AddListener(NotifyTypes.GetBagPanelData, () => {
                DbManager.Instance.GetBagPanelData();
            });

            Messenger.AddListener <List <ItemData>, double>(NotifyTypes.GetBagPanelDataEcho, (items, silver) => {
                BagPanelCtrl.Show(items, silver);
            });

            Messenger.AddListener <ItemData, bool>(NotifyTypes.ShowItemDetailPanel, (item, fromBag) => {
                ItemDetailPanelCtrl.Show(item, fromBag);
            });

            Messenger.AddListener(NotifyTypes.GetSellItemsPanelData, () => {
                DbManager.Instance.GetSellItemsPanelData();
            });

            Messenger.AddListener <List <ItemData> >(NotifyTypes.GetSellItemsPanelDataEcho, (items) => {
                SellItemsPanelCtrl.Show(items);
            });

            Messenger.AddListener(NotifyTypes.MakeSelectedItemOfSellItemsPanel, () => {
                SellItemsPanelCtrl.MakeSelectedItem();
            });

            Messenger.AddListener <JArray>(NotifyTypes.SellItems, (ids) => {
                DbManager.Instance.SellItems(ids);
            });

            Messenger.AddListener <double>(NotifyTypes.SellItemsEcho, (silver) => {
                SellItemsPanelCtrl.Hide();
                StorePanelCtrl.MakeChangeSilverNum(silver);
            });

            Messenger.AddListener <int>(NotifyTypes.DiscardItem, (id) => {
                DbManager.Instance.DiscardItem(id);
            });

            Messenger.AddListener <BookData>(NotifyTypes.ShowBookDetailPanel, (book) => {
                BookDetailPanelCtrl.Show(book);
            });

            Messenger.AddListener <WeaponData>(NotifyTypes.ShowWeaponDetailPanel, (weapon) => {
                WeaponDetailPanelCtrl.Show(weapon);
            });

            Messenger.AddListener <RoleData>(NotifyTypes.ShowRoleDetailPanel, (role) => {
                RoleDetailPanelCtrl.Show(role);
            });

            Messenger.AddListener <List <DropData> >(NotifyTypes.ShowDropsListPanel, (drops) => {
                DropsListPanelCtrl.Show(drops);
            });

            Messenger.AddListener <int>(NotifyTypes.UseItem, (id => {
                DbManager.Instance.UseItem(id);
            }));

            Messenger.AddListener <string>(NotifyTypes.GetInnInCityData, (cityId) => {
                DbManager.Instance.GetInnInCityData(cityId);
            });

            Messenger.AddListener <List <FloydResult> >(NotifyTypes.GetInnInCityDataEcho, (results) => {
                InnPanelCtrl.Show(results);
            });

            Messenger.AddListener <int, int>(NotifyTypes.GoToCity, (fromIndex, toIndex) => {
                DbManager.Instance.GoToCity(fromIndex, toIndex);
            });

            Messenger.AddListener <SceneData>(NotifyTypes.GoToCityEcho, (scene) => {
                string eventId = JsonManager.GetInstance().GetMapping <string>("AreaCityPosDatas", scene.Id);
                string[] fen   = eventId.Split(new char[] { '_' });
                if (fen.Length >= 3)
                {
                    string areaName = fen[0];
                    int x           = int.Parse(fen[1]);
                    int y           = int.Parse(fen[2]);
                    if (UserModel.CurrentUserData != null)
                    {
                        CityScenePanelCtrl.MakeClose();
                        InnPanelCtrl.Hide();
                        UserModel.CurrentUserData.PositionStatu        = UserPositionStatusType.InCity;
                        UserModel.CurrentUserData.CurrentCitySceneId   = scene.Id;
                        UserModel.CurrentUserData.CurrentAreaSceneName = areaName;
                        UserModel.CurrentUserData.CurrentAreaX         = x;
                        UserModel.CurrentUserData.CurrentAreaY         = y;
                        //清空临时事件
                        Messenger.Broadcast(NotifyTypes.ClearDisableEventIdMapping);
                        Messenger.Broadcast <System.Action <UserData> >(NotifyTypes.UpdateUserData, null);
                        Messenger.Broadcast <string>(NotifyTypes.GoToScene, areaName);
                    }
                }
            });

            Messenger.AddListener <string>(NotifyTypes.NpcsEventHandler, (npcId) => {
                switch (npcId)
                {
                case "05002001":
                    if (DbManager.Instance.HostData.Occupation == OccupationType.None)
                    {
                        if (!DbManager.Instance.HasAnyTask((new List <string>()
                        {
                            "task_occupation0",
                            "task_occupation1",
                            "task_occupation2",
                            "task_occupation3",
                            "task_occupation4",
                            "task_occupation5"
                        }).ToArray()))
                        {
                            OccupationPanelCtrl.Show();
                        }
                        else
                        {
                            AlertCtrl.Show("去吧去吧,老夫已为你做了引荐");
                        }
                    }
                    else
                    {
                        AlertCtrl.Show(string.Format("你已是{0}{1},可喜可贺啊,哦哈哈哈哈", Statics.GetOccupationName(DbManager.Instance.HostData.Occupation), Statics.GetOccupationDesc(DbManager.Instance.HostData.Occupation)));
                    }
                    break;

                default:
                    break;
                }
            });
        }