Example #1
0
        public override void Execute(INotification notification)
        {
            AvatarDistributedObject avatar      = (AvatarDistributedObject)((object[])notification.Body)[0];
            String                chatText      = (String)((object[])notification.Body)[1];
            IGuiManager           guiManager    = GameFacade.Instance.RetrieveMediator <RuntimeGuiManager>();
            CameraManagerMediator cameraManager = GameFacade.Instance.RetrieveMediator <CameraManagerMediator>();
            ChatMediator          chatMediator  = GameFacade.Instance.RetrieveMediator <ChatMediator>();

            // Show the chat bubble above the avatars head
            avatar.ShowChat(chatText, cameraManager.GetMainCamera(), guiManager);
            // Put the message in the chat log
            chatMediator.AddChatText(chatText);

            GameFacade.Instance.SendNotification(GameFacade.PLAY_SOUND_POPUP_APPEAR_B);
        }
Example #2
0
        public NavigationBar(IGuiManager guiManager)
            : base(guiManager, mResourcePath)
        {
            mMainWindow           = (Window)this.MainGui;
            mMapButton            = mMainWindow.SelectSingleElement <Button>("MainFrame/Map");
            mFriendButton         = mMainWindow.SelectSingleElement <Button>("MainFrame/Friend");
            mRoomButton           = mMainWindow.SelectSingleElement <Button>("MainFrame/Room");
            mClosetButton         = mMainWindow.SelectSingleElement <Button>("MainFrame/Closet");
            mShopButton           = mMainWindow.SelectSingleElement <Button>("MainFrame/Shop");
            mSettingsButton       = mMainWindow.SelectSingleElement <Button>("MainFrame/Settings");
            mCurrentLocationLabel = mMainWindow.SelectSingleElement <Label>("MainFrame/CurrentLocationLabel");
            mEmoteMenuButton      = mMainWindow.SelectSingleElement <Button>("MainFrame/EmoteMenu");
            mEntourageButton      = mMainWindow.SelectSingleElement <Button>("MainFrame/Entourage");
            EmoteGuiController emoteController = new EmoteGuiController(GameFacade.Instance.RetrieveMediator <RuntimeGuiManager>());

            // Hide these until they are implemented
            mFriendButton.Showing   = false;
            mSettingsButton.Showing = false;

            mEntourageButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.SHOW_ENTOURAGE);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.ENTOURAGE_BUTTON);
            });

            mRoomButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.TOGGLE_ROOM_PICKER_GUI, MessageSubType.PublicRooms);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.ROOM_BUTTON);
            });

            mFriendButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.FRIEND_BUTTON_CLICKED);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.FRIEND_BUTTON);
            });

            mClosetButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.CLOSET_BUTTON_CLICKED);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.CLOSET_BUTTON);
            });

            mShopButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.SHOP_BUTTON_CLICKED);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.SHOP_BUTTON);
            });

            mSettingsButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.SETTINGS_BUTTON_CLICKED);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.SETTINGS_BUTTON);
            });
            mCurrentLocationLabel.Text = string.Empty;

            mMapButton.AddOnPressedAction(delegate()
            {
                ToggleWindow(GameFacade.MAP_BUTTON_CLICKED);
                EventLogger.Log(LogGlobals.CATEGORY_GUI, LogGlobals.MAP_BUTTON);
            });

            mEmoteMenuButton.AddOnPressedAction(delegate()
            {
                emoteController.ToggleOpen();
            });

            // Load chat bar
            IInputManager inputManager = GameFacade.Instance.RetrieveMediator <InputManagerMediator>();
            ChatMediator  chatMediator = GameFacade.Instance.RetrieveMediator <ChatMediator>();

            mChatWindow             = new ChatWindow(inputManager, mMainWindow.SelectSingleElement <IGuiFrame>("MainFrame/ChatBar"));
            chatMediator.ChatWindow = mChatWindow;
        }