Пример #1
0
    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;
        }
    }
Пример #2
0
    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;
        }
    }
Пример #3
0
    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();
    }