コード例 #1
0
        public void Functions_OnOnDutyStateChanged(bool onDuty)
        {
            if (onDuty)
            {
                Common.RegisterCallouts();

                if (Settings.AmbientEvents.EnableAmbientEvents)
                {
                    EventPool.EventsController();
                }

                Globals.HeliCamera.ManagerFiber.Start();

                // set up integration with PoliceSmartRadio
                if (IsLSPDFRPluginRunning("PoliceSmartRadio"))
                {
                    PoliceSmartRadioAvailable = true;
                    PoliceSmartRadioFunctions = new PoliceSmartRadioFunctions();
                }

                GameFiber.StartNew(delegate
                {
                    Logger.LogTrivial("Functions fiber started");

                    while (true)
                    {
                        GameFiber.Yield();

                        if (Controls.ToggleBinoculars.IsJustPressed() &&
                            !Game.LocalPlayer.Character.IsInAnyVehicle(false) && !Binoculars.IsActive &&
                            Settings.General.IsBinocularEnable)
                        {
                            Binoculars.EnableBinoculars();
                        }

                        if (Controls.ToggleInteractionMenu.IsJustPressed() && !Binoculars.IsActive)
                        {
                            InteractionMenu.DisEnable();
                        }
                    }
                });

                Game.DisplayNotification("~g~<font size=\"14\"><b>WILDERNESS CALLOUTS</b></font>~s~~n~Version: ~b~" +
                                         WildernessCallouts.Common.GetVersion(
                                             @"Plugins\LSPDFR\Wilderness Callouts.dll") + "~s~~n~Loaded!");
            }
        }