Exemplo n.º 1
0
    IEnumerator DelayedRecorderInit(float waitSeconds)
    {
        yield return(new WaitForSeconds(waitSeconds));

        InitializeRecorder();
        InfoMessageManager.Display("Voice reinitialized: if voice does not work, please re-launch the application with the new mic plugged in");
    }
Exemplo n.º 2
0
    void Update()
    {
        if (!initialized && CommunicationManager.IsConnected)
        {
            if (VoiceChatRecorder.Instance.NetworkId == -1)
            {
                VoiceChatRecorder.Instance.NetworkId = CommunicationManager.MySelf.Id;
            }

            // use the default device by keeping VoiceChatRecorder.Instance.Device == null
            numMicrophoneDevices = VoiceChatRecorder.Instance.AvailableDevices.Length;
            InitializeRecorder();
            ToggleToTalk = GameManager.Inst.voiceToggleInitSetting;
            initialized  = true;
        }
        if (numMicrophoneDevices != VoiceChatRecorder.Instance.AvailableDevices.Length)
        {
            string msg = (numMicrophoneDevices < VoiceChatRecorder.Instance.AvailableDevices.Length) ? "new" : "lost";
            InfoMessageManager.Display("Detected a " + msg + " microphone device, reinitializing voice");
            VoiceChatRecorder.Instance.UpdateUserMicHWI("(unknown)");
            StartCoroutine(DelayedRecorderInit(2.0f));
            numMicrophoneDevices = VoiceChatRecorder.Instance.AvailableDevices.Length;
        }
        if (HandleFeedbackDetection && AllowVoiceToggle && IsFeedbackOverThreshold())
        {
            AnnouncementManager.Inst.Announce("Microphone Feedback", "We\'re sorry. Your computer has been detected to be causing audio feedback for other users.  Please use the Push To Talk option when you\'d like to speak.");
            AllowVoiceToggle = false;
        }
    }
Exemplo n.º 3
0
 private void OnCrashed(System.Object sender, EventArgs args)
 {
     if (crashedCount++ > 1)
     {
         InfoMessageManager.Display("The web screen has crashed, please try a different url");
         newUrl = "";
         return;
     }
     browserTexture.ReviveWebView();
 }
Exemplo n.º 4
0
 void OnKeyEntryBlocked(System.Object sender, KeyEventArgs args)
 {
     if (MainCameraController.Inst.cameraType != CameraType.SNAPCAM && !GameGUI.Inst.GuiLayerHasInputFocus && RemoteMouseManager.Inst.GetMyVisual().browserId == browserTexture.id)
     {
         bool isArrowKey = args.Key == KeyCode.UpArrow || args.Key == KeyCode.DownArrow || args.Key == KeyCode.RightArrow || args.Key == KeyCode.LeftArrow;
         if (allowZoomInMsg && !isArrowKey)
         {
             InfoMessageManager.Display("You must zoom in to enter text on this panel  <span id=zoom-link onclick=\"handleZoomRequest();\">Zoom Now</span>");
             allowZoomInMsg = false;
         }
     }
 }
Exemplo n.º 5
0
 void OnGUI()
 {
     if (Event.current != null && Event.current.type == EventType.MouseUp && MouseHelpers.GetCurrentGameObjectHit() == gameObject && levelDestination != GameManager.Level.NONE)
     {
         if (MaxDistCheck())
         {
             Teleport();
         }
         else
         {
             InfoMessageManager.Display("Please move closer to teleport");
         }
     }
 }
Exemplo n.º 6
0
 void OnGUI()
 {
     if (MouseHelpers.GetCurrentGameObjectHit() == gameObject && (string.IsNullOrEmpty(serverName) || serverName == GameManager.Inst.ServerConfig) && GameManager.Inst.LocalPlayer && MaxDistCheck() && (hideForCameraType == CameraType.NONE || hideForCameraType != MainCameraController.Inst.cameraType))
     {
         if (!msgShown)
         {
             InfoMessageManager.Display(message);
         }
         msgShown = true;
     }
     else
     {
         msgShown = false;
     }
 }
Exemplo n.º 7
0
    protected void Teleport()
    {
        if (GameManager.Inst.LocalPlayer.Type < minAccessRights)
        {
            InfoMessageManager.Display("Sorry, you do not have access to this room");
            return;
        }

        if (WebViewManager.Inst.AreAnyBusy())
        {
            WebViewManager.Inst.StopAll();
        }
        teleporting = true;
        GameManager.Inst.LocalPlayer.IsTeleporting = true;
        makeActionRequest = true;
    }
