Skip to content

Commit b506dac

Browse files
committed
Another potential fix for WSE crash
1 parent 2680fc0 commit b506dac

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

noita-proxy/src/lib.rs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ pub struct App {
539539
appearance: PlayerAppearance,
540540
connected_menu: ConnectedMenu,
541541
show_host_settings: bool,
542-
ux_settings: UXSettings
542+
ux_settings: UXSettings,
543543
}
544544

545545
fn filled_group<R>(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {
@@ -597,13 +597,18 @@ fn settings_get() -> Settings {
597597
}
598598
}
599599

600-
fn settings_set(app: AppSavedState, color: PlayerAppearance, modmanager: ModmanagerSettings, ux: UXSettings) {
600+
fn settings_set(
601+
app: AppSavedState,
602+
color: PlayerAppearance,
603+
modmanager: ModmanagerSettings,
604+
ux: UXSettings,
605+
) {
601606
if let Ok(s) = std::env::current_exe() {
602607
let settings = Settings {
603608
app,
604609
color,
605610
modmanager,
606-
ux
611+
ux,
607612
};
608613
let file = s.parent().unwrap().join("proxy.ron");
609614
let settings = ron::to_string(&settings).unwrap();
@@ -1106,14 +1111,22 @@ impl App {
11061111
ui.add_space(10.0);
11071112
ui.label(tr("ping-note"));
11081113
ui.add_space(10.0);
1109-
ui.add(egui::Slider::new(&mut self.ux_settings.ping_lifetime, 1..=60).text(tr("ping-lifetime"))
1110-
.min_decimals(0)
1111-
.max_decimals(0)
1112-
.step_by(1.0)).on_hover_text(tr("ping-lifetime-tooltip"));
1113-
ui.add(egui::Slider::new(&mut self.ux_settings.ping_scale, 0.0..=1.5).text(tr("ping-scale"))
1114-
.min_decimals(0)
1115-
.max_decimals(1)
1116-
.step_by(0.1)).on_hover_text(tr("ping-scale-tooltip"));
1114+
ui.add(
1115+
egui::Slider::new(&mut self.ux_settings.ping_lifetime, 1..=60)
1116+
.text(tr("ping-lifetime"))
1117+
.min_decimals(0)
1118+
.max_decimals(0)
1119+
.step_by(1.0),
1120+
)
1121+
.on_hover_text(tr("ping-lifetime-tooltip"));
1122+
ui.add(
1123+
egui::Slider::new(&mut self.ux_settings.ping_scale, 0.0..=1.5)
1124+
.text(tr("ping-scale"))
1125+
.min_decimals(0)
1126+
.max_decimals(1)
1127+
.step_by(0.1),
1128+
)
1129+
.on_hover_text(tr("ping-scale-tooltip"));
11171130
}
11181131

11191132
fn connect_to_steam_lobby(&mut self, lobby_id: String) {

quant.ew/files/core/util.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ local base64 = dofile_once("mods/quant.ew/files/resource/base64.lua")
44

55
local util = {}
66

7+
local entity_load_orig = EntityLoad
8+
9+
function EntityLoad(path, ...)
10+
if path == "??SAV/world_state.xml" then
11+
error("Attempted to EntityLoad WSE")
12+
end
13+
return entity_load_orig(path, ...)
14+
end
15+
716
function util.string_split( s, splitter )
817
local words = {};
918
if s == nil or splitter == nil then

0 commit comments

Comments
 (0)