From 4926554f682bee57e5fdabd064c6bd2f26f0eeb2 Mon Sep 17 00:00:00 2001 From: kcalbxof Date: Wed, 4 Dec 2024 08:00:38 +0300 Subject: [PATCH 01/13] Changed file dialog to native via rfd --- noita-proxy/Cargo.toml | 4 +- noita-proxy/src/bookkeeping/mod_manager.rs | 65 ++++++++++++---------- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/noita-proxy/Cargo.toml b/noita-proxy/Cargo.toml index 38316fd9..3c2c3500 100644 --- a/noita-proxy/Cargo.toml +++ b/noita-proxy/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" [dependencies] eframe = { version="0.29.1", features = ["glow", "default_fonts"], default-features = false } -egui-file-dialog = "0.7.0" +rfd = "0.15.1" egui_extras = { version = "0.29.1", features = ["all_loaders"] } egui_plot = "0.29.0" image = { version = "0.25.1", default-features = false, features = ["png", "webp"] } @@ -58,4 +58,4 @@ lto = true strip = true [profile.release-lto] -inherits = "release" \ No newline at end of file +inherits = "release" diff --git a/noita-proxy/src/bookkeeping/mod_manager.rs b/noita-proxy/src/bookkeeping/mod_manager.rs index aa591238..48e07c24 100644 --- a/noita-proxy/src/bookkeeping/mod_manager.rs +++ b/noita-proxy/src/bookkeeping/mod_manager.rs @@ -5,10 +5,11 @@ use std::{ io::BufReader, mem, path::{Path, PathBuf}, + time::Duration, }; -use eframe::egui::{Align2, Context, Ui}; -use egui_file_dialog::{DialogState, FileDialog}; +use eframe::egui::{Context, Ui}; +use eyre::eyre; use eyre::Context as _; use poll_promise::Promise; use serde::{Deserialize, Serialize}; @@ -28,7 +29,8 @@ enum State { #[default] JustStarted, IsAutomaticPathOk, - SelectPath, + PreSelectPath, + SelectPath(Promise>), PreCheckMod, InvalidPath, CheckMod, @@ -40,20 +42,9 @@ enum State { UnpackDone, } +#[derive(Default)] pub struct Modmanager { state: State, - file_dialog: FileDialog, -} - -impl Default for Modmanager { - fn default() -> Self { - Self { - state: Default::default(), - file_dialog: FileDialog::default() - .anchor(Align2::CENTER_CENTER, [0.0, 0.0]) - .title(&tr("modman_path_to_exe")), - } - } } #[derive(Debug, Serialize, Deserialize, Default, Clone)] @@ -185,21 +176,29 @@ impl Modmanager { ctx.request_repaint(); } if ui.button(tr("modman_select_manually")).clicked() { - self.select_noita_file(); + self.state = State::PreSelectPath; } } - State::SelectPath => { - if let Some(path) = self.file_dialog.update(ctx).selected() { - settings.game_exe_path = path.to_path_buf(); - if !check_path_valid(&settings.game_exe_path) { - self.state = State::InvalidPath; - } else { - self.state = State::PreCheckMod; + + State::PreSelectPath => { + self.select_noita_file(); + } + State::SelectPath(promise) => { + match promise.ready() { + Some(Ok(path)) => { + settings.game_exe_path = path.to_path_buf(); + if !check_path_valid(&settings.game_exe_path) { + self.state = State::InvalidPath; + } else { + self.state = State::PreCheckMod; + } } + Some(Err(_)) => { + self.state = State::PreSelectPath; + } + None => {} } - if self.file_dialog.state() == DialogState::Cancelled { - self.state = State::JustStarted - } + ui.ctx().request_repaint_after(Duration::from_millis(200)); } State::InvalidPath => { ui.label(tr("modman_invalid_path")); @@ -340,8 +339,18 @@ impl Modmanager { } fn select_noita_file(&mut self) { - self.state = State::SelectPath; - self.file_dialog.select_file(); + let promise = Promise::spawn_thread("select-path", move || { + let file = rfd::FileDialog::new() + .add_filter("executable", &["exe"]) + .set_title(tr("modman_path_to_exe")) + .pick_file(); + if let Some(path) = file { + Ok(path) + } else { + Err(eyre!("Dialog cancelled")) + } + }); + self.state = State::SelectPath(promise); } pub fn is_done(&self) -> bool { From 77c829510e33df2be6bcc5bac0d464d43bc83b30 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 08:41:26 -0500 Subject: [PATCH 02/13] redo ability action materialized fix to fix some other perks causing weird behaviour --- quant.ew/files/core/player_fns.lua | 6 ++-- .../resource/cbs/count_times_wand_fired.lua | 4 +++ .../local_health/notplayer/notplayer.xml | 2 ++ quant.ew/init.lua | 30 ++++++++++++++----- 4 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 quant.ew/files/resource/cbs/count_times_wand_fired.lua diff --git a/quant.ew/files/core/player_fns.lua b/quant.ew/files/core/player_fns.lua index b8659ed1..1d6b3076 100644 --- a/quant.ew/files/core/player_fns.lua +++ b/quant.ew/files/core/player_fns.lua @@ -586,7 +586,7 @@ function player_fns.is_inventory_open() return ComponentGetValue2(inventory_gui_comp, "mActive") end -local function get_active_held_item(player_entity) +function player_fns.get_active_held_item(player_entity) local inventory2Comp = EntityGetFirstComponentIncludingDisabled(player_entity, "Inventory2Component") if inventory2Comp and inventory2Comp ~= 0 then local mActiveItem = ComponentGetValue2(inventory2Comp, "mActiveItem") @@ -597,7 +597,7 @@ local function get_active_held_item(player_entity) end function player_fns.get_current_slot(player_data) - local held_item = get_active_held_item(player_data.entity) + local held_item = player_fns.get_active_held_item(player_data.entity) if (held_item ~= nil and held_item ~= 0) then local item_comp = EntityGetFirstComponentIncludingDisabled(held_item, "ItemComponent") @@ -653,7 +653,7 @@ end function player_fns.make_fire_data(special_seed, player_data) local player = player_data.entity - local wand = get_active_held_item(player) + local wand = player_fns.get_active_held_item(player) if (wand ~= nil) then local x, y, r = EntityGetTransform(wand) diff --git a/quant.ew/files/resource/cbs/count_times_wand_fired.lua b/quant.ew/files/resource/cbs/count_times_wand_fired.lua new file mode 100644 index 00000000..911b25ec --- /dev/null +++ b/quant.ew/files/resource/cbs/count_times_wand_fired.lua @@ -0,0 +1,4 @@ +function wand_fired( gun_entity_id ) + local current = tonumber(GlobalsGetValue("ew_wand_fired", "0")) + GlobalsSetValue("ew_wand_fired", tostring(current+1)) +end diff --git a/quant.ew/files/system/local_health/notplayer/notplayer.xml b/quant.ew/files/system/local_health/notplayer/notplayer.xml index 33fafd7f..432efc51 100644 --- a/quant.ew/files/system/local_health/notplayer/notplayer.xml +++ b/quant.ew/files/system/local_health/notplayer/notplayer.xml @@ -633,6 +633,8 @@ + + 0 + or (ability ~= nil and ComponentGetValue2(ability, "mCastDelayStartFrame") == GameGetFrameNum()) then + fire() + end end function OnWorldPostUpdate() -- This is called every time the game has finished updating the world From 6878d95899899e6f4fcbcb61501644c21ab6c80c Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 09:26:05 -0500 Subject: [PATCH 03/13] fix statue duping, teleport wands away if grabbed(doesn't work in shops for some reason idk), remove right away when safe removing non wands --- ewext/Cargo.toml | 2 - noita-proxy/Cargo.lock | 622 +++++++++++++++++++++------ quant.ew/files/system/enemy_sync.lua | 4 +- quant.ew/files/system/item_sync.lua | 53 ++- 4 files changed, 542 insertions(+), 139 deletions(-) diff --git a/ewext/Cargo.toml b/ewext/Cargo.toml index cffd62db..a5e67d19 100644 --- a/ewext/Cargo.toml +++ b/ewext/Cargo.toml @@ -18,8 +18,6 @@ iced-x86 = "1.21.0" noita_api_macro = {path = "noita_api_macro"} eyre = "0.6.12" noita_api = {path = "noita_api"} -tungstenite = "0.24.0" -bitcode = "0.6.3" shared = {path = "../shared"} [features] diff --git a/noita-proxy/Cargo.lock b/noita-proxy/Cargo.lock index f23f311d..db645daa 100644 --- a/noita-proxy/Cargo.lock +++ b/noita-proxy/Cargo.lock @@ -166,6 +166,182 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "ashpd" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c39d707614dbcc6bed00015539f488d8e3fe3e66ed60961efc0c90f4b380b3" +dependencies = [ + "async-fs", + "async-net", + "enumflags2", + "futures-channel", + "futures-util", + "rand", + "raw-window-handle", + "serde", + "serde_repr", + "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + +[[package]] +name = "async-broadcast" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -268,6 +444,19 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bstr" version = "1.11.0" @@ -691,27 +880,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -816,18 +984,6 @@ dependencies = [ "nohash-hasher", ] -[[package]] -name = "egui-file-dialog" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09999eebe148a045df9e0d38f32b4ac03ac51bbf136d96fc4ff5e05f73a19ec5" -dependencies = [ - "directories", - "egui", - "serde", - "sysinfo", -] - [[package]] name = "egui-winit" version = "0.29.1" @@ -920,6 +1076,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enum-map" version = "2.7.3" @@ -941,6 +1103,27 @@ dependencies = [ "syn", ] +[[package]] +name = "enumflags2" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "epaint" version = "0.29.1" @@ -986,6 +1169,27 @@ version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1168,6 +1372,30 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +[[package]] +name = "futures-lite" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.31" @@ -1188,6 +1416,7 @@ checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1390,6 +1619,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hmac" version = "0.12.1" @@ -1410,9 +1645,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -2015,6 +2250,19 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -2032,7 +2280,6 @@ dependencies = [ "crossbeam", "dashmap", "eframe", - "egui-file-dialog", "egui_extras", "egui_plot", "eyre", @@ -2044,6 +2291,7 @@ dependencies = [ "quick-xml 0.37.1", "rand", "reqwest", + "rfd", "ron", "rustc-hash 2.1.0", "self-replace", @@ -2380,12 +2628,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "orbclient" version = "0.3.48" @@ -2395,6 +2637,16 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "overload" version = "0.1.1" @@ -2410,6 +2662,12 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.3" @@ -2497,6 +2755,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.31" @@ -2541,6 +2810,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + [[package]] name = "powerfmt" version = "0.2.0" @@ -2740,17 +3015,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "regex" version = "1.11.1" @@ -2854,6 +3118,28 @@ dependencies = [ "usvg", ] +[[package]] +name = "rfd" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f6f80a9b882647d9014673ca9925d30ffc9750f2eed2b4490e189eaebd01e8" +dependencies = [ + "ashpd", + "block2", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "pollster", + "raw-window-handle", + "urlencoding", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + [[package]] name = "rgb" version = "0.8.50" @@ -3154,6 +3440,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_spanned" version = "0.6.8" @@ -3210,6 +3507,15 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -3403,17 +3709,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sysinfo" -version = "0.31.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" -dependencies = [ - "core-foundation-sys", - "libc", - "windows", -] - [[package]] name = "tangled" version = "0.3.0" @@ -3636,9 +3931,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -3788,6 +4083,17 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + [[package]] name = "unic-langid" version = "0.9.5" @@ -3858,9 +4164,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ "base64 0.22.1", "flate2", @@ -3881,8 +4187,15 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "usvg" version = "0.37.0" @@ -4246,70 +4559,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" -dependencies = [ - "windows-core", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result 0.1.2", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-result 0.2.0", + "windows-result", "windows-strings", "windows-targets 0.52.6", ] -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.2.0" @@ -4325,7 +4585,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result 0.2.0", + "windows-result", "windows-targets 0.52.6", ] @@ -4682,6 +4942,16 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -4746,6 +5016,69 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zbus" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1162094dc63b1629fcc44150bcceeaa80798cd28bcbe7fa987b65a034c258608" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-util", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.59.0", + "winnow", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd2dcdce3e2727f7d74b7e33b5a89539b3cc31049562137faf7ae4eb86cd16d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "856b7a38811f71846fd47856ceee8bccaec8399ff53fb370247e66081ace647b" +dependencies = [ + "serde", + "static_assertions", + "winnow", + "zvariant", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4900,3 +5233,46 @@ dependencies = [ "cc", "pkg-config", ] + +[[package]] +name = "zvariant" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1200ee6ac32f1e5a312e455a949a4794855515d34f9909f4a3e082d14e1a56f" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "url", + "winnow", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687e3b97fae6c9104fbbd36c73d27d149abf04fb874e2efbd84838763daa8916" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20d1d011a38f12360e5fcccceeff5e2c42a8eb7f27f0dcba97a0862ede05c9c6" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "static_assertions", + "syn", + "winnow", +] diff --git a/quant.ew/files/system/enemy_sync.lua b/quant.ew/files/system/enemy_sync.lua index 2a1bb0c5..6684a63c 100644 --- a/quant.ew/files/system/enemy_sync.lua +++ b/quant.ew/files/system/enemy_sync.lua @@ -506,7 +506,9 @@ local function sync_enemy(enemy_info_raw, force_no_cull) if ghost ~= nil then ComponentSetValue2(ghost, "die_if_no_home", false) end - util.make_ephemerial(enemy_id) + if not EntityHasTag(enemy_id, "effectable_prop") then + util.make_ephemerial(enemy_id) + end end local enemy_data_new = ctx.entity_by_remote_id[remote_enemy_id] diff --git a/quant.ew/files/system/item_sync.lua b/quant.ew/files/system/item_sync.lua index 3364420e..8d466b2d 100644 --- a/quant.ew/files/system/item_sync.lua +++ b/quant.ew/files/system/item_sync.lua @@ -108,15 +108,36 @@ function item_sync.get_global_item_id(item) return ret end +local function is_wand(ent) + if ent == nil or ent == 0 then return false end + local ability = ComponentGetValue2(ent, "AbilityComponent") + if ability == nil then + return false + end + return ComponentGetValue2(ability, "use_gun_script") == true +end + +local function is_safe_to_remove() + return not ctx.is_wand_pickup +end + function item_sync.remove_item_with_id(gid) - table.insert(pending_remove, gid) + if is_safe_to_remove() or not is_wand(a) then + item_sync.remove_item_with_id_now(gid) + else + table.insert(pending_remove, gid) + local item_ent_id = item_sync.find_by_gid(gid) + EntitySetTransform(item_ent_id, 0, 0) + util.make_ephemerial(item_ent_id) + end end local find_by_gid_cache = {} function item_sync.find_by_gid(gid) if find_by_gid_cache[gid] ~= nil then if EntityGetIsAlive(find_by_gid_cache[gid]) - and EntityHasTag(find_by_gid_cache[gid], "ew_global_item") and is_item_on_ground(find_by_gid_cache[gid]) then + and EntityHasTag(find_by_gid_cache[gid], "ew_global_item") + and is_item_on_ground(find_by_gid_cache[gid]) then return find_by_gid_cache[gid] else find_by_gid_cache[gid] = nil @@ -145,6 +166,7 @@ end function item_sync.remove_item_with_id_now(gid) local item = item_sync.find_by_gid(gid) if item ~= nil then + find_by_gid_cache[gid] = nil for _, audio in ipairs(EntityGetComponent(item, "AudioComponent") or {}) do if string.sub(ComponentGetValue2(audio, "event_root"), 1, 10) == "collision/" then EntitySetComponentIsEnabled(item, audio, false) @@ -421,10 +443,6 @@ local function send_item_positions(all) dead_entities = {} end -local function is_safe_to_remove() - return not ctx.is_wand_pickup -end - function item_sync.on_world_update() -- TODO check that we not removing item we are going to pick now, instead of checking if picker gui is open. if is_safe_to_remove() then @@ -560,13 +578,18 @@ function rpc.item_globalize(item_data) if wait_for_gid[item_data.gid] ~= nil then wait_for_gid[item_data.gid] = GameGetFrameNum() + 30 end - local k - if is_safe_to_remove() then - k = item_sync.remove_item_with_id_now(item_data.gid) - end - local n = item_sync.find_by_gid(item_data.gid) - if n ~= nil and k ~= n then - return + local a = item_sync.find_by_gid(item_data.gid) + if is_safe_to_remove() or not is_wand(a) then + local k = item_sync.remove_item_with_id_now(item_data.gid) + local n = item_sync.find_by_gid(item_data.gid) + if n ~= nil and k ~= n then + return + end + else + local n = item_sync.find_by_gid(item_data.gid) + if n ~= nil then + return + end end local item = inventory_helper.deserialize_single_item(item_data) add_stuff_to_globalized_item(item, item_data.gid) @@ -636,6 +659,9 @@ function rpc.update_positions(position_data, all) end local cx, cy = GameGetCameraPos() for gid, el in pairs(position_data) do + if table.contains(pending_remove, gid) then + goto continue + end local x, y = el[1], el[2] if math.abs(x - cx) < DISTANCE_LIMIT and math.abs(y - cy) < DISTANCE_LIMIT then gid_last_frame_updated[ctx.rpc_peer_id][gid] = frame[ctx.rpc_peer_id] @@ -662,6 +688,7 @@ function rpc.update_positions(position_data, all) wait_for_gid[gid] = GameGetFrameNum() + 300 end end + ::continue:: end if all then cleanup(ctx.rpc_peer_id) From ef5c872cae4516e4b2c166f44a203354b88bcff6 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 10:45:23 -0500 Subject: [PATCH 04/13] allow picking wands up from a distance --- quant.ew/files/system/item_sync.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/quant.ew/files/system/item_sync.lua b/quant.ew/files/system/item_sync.lua index 8d466b2d..ca518e9f 100644 --- a/quant.ew/files/system/item_sync.lua +++ b/quant.ew/files/system/item_sync.lua @@ -451,7 +451,7 @@ function item_sync.on_world_update() item_sync.remove_item_with_id_now(gid) end end - if GameGetFrameNum() % 60 == 35 then + if GameGetFrameNum() % 120 == 35 then for _, ent in ipairs(EntityGetWithTag("mimic_potion")) do if not EntityHasTag(ent, "polymorphed_player") and is_item_on_ground(ent) then if not EntityHasTag(ent, "ew_global_item") then @@ -463,6 +463,12 @@ function item_sync.on_world_update() end end end + for _, wand in ipairs(EntityGetWithTag("wand")) do + local com = EntityGetFirstComponentIncludingDisabled(wand, "ItemComponent") + if com ~= nil then + ComponentSetValue2(com, "item_pickup_radius", 256) + end + end end if GameGetFrameNum() % 60 == 3 then send_item_positions(true) From 3c30e8a42468d3795a4440ed53bdbf2278eff33a Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 10:58:11 -0500 Subject: [PATCH 05/13] dont send twwe --- quant.ew/files/core/perk_fns.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/quant.ew/files/core/perk_fns.lua b/quant.ew/files/core/perk_fns.lua index 3acae7f3..eb0d5a91 100644 --- a/quant.ew/files/core/perk_fns.lua +++ b/quant.ew/files/core/perk_fns.lua @@ -23,6 +23,7 @@ local perks_to_ignore = { ADVENTURER = true, HOMUNCULUS = true, LUKKI_MINION = true, + EDIT_WANDS_EVERYWHERE = true } local global_perks = { From d15b3babda5b6861715936e43a01ff52f2292094 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 11:22:34 -0500 Subject: [PATCH 06/13] add share gold option --- noita-proxy/src/lib.rs | 9 +++++++++ noita-proxy/src/net.rs | 4 ++-- quant.ew/files/system/player_sync.lua | 29 ++++++++++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 3816bc5d..fcfa8a8e 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -86,6 +86,7 @@ pub struct GameSettings { perk_ban_list: Option, perma_death: Option, physics_damage: Option, + share_gold: Option, } impl GameSettings { fn show_editor(&mut self, ui: &mut Ui, enabled: bool) { @@ -217,6 +218,12 @@ impl GameSettings { game_settings.friendly_fire = Some(temp) } } + { + let mut temp = game_settings.share_gold.unwrap_or(def.share_gold); + if ui.checkbox(&mut temp, "Share Gold").changed() { + game_settings.share_gold = Some(temp) + } + } ui.add_space(10.0); ui.label("Perks"); { @@ -284,6 +291,7 @@ pub struct DefaultSettings { perk_ban_list: String, perma_death: bool, physics_damage: bool, + share_gold: bool, } impl Default for DefaultSettings { @@ -306,6 +314,7 @@ impl Default for DefaultSettings { perk_ban_list: "GLOBAL_GORE,GLASS_CANNON,REVENGE_RATS,PLAGUE_RATS,VOMIT_RATS,CORDYCEPS,MOLD,FUNGAL_DISEASE,HOMUNCULUS,LUKKI_MINION".to_string(), perma_death: false, physics_damage: true, + share_gold: false, } } } diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index 1306d942..502ae1db 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -499,8 +499,8 @@ impl NetManager { } else { info!("No nickname chosen"); } - let ff = settings.friendly_fire.unwrap_or(def.friendly_fire); - state.try_ws_write_option("friendly_fire", ff); + state.try_ws_write_option("friendly_fire", settings.friendly_fire.unwrap_or(def.friendly_fire)); + state.try_ws_write_option("share_gold", settings.share_gold.unwrap_or(def.share_gold)); state.try_ws_write_option("debug", settings.debug_mode.unwrap_or(def.debug_mode)); state.try_ws_write_option( "world_sync_version", diff --git a/quant.ew/files/system/player_sync.lua b/quant.ew/files/system/player_sync.lua index 288c70b1..7bbc05d9 100644 --- a/quant.ew/files/system/player_sync.lua +++ b/quant.ew/files/system/player_sync.lua @@ -6,10 +6,26 @@ local rpc = net.new_rpc_namespace() local module = {} -function rpc.send_money_and_ingestion(money, ingestion_size) +local last_money + +function rpc.send_money_and_ingestion(money, delta, ingestion_size) local entity = ctx.rpc_player_data.entity local wallet = EntityGetFirstComponentIncludingDisabled(entity, "WalletComponent") - if wallet ~= nil then + if wallet ~= nil and money ~= nil then + if ctx.proxy_opt.share_gold then + local my_wallet = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "WalletComponent") + local cm = ComponentGetValue2(my_wallet, "money") + if ctx.is_host then + ComponentSetValue2(my_wallet, "money", cm + delta) + elseif ctx.rpc_peer_id == ctx.host_id then + local my_delta = 0 + if cm ~= last_money then + my_delta = cm - last_money + end + last_money = money + ComponentSetValue2(my_wallet, "money", money + my_delta) + end + end ComponentSetValue2(wallet, "money", money) end local ingestion = EntityGetFirstComponentIncludingDisabled(entity, "IngestionComponent") @@ -186,7 +202,14 @@ function module.on_world_update() local wallet = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "WalletComponent") local ingestion = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "IngestionComponent") if wallet ~= nil or ingestion ~= nil then - rpc.send_money_and_ingestion(wallet and ComponentGetValue2(wallet, "money"), + local delta = 0 + if wallet ~= nil then + if last_money ~= nil then + delta = ComponentGetValue2(wallet, "money") - last_money + end + last_money = ComponentGetValue2(wallet, "money") + end + rpc.send_money_and_ingestion(last_money, delta, ingestion and ComponentGetValue2(ingestion, "ingestion_size")) end end From 5ab31d956001a4df41960bd7ee9ba8fedacf39be Mon Sep 17 00:00:00 2001 From: IQuant Date: Wed, 4 Dec 2024 19:46:58 +0300 Subject: [PATCH 07/13] Fix ui lag --- noita-proxy/src/net.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index 502ae1db..eec426c5 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -296,10 +296,12 @@ impl NetManager { } else { dont_kick.clear() } - let list = self.ban_list.lock().unwrap(); - for peer in list.iter() { - if self.peer.iter_peer_ids().contains(peer) { - to_kick.push(*peer) + { + let list = self.ban_list.lock().unwrap(); + for peer in list.iter() { + if self.peer.iter_peer_ids().contains(peer) { + to_kick.push(*peer) + } } } for peer in to_kick.iter() { From e58842f44c0abe17c33dd7cb40a5071a9425967b Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 12:28:20 -0500 Subject: [PATCH 08/13] fix enemy duping when host restarts --- quant.ew/files/system/enemy_sync.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quant.ew/files/system/enemy_sync.lua b/quant.ew/files/system/enemy_sync.lua index 6684a63c..ccfe7c19 100644 --- a/quant.ew/files/system/enemy_sync.lua +++ b/quant.ew/files/system/enemy_sync.lua @@ -506,9 +506,7 @@ local function sync_enemy(enemy_info_raw, force_no_cull) if ghost ~= nil then ComponentSetValue2(ghost, "die_if_no_home", false) end - if not EntityHasTag(enemy_id, "effectable_prop") then - util.make_ephemerial(enemy_id) - end + util.make_ephemerial(enemy_id) end local enemy_data_new = ctx.entity_by_remote_id[remote_enemy_id] @@ -678,6 +676,9 @@ end function rpc.handle_enemy_data(enemy_data, is_first) if is_first then + for _, n in pairs(ctx.entity_by_remote_id) do + EntityKill(n.id) + end ctx.entity_by_remote_id = {} end frame = GameGetFrameNum() From c753df0d1f50c5d046220d1073226f58229c9b64 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 12:47:28 -0500 Subject: [PATCH 09/13] add no notplayer option lazily --- noita-proxy/src/lib.rs | 11 + noita-proxy/src/net.rs | 4 + quant.ew/files/system/enemy_sync.lua | 4 +- .../system/local_health/local_health.lua | 142 ++++--- .../system/local_health/mimic_potion.xml | 365 ++++++++++++++++++ quant.ew/files/system/local_health/poly.xml | 12 + .../system/notplayer_ai/notplayer_ai.lua | 1 + .../system/player_arrows/player_arrows.lua | 3 +- quant.ew/files/system/player_sync.lua | 1 + .../system/player_tether/player_tether.lua | 2 +- .../spectator_helps/spectator_helps.lua | 4 +- 11 files changed, 491 insertions(+), 58 deletions(-) create mode 100644 quant.ew/files/system/local_health/mimic_potion.xml create mode 100644 quant.ew/files/system/local_health/poly.xml diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index fcfa8a8e..63ff8fc6 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -87,6 +87,7 @@ pub struct GameSettings { perma_death: Option, physics_damage: Option, share_gold: Option, + no_notplayer: Option, } impl GameSettings { fn show_editor(&mut self, ui: &mut Ui, enabled: bool) { @@ -165,6 +166,14 @@ impl GameSettings { game_settings.physics_damage = Some(temp) } } + ui.add_space(1.0); + { + let mut temp = + game_settings.no_notplayer.unwrap_or(def.no_notplayer); + if ui.checkbox(&mut temp, "no minua").changed() { + game_settings.no_notplayer = Some(temp) + } + } } } }); @@ -292,6 +301,7 @@ pub struct DefaultSettings { perma_death: bool, physics_damage: bool, share_gold: bool, + no_notplayer: bool, } impl Default for DefaultSettings { @@ -315,6 +325,7 @@ impl Default for DefaultSettings { perma_death: false, physics_damage: true, share_gold: false, + no_notplayer: false, } } } diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index eec426c5..ae5a02c9 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -548,6 +548,10 @@ impl NetManager { "physics_damage", settings.physics_damage.unwrap_or(def.physics_damage), ); + state.try_ws_write_option( + "no_notplayer", + settings.no_notplayer.unwrap_or(def.no_notplayer), + ); let lst = settings.clone(); state.try_ws_write_option( "perk_ban_list", diff --git a/quant.ew/files/system/enemy_sync.lua b/quant.ew/files/system/enemy_sync.lua index ccfe7c19..df4eafe8 100644 --- a/quant.ew/files/system/enemy_sync.lua +++ b/quant.ew/files/system/enemy_sync.lua @@ -506,7 +506,9 @@ local function sync_enemy(enemy_info_raw, force_no_cull) if ghost ~= nil then ComponentSetValue2(ghost, "die_if_no_home", false) end - util.make_ephemerial(enemy_id) + if not EntityHasTag(enemy_id, "effectable_prop") then + util.make_ephemerial(enemy_id) + end end local enemy_data_new = ctx.entity_by_remote_id[remote_enemy_id] diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index 7f473f0e..d654e606 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -49,6 +49,34 @@ function rpc.remove_homing(clear_area) end end +local function remove_stuff() + for _, child in ipairs(EntityGetAllChildren(ctx.my_player.entity) or {}) do + if not EntityHasTag(child, "perk_entity") then + local com = EntityGetFirstComponentIncludingDisabled(child, "GameEffectComponent") + local comt = EntityGetFirstComponentIncludingDisabled(child, "LifetimeComponent") + if (com ~= nil and ComponentGetValue2(com, "frames") ~= -1 and ComponentGetValue2(com, "frames") < 60 * 60 * 60) + or (comt ~= nil and ComponentGetValue2(comt, "lifetime") ~= -1 and ComponentGetValue2(comt, "lifetime") < 60 * 60 * 60) + or EntityHasTag(child, "projectile") then + EntityKill(child) + end + end + end + if EntityGetFirstComponent(ctx.my_player.entity, "StatusEffectDataComponent") ~= nil then + for _, effect in pairs(status_effects) do + if EntityGetIsAlive(ctx.my_player.entity) then + EntityRemoveStainStatusEffect(ctx.my_player.entity, effect.id) + EntityRemoveIngestionStatusEffect(ctx.my_player.entity, effect.id) + end + end + end + local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") + if damage_model ~= nil then + ComponentSetValue2(damage_model, "mFireProbability", 0) + ComponentSetValue2(damage_model, "mFireFramesLeft", 0) + ComponentSetValue2(damage_model, "air_in_lungs", ComponentGetValue2(damage_model, "air_in_lungs_max")) + end +end + local function set_camera_free(enable, entity, dont) local cam = EntityGetFirstComponentIncludingDisabled(entity, "PlatformShooterPlayerComponent") if cam ~= nil then @@ -172,6 +200,17 @@ local function allow_notplayer_perk(perk_id) return not ignored_perks[perk_id] end +local function reduce_hp() + local p = 100 - ctx.proxy_opt.health_lost_on_revive + if p ~= 100 then + if ctx.proxy_opt.global_hp_loss then + rpc.loss_hp() + end + local hp, max_hp = util.get_ent_health(ctx.my_player.entity) + util.set_ent_health(ctx.my_player.entity, {(hp * p) / 100, (max_hp * p) / 100}) + end +end + rpc.opts_everywhere() rpc.opts_reliable() function rpc.show_death_message(untranslated_message, source_player) @@ -235,25 +274,49 @@ local function player_died() show_death_message() end - rpc.remove_homing(false) - -- Serialize inventory, perks, and max_hp, we'll need to copy it over to notplayer. - local item_data = inventory_helper.get_item_data(ctx.my_player) - remove_inventory() - local perk_data = perk_fns.get_my_perks() - local _, max_hp = util.get_ent_health(ctx.my_player.entity) - local cap = util.get_ent_health_cap(ctx.my_player.entity) - -- This may look like a hack, but it allows to use existing poly machinery to change player entity AND to store the original player for later, -- Which is, like, perfect. GameAddFlagRun("ew_flag_notplayer_active") + if ctx.proxy_opt.no_notplayer then + local ent = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/poly.xml") + EntityAddTag(ent + 1, "ew_notplayer") + + EntityAddComponent2(ent + 1, "LuaComponent", { + script_item_picked_up = "mods/quant.ew/files/system/potion_mimic/pickup.lua", + script_throw_item = "mods/quant.ew/files/system/potion_mimic/pickup.lua", + }) + + for _, com in ipairs(EntityGetComponent(ent + 1, "LuaComponent")) do + if ComponentGetValue2(com, "script_death") == "data/scripts/items/potion_glass_break.lua" then + EntityRemoveComponent(ent + 1, com) + break + end + end + for _, com in ipairs(EntityGetComponent(ent + 1, "DamageModelComponent")) do + EntityRemoveComponent(ent + 1, com) + end + + polymorph.switch_entity(ent + 1) + return + end if ctx.proxy_opt.perma_death then + remove_inventory() local ent = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/notplayer/cessation.xml") + EntityAddTag(ent + 1, "ew_notplayer") polymorph.switch_entity(ent + 1) GameAddFlagRun("msg_gods_looking") GameAddFlagRun("msg_gods_looking2") - EntityAddTag(ctx.my_player.entity, "ew_notplayer") return end + + rpc.remove_homing(false) + -- Serialize inventory, perks, and max_hp, we'll need to copy it over to notplayer. + local item_data = inventory_helper.get_item_data(ctx.my_player) + remove_inventory() + local perk_data = perk_fns.get_my_perks() + local _, max_hp = util.get_ent_health(ctx.my_player.entity) + local cap = util.get_ent_health_cap(ctx.my_player.entity) + local ent = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/notplayer/poly_effect.xml") ctx.my_player.entity = ent + 1 if ctx.proxy_opt.physics_damage then @@ -379,13 +442,21 @@ function module.on_world_update() end end - --if notplayer_active then - -- local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") - --end -end - -function module.on_world_update_client() - + if ctx.proxy_opt.no_notplayer and notplayer_active then + local x, y = EntityGetTransform(ctx.my_player.entity) + for _, ent in ipairs(EntityGetInRadiusWithTag(x, y, 8, "drillable")) do + if EntityGetFilename(ent) == "data/entities/items/pickup/heart_fullhp_temple.xml" then + GameRemoveFlagRun("ew_flag_notplayer_active") + EntityKill(ent) + ctx.my_player.entity = end_poly_effect(ctx.my_player.entity) + remove_stuff() + polymorph.switch_entity(ctx.my_player.entity) + spectate.disable_throwing(false, ctx.my_player.entity) + reduce_hp() + break + end + end + end end -- Do not lose the game if there aren't any players alive from the start. (If alive players haven't connected yet) @@ -445,17 +516,6 @@ function rpc.loss_hp() util.set_ent_health(ctx.my_player.entity, {(hp * p) / 100, (max_hp * p) / 100}) end -local function reduce_hp() - local p = 100 - ctx.proxy_opt.health_lost_on_revive - if p ~= 100 then - if ctx.proxy_opt.global_hp_loss then - rpc.loss_hp() - end - local hp, max_hp = util.get_ent_health(ctx.my_player.entity) - util.set_ent_health(ctx.my_player.entity, {(hp * p) / 100, (max_hp * p) / 100}) - end -end - -- Provides health capability ctx.cap.health = { health = module.health, @@ -467,7 +527,7 @@ ctx.cap.health = { on_poly_death = function() local notplayer_active = GameHasFlagRun("ew_flag_notplayer_active") if notplayer_active then - if GameHasFlagRun("ending_game_completed") and not GameHasFlagRun("ew_kill_player") then + if GameHasFlagRun("ending_game_completed") and not GameHasFlagRun("ew_kill_player") or ctx.proxy_opt.no_notplayer then return end rpc.remove_homing(true) @@ -475,31 +535,7 @@ ctx.cap.health = { remove_inventory() GameRemoveFlagRun("ew_flag_notplayer_active") ctx.my_player.entity = end_poly_effect(ctx.my_player.entity) - for _, child in ipairs(EntityGetAllChildren(ctx.my_player.entity) or {}) do - if not EntityHasTag(child, "perk_entity") then - local com = EntityGetFirstComponentIncludingDisabled(child, "GameEffectComponent") - local comt = EntityGetFirstComponentIncludingDisabled(child, "LifetimeComponent") - if (com ~= nil and ComponentGetValue2(com, "frames") ~= -1 and ComponentGetValue2(com, "frames") < 60 * 60 * 60) - or (comt ~= nil and ComponentGetValue2(comt, "lifetime") ~= -1 and ComponentGetValue2(comt, "lifetime") < 60 * 60 * 60) - or EntityHasTag(child, "projectile") then - EntityKill(child) - end - end - end - if EntityGetFirstComponent(ctx.my_player.entity, "StatusEffectDataComponent") ~= nil then - for _, effect in pairs(status_effects) do - if EntityGetIsAlive(ctx.my_player.entity) then - EntityRemoveStainStatusEffect(ctx.my_player.entity, effect.id) - EntityRemoveIngestionStatusEffect(ctx.my_player.entity, effect.id) - end - end - end - local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") - if damage_model ~= nil then - ComponentSetValue2(damage_model, "mFireProbability", 0) - ComponentSetValue2(damage_model, "mFireFramesLeft", 0) - ComponentSetValue2(damage_model, "air_in_lungs", ComponentGetValue2(damage_model, "air_in_lungs_max")) - end + remove_stuff() inventory_helper.set_item_data(item_data, ctx.my_player, true, false) remove_inventory_tags() local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") diff --git a/quant.ew/files/system/local_health/mimic_potion.xml b/quant.ew/files/system/local_health/mimic_potion.xml new file mode 100644 index 00000000..089fa7a2 --- /dev/null +++ b/quant.ew/files/system/local_health/mimic_potion.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quant.ew/files/system/local_health/poly.xml b/quant.ew/files/system/local_health/poly.xml new file mode 100644 index 00000000..10428aad --- /dev/null +++ b/quant.ew/files/system/local_health/poly.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index e63236a3..229ae567 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -1466,6 +1466,7 @@ end function module.on_world_update() local active = GameHasFlagRun("ew_flag_notplayer_active") and not ctx.proxy_opt.perma_death + and not ctx.proxy_opt.no_notplayer if active and EntityGetIsAlive(ctx.my_player.entity) and EntityHasTag(ctx.my_player.entity, "ew_notplayer") then if state == nil then init_state() diff --git a/quant.ew/files/system/player_arrows/player_arrows.lua b/quant.ew/files/system/player_arrows/player_arrows.lua index 38e057f4..27d9aa0f 100644 --- a/quant.ew/files/system/player_arrows/player_arrows.lua +++ b/quant.ew/files/system/player_arrows/player_arrows.lua @@ -44,7 +44,8 @@ function module.on_world_update() for peer_id, player_data in pairs(ctx.players) do if (ctx.my_id == peer_id and (ctx.spectating_over_peer_id == nil or ctx.spectating_over_peer_id == peer_id)) - or EntityHasTag(player_data.entity, "polymorphed_cessation") then + or EntityHasTag(player_data.entity, "polymorphed_cessation") + or (EntityHasTag(player_data.entity, "ew_notplayer") and ctx.proxy_opt.no_notplayer) then goto continue end local px, py = EntityGetTransform(player_data.entity) diff --git a/quant.ew/files/system/player_sync.lua b/quant.ew/files/system/player_sync.lua index 7bbc05d9..09ce9250 100644 --- a/quant.ew/files/system/player_sync.lua +++ b/quant.ew/files/system/player_sync.lua @@ -149,6 +149,7 @@ function module.on_world_update() local x, y = EntityGetTransform(ent) local notplayer = EntityHasTag(ent, "ew_notplayer") and not ctx.proxy_opt.perma_death + and not ctx.proxy_opt.no_notplayer if notplayer and GameHasFlagRun("ending_game_completed") then goto continue end diff --git a/quant.ew/files/system/player_tether/player_tether.lua b/quant.ew/files/system/player_tether/player_tether.lua index 07b0376c..7eb30aad 100644 --- a/quant.ew/files/system/player_tether/player_tether.lua +++ b/quant.ew/files/system/player_tether/player_tether.lua @@ -217,7 +217,7 @@ function module.on_world_update() return end local host_playerdata = player_fns.peer_get_player_data(ctx.host_id, true) - if ctx.proxy_opt.perma_death and (not ctx.my_player.status.is_alive or not host_playerdata.is_alive) then + if (ctx.proxy_opt.perma_death or ctx.proxy_opt.no_notplayer) and (not ctx.my_player.status.is_alive or not host_playerdata.is_alive) then return end local x2, y2 = EntityGetTransform(ctx.my_player.entity) diff --git a/quant.ew/files/system/spectator_helps/spectator_helps.lua b/quant.ew/files/system/spectator_helps/spectator_helps.lua index d16bea13..610c91ce 100644 --- a/quant.ew/files/system/spectator_helps/spectator_helps.lua +++ b/quant.ew/files/system/spectator_helps/spectator_helps.lua @@ -84,8 +84,8 @@ end local last_spectate function module.on_world_update() - if GameHasFlagRun("ending_game_completed") or ctx.proxy_opt.perma_death then - if not ctx.proxy_opt.perma_death then + if GameHasFlagRun("ending_game_completed") or ctx.proxy_opt.perma_death or ctx.proxy_opt.no_notplayer then + if not ctx.proxy_opt.perma_death and not ctx.proxy_opt.no_notplayer then rpc.del_shield() end return From 19ead8ca4a488d0178322d5b0130c89cd5b051af Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 13:18:14 -0500 Subject: [PATCH 10/13] add ability to text game chat --- quant.ew/files/system/text/text.lua | 35 +++++++++++++++++++++++++++++ quant.ew/init.lua | 1 + quant.ew/settings.lua | 16 +++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 quant.ew/files/system/text/text.lua diff --git a/quant.ew/files/system/text/text.lua b/quant.ew/files/system/text/text.lua new file mode 100644 index 00000000..5cc66a41 --- /dev/null +++ b/quant.ew/files/system/text/text.lua @@ -0,0 +1,35 @@ +local module = {} +local gui = GuiCreate() +local rpc = net.new_rpc_namespace() + +local text = "" + +local enabled = false + +function rpc.text(msg) + if not ModSettingGet("quant.ew.notext") then + GamePrint(ctx.rpc_player_data.name .. ": " ..msg) + end +end + +function module.on_world_update() + if InputIsKeyJustDown(tonumber(ModSettingGet("quant.ew.text"))) then + local g = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "InventoryGuiComponent") + if enabled then + rpc.text(string.sub(text, 1, -1)) + text = "" + if gui ~= nil then + EntitySetComponentIsEnabled(ctx.my_player.entity, g, true) + end + elseif gui ~= nil then + EntitySetComponentIsEnabled(ctx.my_player.entity, g, false) + end + enabled = not enabled + end + if enabled then + GuiStartFrame(gui) + text = GuiTextInput(gui, 421, 64, 100, text, 512, 256) + end +end + +return module \ No newline at end of file diff --git a/quant.ew/init.lua b/quant.ew/init.lua index 780dbef2..39defdd2 100755 --- a/quant.ew/init.lua +++ b/quant.ew/init.lua @@ -135,6 +135,7 @@ local function load_modules() ctx.load_system("potion_mimic") ctx.load_system("map") ctx.load_system("homunculus") + ctx.load_system("text") end local function load_extra_modules() diff --git a/quant.ew/settings.lua b/quant.ew/settings.lua index c6a0426a..26f7ecc3 100755 --- a/quant.ew/settings.lua +++ b/quant.ew/settings.lua @@ -147,6 +147,22 @@ local function build_settings() is_waiting_for_input = false, scope = MOD_SETTING_SCOPE_RUNTIME, }, + { + id = "text", + ui_name = "text", + ui_description = "hi", + value_default = "40", + ui_fn = ui_get_input, + is_waiting_for_input = false, + scope = MOD_SETTING_SCOPE_RUNTIME, + }, + { + id = "notext", + ui_name = "no text", + ui_description = ":c", + value_default = false, + scope = MOD_SETTING_SCOPE_RUNTIME, + }, { id = "ping_life", ui_name = "ping lifetime", From 97bdc4d09dec6d646722b95902f6dba6c58eb34e Mon Sep 17 00:00:00 2001 From: Mikael Walhelm Date: Wed, 4 Dec 2024 13:20:51 -0500 Subject: [PATCH 11/13] Revert "Add apt caching to release workflow" --- .github/workflows/release.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66cf3f0a..fbabce33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: i686-pc-windows-gnu - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: gcc-mingw-w64-i686 - version: 1.0 + - name: Install extra deps + run: sudo apt-get install -y gcc-mingw-w64-i686 - uses: Swatinem/rust-cache@v2 with: @@ -42,10 +40,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-gnu - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64 - version: 1.0 + - name: Install extra deps + run: sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64 - uses: Swatinem/rust-cache@v2 with: @@ -71,10 +67,9 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-gnu - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64 - version: 1.0 + - name: Install extra deps + run: sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64 + - uses: Swatinem/rust-cache@v2 with: workspaces: noita-proxy -> target From 809cc43f12c5c506aeef04a82013288274d9e6ba Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 13:27:36 -0500 Subject: [PATCH 12/13] Automated commit: v0.31.1 --- last_release_notes.md | 29 ++++++++++++----------------- noita-proxy/Cargo.lock | 2 +- noita-proxy/Cargo.toml | 2 +- noita-proxy/src/lib.rs | 3 +-- noita-proxy/src/net.rs | 5 ++++- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/last_release_notes.md b/last_release_notes.md index 790f5f55..d8b46992 100644 --- a/last_release_notes.md +++ b/last_release_notes.md @@ -1,30 +1,25 @@ -## Noita Entangled Worlds v0.31.0 - UI changes, fix item sync, fix/sync some perks +## Noita Entangled Worlds v0.31.1 -- allow peaking at peers mod list +- add in game chat system, enter to start/end -- allow unbanning players +- fix projectiles duplicating from bombs materialized fix -- fix item sync removing and respawning items +- fix enemies duping when host/player restarts -- fix enemies not dropping wands sometimes +- teleport wands if grabbed sometimes since we cant remove them due to a crash, remove items faster when safe -- allow seeing spells of other players while spectating +- allow picking up wands from greater distances -- fix ability action materialized +- add share gold option(prob buggy) -- fix homunculus - -- sync position of homunculus and lukki minion - -- allow disabling controller binds in the in game settings menu - -- allow cli to use proxy ron +- add no notplayer option(has issues i prob wont fix) ## Accepted pull requests - -No pull requests have been accepted in this release. - +- Revert "Add apt caching to release workflow" by @bgkillas in #258 +- Add apt caching to release workflow by @kcalbxof in #255 +- Changed file dialog to native via rfd by @kcalbxof in #254 +- make ewext compileable on old systems UPD: added as feature flag by @kcalbxof in #236 ## Installation diff --git a/noita-proxy/Cargo.lock b/noita-proxy/Cargo.lock index db645daa..36fddd1b 100644 --- a/noita-proxy/Cargo.lock +++ b/noita-proxy/Cargo.lock @@ -2271,7 +2271,7 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "noita-proxy" -version = "0.31.0" +version = "0.31.1" dependencies = [ "argh", "bitcode", diff --git a/noita-proxy/Cargo.toml b/noita-proxy/Cargo.toml index bc35d358..95637fd8 100644 --- a/noita-proxy/Cargo.toml +++ b/noita-proxy/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" [package] name = "noita-proxy" description = "Noita Entangled Worlds companion app." -version = "0.31.0" +version = "0.31.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 63ff8fc6..91ad036c 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -168,8 +168,7 @@ impl GameSettings { } ui.add_space(1.0); { - let mut temp = - game_settings.no_notplayer.unwrap_or(def.no_notplayer); + let mut temp = game_settings.no_notplayer.unwrap_or(def.no_notplayer); if ui.checkbox(&mut temp, "no minua").changed() { game_settings.no_notplayer = Some(temp) } diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index ae5a02c9..5d939ed5 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -501,7 +501,10 @@ impl NetManager { } else { info!("No nickname chosen"); } - state.try_ws_write_option("friendly_fire", settings.friendly_fire.unwrap_or(def.friendly_fire)); + state.try_ws_write_option( + "friendly_fire", + settings.friendly_fire.unwrap_or(def.friendly_fire), + ); state.try_ws_write_option("share_gold", settings.share_gold.unwrap_or(def.share_gold)); state.try_ws_write_option("debug", settings.debug_mode.unwrap_or(def.debug_mode)); state.try_ws_write_option( From df7367645e5a131fc154224c7780596c3b6b405a Mon Sep 17 00:00:00 2001 From: bgkillas Date: Wed, 4 Dec 2024 14:42:48 -0500 Subject: [PATCH 13/13] see your own messages --- quant.ew/files/system/text/text.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quant.ew/files/system/text/text.lua b/quant.ew/files/system/text/text.lua index 5cc66a41..8920a369 100644 --- a/quant.ew/files/system/text/text.lua +++ b/quant.ew/files/system/text/text.lua @@ -6,6 +6,8 @@ local text = "" local enabled = false +rpc.opts_everywhere() +rpc.opts_reliable() function rpc.text(msg) if not ModSettingGet("quant.ew.notext") then GamePrint(ctx.rpc_player_data.name .. ": " ..msg)