Exemplo n.º 8
0
 void OnClickBlocked(System.Object sender, System.EventArgs args)
 {
     if (GameManager.Inst.LevelLoaded == GameManager.Level.ORIENT)
     {
         if (browserTexture.AllowInputChanges && browserTexture.restrictedByTrigger)
         {
             if (!ReplayManager.Initialized || !ReplayManager.Inst.Playing)
             {
                 InfoMessageManager.Display("Move onto the stage to click on screen");
             }
         }
         else if (!browserTexture.AllowInputChanges)
         {
             InfoMessageManager.Display("You do not have permission to click on this screen. :(");
         }
     }
 }
Exemplo n.º 9
0
    public void HandleAction(string action)
    {
        string[] tok = action.Split(new char[] { ',' }, 3);
        if (tok.Length < 3)
        {
            Debug.LogError("Number of expected tokens not found");
            return;
        }

        int bssId = -1;

        int.TryParse(tok[0].Substring(tok[0].IndexOf("=") + 1), out bssId);

        string div = tok[1].Substring(tok[1].IndexOf("=") + 1);
        string url = tok[2].Substring(tok[2].IndexOf("=") + 1);;


        // This can become more efficient
        for (int i = 0; i < BizSimScreen.GetAll().Count; ++i)
        {
            if (BizSimScreen.GetAll()[i].bTex.id == bssId)
            {
                string error = null;
                if (BizSimScreen.GetAll()[i].bTex.isWebViewBusy())
                {
                    error = "The panel appears to be busy, please try again";
                }
                if (BizSimScreen.GetAll()[i].bTex.URL != url)
                {
                    error = "The url appears to have changed, please try again";
                }
                if (error != null)
                {
                    InfoMessageManager.Display(error);
                }
                else
                {
                    BizSimScreen.GetAll()[i].bTex.ForceConfirmClickOnDiv(":submit");
                }

                return;
            }
        }
    }
Exemplo n.º 10
0
 protected override void OnTriggerEnter(Collider other)
 {
     if ((GameManager.Inst.LocalPlayer != null) && (other.gameObject == GameManager.Inst.LocalPlayer.gameObject))
     {
         if (AngleCheck(other))
         {
             Teleport();
         }
         else
         {
             checkAngleWithinTeleport = true;
             InfoMessageManager.Display("Turn around to teleport");
         }
     }
     else if (GameManager.buildType == GameManager.BuildType.REPLAY && other.GetComponent <PlayerController>() != null)
     {
         other.gameObject.SetActive(false);
     }
 }
Exemplo n.º 11
0
    void OnGUI()
    {
        if (Event.current != null && Event.current.type == EventType.MouseUp && MouseHelpers.GetCurrentGameObjectHit() == gameObject)
        {
            if (MaxDistCheck())
            {
                Transform playerTransform = GameManager.Inst.LocalPlayer.gameObject.transform;

                // put player in position
                float   dirMultiplier = flipDir ? -1.0f : 1.0f;
                Vector3 forwardDir    = dirMultiplier * gameObject.transform.forward;
                GameManager.Inst.playerManager.SetLocalPlayerTransform(gameObject.transform.position + (-sitSettings.DropDistance * Vector3.up) + (sitSettings.DistanceFromChair * forwardDir.normalized), Quaternion.LookRotation(forwardDir));
                GameManager.Inst.LocalPlayer.Sit();
            }
            else
            {
                InfoMessageManager.Display("Please move closer to sit");
            }
        }
    }
Exemplo n.º 12
0
    private void OnBeginLoading(System.Object sender, Awesomium.Mono.BeginLoadingEventArgs args)
    {
        if (!CheckWebView())
        {
            return;
        }

        if (!args.Url.Contains("holdinginfo.php"))
        {
            // the url is expected to redirect to holdinginfo.php, so if it hasn't, assume there was an error
            InfoMessageManager.Display("* We're sorry, the business simulation is unavailable at this time *");
            Debug.LogError("Biz Sim Login Error: url didn't redirect: " + args.Url);
            return;
        }
        switch (stage)
        {
        case LoginStage.START:
            stage = LoginStage.IN_GAME;
            RaiseLoginCompleteEvent(args);
            break;
        }
    }
