Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src_stripped/KSP/Sim/Definitions/PartBehaviourModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public IObjectAssemblyPart OABPart
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnStart() => throw null;

/// <summary>
/// It appears this doesn't trigger at all?
/// </summary>>
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnShutdown() => throw null;

Expand Down Expand Up @@ -198,21 +201,42 @@ int IPriorityOverride.ExecutionPriorityOverride
[MethodImpl(MethodImplOptions.NoInlining)] get => throw null;
}

/// <summary>
/// It appears this doesn't trigger at all?
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
public void OnFixedUpdate(float deltaTime) => throw null;

/// <summary>
/// This starts triggering when the Flight scene is loaded and then keeps triggering
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnModuleFixedUpdate(float fixedDeltaTime) => throw null;

/// <summary>
/// This starts triggering as soon as the part is first placed in the OAB scene.
/// Does not trigger anymore when scene transitions fo Flight.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnModuleOABFixedUpdate(float fixedDeltaTime) => throw null;

/// <summary>
/// This starts triggering as soon as the part is first placed in the OAB scene.
/// Keeps triggering in every scene after this.
/// OnUpdate is called every frame.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void OnUpdate(float deltaTime) => throw null;

/// <summary>
/// It appears this doesn't trigger at all?
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnModuleUpdate(float deltaTime) => throw null;

/// <summary>
/// It appears this doesn't trigger at all?
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
protected virtual void OnModuleOABUpdate(float deltaTime) => throw null;

Expand Down
16 changes: 16 additions & 0 deletions src_stripped/KSP/Sim/impl/PartComponentModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,31 @@ protected ResourceFlowRequestBroker resourceFlowRequestBroker
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void ThermalUpdate(double deltaTime) => throw null;

/// <summary>
/// This triggers when the Flight scene is first loaded. When loading a game it triggers for in-flight vessels also.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void OnStart(double universalTime) => throw null;

/// <summary>
/// This starts triggering when vessel is first placed in Flight. Does not trigger while still in OAB.
/// Keeps triggering in every scene once it's in Flight.
/// OnUpdate is called every frame.
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void OnUpdate(double universalTime, double deltaUniversalTime) => throw null;

/// <summary>
/// This triggers when the part is destroyed, when leaving the Flight scene, when exiting the game.
/// It... also triggers when Flight scene is loaded? (why? maybe it's triggered when leaving the OAB scene)
/// </summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void OnShutdown() => throw null;

/// <summary>
/// It appears this doesn't trigger at all?
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)]
public virtual void OnFinalizeCreation(double universalTime) => throw null;

Expand Down