Lua Console Overhaul in progress
This commit is contained in:
@@ -202,6 +202,37 @@ FString UlxLuaCallLibrary::AllFunctionsWithPrefix(const TCHAR *Prefix)
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
void UlxLuaCallLibrary::ValidateLua(
|
||||
ElxLuaSyntaxCheck &Result, FString &ErrorMessage, UObject *context, const FString &Code)
|
||||
{
|
||||
if (Code.StartsWith(TEXT("/")))
|
||||
{
|
||||
ErrorMessage = "SlashCommand";
|
||||
Result = ElxLuaSyntaxCheck::SlashCommand;
|
||||
return;
|
||||
}
|
||||
if (Code.TrimStart().IsEmpty())
|
||||
{
|
||||
ErrorMessage = "";
|
||||
Result = ElxLuaSyntaxCheck::Whitespace;
|
||||
return;
|
||||
}
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
ErrorMessage = mode->LuaValidate(Code);
|
||||
if (ErrorMessage.IsEmpty())
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::ValidLua;
|
||||
}
|
||||
else if (ErrorMessage.Contains(TEXT("<eof>")))
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::TruncatedLua;
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = ElxLuaSyntaxCheck::InvalidLua;
|
||||
}
|
||||
}
|
||||
|
||||
void UlxLuaCallLibrary::LuaCallBegin(UObject *context, const FString &cname, const FString &fname)
|
||||
{
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
@@ -211,7 +242,6 @@ void UlxLuaCallLibrary::LuaCallBegin(UObject *context, const FString &cname, con
|
||||
sb.write_string(fname);
|
||||
}
|
||||
|
||||
|
||||
void UlxLuaCallLibrary::LuaCallInvoke(UObject *context, AActor *place)
|
||||
{
|
||||
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
|
||||
|
||||
Reference in New Issue
Block a user