Console overhaul, part 2. New console is mostly working.
This commit is contained in:
@@ -202,37 +202,44 @@ FString UlxLuaCallLibrary::AllFunctionsWithPrefix(const TCHAR *Prefix)
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
void UlxLuaCallLibrary::ValidateLua(
|
||||
ElxLuaSyntaxCheck &Result, FString &ErrorMessage, UObject *context, const FString &Code)
|
||||
void UlxLuaCallLibrary::ValidateLuaExpr(
|
||||
ElxLuaSyntaxCheck &Status, FString &ErrorMessage, UObject *context, const FString &Code)
|
||||
{
|
||||
if (Code.StartsWith(TEXT("/")))
|
||||
{
|
||||
ErrorMessage = "SlashCommand";
|
||||
Result = ElxLuaSyntaxCheck::SlashCommand;
|
||||
Status = ElxLuaSyntaxCheck::SlashCommand;
|
||||
return;
|
||||
}
|
||||
if (Code.TrimStart().IsEmpty())
|
||||
{
|
||||
ErrorMessage = "";
|
||||
Result = ElxLuaSyntaxCheck::Whitespace;
|
||||
Status = ElxLuaSyntaxCheck::Whitespace;
|
||||
return;
|
||||
}
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
ErrorMessage = mode->LuaValidate(Code);
|
||||
ErrorMessage = mode->ValidateLuaExpr(Code);
|
||||
if (ErrorMessage.IsEmpty())
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::ValidLua;
|
||||
Status = ElxLuaSyntaxCheck::ValidLua;
|
||||
}
|
||||
else if (ErrorMessage.Contains(TEXT("<eof>")))
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::TruncatedLua;
|
||||
Status = ElxLuaSyntaxCheck::TruncatedLua;
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::InvalidLua;
|
||||
Status = ElxLuaSyntaxCheck::InvalidLua;
|
||||
}
|
||||
}
|
||||
|
||||
void UlxLuaCallLibrary::InvokeLuaExpr(UObject *context, const FString &Code)
|
||||
{
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
mode->InvokeLuaExpr(Code);
|
||||
}
|
||||
|
||||
|
||||
void UlxLuaCallLibrary::LuaCallBegin(UObject *context, const FString &cname, const FString &fname)
|
||||
{
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
|
||||
Reference in New Issue
Block a user