Skip to content

Commit

Permalink
Added checkbox to disable elapsed time on script output
Browse files Browse the repository at this point in the history
  • Loading branch information
markdwags committed Mar 23, 2023
1 parent 7daf18e commit b363f00
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 613 deletions.
22 changes: 17 additions & 5 deletions Razor/Scripts/ScriptManager.cs
Expand Up @@ -141,7 +141,11 @@ protected override void OnTick()
{
if (!Config.GetBool("ScriptDisablePlayFinish"))
{
Stopwatch.Start();
if (!Config.GetBool("DisableScriptStopwatch"))
{
Stopwatch.Start();
}

World.Player?.SendMessage(LocString.ScriptPlaying, _queuedScriptName);
}

Expand All @@ -155,11 +159,19 @@ protected override void OnTick()
{
if (!Config.GetBool("ScriptDisablePlayFinish"))
{
Stopwatch.Stop();
TimeSpan elapsed = Stopwatch.Elapsed;
Stopwatch.Reset();
if (!Config.GetBool("DisableScriptStopwatch"))
{
Stopwatch.Stop();
TimeSpan elapsed = Stopwatch.Elapsed;
Stopwatch.Reset();

World.Player?.SendMessage(LocString.ScriptFinishedStopwatch, _queuedScriptName, elapsed.TotalMilliseconds);
}
else
{
World.Player?.SendMessage(LocString.ScriptFinished, _queuedScriptName);
}

World.Player?.SendMessage(LocString.ScriptFinished, _queuedScriptName, elapsed.TotalMilliseconds);
}

Assistant.Engine.MainWindow.LockScriptUI(false);
Expand Down
1 change: 1 addition & 0 deletions Razor/UI/Config.cs
Expand Up @@ -336,6 +336,7 @@ public void MakeDefault()

AddProperty("DefaultScriptDelay", true);
AddProperty("EnableHighlight", false);
AddProperty("DisableScriptStopwatch", false);

Counter.Default();
Filter.DisableAll();
Expand Down
1 change: 1 addition & 0 deletions Razor/UI/Languages.cs
Expand Up @@ -592,6 +592,7 @@ public enum LocString : int
PauseScript,
ResumeScriptMessage,
PauseScriptMessage,
ScriptFinishedStopwatch,
__End
}

Expand Down

0 comments on commit b363f00

Please sign in to comment.