public MyGuiControlUseProperties(IMyGuiControlsParent parent, Vector2 position, MyUseProperties useProperties, Vector4 labelColor)
     : base(parent, position, new Vector2(0.7f, 0.35f), Vector4.Zero, null, MyGuiManager.GetBlankTexture()) 
 {
     m_labelColor = labelColor;
     m_useProperties = useProperties;            
     InitControls();
 }
Exemplo n.º 2
0
 protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
 {
     MyMwcObjectBuilder_PrefabGenerator objectBuilderGenerator = objectBuilder as MyMwcObjectBuilder_PrefabGenerator;
     UseProperties = new MyUseProperties(MyUseType.FromHUB | MyUseType.Solo, MyUseType.FromHUB | MyUseType.Solo);
     if (objectBuilder.UseProperties == null)
     {
         UseProperties.Init(MyUseType.FromHUB | MyUseType.Solo, MyUseType.FromHUB | MyUseType.Solo, 1, 4000, false);                
     }
     else
     {
         UseProperties.Init(objectBuilder.UseProperties);
     }
 }
Exemplo n.º 3
0
 protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
 {
     UseProperties = new MyUseProperties(MyUseType.FromHUB | MyUseType.Solo, MyUseType.None);
     if (objectBuilder.UseProperties == null)
     {
         UseProperties.Init(MyUseType.FromHUB | MyUseType.Solo, MyUseType.None, 0, 1, false);                
     }
     else
     {                
         UseProperties.Init(objectBuilder.UseProperties);
     }            
     
     Enabled = true;
 }
Exemplo n.º 4
0
        protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
        {
            //Physics.RemoveAllElements();

            //float raidus = ModelLod0.BoundingSphere.Radius;
            //Vector3 min = new Vector3(-raidus, -raidus, -raidus);
            //Vector3 max = new Vector3(raidus, raidus, raidus);
            //m_localBoundingBox = new BoundingBox(min, max);            

            UseProperties = new MyUseProperties(MyUseType.None, MyUseType.Solo);
            if (objectBuilder.UseProperties == null)
            {
                UseProperties.Init(MyUseType.None, MyUseType.None, 3, 8000, false);
            }
            else
            {
                UseProperties.Init(objectBuilder.UseProperties);
            }
        }
Exemplo n.º 5
0
 protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
 {
     MyMwcObjectBuilder_PrefabBankNode objectBuilderBankNode = objectBuilder as MyMwcObjectBuilder_PrefabBankNode;
     Cash = objectBuilderBankNode.Cash;
     UseProperties = new MyUseProperties(MyUseType.None, MyUseType.Solo);
     if (objectBuilderBankNode.UseProperties == null)
     {
         UseProperties.Init(MyUseType.None, MyUseType.Solo, 3, 4000, false);                
     }
     else
     {                
         UseProperties.Init(objectBuilderBankNode.UseProperties);
     }
     // some default cash for testing
     if (!UseProperties.IsHacked)
     {
         Cash = 8000f;
     }            
 }
Exemplo n.º 6
0
        protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
        {
            //Physics.RemoveAllElements();

            //float raidus = ModelLod0.BoundingSphere.Radius;
            //Vector3 min = new Vector3(-raidus, -raidus, -raidus);
            //Vector3 max = new Vector3(raidus, raidus, raidus);
            //m_localBoundingBox = new BoundingBox(min, max);

            UseProperties = new MyUseProperties(MyUseType.None, MyUseType.Solo);
            if (objectBuilder.UseProperties == null)
            {
                UseProperties.Init(MyUseType.None, MyUseType.None, 3, 8000, false);
            }
            else
            {
                UseProperties.Init(objectBuilder.UseProperties);
            }
        }
        protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
        {
            MyMwcObjectBuilder_PrefabSecurityControlHUB objectBuilderSecurityControlHUB = (MyMwcObjectBuilder_PrefabSecurityControlHUB) objectBuilder;
            //m_connetectedEntitiesIds.AddRange(objectBuilderSecurityControlHUB.ConnectedEntities);

            UseProperties = new MyUseProperties(MyUseType.Solo, MyUseType.Solo);
            if (objectBuilderSecurityControlHUB.UseProperties == null)
            {
                UseProperties.Init(MyUseType.Solo, MyUseType.Solo, 1, 4000, false);
            }
            else
            {
                UseProperties.Init(objectBuilderSecurityControlHUB.UseProperties);
            }

            UpdateSound();

            m_needsUpdate = true;
        }
Exemplo n.º 8
0
        public void Init()
        {
            Init(MyModelsEnum.RemoteCamera, MyMwcObjectBuilder_SmallShip_Ammo_TypesEnum.Universal_Launcher_Remote_Camera, MyUniversalLauncherConstants.USE_SPHERE_PHYSICS);

            // initialize gameplay properties here:
            m_gameplayProperties = MyGameplayConstants.GetGameplayProperties(MyMwcObjectBuilderTypeEnum.SmallShip_Tool,
                                                                             (int) MyMwcObjectBuilder_SmallShip_Tool_TypesEnum.REMOTE_CAMERA,
                                                                             MyMwcObjectBuilder_FactionEnum.None);
            Debug.Assert(m_gameplayProperties != null);
            if (m_gameplayProperties != null)
            {
                MaxHealth = m_gameplayProperties.MaxHealth;
                Health = m_gameplayProperties.MaxHealth;
            }

            //Physics.RigidBody.RaiseFlag(RigidBodyFlag.RBF_COLDET_THROUGH_VOXEL_TRIANGLES);

            m_canByAffectedByExplosionForce = true;

            UseProperties = new MyUseProperties(MyUseType.Solo, MyUseType.None, MyTextsWrapperEnum.NotificationYouCanTake);
            UseProperties.Init(MyUseType.Solo, MyUseType.None, 0, 1, false);
        }
        public void SaveTo(MyUseProperties useProperties) 
        {
            useProperties.UseType = MyUseType.None;
            if (m_useSoloCheckbox.Checked) 
            {
                useProperties.UseType |= MyUseType.Solo;
            }
            if (m_useHUBCheckbox != null && m_useHUBCheckbox.Checked)
            {
                useProperties.UseType |= MyUseType.FromHUB;
            }

            useProperties.HackType = MyUseType.None;
            if (m_hackSoloCheckbox.Checked)
            {
                useProperties.HackType |= MyUseType.Solo;
            }
            if (m_hackHUBCheckbox != null && m_hackHUBCheckbox.Checked)
            {
                useProperties.HackType |= MyUseType.FromHUB;
            }

            useProperties.HackingTime = (int)double.Parse(m_hackingTimeTextbox.Text.Trim());
            useProperties.HackingLevel = m_hackingLevelCombobox.GetSelectedKey();
            useProperties.IsHacked = m_isHackedCheckbox.Checked;
        }
