diff --git a/Content/Luprex/InputActions/IA_ReloadSource.uasset b/Content/Luprex/InputActions/IA_ReloadSource.uasset new file mode 100644 index 00000000..5c0d0f4a --- /dev/null +++ b/Content/Luprex/InputActions/IA_ReloadSource.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed80fc3f44c3733bc0a1060994ec132c6ded252e40e6177a58ea70ad458d7ae2 +size 1384 diff --git a/Content/Luprex/lxMappingContext.uasset b/Content/Luprex/lxMappingContext.uasset index 7dcd323b..a2e8183d 100644 --- a/Content/Luprex/lxMappingContext.uasset +++ b/Content/Luprex/lxMappingContext.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d499a2e5a0daf85def5c3690cac7444f2a0c5d11bc7efaf55a595592d12fdca -size 28583 +oid sha256:4b86a0d6e2ae5c5bc6b0e9ea670838073ff073e9ae5c9ce2e41b541440f9fa72 +size 29268 diff --git a/Content/Luprex/lxPlayerController.uasset b/Content/Luprex/lxPlayerController.uasset index f1b27f66..f3e6ed48 100644 --- a/Content/Luprex/lxPlayerController.uasset +++ b/Content/Luprex/lxPlayerController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f90f81a656706ba63290f945f2fed5e2f17427c14a2ad2bed0073b2479170ead -size 165578 +oid sha256:7ddb007e4177bb1bba27289702fe4d47b260f1548f03d5182675269d3e153932 +size 177055 diff --git a/Content/Widgets/WB_Crosshair.uasset b/Content/Widgets/WB_Crosshair.uasset index 55b21f75..8debd381 100644 --- a/Content/Widgets/WB_Crosshair.uasset +++ b/Content/Widgets/WB_Crosshair.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:51b886623cd35728a93c0ef05cf9aed953a95b1be18c5c25e52b273953ce6697 -size 70472 +oid sha256:9394019f57d98995742087892daddb6a7e0e3cdd463a531bba3d25b647badbf7 +size 55542 diff --git a/Source/Integration/PlayerControllerBase.cpp b/Source/Integration/PlayerControllerBase.cpp index a2271439..9842b3ac 100644 --- a/Source/Integration/PlayerControllerBase.cpp +++ b/Source/Integration/PlayerControllerBase.cpp @@ -77,22 +77,10 @@ void AlxPlayerControllerBase::BeginPlay() RootWidget->AddToViewport(0); Super::BeginPlay(); - - if (FSlateApplication::IsInitialized()) - { - FocusChangingHandle = FSlateApplication::Get().OnFocusChanging().AddUObject( - this, &AlxPlayerControllerBase::HandleFocusChanging); - } } void AlxPlayerControllerBase::EndPlay(const EEndPlayReason::Type EndPlayReason) { - if (FocusChangingHandle.IsValid() && FSlateApplication::IsInitialized()) - { - FSlateApplication::Get().OnFocusChanging().Remove(FocusChangingHandle); - FocusChangingHandle.Reset(); - } - if (IsValid(RootWidget)) { RootWidget->RemoveFromParent(); @@ -103,20 +91,6 @@ void AlxPlayerControllerBase::EndPlay(const EEndPlayReason::Type EndPlayReason) Super::EndPlay(EndPlayReason); } -void AlxPlayerControllerBase::HandleFocusChanging( - const FFocusEvent &FocusEvent, - const FWeakWidgetPath &OldPath, - const TSharedPtr &OldFocusedWidget, - const FWidgetPath &NewPath, - const TSharedPtr &NewFocusedWidget) -{ - UE_LOG(LogLuprexIntegration, Display, - TEXT("Focus changing: '%s' -> '%s' (cause: %s)"), - OldFocusedWidget.IsValid() ? *OldFocusedWidget->GetTypeAsString() : TEXT(""), - NewFocusedWidget.IsValid() ? *NewFocusedWidget->GetTypeAsString() : TEXT(""), - *UEnum::GetValueAsString(FocusEvent.GetCause())); -} - UInputComponent* AlxPlayerControllerBase::GetWidgetInputComponent(UUserWidget *Widget) { if (!IsValid(Widget)) return nullptr; diff --git a/Source/Integration/PlayerControllerBase.h b/Source/Integration/PlayerControllerBase.h index 7cabde8b..7a6af291 100644 --- a/Source/Integration/PlayerControllerBase.h +++ b/Source/Integration/PlayerControllerBase.h @@ -48,15 +48,6 @@ public: virtual void BeginPlay() override; virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; -private: - FDelegateHandle FocusChangingHandle; - void HandleFocusChanging( - const struct FFocusEvent &FocusEvent, - const class FWeakWidgetPath &OldPath, - const TSharedPtr &OldFocusedWidget, - const class FWidgetPath &NewPath, - const TSharedPtr &NewFocusedWidget); - public: virtual void BuildInputStack(TArray& InputStack) override; diff --git a/luprex/cpp/core/world-core.cpp b/luprex/cpp/core/world-core.cpp index 7d000713..7c90eb2f 100644 --- a/luprex/cpp/core/world-core.cpp +++ b/luprex/cpp/core/world-core.cpp @@ -536,25 +536,30 @@ void World::probe_lua_call(int64_t actor_id, int64_t place_id, std::string_view // in top-level code. // bool World::rebuild_sourcedb(int64_t actor_id) { - bool ok = true; + int successes = 0; + int failures = 0; for (const eng::string &mod: source_db_.modules()) { open_lthread_state(0, 0, 0, false); eng::string err = source_db_.rebuild_module(mod); eng::string prints = lthread_prints_.str(); clear_lthread_state(); - if (!err.empty()) ok = false; - if (actor_id >= 0) { - lthread_prints_ << "Compiling " << mod << std::endl; + if (err.empty()) successes ++; + else failures ++; + if ((!err.empty()) || (!prints.empty())) { + lthread_prints_ << "Compiling " << mod << ":" << std::endl; if (!err.empty()) lthread_prints_ << err << std::endl; if (!prints.empty()) lthread_prints_ << prints; - lthread_prints_to_actor(actor_id); + util::dprintview(lthread_prints_.view()); + if (actor_id != 0) lthread_prints_to_actor(actor_id); } } - if (actor_id > 0) { - lthread_prints_ << (ok ? "Compilation Successful." : "Compilation Failed.") << std::endl; - lthread_prints_to_actor(actor_id); + lthread_prints_ << "Compiled " << successes << " modules successfully." << std::endl; + if (failures > 0) { + lthread_prints_ << "Compiled " << failures << " modules with errors." << std::endl; } - return ok; + util::dprintview(lthread_prints_.view()); + if (actor_id > 0) lthread_prints_to_actor(actor_id); + return (failures == 0); } bool World::update_source(const util::LuaSourceVec &source, int64_t actor_id) { @@ -698,7 +703,7 @@ HttpServerResponse World::http_serve(const HttpParser &request) { open_lthread_state(0, 0, 0, false); eng::string msg = traceback_pcall(L, 1, LUA_MULTRET); if (!msg.empty()) lthread_prints_ << msg << std::endl; - lthread_prints_to_actor(0); + util::dprintview(lthread_prints_.view()); clear_lthread_state(); // If the call threw an error, return @@ -1167,13 +1172,9 @@ void World::lthread_prints_to_actor(int64_t actor_id) { const eng::string &output = lthread_prints_.str(); if (output.size() > 0) { - if (actor_id >= 0) { - Tangible *actor = tangible_get(actor_id); - if (actor != nullptr) { - actor->print_buffer_.add_string(output, is_authoritative()); - } else { - util::dprintview(output); - } + Tangible *actor = tangible_get(actor_id); + if (actor != nullptr) { + actor->print_buffer_.add_string(output, is_authoritative()); } lthread_prints_.str(""); lthread_prints_.clear(); diff --git a/luprex/cpp/core/world-diffxmit.cpp b/luprex/cpp/core/world-diffxmit.cpp index d3b05d21..adb90a29 100644 --- a/luprex/cpp/core/world-diffxmit.cpp +++ b/luprex/cpp/core/world-diffxmit.cpp @@ -292,7 +292,7 @@ void World::patch_source(StreamBuffer *sb, DebugCollector *dbc) { DebugBlock dbb(dbc, "patch_source"); bool modified = source_db_.patch(sb, dbc); if (modified) { - rebuild_sourcedb(-1); + rebuild_sourcedb(0); DebugLine(dbc) << "Source DB rebuilt"; } } diff --git a/luprex/cpp/core/world.hpp b/luprex/cpp/core/world.hpp index 8a0110a3..3b0856fa 100644 --- a/luprex/cpp/core/world.hpp +++ b/luprex/cpp/core/world.hpp @@ -284,7 +284,7 @@ public: // Rebuild the global environment from the source database. // - // Error messages go to the specified actor. + // Error messages go to the specified actor, and also dprint. // // Returns true if the rebuild goes without errors. // @@ -292,7 +292,7 @@ public: // Update the source database from disk, then rebuild the global environment. // - // Error messages go to the specified actor. + // Error messages go to the specified actor, and also dprint. // // Returns true if the update goes without errors. // @@ -378,9 +378,7 @@ public: // Send the lthread_prints output to the specified actor. // - // If actor_id == (-1) prints are discarded. - // If actor_id == (0) prints go to dprint. - // Anything else, and the prints go to a specific actor. + // Send prints to the specified actor's printbuffer. // void lthread_prints_to_actor(int64_t actor_id);