Skip to content

Commit

Permalink
Fix for #120, delete some old untouched code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAdderley committed Sep 22, 2024
1 parent bd7ff25 commit 5584729
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
Binary file modified GameData/Waterfall/Plugins/Waterfall.dll
Binary file not shown.
9 changes: 0 additions & 9 deletions Source/Waterfall/EffectControllers/WaterfallController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,6 @@ public void SetOverride(bool mode)
overridden = mode;
}

/// <summary>
/// Sets the override value, not controlled by the game, likely an editor UI
/// </summary>
/// <param name="value"></param>
public void SetOverrideValue(float value)
{
overrideValue = value;
}

public virtual void UpgradeToCurrentVersion(Version loadedVersion)
{

Expand Down
22 changes: 14 additions & 8 deletions Source/Waterfall/EffectModifiers/EffectModifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public virtual void Init(WaterfallEffect effect)
Controller = parentEffect.parentModule.AllControllersDict.TryGetValue(controllerName, out var controller) ? controller : null;
if (Controller == null)
{
Utils.LogError($"[EffectModifier]: Controller {controllerName} not found for modifier {fxName} in effect {effect.name} in module {effect.parentModule.moduleID}");
Utils.LogWarning($"[EffectModifier]: Controller {controllerName} not found for modifier {fxName} in effect {effect.name} in module {effect.parentModule.moduleID}");
}
else
{
Expand Down Expand Up @@ -167,15 +167,21 @@ protected virtual void ApplySubtract(float[] strength) { }

public virtual void CreateOrAttachToIntegrator<T>(List<T> integrators) where T : EffectIntegrator
{
if (integrators == null || !ValidForIntegrator) return;
T target = integrators.FirstOrDefault(x => IntegratorSuitable(x));
if (target == null)
if (Controller != null)
{
target = CreateIntegrator() as T;
integrators.Add(target);
if (integrators == null || !ValidForIntegrator) return;
T target = integrators.FirstOrDefault(x => IntegratorSuitable(x));
if (target == null)
{
target = CreateIntegrator() as T;
integrators.Add(target);
}
else target.AddModifier(this);
integrator = target;
} else
{
Utils.LogWarning($"[EffectModifier]: Controller {controllerName} is null and will not be added to the integrator list");
}
else target.AddModifier(this);
integrator = target;
}

public virtual void RemoveFromIntegrator<T>(List<T> integrators) where T : EffectIntegrator
Expand Down
18 changes: 0 additions & 18 deletions Source/Waterfall/Modules/ModuleWaterfallFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,24 +337,6 @@ private void LoadControllers(ConfigNode node)
public string GetModuleTitle() => "";

public override string GetInfo() => "";

private static readonly float[] EmptyControllerResult = new float[1];

/// <summary>
/// Gets the value of the requested controller by name
/// </summary>
/// <param name="controllerName"></param>
/// <returns></returns>
public float[] GetControllerValues(string controllerName)
{
if (allControllers.TryGetValue(controllerName, out var controller))
return controller.Get();
else
{
return EmptyControllerResult;
}
}

/// <summary>
/// Gets the list of controllers
/// </summary>
Expand Down

0 comments on commit 5584729

Please sign in to comment.