Пример #1
0
        public string GetCorrectDisplayName(ref MyHudMaxDistanceMultiplerTypes? maxDistanceMultiplerType)
        {
            string displayName = DisplayName;

            switch (m_cargoBoxType)
            {
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type7:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type3:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxMedkit;
                    if (DisplayName == "Medikit")
                        displayName = MyTextsWrapper.Get(MyTextsWrapperEnum.CargoBoxMedikit).ToString();
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type8:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type6:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxAmmo;
                    if (DisplayName == "Ammo")
                        displayName = MyTextsWrapper.Get(MyTextsWrapperEnum.CargoBoxAmmo).ToString();
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.TypeProp_A:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type9:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxOxygen;
                    if (DisplayName == "Oxygen")
                        displayName = MyTextsWrapper.Get(MyTextsWrapperEnum.CargoBoxOxygen).ToString();
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type5:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type11:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxFuel;
                    if (DisplayName == "Fuel")
                        displayName = MyTextsWrapper.Get(MyTextsWrapperEnum.CargoBoxFuel).ToString();
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type2:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type12:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxRepair;
                    if (DisplayName == "Repair")
                        displayName = MyTextsWrapper.Get(MyTextsWrapperEnum.CargoBoxRepair).ToString();
                    break;
                default:
                    maxDistanceMultiplerType = null;
                    break;
            }

            return displayName;
        }
Пример #2
0
        public MyHudEntityParams(StringBuilder text, MyGuitargetMode? targetMode, float maxDistance, MyHudIndicatorFlagsEnum flagsEnum, MyHudDisplayFactionRelation? displayFactionRelation = null, MyHudMaxDistanceMultiplerTypes? maxDistanceMultiplerType = null)
            : this()
        {
            this.Text = text;
            this.FlagsEnum = flagsEnum;
            this.MaxDistance = maxDistance;
            this.TargetMode = targetMode;
            this.MaxDistanceMultiplerType = maxDistanceMultiplerType;

            if (displayFactionRelation.HasValue)
            {
                DisplayFactionRelation = displayFactionRelation.Value;
            }
            else 
            {
                DisplayFactionRelation = MyHudDisplayFactionRelation.Default;
            }
        }
Пример #3
0
 /// <summary>
 /// Adds the text that is displayed per entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="text">The text to display</param>
 public static void AddText(MyEntity entity, StringBuilder text, MyGuitargetMode? targetMode = null, float maxDistance = 0, MyHudIndicatorFlagsEnum flagsEnum = MyHudIndicatorFlagsEnum.SHOW_TEXT | MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS | MyHudIndicatorFlagsEnum.SHOW_DISTANCE | MyHudIndicatorFlagsEnum.ALPHA_CORRECTION_BY_DISTANCE | MyHudIndicatorFlagsEnum.SHOW_MISSION_MARKER | MyHudIndicatorFlagsEnum.SHOW_FACTION_RELATION_MARKER, MyHudDisplayFactionRelation? displayFactinRelation = null, MyHudMaxDistanceMultiplerTypes? maxDistanceMultiplerType = null)
 {
     //Why assert?
     //Debug.Assert(text.Length != 0);
     HudEntities.Add(new Tuple<WeakReference, MyHudEntityParams>(new WeakReference(entity), new MyHudEntityParams(text, targetMode, maxDistance, flagsEnum, displayFactinRelation, maxDistanceMultiplerType)));
 }
Пример #4
0
        public static void ChangeText(MyEntity entity, StringBuilder text, MyGuitargetMode? targetMode, float maxDistance = 0, MyHudIndicatorFlagsEnum flagsEnum = DEFAULT_FLAGS, MyHudDisplayFactionRelation? displayFactinRelation = null, MyHudMaxDistanceMultiplerTypes? maxDistanceMultiplerType = null)
        {
            RemoveText(entity);

            AddText(entity, text, targetMode, maxDistance, flagsEnum, displayFactinRelation, maxDistanceMultiplerType);
        }
Пример #5
0
        public string GetCorrectDisplayName(ref MyHudMaxDistanceMultiplerTypes? maxDistanceMultiplerType)
        {
            string displayName = GetCorrectDisplayName();

            switch (m_cargoBoxType)
            {
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type7:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type3:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxMedkit;
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type8:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type6:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxAmmo;
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.TypeProp_A:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type9:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxOxygen;
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type5:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type11:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxFuel;
                    break;
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type2:
                case MyMwcObjectBuilder_CargoBox_TypesEnum.Type12:
                    maxDistanceMultiplerType = MyHudMaxDistanceMultiplerTypes.CargoBoxRepair;
                    break;
                default:
                    maxDistanceMultiplerType = null;
                    break;
            }

            return displayName;
        }