Ejemplo n.º 1
0
 public override void ResetSettings()
 {
     base.ResetSettings();
     upgradeSettings.Clear();
     if (VehicleMod.ModifiableSettings)
     {
         foreach (VehicleDef def in DefDatabase <VehicleDef> .AllDefs)
         {
             SettingsCustomizableFields.PopulateSaveableUpgrades(def, true);
         }
     }
 }
Ejemplo n.º 2
0
        public override void SettingsWindow(VehicleDef def, Listing_Settings listing)
        {
            FieldInfo dictField = SettingsCache.GetCachedField(typeof(StatUpgrade), nameof(values));

            Rect buttonRect = listing.GetRect(16);

            buttonRect.x      = buttonRect.width - 24;
            buttonRect.width  = 24;
            buttonRect.height = 24;
            listing.Header(label, GameFont.Medium, TextAnchor.MiddleCenter);
            if (Widgets.ButtonImage(buttonRect, VehicleTex.ResetPage))
            {
                SettingsCustomizableFields.PopulateSaveableUpgrades(def, true);
            }
            listing.Gap();

            foreach (var statUpgrade in values)
            {
                SaveableDefPair <StatUpgradeCategoryDef> saveable = new SaveableDefPair <StatUpgradeCategoryDef>(def, dictField, string.Concat(statUpgrade.Key.defName, "_", upgradeID), statUpgrade.Key, LookMode.Value);
                statUpgrade.Key.DrawStatLister(def, listing, saveable, statUpgrade.Value);
            }
        }