public override void DoSettingsWindowContents(Rect inRect)
        {
            base.DoSettingsWindowContents(inRect);
            var things = DefDatabase <ThingDef> .AllDefsListForReading;

            foreach (var thing in things)
            {
                if (thing.HasModExtension <HeavyWeapon>())
                {
                    if (settings.weaponStates == null)
                    {
                        settings.weaponStates = new Dictionary <string, bool>();
                    }
                    if (settings.weaponHPStates == null)
                    {
                        settings.weaponHPStates = new Dictionary <string, int>();
                    }

                    if (!settings.weaponStates.ContainsKey(thing.defName))
                    {
                        settings.weaponStates[thing.defName] = true;
                    }
                    if (!settings.weaponHPStates.ContainsKey(thing.defName))
                    {
                        var options = thing.GetModExtension <HeavyWeapon>();
                        settings.weaponHPStates[thing.defName] = options.weaponHitPointsDeductionOnShot;
                        Log.Message("options.weaponHitPointsDeductionOnShot: " + thing + " - " + options.weaponHitPointsDeductionOnShot);
                    }
                }
            }
            settings.DoSettingsWindowContents(inRect);
        }
Example #2
0
 public override void DoSettingsWindowContents(Rect inRect)
 {
     base.DoSettingsWindowContents(inRect);
     settings.DoSettingsWindowContents(inRect);
 }