Example #1
0
        private void ShowCharacterCreationMenuEvent(object[] args)
        {
            // Destroy the menu
            Browser.DestroyBrowserEvent(null);

            // Initialize the character creation
            playerData = new PlayerModel();
            ApplyPlayerModelChanges();

            // Set the character into the creator menu
            Events.CallRemote("setCharacterIntoCreator");

            // Make the camera focus the player
            camera = RAGE.Game.Cam.CreateCameraWithParams(RAGE.Game.Misc.GetHashKey("DEFAULT_SCRIPTED_CAMERA"), 152.6008f, -1003.25f, -98f, -20.0f, 0.0f, 0.0f, 90.0f, true, 2);
            RAGE.Game.Cam.SetCamActive(camera, true);
            RAGE.Game.Cam.RenderScriptCams(true, false, 0, true, false, 0);

            // Disable the interface
            RAGE.Game.Ui.DisplayRadar(false);
            RAGE.Game.Ui.DisplayHud(false);
            Chat.Activate(false);
            Chat.Show(false);

            // Load the character creation menu
            Browser.CreateBrowserEvent(new object[] { "package://statics/html/characterCreator.html" });
        }
Example #2
0
 public static void ToggleInterface(bool state)
 {
     RAGE.Game.Ui.DisplayRadar(state);
     RAGE.Game.Ui.DisplayHud(state);
     Chat.Activate(state);
     Chat.Show(state);
 }
Example #3
0
        private void CloseATMEvent(object[] args)
        {
            // Destroy the browser
            Browser.DestroyBrowserEvent(null);

            // Enable the chat
            Chat.Activate(true);
            Chat.Show(true);
        }
Example #4
0
        private void ShowATMEvent(object[] args)
        {
            // Disable the chat
            Chat.Activate(false);
            Chat.Show(false);

            // Bank menu creation
            Browser.CreateBrowserEvent(new object[] { "package://statics/html/bankMenu.html" });
        }
        private void FinishLicenseExamEvent(object[] args)
        {
            // Enable the chat
            Chat.Activate(true);
            Chat.Show(true);

            // Destroy the exam's window
            Browser.DestroyBrowserEvent(null);
        }
Example #6
0
        private void CloseCatalogEvent(object[] args)
        {
            // Destroy preview catalog
            Browser.DestroyBrowserEvent(null);

            // Enable the chat
            Chat.Activate(true);
            Chat.Show(true);
        }
Example #7
0
        private void ShowVehicleCatalogEvent(object[] args)
        {
            // Get the variables from the arguments
            carShopVehiclesJson = args[0].ToString();
            dealership          = Convert.ToInt32(args[1]);

            // Disable the chat
            Chat.Activate(false);
            Chat.Show(false);

            // Show the catalog
            Browser.CreateBrowserEvent(new object[] { "package://statics/html/vehicleCatalog.html", "populateVehicleList", dealership, carShopVehiclesJson });
        }
Example #8
0
        private void MoveFurnitureEvent(object[] args)
        {
            // Get the furniture available to move
            furnitureList = JsonConvert.DeserializeObject <List <FurnitureModel> >(args[0].ToString());

            // Enable the cursor and disable the chat
            Cursor.Visible = true;
            Chat.Activate(false);
            Chat.Show(false);


            // Set the flag for moving furniture
            movingFurniture = true;
        }
