コード例 #1
0
ファイル: AbstractTypeClass.cs プロジェクト: DCoderLT/cncpp
 public virtual bool ReadFromINI(FileFormats.Text.INI iniFile)
 {
     if (iniFile.SectionExists(ID)) {
         iniFile.GetString(ID, "Name", ref Name);
         if (iniFile.GetString(ID, "UIName", ref UINameLabel)) {
             UIName = FileFormats.Binary.CSF.StringTable.GetValue(UINameLabel);
         }
         return true;
     }
     return false;
 }
コード例 #2
0
ファイル: ObjectTypeClass.cs プロジェクト: DCoderLT/cncpp
        public override bool ReadFromINI(FileFormats.Text.INI iniFile)
        {
            if (!base.ReadFromINI(iniFile)) {
                return false;
            }

            iniFile.GetInteger(ID, "Strength", out Strength, Strength);
            iniFile.GetString(ID, "Image", out ImageName, ImageName);
            iniFile.GetString(ID, "AlphaImage", out AlphaImageName, AlphaImageName);
            iniFile.GetBool(ID, "AlternateArcticArt", out AlternateArcticArt, AlternateArcticArt);
            iniFile.GetBool(ID, "Crushable", out Crushable, Crushable);
            iniFile.GetBool(ID, "Bombable", out Bombable, Bombable);
            iniFile.GetBool(ID, "RadarInvisible", out RadarInvisible, RadarInvisible);
            iniFile.GetBool(ID, "Selectable", out Selectable, Selectable);
            iniFile.GetBool(ID, "LegalTarget", out LegalTarget, LegalTarget);
            iniFile.GetBool(ID, "Insignificant", out Insignificant, Insignificant);
            iniFile.GetBool(ID, "Immune", out Immune, Immune);
            iniFile.GetBool(ID, "HasRadialIndicator", out HasRadialIndicator, HasRadialIndicator);
            iniFile.GetBool(ID, "IgnoresFirestorm", out IgnoresFirestorm, IgnoresFirestorm);

            FileFormats.Text.INI.Art_INI.GetBool(ID, "UseLineTrail", ref UseLineTrail);
            FileFormats.Text.INI.Art_INI.GetBool(ID, "Theater", ref Theater);
            FileFormats.Text.INI.Art_INI.GetBool(ID, "NewTheater", ref NewTheater);
            FileFormats.Text.INI.Art_INI.GetBool(ID, "Voxel", ref Voxel);

            if (!Voxel) {
                Load2DArt();
            }

            if (AlphaImageName.Length > 0) {
                AlphaImage = new Helpers.WeakRef<FileFormats.Binary.SHP>(FileFormats.Binary.SHP.LoadFile(AlphaImageName + ".SHP"));
            } else {
                AlphaImage.Empty();
            }

            return true;
        }