public MyGuiScreenScriptingTools() : base(
                new Vector2(MyGuiManager.GetMaxMouseCoord().X - SCREEN_SIZE.X * 0.5f + HIDDEN_PART_RIGHT, 0.5f),
                SCREEN_SIZE,
                MyGuiConstants.SCREEN_BACKGROUND_COLOR,
                false)
        {
            CanBeHidden   = true;
            CanHideOthers = false;
            m_canCloseInCloseAllScreenCalls = true;
            m_canShareInput   = true;
            m_isTopScreen     = false;
            m_isTopMostScreen = false;

            // Create new manipulator with predicate for area triggers only
            m_triggerManipulator = new MyTriggerManipulator(trigger => trigger is MyAreaTriggerComponent);
            m_transformSys       = MySession.Static.GetComponent <MyEntityTransformationSystem>();
            m_transformSys.ControlledEntityChanged += TransformSysOnControlledEntityChanged;
            m_transformSys.RayCasted += TransformSysOnRayCasted;
            m_scriptManager           = MySession.Static.GetComponent <MyVisualScriptManagerSessionComponent>();

            // Switch to spectator
            MySession.Static.SetCameraController(MyCameraControllerEnum.SpectatorFreeMouse);

            // Enable Debug draw when opened
            MyDebugDrawSettings.ENABLE_DEBUG_DRAW         = true;
            MyDebugDrawSettings.DEBUG_DRAW_UPDATE_TRIGGER = true;

            RecreateControls(true);
        }
Ejemplo n.º 2
0
        protected override void RegisterEventsInVisualScripting()
        {
            MyVisualScriptManagerSessionComponent component = MySession.Static.GetComponent <MyVisualScriptManagerSessionComponent>();

            if ((component != null) && (component.SMManager != null))
            {
                component.SMManager.StateMachineStarted += new Action <MyVSStateMachine>(this.SMManager_StateMachineStarted);
                foreach (MyVSStateMachine machine in component.SMManager.RunningMachines)
                {
                    this.SMManager_StateMachineStarted(machine);
                }
            }
        }
Ejemplo n.º 3
0
        protected override Dictionary <string, object> GetGameplayStartData(MyGameEntryEnum entry, MyObjectBuilder_SessionSettings settings)
        {
            int isVanilla;
            int num2;
            int count;
            MyVisualScriptManagerSessionComponent component = MySession.Static.GetComponent <MyVisualScriptManagerSessionComponent>();
            bool flag = (MyCampaignManager.Static != null) ? (MyCampaignManager.Static.ActiveCampaign != null) : false;
            Dictionary <string, object> gameplayStartData = base.GetGameplayStartData(entry, settings);

            gameplayStartData["is_campaign_mission"] = flag;
            Dictionary <string, object> dictionary1 = gameplayStartData;

            if (!flag || (MyCampaignManager.Static.ActiveCampaign == null))
            {
                isVanilla = 0;
            }
            else
            {
                isVanilla = (int)MyCampaignManager.Static.ActiveCampaign.IsVanilla;
            }
            dictionary1[(string)dictionary1] = (bool)isVanilla;
            if ((component == null) || (component.RunningLevelScriptNames == null))
            {
                num2 = 0;
            }
            else
            {
                num2 = component.RunningLevelScriptNames.Count <string>();
            }
            "is_official_campaign"["level_script_count"] = num2;
            if (((component == null) || (component.SMManager == null)) || (component.SMManager.MachineDefinitions == null))
            {
                count = 0;
            }
            else
            {
                count = component.SMManager.MachineDefinitions.Count;
            }
            "is_official_campaign"["state_machine_count"] = count;
            this.m_lastCampaignProgressionTime            = 0;
            string local2 = "is_official_campaign";

            local2["voxel_support"]       = settings.StationVoxelSupport;
            local2["destructible_blocks"] = settings.DestructibleBlocks;
            local2["destructible_voxels"] = settings.EnableVoxelDestruction;
            local2["jetpack"]             = settings.EnableJetpack;
            local2["hostility"]           = settings.EnvironmentHostility.ToString();
            local2["drones"]                          = settings.EnableDrones;
            local2["wolfs"]                           = settings.EnableWolfs;
            local2["spiders"]                         = settings.EnableSpiders;
            local2["encounters"]                      = settings.EnableEncounters;
            local2["oxygen"]                          = settings.EnableOxygen;
            local2["pressurization"]                  = settings.EnableOxygenPressurization;
            local2["realistic_sounds"]                = settings.RealisticSound;
            local2["tool_shake"]                      = settings.EnableToolShake;
            local2["multiplier_inventory"]            = settings.InventorySizeMultiplier;
            local2["multiplier_welding_speed"]        = settings.WelderSpeedMultiplier;
            local2["multiplier_grinding_speed"]       = settings.GrinderSpeedMultiplier;
            local2["multiplier_refinery_speed"]       = settings.RefinerySpeedMultiplier;
            local2["multiplier_assembler_speed"]      = settings.AssemblerSpeedMultiplier;
            local2["multiplier_assembler_efficiency"] = settings.AssemblerEfficiencyMultiplier;
            local2["max_floating_objects"]            = settings.MaxFloatingObjects;
            return((Dictionary <string, object>)local2);
        }