Example #9
0
        private void CharacterCreatedSuccessfullyEvent(object[] args)
        {
            // Get the default camera
            RAGE.Game.Cam.DestroyCam(camera, true);
            RAGE.Game.Cam.RenderScriptCams(false, false, 0, true, false, 0);

            // Enable the interface
            RAGE.Game.Ui.DisplayRadar(true);
            RAGE.Game.Ui.DisplayHud(true);
            Chat.Activate(true);
            Chat.Show(true);

            // Destroy character creation menu
            Browser.DestroyBrowserEvent(null);
        }
        private void StartLicenseExamEvent(object[] args)
        {
            // Get the variables from the arguments
            string questionsJson = args[0].ToString();
            string answersJson   = args[1].ToString();

            // Get the exam questions and answers
            questionsList = JsonConvert.DeserializeObject <List <DrivingTest> >(questionsJson);
            answersList   = JsonConvert.DeserializeObject <List <DrivingTest> >(answersJson);

            // Disable the chat
            Chat.Activate(false);
            Chat.Show(false);

            // Show the question
            Browser.CreateBrowserEvent(new object[] { "package://statics/html/licenseExam.html", "getFirstTestQuestion" });
        }
        private void OnGuiReadyEvent()
        {
            // Initialize the player's position
            Player.LocalPlayer.FreezePosition(true);

            // Create the camera
            var cam = RAGE.Game.Cam.CreateCameraWithParams(RAGE.Game.Misc.GetHashKey("DEFAULT_SCRIPTED_CAMERA"), 3400.0f, 5075.0f, 20.0f, 0.0f, 0.0f, 8.0f, 75.0f, true, 2);

            RAGE.Game.Cam.SetCamActive(cam, true);
            RAGE.Game.Cam.RenderScriptCams(true, false, 0, false, false, 0);

            // Hide the chat, HUD and radar
            Chat.Show(false);
            Chat.Activate(false);
            RAGE.Game.Ui.DisplayHud(false);
            RAGE.Game.Ui.DisplayRadar(false);
        }
Example #12
0
 private static void prepair(bool isOpen, bool withBlure)
 {
     isOpened = isOpen;
     Player.LocalPlayer.FreezePosition(isOpen);
     RAGE.Ui.Cursor.Visible = isOpen;
     if (isOpen)
     {
         ClientTest.isPlayerInBrowser = true;
         Chat.Activate(false);
         Cef = new RAGE.Ui.HtmlWindow(url);
         if (withBlure)
         {
             RAGE.Game.Graphics.TransitionToBlurred(blureTime);
         }
     }
     else
     {
         ClientTest.isPlayerInBrowser = false;
         Cef.Destroy();
         Chat.Activate(true);
         RAGE.Game.Graphics.TransitionFromBlurred(blureTime);
     }
 }
Example #13
0
        private void StopPlayerSwitch(object[] args)
        {
            if (_switchingPlayer)
            {
                _switchingPlayer = false;

                RAGE.Game.Misc.ClearOverrideWeather();
                RAGE.Game.Misc.ClearWeatherTypePersist();

                RAGE.Game.Cam.DestroyCam(_cameraLogin, true);
                RAGE.Game.Cam.RenderScriptCams(false, false, 0, true, false, 0);

                RAGE.Game.Network.NetworkFadeInEntity(_localPlayer.Handle, true, 0);

                Chat.Activate(true);
                Chat.Show(true);

                RAGE.Game.Graphics.StopAllScreenEffects();

                Common.RemoveHUDElements();

                SetupLocalAI();
            }
        }
Example #14
0
        private void StartPlayerSwitch(object[] args)
        {
            _switchingPlayer = true;

            RAGE.Game.Network.NetworkFadeOutEntity(_localPlayer.Handle, true, false);

            Chat.Activate(false);
            Chat.Show(false);

            var rotX        = 0f;
            var rotY        = 0f;
            var rotZ        = 0f;
            var fieldOfView = 90.0f;

            _cameraLogin = RAGE.Game.Cam.CreateCameraWithParams(RAGE.Game.Misc.GetHashKey("DEFAULT_SCRIPTED_CAMERA"), 3353.261f, 5154.649f, 50f, rotX, rotY, rotZ, fieldOfView, true, 2);
            RAGE.Game.Cam.PointCamAtCoord(_cameraLogin, 3459.142f, 5096.136f, 25);

            RAGE.Game.Graphics.StartScreenEffect("SwitchHUDIn", 1000, true);

            RAGE.Game.Cam.SetCamActive(_cameraLogin, true);
            RAGE.Game.Cam.RenderScriptCams(true, false, 0, true, false, 0);

            Common.RemoveHUDElements();
        }
 /// <summary>
 /// Shows and Activates the chat.
 /// </summary>
 /// <param name="chat"></param>
 /// <param name="enable"></param>
 /// <param name="activate"></param>
 public static void EnableChat(bool enable, bool activate = false)
 {
     Chat.Activate(activate);
     Chat.Show(enable);
 }
Example #16
0
 public static void ActivateChat()
 {
     _chat.Activate();
 }