Code polish

This commit is contained in:
2025-02-24 09:34:09 +01:00
parent f17ef5b559
commit e86c26a0d8
3 changed files with 21 additions and 25 deletions

View File

@@ -65,6 +65,9 @@ namespace TerraTech {
float max = 32f;
ModuleWingManager.Setup(Config);
ModuleBoosterManager.Setup(Config);
ModuleShieldGeneratorManager.Setup(Config);
ModuleWeaponGunManager.Setup(Config);
xpMultiplier =
Config.Bind("General", "XP Multiplier", 1f,

View File

@@ -20,7 +20,7 @@ namespace TerraTech {
shieldRadiusMultiplier = config.Bind(
"Shield", "Shield Radius Multiplier", 1f,
new ConfigDescription("Shield Radius Multiplier", new AcceptableValueRange<float>(min, max)));
shieldRadiusMultiplier.SettingChanged += (sender, args) => ModuleShieldGeneratorManager.DoPatch();
shieldRadiusMultiplier.SettingChanged += (sender, args) => DoPatch();
shieldHeartbeatIntervalMultiplier =
config.Bind("Shield", "Shield Heartbeat Interval Multiplier", 1f,
@@ -28,31 +28,28 @@ namespace TerraTech {
new AcceptableValueRange<float>(min, max)));
shieldHeartbeatIntervalMultiplier.SettingChanged += (sender, args) =>
ModuleShieldGeneratorManager.DoPatch();
DoPatch();
shieldPowerUpDelayMultiplier = config.Bind(
"Shield", "Shield Power Up Delay Multiplier", 1f,
new ConfigDescription("Shield Power Up Delay Multiplier", new AcceptableValueRange<float>(min, max)));
shieldPowerUpDelayMultiplier.SettingChanged += (sender, args) => ModuleShieldGeneratorManager.DoPatch();
shieldPowerUpDelayMultiplier.SettingChanged += (sender, args) => DoPatch();
shieldRadiusMultiplierHealing = config.Bind(
"Shield", "Shield Radius Multiplier Healing", 1f,
new ConfigDescription("Shield Radius Multiplier Healing", new AcceptableValueRange<float>(min, max)));
shieldRadiusMultiplierHealing.SettingChanged += (sender, args) => ModuleShieldGeneratorManager.DoPatch();
shieldRadiusMultiplierHealing.SettingChanged += (sender, args) => DoPatch();
}
private static void ConfigureShieldGenerator(MultipliedObject<ModuleShieldGenerator> obj) {
obj.AddField(new FieldConfiguration<float>("m_HealingHeartbeatInterval",
ModuleShieldGeneratorManager.shieldHeartbeatIntervalMultiplier));
obj.AddField(
new FieldConfiguration<float>("m_HealingHeartbeatInterval", shieldHeartbeatIntervalMultiplier));
obj.AddField(new FieldConfiguration<float>(
"m_Radius", ModuleShieldGeneratorManager.shieldRadiusMultiplier, instance => {
obj.AddField(new FieldConfiguration<float>("m_Radius", shieldRadiusMultiplier, instance => {
var shield = (ModuleShieldGenerator)instance;
return shield.m_Healing ? ModuleShieldGeneratorManager.shieldRadiusMultiplierHealing
: ModuleShieldGeneratorManager.shieldRadiusMultiplier;
return shield.m_Healing ? shieldRadiusMultiplierHealing : shieldRadiusMultiplier;
}));
obj.AddField(new FieldConfiguration<float>("m_PowerUpDelay",
ModuleShieldGeneratorManager.shieldPowerUpDelayMultiplier));
obj.AddField(new FieldConfiguration<float>("m_PowerUpDelay", shieldPowerUpDelayMultiplier));
}
[HarmonyPrefix]

View File

@@ -19,30 +19,26 @@ namespace TerraTech {
aerofoilAngleRangeMultiplier = config.Bind(
"Aerofoil", "Aerofoil Angle Range Multiplier", 1f,
new ConfigDescription("Aerofoil Angle Range Multiplier", new AcceptableValueRange<float>(min, max)));
aerofoilAngleRangeMultiplier.SettingChanged += (sender, args) => ModuleWingManager.DoPatch();
aerofoilAngleRangeMultiplier.SettingChanged += (sender, args) => DoPatch();
aerofoilAngleTurnSpeedMultiplier =
config.Bind("Aerofoil", "Aerofoil Angle Turn Speed Multiplier", 1f,
new ConfigDescription("Aerofoil Angle Turn Speed Multiplier",
new AcceptableValueRange<float>(min, max)));
aerofoilAngleTurnSpeedMultiplier.SettingChanged += (sender, args) => ModuleWingManager.DoPatch();
aerofoilAngleTurnSpeedMultiplier.SettingChanged += (sender, args) => DoPatch();
aerofoilLiftStrengthMultiplier = config.Bind(
"Aerofoil", "Aerofoil Lift Strength Multiplier", 1f,
new ConfigDescription("Aerofoil Lift Strength Multiplier", new AcceptableValueRange<float>(min, max)));
aerofoilLiftStrengthMultiplier.SettingChanged += (sender, args) => ModuleWingManager.DoPatch();
aerofoilLiftStrengthMultiplier.SettingChanged += (sender, args) => DoPatch();
}
private static void ConfigureAerofoil(MultipliedObject<ModuleWing.Aerofoil> obj) {
obj.AddField(
new FieldConfiguration<float>("flipAngleRangeActual", ModuleWingManager.aerofoilAngleRangeMultiplier));
obj.AddField(
new FieldConfiguration<float>("flipAngleRangeVisual", ModuleWingManager.aerofoilAngleRangeMultiplier));
obj.AddField(new FieldConfiguration<float>("flipAngleRangeActual", aerofoilAngleRangeMultiplier));
obj.AddField(new FieldConfiguration<float>("flipAngleRangeVisual", aerofoilAngleRangeMultiplier));
obj.AddField(new FieldConfiguration<float>("flipAngleTurnSpeed",
ModuleWingManager.aerofoilAngleTurnSpeedMultiplier));
obj.AddField(
new FieldConfiguration<float>("liftStrength", ModuleWingManager.aerofoilLiftStrengthMultiplier));
obj.AddField(new FieldConfiguration<float>("flipAngleTurnSpeed", aerofoilAngleTurnSpeedMultiplier));
obj.AddField(new FieldConfiguration<float>("liftStrength", aerofoilLiftStrengthMultiplier));
}
[HarmonyPrefix]