public void Initialize(IChatController chatController, IMouseCatcher mouseCatcher) { view = WorldChatWindowHUDView.Create(); view.controller = this; chatHudController = new ChatHUDController(); chatHudController.Initialize(view.chatHudView); chatHudController.OnPressPrivateMessage -= ChatHUDController_OnPressPrivateMessage; chatHudController.OnPressPrivateMessage += ChatHUDController_OnPressPrivateMessage; LoadLatestReadWorldChatMessagesStatus(); view.OnSendMessage += SendChatMessage; this.chatController = chatController; this.mouseCatcher = mouseCatcher; if (chatController != null) { chatController.OnAddMessage -= OnAddMessage; chatController.OnAddMessage += OnAddMessage; } if (mouseCatcher != null) { mouseCatcher.OnMouseLock += view.ActivatePreview; } }
public ProfileHUDController() { mouseCatcher = InitialSceneReferences.i?.mouseCatcher; view = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("ProfileHUD")).GetComponent <ProfileHUDView>(); view.name = "_ProfileHUD"; view.buttonLogOut.onClick.AddListener(WebInterface.LogOut); view.buttonClaimName.onClick.AddListener(() => WebInterface.OpenURL(URL_CLAIM_NAME)); ownUserProfile.OnUpdate += OnProfileUpdated; if (mouseCatcher != null) { mouseCatcher.OnMouseLock += OnMouseLocked; } }
public void Initialize(IMouseCatcher mouseCatcher, IChatController chatController, IFriendsController friendsController) { this.mouseCatcher = mouseCatcher; this.chatController = chatController; view = TaskbarHUDView.Create(this, chatController, friendsController); if (mouseCatcher != null) { mouseCatcher.OnMouseLock -= MouseCatcher_OnMouseLock; mouseCatcher.OnMouseUnlock -= MouseCatcher_OnMouseUnlock; mouseCatcher.OnMouseLock += MouseCatcher_OnMouseLock; mouseCatcher.OnMouseUnlock += MouseCatcher_OnMouseUnlock; } view.chatHeadsGroup.OnHeadToggleOn += ChatHeadsGroup_OnHeadOpen; view.chatHeadsGroup.OnHeadToggleOff += ChatHeadsGroup_OnHeadClose; view.windowContainerLayout.enabled = false; view.OnChatToggleOff += View_OnChatToggleOff; view.OnChatToggleOn += View_OnChatToggleOn; view.OnFriendsToggleOff += View_OnFriendsToggleOff; view.OnFriendsToggleOn += View_OnFriendsToggleOn; toggleFriendsTrigger = Resources.Load <InputAction_Trigger>("ToggleFriends"); toggleFriendsTrigger.OnTriggered -= ToggleFriendsTrigger_OnTriggered; toggleFriendsTrigger.OnTriggered += ToggleFriendsTrigger_OnTriggered; closeWindowTrigger = Resources.Load <InputAction_Trigger>("CloseWindow"); closeWindowTrigger.OnTriggered -= CloseWindowTrigger_OnTriggered; closeWindowTrigger.OnTriggered += CloseWindowTrigger_OnTriggered; toggleWorldChatTrigger = Resources.Load <InputAction_Trigger>("ToggleWorldChat"); toggleWorldChatTrigger.OnTriggered -= ToggleWorldChatTrigger_OnTriggered; toggleWorldChatTrigger.OnTriggered += ToggleWorldChatTrigger_OnTriggered; if (chatController != null) { chatController.OnAddMessage -= OnAddMessage; chatController.OnAddMessage += OnAddMessage; } view.windowContainerAnimator.Show(); }