Skip to content

Commit

Permalink
Merge pull request #11 from cesare-montresor/UOSEnginePlus
Browse files Browse the repository at this point in the history
Uos engine plus bugfix
  • Loading branch information
cesare-montresor authored Jan 2, 2024
2 parents 11b509c + 39b4249 commit d0c35a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Razor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("0.8.2.104")]
[assembly: AssemblyVersion("0.8.2.105")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
Expand Down
18 changes: 9 additions & 9 deletions Razor/RazorEnhanced/EnhancedScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ public void Suspend()
ScriptEngine.Suspend();
}

public void Reseume()
public void Resume()
{
ScriptEngine.Reseume();
ScriptEngine.Resume();
}


Expand Down Expand Up @@ -694,24 +694,24 @@ public bool Suspended
get { return m_Suspended; }
set {
if (value) { Suspend();}
else { Reseume(); }
else { Resume(); }
}
}
public void Suspend()
{
if (m_Script.Language != ScriptLanguage.PYTHON) {
Misc.SendMessage("WARNING: Script Suspend is supported only by python scripts.");
if (m_Script.Language == ScriptLanguage.CSHARP) {
Misc.SendMessage("WARNING: Script Suspend is not supported by c# scripts.");
return;
}
m_Suspended = true;
m_SuspendedMutex.Reset();
}

public void Reseume()
public void Resume()
{
if (m_Script.Language != ScriptLanguage.PYTHON)
if (m_Script.Language == ScriptLanguage.CSHARP)
{
Misc.SendMessage("WARNING: Script Resume is supported only by python scripts.");
Misc.SendMessage("WARNING: Script Resume is not supported by c# scripts.");
return;
}
m_Suspended = false;
Expand Down Expand Up @@ -984,7 +984,7 @@ private bool RunUOSteam()
{
try
{
uosEngine.OnTraceback(TracebackUOS);
uosEngine.SetTrace(TracebackUOS);
uosEngine.Execute();
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion Razor/RazorEnhanced/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ public static void ScriptResume(string scriptfile)
EnhancedScript script = EnhancedScript.Service.Search(scriptfile);
if (script != null)
{
script.Reseume();
script.Resume();
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions Razor/RazorEnhanced/UOSteamEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class UOSteamEngine
private Interpreter m_Interpreter;
private Script m_Script;

public void OnTraceback(UOSTracebackDelegate traceDelegate) {
public void SetTrace(UOSTracebackDelegate traceDelegate) {
m_Script.OnTraceback += traceDelegate;
}

Expand Down Expand Up @@ -138,7 +138,7 @@ public UOSteamEngine()
UpdateNamespace();
}


private void RegisterAlias()
{
m_Interpreter.RegisterAliasHandler("ground", AliasHandler);
Expand Down Expand Up @@ -5278,7 +5278,7 @@ public bool ExecuteNext()

var node = _statement.FirstChild();

if (OnTraceback!=null && OnTraceback.Invoke(this, node, _scope)){
if (OnTraceback!=null && !OnTraceback.Invoke(this, node, _scope)){
return false;
}

Expand Down

0 comments on commit d0c35a5

Please sign in to comment.