From 6ba3ece99cd8075c3489418bdcf8b7063c4f50a6 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Fri, 6 Dec 2024 16:54:18 -0500 Subject: [PATCH] fix controls being enabled when notplayer from texting --- noita-proxy/src/lib.rs | 1 + quant.ew/files/system/text/text.lua | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index b29b741b..5bb6e1d7 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -1228,6 +1228,7 @@ impl App { let mut old_settings = netman.settings.lock().unwrap().clone(); old_settings.progress.clear(); old_settings.seed = new_settings.seed; + old_settings.world_num = new_settings.world_num; netman .dirty .store(old_settings != new_settings, Ordering::Relaxed) diff --git a/quant.ew/files/system/text/text.lua b/quant.ew/files/system/text/text.lua index f689054f..ca82d442 100644 --- a/quant.ew/files/system/text/text.lua +++ b/quant.ew/files/system/text/text.lua @@ -99,26 +99,30 @@ end local function starttext() enabled = true - local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") local g = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "InventoryGuiComponent") if g ~= nil then EntitySetComponentIsEnabled(ctx.my_player.entity, g, false) end - if controls ~= nil then - ComponentSetValue2(controls, "enabled", false) + if not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then + local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") + if controls ~= nil then + ComponentSetValue2(controls, "enabled", false) + end end end local function stoptext() enabled = false text = "" - local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") local g = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "InventoryGuiComponent") if g ~= nil then EntitySetComponentIsEnabled(ctx.my_player.entity, g, true) end - if controls ~= nil then - ComponentSetValue2(controls, "enabled", true) + if not EntityHasTag(ctx.my_player.entity, "ew_notplayer") then + local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") + if controls ~= nil then + ComponentSetValue2(controls, "enabled", true) + end end end @@ -162,4 +166,4 @@ function module.on_world_update() end end -return module +return module \ No newline at end of file