Exemplo n.º 10
0
        protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
        {
            MyMwcObjectBuilder_PrefabScanner objectBuilderScanner = objectBuilder as MyMwcObjectBuilder_PrefabScanner;

            UseProperties = new MyUseProperties(MyUseType.FromHUB, MyUseType.FromHUB | MyUseType.Solo);
            if (objectBuilderScanner.UseProperties == null)
            {
                UseProperties.Init(MyUseType.FromHUB | MyUseType.Solo, MyUseType.FromHUB | MyUseType.Solo, 3, 4000, false);
            }
            else
            {                
                UseProperties.Init(objectBuilderScanner.UseProperties);
            }

            Size = objectBuilderScanner.Size;
            Color = objectBuilderScanner.Color;
            ScanningSpeed = objectBuilderScanner.ScanningSpeed;
            InitScanningPart();

            Flags |= EntityFlags.EditableInEditor;            
        }
Exemplo n.º 11
0
        protected override void InitPrefab(string displayName, Vector3 relativePosition, Matrix localOrientation, MyMwcObjectBuilder_PrefabBase objectBuilder, MyPrefabConfiguration prefabConfig)
        {
            MyPrefabConfigurationKinematic prefabKinematicConfig = (MyPrefabConfigurationKinematic)prefabConfig;
            MyMwcObjectBuilder_PrefabKinematic kinematicBuilder = objectBuilder as MyMwcObjectBuilder_PrefabKinematic;                        

            MyModel model = MyModels.GetModelOnlyDummies(m_config.ModelLod0Enum);

            for (int i = 0; i < prefabKinematicConfig.KinematicParts.Count; i++)
            {
                MyPrefabConfigurationKinematicPart kinematicPart = prefabKinematicConfig.KinematicParts[i];
                MyModelDummy open, close;
                if (model.Dummies.TryGetValue(kinematicPart.m_open, out open) && model.Dummies.TryGetValue(kinematicPart.m_close, out close))
                {
                    float? kinematicPartHealth = kinematicBuilder.KinematicPartsHealth[i];
                    float? kinematicPartMaxHealth = kinematicBuilder.KinematicPartsMaxHealth[i];
                    uint? kinematicPartEntityId = kinematicBuilder.KinematicPartsEntityId[i];

                    // if health is not set or not destroyed, then create part
                    if (kinematicPartHealth == null || kinematicPartHealth != 0)
                    {
                        MyPrefabKinematicPart newPart = new MyPrefabKinematicPart(m_owner);
                        if (kinematicPartEntityId.HasValue)
                        {
                            newPart.EntityId = new MyEntityIdentifier(kinematicPartEntityId.Value);
                        }
                        Parts[i] = newPart;
                        newPart.Init(this, kinematicPart, prefabKinematicConfig.m_openTime, prefabKinematicConfig.m_closeTime, (MyModelsEnum)kinematicPart.m_modelMovingEnum, open.Matrix, close.Matrix, prefabKinematicConfig.MaterialType, prefabKinematicConfig.m_soundLooping, prefabKinematicConfig.m_soundOpening, prefabKinematicConfig.m_soundClosing/*, m_groupMask*/, kinematicPartHealth, kinematicPartMaxHealth, Activated);
                    }
                }
            }                        

            //make handler
            m_sensorHandler = new MyPrefabKinematicSensor(this);
            MySphereSensorElement sensorEl = new MySphereSensorElement();
            sensorEl.Radius = DETECT_RADIUS;
            sensorEl.LocalPosition = new Vector3(0, 0, 0);
            sensorEl.DetectRigidBodyTypes = MyConstants.RIGIDBODY_TYPE_SHIP;            
            sensorEl.SpecialDetectingAngle = DETECTION_ANGLE;
            MySensorDesc senDesc = new MySensorDesc();
            senDesc.m_Element = sensorEl;
            senDesc.m_Matrix = WorldMatrix;
            senDesc.m_SensorEventHandler = m_sensorHandler;
            m_sensor = new MySensor();
            m_sensor.LoadFromDesc(senDesc);
            MyPhysics.physicsSystem.GetSensorModule().AddSensor(m_sensor);

            GetOwner().UpdateAABB();

            UseProperties = new MyUseProperties(MyUseType.FromHUB | MyUseType.Solo, MyUseType.FromHUB);
            if (kinematicBuilder.UseProperties == null)
            {
                UseProperties.Init(MyUseType.FromHUB, MyUseType.FromHUB, 3, 4000, false);
            }
            else
            {
                UseProperties.Init(kinematicBuilder.UseProperties);
            }
            UpdateHudAndCloseStatus();
        }