Progress toward popping up look-at widgets

This commit is contained in:
2025-03-19 16:01:38 -04:00
parent e470c41e77
commit 27be4ce758
9 changed files with 51 additions and 61 deletions

View File

@@ -228,37 +228,23 @@ void UlxLuaCallLibrary::LuaCallProbe(UObject *context, AActor *place) {
}
void UlxLuaCallLibrary::InvokeEngioMove(UObject *context, const FString &action, const FVector &xyz, double facing) {
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
FlxStreamBuffer &sb = mode->LuaCallBegin();
sb.write_string("engio");
sb.write_string("move");
sb.write_simple_dynamic_tag(SimpleDynamicTag::STRING);
sb.write_string(action);
sb.write_simple_dynamic_tag(SimpleDynamicTag::VECTOR);
sb.write_fvector(xyz);
sb.write_simple_dynamic_tag(SimpleDynamicTag::NUMBER);
sb.write_double(facing);
mode->LuaCallEnd(InvocationKind::LUA_INVOKE);
}
ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context) {
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
FlxStreamBuffer &sb = mode->LuaCallGetResult();
if (sb.empty()) return ELpxSimpleDynamicTag::None;
int64_t total_reads = sb.total_reads();
SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
sb.unread_to(total_reads);
switch (tag) {
case SimpleDynamicTag::STRING: return ELpxSimpleDynamicTag::String;
case SimpleDynamicTag::TOKEN: return ELpxSimpleDynamicTag::Name;
case SimpleDynamicTag::NUMBER: return ELpxSimpleDynamicTag::Float;
case SimpleDynamicTag::VECTOR: return ELpxSimpleDynamicTag::Vector;
case SimpleDynamicTag::BOOLEAN: return ELpxSimpleDynamicTag::Boolean;
default: return ELpxSimpleDynamicTag::None;
}
}
// ELpxSimpleDynamicTag UlxLuaCallLibrary::LuaCallNextResultType(UObject *context) {
// ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(context);
// FlxStreamBuffer &sb = mode->LuaCallGetResult();
// if (sb.empty()) return ELpxSimpleDynamicTag::None;
// int64_t total_reads = sb.total_reads();
// SimpleDynamicTag tag = sb.read_simple_dynamic_tag();
// sb.unread_to(total_reads);
// switch (tag) {
// case SimpleDynamicTag::STRING: return ELpxSimpleDynamicTag::String;
// case SimpleDynamicTag::TOKEN: return ELpxSimpleDynamicTag::Name;
// case SimpleDynamicTag::NUMBER: return ELpxSimpleDynamicTag::Float;
// case SimpleDynamicTag::VECTOR: return ELpxSimpleDynamicTag::Vector;
// case SimpleDynamicTag::BOOLEAN: return ELpxSimpleDynamicTag::Boolean;
// default: return ELpxSimpleDynamicTag::None;
// }
// }
/////////////////////////////////////////////////////////////////
//