r_lighting and gameplay globals

This commit is contained in:
2022-05-22 21:28:37 +03:00
parent 99aa9ab6f8
commit 42f4840b09
6 changed files with 69 additions and 17 deletions

View File

@@ -472,25 +472,34 @@ namespace Game
//Console.PrintDebug("Executed '" + execute + "' with params: '" + value + "'");
if (consoleCommands.TryGetValue(executeLower, out ConsoleCommand cmd))
try
{
string[] values = strs.Skip(1).ToArray();
if (values.Length > 0)
cmd.Invoke(values);
else
cmd.Invoke();
//Console.Print("Command bound to '" + execute + "' is '" + cmd.method.Name + "'");
}
else if (consoleVariables.TryGetValue(executeLower, out ConsoleVariable cvar))
{
if (value != null)
cvar.SetValue(value);
if (consoleCommands.TryGetValue(executeLower, out ConsoleCommand cmd))
{
string[] values = strs.Skip(1).ToArray();
if (values.Length > 0)
cmd.Invoke(values);
else
cmd.Invoke();
//Console.Print("Command bound to '" + execute + "' is '" + cmd.method.Name + "'");
}
else if (consoleVariables.TryGetValue(executeLower, out ConsoleVariable cvar))
{
if (value != null)
cvar.SetValue(value);
Console.Print("'" + execute + "' is '" + cvar.GetValueString() + "'");
Console.Print("'" + execute + "' is '" + cvar.GetValueString() + "'");
}
else
{
Console.Print("Unknown command '" + execute + "'");
}
}
else
catch (Exception e)
{
Console.Print("Unknown command '" + execute + "'");
var message = e.InnerException != null ? e.InnerException.Message : e.Message;
Console.Print("Command failed: " + message);
throw;
}
}