Skip to content

Commit

Permalink
time multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed May 13, 2024
1 parent ad665a8 commit b2e7de5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions FModel/Views/Snooper/Animations/TimeTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class TimeTracker : IDisposable
public bool IsActive;
public float ElapsedTime;
public float MaxElapsedTime;
public int TimeMultiplier;

public TimeTracker()
{
Expand All @@ -29,7 +30,7 @@ public TimeTracker()
public void Update(float deltaSeconds)
{
if (IsPaused || IsActive) return;
ElapsedTime += deltaSeconds;
ElapsedTime += deltaSeconds * TimeMultiplier;
if (ElapsedTime >= MaxElapsedTime) Reset(false);
}

Expand All @@ -47,7 +48,11 @@ public void Reset(bool doMet = true)
{
IsPaused = false;
ElapsedTime = 0.0f;
if (doMet) MaxElapsedTime = 0.01f;
if (doMet)
{
MaxElapsedTime = 0.01f;
TimeMultiplier = 1;
}
}

public void Dispose()
Expand Down
4 changes: 3 additions & 1 deletion FModel/Views/Snooper/SnimGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ private void DrawWorld(Snooper s)
{
Layout("Animate With Rotation Only");ImGui.PushID(1);
ImGui.Checkbox("", ref s.Renderer.AnimateWithRotationOnly);
ImGui.PopID();Layout("Vertex Colors");ImGui.PushID(2);
ImGui.PopID();Layout("Time Multiplier");ImGui.PushID(2);
ImGui.DragInt("", ref s.Renderer.Options.Tracker.TimeMultiplier, 0.1f, 1, 8, "x%i", ImGuiSliderFlags.NoInput);
ImGui.PopID();Layout("Vertex Colors");ImGui.PushID(3);
var c = (int) s.Renderer.Color;
ImGui.Combo("vertex_colors", ref c,
"Default\0Sections\0Colors\0Normals\0Texture Coordinates\0");
Expand Down

0 comments on commit b2e7de5

Please sign in to comment.