Exemplo n.º 13
0
    private void LoadLevelImpl(Level level, bool privateRm = false)
    {
        loadLevel = level;
        if (loadLevel == Level.NONE)
        {
            return;
        }

        if (!WebViewManager.Inst.AreAnyBusy() || (warningDisplayed && DateTime.UtcNow.Subtract(warningStart).TotalSeconds > 1.0f))
        {
            // save current state
            lastLevel    = (level != GameManager.Inst.LevelLoaded) ? GameManager.Inst.LevelLoaded : lastLevel;
            lastCampus   = (level == GameManager.Level.CAMPUS || level == GameManager.Level.MINICAMPUS) ? level : lastCampus;
            lastRoomId   = CommunicationManager.Inst.roomNumToLoad;
            lastPosition = GameManager.Inst.LocalPlayer ? GameManager.Inst.LocalPlayer.gameObject.transform.position : Vector3.zero;
            lastRotation = GameManager.Inst.LocalPlayer ? GameManager.Inst.LocalPlayer.gameObject.transform.rotation : Quaternion.identity;
            CommunicationManager.LevelToLoad = loadLevel;
            if (privateRm)
            {
                CommunicationManager.Inst.roomToJoin = "";
            }
            IsLoadingLevel = true;
            CommunicationManager.SendJoinRoomRequest();
            loadLevel        = Level.NONE;
            warningDisplayed = false;
        }
        else if (!warningDisplayed)
        {
            if (GameGUI.Inst.fadeAlpha < 0.9f)
            {
                InfoMessageManager.Display("The level is still loading, you will be teleported shortly");
            }
            WebViewManager.Inst.StopAll();
            warningDisplayed = true;
            warningStart     = DateTime.UtcNow;
        }
    }
Exemplo n.º 14
0
    public void DrawConsoleInput()
    {
        // by default tab puts focus on unity text fields, disabling that here.
        if ((Event.current.keyCode == KeyCode.Tab || Event.current.character == '\t') && FocusManager.Inst.AnyKeyInputBrowsersFocused())
        {
            return;
        }

        // Render the console input bar.
        // Console Input Rect
        Rect consoleRect = new Rect(consoleLeftIndent, Screen.height - (consoleBottomIndent + consoleBarHeight), consoleWidth, consoleBarHeight);

        GameGUI.Inst.DrawConsoleGUIBar(consoleRect);

        GUI.skin.textField.normal.background  = null;
        GUI.skin.textField.active.background  = null;
        GUI.skin.textField.focused.background = null;
        GUI.skin.textField.hover.background   = null;

        int consoleTextMarginY = 5;
        int consoleTextMarginX = 8;

        GUI.SetNextControlName("consoleInput");
        consoleInput = GUI.TextField(new Rect(consoleRect.x + consoleTextMarginX, consoleRect.y + consoleTextMarginY, consoleRect.width - (2 * consoleTextMarginX), consoleRect.height - (2 * consoleTextMarginY)), consoleInput);

        // FocusConsole() runs this stuff until the console is focused.
        // This takes two ticks to work (not sure why)... focusConsoleTicks keeps track.
        if (focusConsoleTicks > 0)
        {
            GUI.FocusControl("consoleInput");

            TextEditor editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl);
            if (editor != null)
            {
                editor.selectPos = consoleInput.Length;
                editor.pos       = consoleInput.Length;
            }

            focusConsoleTicks--;
        }

        bool consoleInputHasFocus = GUI.GetNameOfFocusedControl() == "consoleInput";

        // Enter command with Enter.
        if (consoleInputHasFocus && Event.current.type == EventType.keyUp && Event.current.keyCode == KeyCode.Return)
        {
            ConsoleInterpreter.Inst.ProcCommand(consoleInput);
            ClearConsoleInput();
            if (GameGUI.Inst.guiLayer == null)
            {
                GameGUI.Inst.Visible = false;
            }
        }
        // Scroll up through inputs.
        else if (consoleInputHasFocus && Event.current.type == EventType.keyUp && Event.current.keyCode == KeyCode.UpArrow)
        {
            if (inputIndex < consoleInputs.Count)
            {
                SeedConsole(consoleInputs[inputIndex]);
                inputIndex++;
            }
        }
        // Scroll down through inputs.
        else if (consoleInputHasFocus && Event.current.type == EventType.keyUp && Event.current.keyCode == KeyCode.DownArrow)
        {
            if (inputIndex > 0)
            {
                inputIndex--;
                SeedConsole(consoleInputs[inputIndex]);
            }
        }
        // Exit console input.
        else if (consoleInputHasFocus && Event.current.isKey && Event.current.keyCode == KeyCode.Escape)
        {
            ClearConsoleInput();
        }
        // Console takes focus on 'Enter', if applicable.
        if (!consoleInputHasFocus && AllowConsoleToTakeEnterFocus && Input.GetKeyUp(KeyCode.Return))
        {
            if (FocusManager.Inst.IsFocusedOnPanel() && MainCameraController.Inst.cameraType == CameraType.SNAPCAM)
            {
                InfoMessageManager.Display("Web Panel has focus, to chat, click in the console input area");
            }
            else
            {
                FocusConsole();
            }
        }
        if (!hadFocusLastFrame && consoleInputHasFocus)
        {
            FocusManager.Inst.UnfocusKeyInputBrowserPanels();
        }

        showConsoleOnUpdate = keepConsoleUpWhileInputHasFocus && consoleInputHasFocus;
        hadFocusLastFrame   = consoleInputHasFocus;
    }