private void AdminScreen_Loaded(object sender, RoutedEventArgs e) { PopupManager.Init(this.LayoutRoot); ServerManager.Instance.Reset(); ServerManager.Instance.Response += new ServerResponseEventHandler(OnServerResponse); _dragDropManager = new DragDropManager(LayoutRoot); lstActors.DragDropManager = _dragDropManager; lstTemplates.DragDropManager = _dragDropManager; // Event Hanlders ctlMap.CanAlwaysMove = true; ctlMap.DirectionClick += new Perenthia.Controls.DirectionEventHandler(ctlMap_DirectionClick); ServerManager.Instance.SendUserCommand("PLAY", this.OnPlayCommandResponse, _playerId); }
void Init() { Get = this; actualEnemy = (Enemy)0; // makes object persistant so that they don't get destroyed on scene unloading DontDestroyOnLoad(persistantContainer); // initializes all text content gameData.Init(); // initializes all managers panelManager.Init(() => { eventSystem = FindObjectOfType <EventSystem>(); actualTutorial = FindObjectOfType <Tutorial>(); // gets refs to popups and closes them without cool effect (as if it was never here) popupManager.GetAllScenePopups(); popupManager.ForceCancelPop(); audioProjectManager.FadeMusicIn(); SetAllTextFont(); }); audioManager.Init(); audioProjectManager.Init(panelManager.fadeDuration, popupManager.fadeDuration, () => { return(panelManager.nextPanel); }, () => { return(panelManager.actualPanel); }, () => { return(popupManager.actualPopup); }); popupManager.Init(audioProjectManager.FadePopupMusicOut); PlugPanelEvents(); PlugPopupEvents(); // real start of game (these actions are normally called during transition events) popupManager.GetAllScenePopups(); popupManager.ForceCancelPop(); InitTitlePanel(); audioProjectManager.FadeMusicIn(); Skinning.Init(selectedSkin); SetAllTextFont(); }
private void BuildScreen_Loaded(object sender, RoutedEventArgs e) { // Load the game component. _token = new UserToken() { AuthKey = Settings.UserAuthKey }; ctlWait.Hide(); PopupManager.Init(this.PopupContainer); // Stop issuing commands to the server. ServerManager.Instance.Reset(); _dragDropManager = new DragDropManager(this.LayoutRoot); lstCreatures.DragDropManager = _dragDropManager; lstItems.DragDropManager = _dragDropManager; lstNpcs.DragDropManager = _dragDropManager; lstQuests.DragDropManager = _dragDropManager; lstCreatures.EnableDrag = true; lstItems.EnableDrag = true; lstNpcs.EnableDrag = true; lstQuests.EnableDrag = true; ctlMap.StatusUpdated += new MapEditor.StatusUpdatedEventHandler(ctlMap_StatusUpdated); ctlMap.PlaceChanged += new PlaceEventHanlder(ctlMap_PlaceChanged); ctlMap.MapLoadComplete += new EventHandler(ctlMap_MapLoadComplete); ctlProperties.PropertyChanged += new PropertyChangedEventHandler(ctlProperties_PropertyChanged); ctlActors.EnableDrag = true; ctlActors.ActorDrop += new ActorEventHandler(ctlActors_ActorDrop); ctlActors.ActorClick += new ActorEventHandler(ctlActors_ActorClick); this.LoadTemplates(); }