diff --git a/CMakeLists.txt b/CMakeLists.txt index 023e85d..ae062d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,4 +143,6 @@ install( COMPONENT ComponentExplorer ) +install(DIRECTORY unsafe-explorer DESTINATION "." COMPONENT ComponentExplorer-Unsafe) + include(packaging/CMakeLists.txt) diff --git a/component-explorer/component_fields.lua b/component-explorer/component_fields.lua index 7b06e42..9a7b01c 100644 --- a/component-explorer/component_fields.lua +++ b/component-explorer/component_fields.lua @@ -1,12 +1,15 @@ local stringify = dofile_once("mods/component-explorer/deps/datadumper.lua") dofile_once("mods/component-explorer/field_enums.lua") dofile_once("mods/component-explorer/entity.lua") -dofile_once("mods/component-explorer/utils/settings_util.lua") local file_viewer = dofile_once("mods/component-explorer/file_viewer.lua") local matutil = dofile_once("mods/component-explorer/utils/matutil.lua") + ---@module 'component-explorer.help' local help = dofile_once("mods/component-explorer/help.lua") +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + ---@module 'component-explorer.utils.math_util' local math_util = dofile_once("mods/component-explorer/utils/math_util.lua") @@ -67,7 +70,7 @@ end -- float format local function ff(type) - local configured = setting_get("preferred_decimal_format") + local configured = ce_settings.get("preferred_decimal_format") if type == "double" and configured == "double_scientific" or diff --git a/component-explorer/entity_list.lua b/component-explorer/entity_list.lua index 6cddc7b..50f22b0 100644 --- a/component-explorer/entity_list.lua +++ b/component-explorer/entity_list.lua @@ -1,9 +1,12 @@ local string_util = dofile_once("mods/component-explorer/utils/strings.lua") dofile_once("mods/component-explorer/entity.lua") +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + local entity_list = {} -entity_list.open = setting_get("window_open_entity_list") +entity_list.open = ce_settings.get("window_open_entity_list") local entity_search = "" local include_child_entities = false diff --git a/component-explorer/globals.lua b/component-explorer/globals.lua index 0307a43..6db460f 100644 --- a/component-explorer/globals.lua +++ b/component-explorer/globals.lua @@ -239,7 +239,7 @@ end function globals.show() imgui.SetNextWindowSize(600, 200, imgui.Cond.FirstUseEver) local should_show - should_show, globals.open = imgui.Begin("Globals / flags", globals.open) + should_show, globals.open = imgui.Begin("Globals", globals.open) if not should_show then return end diff --git a/component-explorer/init.lua b/component-explorer/init.lua index 14b2833..8347db7 100644 --- a/component-explorer/init.lua +++ b/component-explorer/init.lua @@ -3,338 +3,10 @@ if not load_imgui then EntityLoad("mods/component-explorer/entities/imgui_warning.xml") end error("Missing ImGui.") -end - --- Loading imgui early so it's available when other files are loaded -imgui = load_imgui({version="1.7.0", mod="Component Explorer"}) - -dofile_once("mods/component-explorer/utils/settings_util.lua") -- Should be loaded early -dofile_once("mods/component-explorer/lua_console.lua") ----@module 'component-explorer.globals' -local globals = dofile_once("mods/component-explorer/globals.lua") -dofile_once("mods/component-explorer/components.lua") ----@module 'component-explorer.entity_list' -local entity_list = dofile_once("mods/component-explorer/entity_list.lua") -dofile_once("mods/component-explorer/entity.lua") -local version = dofile_once("mods/component-explorer/version.lua") ----@module 'component-explorer.entity_picker' -local entity_picker = dofile_once("mods/component-explorer/entity_picker.lua") ----@module 'component-explorer.wiki_wands' -local wiki_wands = dofile_once("mods/component-explorer/wiki_wands.lua") ----@module 'component-explorer.link_ui' -local link_ui = dofile_once("mods/component-explorer/link_ui.lua") ----@module 'component-explorer.user_scripts' -local us = dofile_once("mods/component-explorer/user_scripts.lua") ----@module 'component-explorer.file_viewer' -local file_viewer = dofile_once("mods/component-explorer/file_viewer.lua") ----@module 'component-explorer.mod_settings' -local mod_settings = dofile_once("mods/component-explorer/mod_settings.lua") ----@module 'component-explorer.help' -local help = dofile_once("mods/component-explorer/help.lua") - ----@module 'component-explorer.logger' -dofile_once("mods/component-explorer/logger.lua") ----@module 'component-explorer.utils.noita_version' -dofile_once("mods/component-explorer/utils/noita_version.lua") -if is_steam_version() then - dofile_once("mods/component-explorer/magic_numbers.lua") - dofile_once("mods/component-explorer/debug.lua") -end - -local console = new_console() - -console.open = setting_get("window_open_lua_console") -console.user_scripts_open = setting_get("window_open_user_scripts") -window_open_logs = setting_get("window_open_logs") -local window_open_about = false -local overlay_open_logs = setting_get("overlay_open_logs") -local windows_hidden_component = false -local windows_hidden_entity = false - -function OnMagicNumbersAndWorldSeedInitialized() - local function run_us_ifexists(script) - if us.exists(script) then - console_run_command(console, us.user_script_call_string(script)) - end - end - - run_us_ifexists("init.lua") - run_us_ifexists("_init.lua") -end - -is_escape_paused = false -is_inventory_paused = false - -function OnPausedChanged(paused, inventory_pause) - load_settings() -- Settings might've changed, reload - - is_escape_paused = paused and not inventory_pause - is_inventory_paused = inventory_pause - - if not paused then update_ui(true, GameGetFrameNum()) end -end - -function OnWorldPreUpdate() - update_ui(false, GameGetFrameNum()) -end - -function OnPausePreUpdate() - update_ui(true, GameGetFrameNum()) -end - -function show_view_menu_items() - local function sct(shortcut_text) - return setting_get("keyboard_shortcuts") and shortcut_text or "" - end - - local _ - _, console.open = imgui.MenuItem("Lua Console", sct("CTRL+SHIFT+L"), console.open) - _, entity_list.open = imgui.MenuItem("Entity List", sct("CTRL+SHIFT+K"), entity_list.open) - _, window_open_logs = imgui.MenuItem("Logs Window", "", window_open_logs) - _, overlay_open_logs = imgui.MenuItem("Logs Overlay", sct("CTRL+SHIFT+O"), overlay_open_logs) - _, wiki_wands.open = imgui.MenuItem("Wiki Wands", "", wiki_wands.open) - _, file_viewer.open = imgui.MenuItem("File Viewer", sct("CTRL+SHIFT+F"), file_viewer.open) - - local clicked - clicked, entity_picker.open = imgui.MenuItem("Entity Picker...", sct("CTRL+SHIFT+E"), entity_picker.open) - if clicked then - imgui.SetWindowFocus(nil) - end - - if imgui.IsItemHovered() then - help.tooltip(table.concat({ - "Allows you to move your mouse over an entity to open a window for it. ", - "Press the entry number to select the entity. ESC to cancel the action.\n\n", - "When keyboard shortcuts are enabled, you can hit CTRL+SHIFT+E to open or close the picker.", - })) - end - - _, globals.open = imgui.MenuItem("Globals", "", globals.open) - _, mod_settings.open = imgui.MenuItem("Mod Settings", "", mod_settings.open) - - if is_steam_version() then - imgui.Separator() - _, window_open_magic_numbers = imgui.MenuItem("Magic Numbers", sct("CTRL+SHIFT+M"), window_open_magic_numbers) - _, window_open_debug = imgui.MenuItem("Debug", sct("CTRL+SHIFT+D"), window_open_debug) - end - - imgui.Separator() - _, windows_hidden_entity = imgui.MenuItem("Hide entity windows", "", windows_hidden_entity) - _, windows_hidden_component = imgui.MenuItem("Hide component windows", "", windows_hidden_component) -end - --- Can't know the width before creating the window.. Just an initial value, it's updated --- to the real value once we can call imgui.GetWindowWidth() -local main_window_width = 100 - -function main_window_position() - local menubar_height = imgui.GetFontSize() + 2 * imgui.GetStyle().FramePadding_y - - -- Available space - local aw, ah = imgui.GetMainViewportSize() - aw = aw - main_window_width - ah = ah - menubar_height + 3 -- Bit extra to get rid of the bottom deadzone of the window - - local rx, ry - - local side = setting_get("main_window_side") - - if side == "top" then ry = 0 - elseif side == "bottom" then ry = 1 - elseif side == "left" then rx = 0 - elseif side == "right" then rx = 1 end - - local roffset = setting_get("main_window_side_offset") / 100 - - if rx == nil then rx = roffset - elseif ry == nil then ry = roffset end - - local vx, vy = imgui.GetMainViewportWorkPos() - return vx + aw * rx, vy + ah * ry -end - -function main_window() - local window_flags = bit.bor( - imgui.WindowFlags.MenuBar, - imgui.WindowFlags.NoDocking, - imgui.WindowFlags.NoSavedSettings, - imgui.WindowFlags.NoFocusOnAppearing, - imgui.WindowFlags.NoMove, - imgui.WindowFlags.NoDecoration, - imgui.WindowFlags.NoBackground - ) - - imgui.SetNextWindowViewport(imgui.GetMainViewportID()) - imgui.SetNextWindowPos(main_window_position()) - imgui.SetNextWindowSize(0, 0) - - if imgui.Begin("Main Menu", nil, window_flags) then - -- Save actual window width for next positioning - main_window_width = imgui.GetWindowWidth() - - if imgui.BeginMenuBar() then - if imgui.BeginMenu("CE") then - local _ - _, window_open_about = imgui.MenuItem("About", "", window_open_about) - link_ui.menu_item("Docs", "Opens noita.wiki.gg", version.wiki) - imgui.EndMenu() - end - - if imgui.BeginMenu("View") then - show_view_menu_items() - imgui.EndMenu() - end - - imgui.EndMenuBar() - end - - imgui.End() - end -end - -function show_about_window() - local should_show - should_show, window_open_about = imgui.Begin("About", window_open_about) - if should_show then - imgui.Text("Component explorer version " .. version.version) - imgui.Text("Made by dextercd") - link_ui.button("Homepage", version.homepage) - - imgui.End() - end -end - -local last_frame_run = -1 - -function update_ui(paused, current_frame_run) - if paused then - if is_escape_paused and not setting_get("pause_escape") or - is_inventory_paused and not setting_get("pause_wands") - then - return - end - else - if last_frame_run >= current_frame_run then - return - end - end - last_frame_run = current_frame_run - - if setting_get("keyboard_shortcuts") then - keyboard_shortcuts() - end - - main_window() - - if window_open_about then - show_about_window() - end - - if globals.open then - globals.show() - end - - if not windows_hidden_entity then - show_entity_windows() - end - - if not windows_hidden_component then - show_component_windows() - end - - if entity_list.open then - entity_list.show() - end - - if console.open then - console_draw(console) - -- So that current setting is preserved - setting_set("window_open_user_scripts", console.user_scripts_open) - end - - if window_open_logs then - draw_log_window() - end - - if overlay_open_logs then - draw_log_overlay() - end - - if entity_picker.open then - entity_picker.show() - end - - if wiki_wands.open then - wiki_wands.show() - end - - if file_viewer.open then - file_viewer.show() - end - - if mod_settings.open then - mod_settings.show() - end - - if is_steam_version() then - if window_open_magic_numbers then - show_magic_numbers() - end - - if window_open_debug then - show_debug() - end - end -end - -function keyboard_shortcuts() - if not imgui.IsKeyDown(imgui.Key.LeftCtrl) then return end - if not imgui.IsKeyDown(imgui.Key.LeftShift) then return end - - if imgui.IsKeyPressed(imgui.Key.E) then - entity_picker.open = not entity_picker.open - end - - if imgui.IsKeyPressed(imgui.Key.F) then - file_viewer.open = not file_viewer.open - end - - if imgui.IsKeyPressed(imgui.Key.W) then - local world_entity = GameGetWorldStateEntity() - local world_component = EntityGetFirstComponent(world_entity, "WorldStateComponent") - toggle_watch_component(world_entity, world_component) - end - - if imgui.IsKeyPressed(imgui.Key.P) then - local players = EntityGetWithTag("player_unit") - for _, player in ipairs(players) do - toggle_watch_entity(player) - end - end - - if imgui.IsKeyPressed(imgui.Key.K) then - entity_list.open = not entity_list.open - end - - if imgui.IsKeyPressed(imgui.Key.L) then - console.open = not console.open - end - - if imgui.IsKeyPressed(imgui.Key.U) then - console.user_scripts_open = not console.user_scripts_open - end - - if imgui.IsKeyPressed(imgui.Key.O) then - overlay_open_logs = not overlay_open_logs - end - - if is_steam_version() then - if imgui.IsKeyPressed(imgui.Key.M) then - window_open_magic_numbers = not window_open_magic_numbers - end - - if imgui.IsKeyPressed(imgui.Key.D) then - window_open_debug = not window_open_debug - end +else + function OnModPostInit() + -- Delay dofile calls until latter end of mod initialisation, so that other + -- mods can do ModLuaFileAppend to the component-explorer files. + dofile("mods/component-explorer/main.lua") end end diff --git a/component-explorer/lib/global_flag.lua b/component-explorer/lib/global_flag.lua new file mode 100644 index 0000000..018f248 --- /dev/null +++ b/component-explorer/lib/global_flag.lua @@ -0,0 +1,35 @@ +local global_flag = {} + +---@class GlobalFlag +---@field key string +---@field value boolean +---@field default boolean + +local mt = {} +function mt:__index(key) + if key == "value" then + local value = GlobalsGetValue(self.key) + if value ~= "" then + return value == "1" + end + return self.default + end +end + +function mt:__newindex(key, value) + if key == "value" then + GlobalsSetValue(self.key, value and "1" or "0") + end +end + +---@param key string +---@param default boolean? +---@return GlobalFlag +function global_flag.new(key, default) + return setmetatable({ + key=key, + default=default or false, + }, mt) +end + +return global_flag diff --git a/component-explorer/lib/ui_callbacks.lua b/component-explorer/lib/ui_callbacks.lua new file mode 100644 index 0000000..8b80436 --- /dev/null +++ b/component-explorer/lib/ui_callbacks.lua @@ -0,0 +1,54 @@ +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + +local original_OnPausedChanged = OnPausedChanged +local original_OnWorldPreUpdate = OnWorldPreUpdate +local original_OnPausePreUpdate = OnPausePreUpdate + +local last_frame_run = -1 + +is_escape_paused = false +is_inventory_paused = false + +function OnPausedChanged(paused, inventory_pause) + if original_OnPausedChanged then + original_OnPausedChanged(paused, inventory_pause) + end + + ce_settings.load() -- Settings might've changed, reload + + is_escape_paused = paused and not inventory_pause + is_inventory_paused = inventory_pause + + if not paused then update_ui(true, GameGetFrameNum()) end +end + +function OnWorldPreUpdate() + if original_OnWorldPreUpdate then + original_OnWorldPreUpdate() + end + + local current_frame_run = GameGetFrameNum() + if last_frame_run >= current_frame_run then + return + end + last_frame_run = current_frame_run + + update_ui(false, current_frame_run) +end + +function OnPausePreUpdate() + if original_OnPausePreUpdate then + original_OnPausePreUpdate() + end + + if is_escape_paused and not ce_settings.get("pause_escape") or + is_inventory_paused and not ce_settings.get("pause_wands") + then + return + end + + local current_frame_run = GameGetFrameNum() + last_frame_run = current_frame_run + update_ui(true, current_frame_run) +end diff --git a/component-explorer/link_ui.lua b/component-explorer/link_ui.lua index 1c4a688..e5700da 100644 --- a/component-explorer/link_ui.lua +++ b/component-explorer/link_ui.lua @@ -1,22 +1,29 @@ -local win32 = dofile_once("mods/component-explorer/utils/win32.lua") - local link_ui = {} +link_ui.open_link = nil + function link_ui.button(label, url) imgui.Text(label .. ": " .. url) imgui.SameLine() if imgui.SmallButton("Copy") then imgui.SetClipboardText(url) end - imgui.SameLine() - if imgui.SmallButton("Open") then - win32.open(url) + + if link_ui.open_link then + imgui.SameLine() + if imgui.SmallButton("Open") then + link_ui.open_link(url) + end end end function link_ui.menu_item(label, extra, url) if imgui.MenuItem(label, extra) then - win32.open(url) + if link_ui.open_link then + link_ui.open_link(url) + else + imgui.SetClipboardText(url) + end end end diff --git a/component-explorer/lua_console.lua b/component-explorer/lua_console.lua index 60fbec9..29d757e 100644 --- a/component-explorer/lua_console.lua +++ b/component-explorer/lua_console.lua @@ -6,14 +6,17 @@ local stringify = dofile_once("mods/component-explorer/deps/datadumper.lua") local eval = dofile_once("mods/component-explorer/utils/eval.lua") ---@module 'component-explorer.user_scripts' local us = dofile_once("mods/component-explorer/user_scripts.lua") ----@module 'component-explorer.user_scripts_window' -local uswindow = dofile_once("mods/component-explorer/user_scripts_window.lua") + ---@module 'component-explorer.entity_markers' local entity_markers = dofile_once("mods/component-explorer/entity_markers.lua") ---@module 'component-explorer.globals' local globals = dofile_once("mods/component-explorer/globals.lua") ---@module 'component-explorer.help' local help = dofile_once("mods/component-explorer/help.lua") +---@module 'component-explorer.lib.global_flag' +local global_flag = dofile_once("mods/component-explorer/lib/global_flag.lua") + +local lua_console = {} local console_tools = { user_script = us.user_script, @@ -27,33 +30,23 @@ local console_tools = { unwatch_global = globals.unwatch, } -function new_console(name) - name = name or "Console" +function new_console() return { - name = name, - open = true, + open = global_flag.new("ce.console"), history = {}, input = "", last_command = "", scroll_to_bottom = false, focus_input = false, remove_items = 0, - user_scripts_open = false, input_lines = 3, } end function console_draw(console) - if console.user_scripts_open then - local script = uswindow.draw_user_scripts_window(console) - if script then - console_run_command(console, us.user_script_call_string(script)) - end - end - local should_show imgui.SetNextWindowSize(600, 400, imgui.Cond.FirstUseEver) - should_show, console.open = imgui.Begin(console.name, console.open) + should_show, console.open.value = imgui.Begin("Console", console.open.value) if not should_show then return end @@ -152,7 +145,7 @@ local function console_item_context_menu(str_id, console, index) imgui.EndPopup() end -function console_contents_draw(console) +function lua_console.header_buttons(console) if imgui.SmallButton("Clear") then console.history = {} end @@ -185,12 +178,10 @@ function console_contents_draw(console) imgui.SetClipboardText(all_history) end +end - imgui.SameLine() - local ustext = console.user_scripts_open and "Close user scripts" or "Open user scripts" - if imgui.SmallButton(ustext) then - console.user_scripts_open = not console.user_scripts_open - end +function console_contents_draw(console) + lua_console.header_buttons(console) imgui.Separator() @@ -292,3 +283,5 @@ function console_contents_draw(console) console.remove_items = 0 end end + +return lua_console diff --git a/component-explorer/main.lua b/component-explorer/main.lua new file mode 100644 index 0000000..1afd8a9 --- /dev/null +++ b/component-explorer/main.lua @@ -0,0 +1,260 @@ +-- Loading imgui early so it's available when other files are loaded +imgui = load_imgui({version="1.7.0", mod="Component Explorer"}) + +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") +dofile_once("mods/component-explorer/lua_console.lua") +---@module 'component-explorer.globals' +local globals = dofile_once("mods/component-explorer/globals.lua") +dofile_once("mods/component-explorer/components.lua") +---@module 'component-explorer.entity_list' +local entity_list = dofile_once("mods/component-explorer/entity_list.lua") +dofile_once("mods/component-explorer/entity.lua") +local version = dofile_once("mods/component-explorer/version.lua") +---@module 'component-explorer.entity_picker' +local entity_picker = dofile_once("mods/component-explorer/entity_picker.lua") +---@module 'component-explorer.wiki_wands' +local wiki_wands = dofile_once("mods/component-explorer/wiki_wands.lua") +---@module 'component-explorer.link_ui' +local link_ui = dofile_once("mods/component-explorer/link_ui.lua") +---@module 'component-explorer.user_scripts' +local us = dofile_once("mods/component-explorer/user_scripts.lua") +---@module 'component-explorer.file_viewer' +local file_viewer = dofile_once("mods/component-explorer/file_viewer.lua") +---@module 'component-explorer.mod_settings' +local mod_settings = dofile_once("mods/component-explorer/mod_settings.lua") +---@module 'component-explorer.help' +local help = dofile_once("mods/component-explorer/help.lua") + +local console = new_console() + +local window_open_about = false +local windows_hidden_component = false +local windows_hidden_entity = false + +function OnMagicNumbersAndWorldSeedInitialized() + local function run_us_ifexists(script) + if us.exists(script) then + console_run_command(console, us.user_script_call_string(script)) + end + end + + run_us_ifexists("init.lua") + run_us_ifexists("_init.lua") +end + +is_escape_paused = false +is_inventory_paused = false + +function sct(shortcut_text) + return ce_settings.get("keyboard_shortcuts") and shortcut_text or "" +end + +function show_view_menu_items() + local _ + _, console.open.value = imgui.MenuItem("Lua Console", sct("CTRL+SHIFT+L"), console.open.value) + _, entity_list.open = imgui.MenuItem("Entity List", sct("CTRL+SHIFT+K"), entity_list.open) + _, wiki_wands.open = imgui.MenuItem("Wiki Wands", "", wiki_wands.open) + _, file_viewer.open = imgui.MenuItem("File Viewer", sct("CTRL+SHIFT+F"), file_viewer.open) + + local clicked + clicked, entity_picker.open = imgui.MenuItem("Entity Picker...", sct("CTRL+SHIFT+E"), entity_picker.open) + if clicked then + imgui.SetWindowFocus(nil) + end + + if imgui.IsItemHovered() then + help.tooltip(table.concat({ + "Allows you to move your mouse over an entity to open a window for it. ", + "Press the entry number to select the entity. ESC to cancel the action.\n\n", + "When keyboard shortcuts are enabled, you can hit CTRL+SHIFT+E to open or close the picker.", + })) + end + + _, globals.open = imgui.MenuItem("Globals", "", globals.open) + _, mod_settings.open = imgui.MenuItem("Mod Settings", "", mod_settings.open) + + imgui.Separator() + _, windows_hidden_entity = imgui.MenuItem("Hide entity windows", "", windows_hidden_entity) + _, windows_hidden_component = imgui.MenuItem("Hide component windows", "", windows_hidden_component) +end + +-- Can't know the width before creating the window.. Just an initial value, it's updated +-- to the real value once we can call imgui.GetWindowWidth() +local main_window_width = 100 + +function main_window_position() + local menubar_height = imgui.GetFontSize() + 2 * imgui.GetStyle().FramePadding_y + + -- Available space + local aw, ah = imgui.GetMainViewportSize() + aw = aw - main_window_width + ah = ah - menubar_height + 3 -- Bit extra to get rid of the bottom deadzone of the window + + local rx, ry + + local side = ce_settings.get("main_window_side") + + if side == "top" then ry = 0 + elseif side == "bottom" then ry = 1 + elseif side == "left" then rx = 0 + elseif side == "right" then rx = 1 end + + local roffset = ce_settings.get("main_window_side_offset") / 100 + + if rx == nil then rx = roffset + elseif ry == nil then ry = roffset end + + local vx, vy = imgui.GetMainViewportWorkPos() + return vx + aw * rx, vy + ah * ry +end + +function main_window() + local window_flags = bit.bor( + imgui.WindowFlags.MenuBar, + imgui.WindowFlags.NoDocking, + imgui.WindowFlags.NoSavedSettings, + imgui.WindowFlags.NoFocusOnAppearing, + imgui.WindowFlags.NoMove, + imgui.WindowFlags.NoDecoration, + imgui.WindowFlags.NoBackground + ) + + imgui.SetNextWindowViewport(imgui.GetMainViewportID()) + imgui.SetNextWindowPos(main_window_position()) + imgui.SetNextWindowSize(0, 0) + + if imgui.Begin("Main Menu", nil, window_flags) then + -- Save actual window width for next positioning + main_window_width = imgui.GetWindowWidth() + + if imgui.BeginMenuBar() then + if imgui.BeginMenu("CE") then + local _ + _, window_open_about = imgui.MenuItem("About", "", window_open_about) + + local docs_description = "Copies web link" + if link_ui.open_link then + docs_description = "Opens noita.wiki.gg" + end + link_ui.menu_item("Docs", docs_description, version.wiki) + + imgui.EndMenu() + end + + if imgui.BeginMenu("View") then + show_view_menu_items() + imgui.EndMenu() + end + + imgui.EndMenuBar() + end + + imgui.End() + end +end + +function show_about_window() + local should_show + should_show, window_open_about = imgui.Begin("About", window_open_about) + if should_show then + imgui.Text("Component explorer version " .. version.version) + imgui.Text("Made by dextercd") + link_ui.button("Homepage", version.homepage) + + imgui.End() + end +end + +local function keyboard_shortcuts() + if not ce_settings.get("keyboard_shortcuts") then return end + if not imgui.IsKeyDown(imgui.Key.LeftCtrl) then return end + if not imgui.IsKeyDown(imgui.Key.LeftShift) then return end + + keyboard_shortcut_items() +end + +function update_ui(paused, current_frame_run) + keyboard_shortcuts() + + main_window() + + if window_open_about then + show_about_window() + end + + if globals.open then + globals.show() + end + + if not windows_hidden_entity then + show_entity_windows() + end + + if not windows_hidden_component then + show_component_windows() + end + + if entity_list.open then + entity_list.show() + end + + if console.open.value then + console_draw(console) + end + + if entity_picker.open then + entity_picker.show() + end + + if wiki_wands.open then + wiki_wands.show() + end + + if file_viewer.open then + file_viewer.show() + end + + if mod_settings.open then + mod_settings.show() + end +end + +---Handles the keyboard shortcuts. +---CE:ExtensionPoint +function keyboard_shortcut_items() + if imgui.IsKeyPressed(imgui.Key.E) then + entity_picker.open = not entity_picker.open + end + + if imgui.IsKeyPressed(imgui.Key.F) then + file_viewer.open = not file_viewer.open + end + + if imgui.IsKeyPressed(imgui.Key.W) then + local world_entity = GameGetWorldStateEntity() + local world_component = EntityGetFirstComponent(world_entity, "WorldStateComponent") + toggle_watch_component(world_entity, world_component) + end + + if imgui.IsKeyPressed(imgui.Key.P) then + local players = EntityGetWithTag("player_unit") + for _, player in ipairs(players) do + toggle_watch_entity(player) + end + end + + if imgui.IsKeyPressed(imgui.Key.K) then + entity_list.open = not entity_list.open + end + + if imgui.IsKeyPressed(imgui.Key.L) then + console.open.value = not console.open.value + end + + if imgui.IsKeyPressed(imgui.Key.U) then + console.user_scripts_open = not console.user_scripts_open + end +end + +dofile("mods/component-explorer/lib/ui_callbacks.lua") diff --git a/component-explorer/settings.lua b/component-explorer/settings.lua index d5409e9..b6c9c39 100644 --- a/component-explorer/settings.lua +++ b/component-explorer/settings.lua @@ -40,13 +40,6 @@ mod_settings = { value_default = false, scope = MOD_SETTING_SCOPE_RUNTIME, }, - { - id = "window_open_lua_console", - ui_name = "Lua Console", - ui_description = "Console where you can input Lua expressions", - value_default = false, - scope = MOD_SETTING_SCOPE_RUNTIME, - }, { id = "window_open_logs", ui_name = "Logs window", diff --git a/component-explorer/unsafe/appends/link_ui.lua b/component-explorer/unsafe/appends/link_ui.lua new file mode 100644 index 0000000..1830162 --- /dev/null +++ b/component-explorer/unsafe/appends/link_ui.lua @@ -0,0 +1,7 @@ +---@module 'component-explorer.link_ui' +local link_ui = dofile_once("mods/component-explorer/link_ui.lua") + +link_ui.open_link = function(url) + -- Pass value to the unsafe mod which can actually open it + GlobalsSetValue("ue.link", url) +end diff --git a/component-explorer/unsafe/appends/lua_console.lua b/component-explorer/unsafe/appends/lua_console.lua new file mode 100644 index 0000000..7a94ca3 --- /dev/null +++ b/component-explorer/unsafe/appends/lua_console.lua @@ -0,0 +1,28 @@ +---@module 'component-explorer.lua_console' +local lua_console = dofile_once("mods/component-explorer/lua_console.lua") + +---@module 'component-explorer.user_scripts' +local us = dofile_once("mods/component-explorer/user_scripts.lua") + +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + +local _header_buttons = lua_console.header_buttons +function lua_console.header_buttons(console) + _header_buttons(console) + + imgui.SameLine() + local user_scripts_open = ce_settings.get("window_open_user_scripts") + + local ustext = user_scripts_open and "Close user scripts" or "Open user scripts" + if imgui.SmallButton(ustext) then + user_scripts_open = not user_scripts_open + ce_settings.set("window_open_user_scripts", user_scripts_open) + end + + local us_cmd = GlobalsGetValue("ue.us_cmd") + if us_cmd ~= "" then + GlobalsSetValue("ue.us_cmd", "") + console_run_command(console, us.user_script_call_string(us_cmd)) + end +end diff --git a/component-explorer/unsafe/appends/main.lua b/component-explorer/unsafe/appends/main.lua new file mode 100644 index 0000000..51c6956 --- /dev/null +++ b/component-explorer/unsafe/appends/main.lua @@ -0,0 +1,58 @@ +local _show_view_menu_items = show_view_menu_items +local _keyboard_shortcut_items = keyboard_shortcut_items + +local function is_steam_version() + return GlobalsGetValue("ue.steam") == "1" +end + +function show_view_menu_items() + _show_view_menu_items() + + imgui.Separator() + + local _ + local window_open_logs = GlobalsGetValue("ue.logs_window") == "1" + local overlay_open_logs = GlobalsGetValue("ue.logs_overlay") == "1" + + _, window_open_logs = imgui.MenuItem("Logs Window", "", window_open_logs) + _, overlay_open_logs = imgui.MenuItem("Logs Overlay", sct("CTRL+SHIFT+O"), overlay_open_logs) + + GlobalsSetValue("ue.logs_window", window_open_logs and "1" or "0") + GlobalsSetValue("ue.logs_overlay", overlay_open_logs and "1" or "0") + + if is_steam_version() then + imgui.Separator() + local window_open_magic_numbers = GlobalsGetValue("ue.mn_window") == "1" + local window_open_debug = GlobalsGetValue("ue.debug_window") == "1" + + _, window_open_magic_numbers = imgui.MenuItem("Magic Numbers", sct("CTRL+SHIFT+M"), window_open_magic_numbers) + _, window_open_debug = imgui.MenuItem("Debug", sct("CTRL+SHIFT+D"), window_open_debug) + + GlobalsSetValue("ue.mn_window", window_open_magic_numbers and "1" or "0") + GlobalsSetValue("ue.debug_window", window_open_debug and "1" or "0") + end +end + +function keyboard_shortcut_items() + _keyboard_shortcut_items() + + if imgui.IsKeyPressed(imgui.Key.O) then + local overlay_open_logs = GlobalsGetValue("ue.logs_overlay") == "1" + overlay_open_logs = not overlay_open_logs + GlobalsSetValue("ue.logs_overlay", overlay_open_logs and "1" or "0") + end + + if is_steam_version() then + if imgui.IsKeyPressed(imgui.Key.M) then + local window_open_magic_numbers = GlobalsGetValue("ue.mn_window") == "1" + window_open_magic_numbers = not window_open_magic_numbers + GlobalsSetValue("ue.mn_window", window_open_magic_numbers and "1" or "0") + end + + if imgui.IsKeyPressed(imgui.Key.D) then + local window_open_debug = GlobalsGetValue("ue.debug_window") == "1" + window_open_debug = not window_open_debug + GlobalsSetValue("ue.debug_window", window_open_debug and "1" or "0") + end + end +end diff --git a/component-explorer/debug.lua b/component-explorer/unsafe/debug.lua similarity index 96% rename from component-explorer/debug.lua rename to component-explorer/unsafe/debug.lua index 724bb59..84a5ee6 100644 --- a/component-explorer/debug.lua +++ b/component-explorer/unsafe/debug.lua @@ -1,12 +1,10 @@ -dofile_once("mods/component-explorer/memory_type.lua") -local memory_display = dofile_once("mods/component-explorer/memory_display.lua") +dofile_once("mods/component-explorer/unsafe/memory_type.lua") +local memory_display = dofile_once("mods/component-explorer/unsafe/memory_display.lua") local string_util = dofile_once("mods/component-explorer/utils/strings.lua") -window_open_debug = false - -local debug_base = 0x00ff8c90 -local petri_base = 0x00ff8640 -local olli_base = 0x00ff86b4 +local debug_base = 0x00ff9cc0 +local petri_base = 0x00ff9670 +local olli_base = 0x00ff96e4 local debug_categories = { { @@ -454,16 +452,17 @@ end local search = {} function show_debug() + local window_open_debug = GlobalsGetValue("ue.debug_window") == "1" local should_show should_show, window_open_debug = imgui.Begin("Debug", window_open_debug) + GlobalsSetValue("ue.debug_window", window_open_debug and "1" or "0") + if should_show then if imgui.BeginTabBar("##debugtabs") then for _, category in ipairs(debug_categories) do if imgui.BeginTabItem(category.name) then - local search_changed - search_changed, search[category] = imgui.InputText( - "Search", search[category] or "" - ) + local _ + _, search[category] = imgui.InputText("Search", search[category] or "") imgui.Separator() show_debug_items(category, search[category]) diff --git a/component-explorer/unsafe/init.lua b/component-explorer/unsafe/init.lua new file mode 100644 index 0000000..3ba083b --- /dev/null +++ b/component-explorer/unsafe/init.lua @@ -0,0 +1,7 @@ +ModLuaFileAppend("mods/component-explorer/link_ui.lua", "mods/component-explorer/unsafe/appends/link_ui.lua") +ModLuaFileAppend("mods/component-explorer/main.lua", "mods/component-explorer/unsafe/appends/main.lua") +ModLuaFileAppend("mods/component-explorer/lua_console.lua", "mods/component-explorer/unsafe/appends/lua_console.lua") + +function OnModPostInit() + dofile("mods/component-explorer/unsafe/main.lua") +end diff --git a/component-explorer/logger.lua b/component-explorer/unsafe/logger.lua similarity index 97% rename from component-explorer/logger.lua rename to component-explorer/unsafe/logger.lua index 2b94b22..7ac3f06 100644 --- a/component-explorer/logger.lua +++ b/component-explorer/unsafe/logger.lua @@ -1,5 +1,5 @@ local string_util = dofile_once("mods/component-explorer/utils/strings.lua") -local win32 = dofile_once("mods/component-explorer/utils/win32.lua") +local win32 = dofile_once("mods/component-explorer/unsafe/win32.lua") local style = dofile_once("mods/component-explorer/style.lua") local ffi = require("ffi") @@ -125,8 +125,11 @@ local window_autoscroll = true function draw_log_window() local should_show + local window_open_logs = GlobalsGetValue("ue.logs_window") == "1" should_show, window_open_logs = imgui.Begin("logger.txt", window_open_logs) + GlobalsSetValue("ue.logs_window", window_open_logs and "1" or "0") + if not should_show then return end diff --git a/component-explorer/magic_number_items.lua b/component-explorer/unsafe/magic_number_items.lua similarity index 77% rename from component-explorer/magic_number_items.lua rename to component-explorer/unsafe/magic_number_items.lua index e8e7488..546ca13 100644 --- a/component-explorer/magic_number_items.lua +++ b/component-explorer/unsafe/magic_number_items.lua @@ -1,4 +1,4 @@ -dofile_once("mods/component-explorer/memory_type.lua") +dofile_once("mods/component-explorer/unsafe/memory_type.lua") local function table_extend(table1, table2) for _, value in ipairs(table2) do @@ -14,1848 +14,1819 @@ table_extend(developer_items, { { name = "ANIMALAI_FLYING_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00f41ca8, + addr = 0x00f42ca8, }, { name = "DEBUG_SHOW_MOUSE_MATERIAL", type = CE_MemoryType.bool_, - addr = 0x00ff55e0, + addr = 0x00ff660c, }, { name = "PLAYER_KICK_FORCE", type = CE_MemoryType.float_, - addr = 0x00f41b6c, + addr = 0x00f42b6c, }, { name = "PLAYER_KICK_VERLET_RADIUS", type = CE_MemoryType.float_, - addr = 0x00f410b4, + addr = 0x00f420b4, }, { name = "PLAYER_KICK_VERLET_FORCE", type = CE_MemoryType.float_, - addr = 0x00f410c4, + addr = 0x00f420c4, }, { name = "PLAYER_KICK_FRAMES_IGNORE_COLLISION", type = CE_MemoryType.int_, - addr = 0x00f41ccc, + addr = 0x00f42ccc, }, { name = "INVENTORY_GUI_ALWAYS_VISIBLE", type = CE_MemoryType.bool_, - addr = 0x00f41e2a, + addr = 0x00f42e2a, }, { name = "CAMERA_IS_FREE", type = CE_MemoryType.bool_, - addr = 0x00ff5627, + addr = 0x00ff6657, }, { name = "REPORT_DAMAGE_TYPE", type = CE_MemoryType.bool_, - addr = 0x00f41dac, - }, - { - name = "REPORT_DAMAGE_FONT", - type = CE_MemoryType.std_string, - addr = 0x00f435d0, + addr = 0x00f42db0, }, { name = "REPORT_DAMAGE_SCALE", type = CE_MemoryType.float_, - addr = 0x00f41d5c, + addr = 0x00f42d5c, }, { name = "REPORT_DAMAGE_BLOCK_MESSAGE_INTERVAL_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41d1c, + addr = 0x00f42d1c, }, { name = "GAME_LOG_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f411f1, + addr = 0x00f421f1, }, { name = "RANDOMIZE_LARGE_EXPLOSION_RAYS", type = CE_MemoryType.bool_, - addr = 0x00f410c2, + addr = 0x00f420c2, }, { name = "EXPLOSION_FACTORY_FALLING_DIRT_FX_PROBABILITY", type = CE_MemoryType.int_, - addr = 0x00ff7a58, + addr = 0x00ff8a88, }, { name = "EXPLOSION_FACTORY_STAIN_PERCENTAGE", type = CE_MemoryType.float_, - addr = 0x00f41e18, + addr = 0x00f42e18, }, { name = "PHYSICS_JOINT_MAX_FORCE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f411fc, + addr = 0x00f421fc, }, { name = "PHYSICS_RAGDOLL_JOINT_MAX_FORCE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41d9c, + addr = 0x00f42d98, }, { name = "PHYSICS_RAGDOLL_JOINT_MIN_BREAK_FORCE", type = CE_MemoryType.float_, - addr = 0x00f41d44, + addr = 0x00f42d44, }, { name = "PHYSICS_RAGDOLL_JOINT_STIFFNESS", type = CE_MemoryType.float_, - addr = 0x00f411bc, + addr = 0x00f421bc, }, { name = "PHYSICS_RAGDOLL_VERY_STIFF_JOINT_STIFFNESS", type = CE_MemoryType.float_, - addr = 0x00f41b88, + addr = 0x00f42b88, }, { name = "PHYSICS_FIX_SHELF_BUG", type = CE_MemoryType.bool_, - addr = 0x00ff55ec, + addr = 0x00ff661c, }, { name = "GUI_HP_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41d14, + addr = 0x00f42d14, }, { name = "THROW_UI_TIMESTEP_COEFF", type = CE_MemoryType.float_, - addr = 0x00f41d50, + addr = 0x00f42d50, }, { name = "VERLET_STAIN_DROP_CHANCE_DIV", type = CE_MemoryType.int_, - addr = 0x00f412e0, + addr = 0x00f422e0, }, { name = "ITEM_SWITCH_ITEM_TWEEN_TIME_FRAMES", type = CE_MemoryType.float_, - addr = 0x00f410d8, + addr = 0x00f420d8, }, { name = "APPARITION_MIN_BONES_REQUIRED", type = CE_MemoryType.int_, - addr = 0x00f41d98, + addr = 0x00f42d9c, }, { name = "TELEPORT_ATTACK_COOLDOWN_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41d90, + addr = 0x00f42d90, }, { name = "GAMEPLAY_LIVES_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41e2b, + addr = 0x00f42e2b, }, { name = "GAMEEFFECT_MOVEMENT_SLOWER_SPEED_MULTIPLIER_MIN", type = CE_MemoryType.float_, - addr = 0x00f42260, + addr = 0x00f43260, }, { name = "GAMEEFFECT_MOVEMENT_SLOWER_SPEED_MULTIPLIER_MAX", type = CE_MemoryType.float_, - addr = 0x00f412d8, + addr = 0x00f422d8, }, { name = "GAMEEFFECT_MOVEMENT_FASTER_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41b70, + addr = 0x00f42b70, }, { name = "GAMEEFFECT_MOVEMENT_FASTER_2X_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41068, + addr = 0x00f4206c, }, { name = "GAMEEFFECT_CRITICAL_HIT_BOOST_CRIT_EXTRA_CHANCE", type = CE_MemoryType.int_, - addr = 0x00f412dc, + addr = 0x00f422dc, }, { name = "GAMEEFFECT_STAINS_DROP_FASTER_DROP_CHANCE_MULTIPLIER", type = CE_MemoryType.int_, - addr = 0x00f41c88, + addr = 0x00f42c88, }, { name = "GAMEEFFECT_DAMAGE_MULTIPLIER_COEFF", type = CE_MemoryType.float_, - addr = 0x00f41130, + addr = 0x00f42130, }, { name = "GAMEEFFECT_INVISIBILITY_SHOT_COOLDOWN_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41cb8, + addr = 0x00f42cb8, }, { name = "GAMEEFFECT_TELEPORTITIS_COOLDOWN_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41b78, + addr = 0x00f42b7c, }, { name = "GAMEEFFECT_TELEPORTITIS_DAMAGE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41d64, + addr = 0x00f42d64, }, { name = "GAMEEFFECT_ELECROCUTION_RESISTANCE_DURATION_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41da4, + addr = 0x00f42da4, }, { name = "GAMEEFFECT_FIRE_MOVEMENT_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f4113c, + addr = 0x00f42138, }, { name = "GAMEEFFECT_MANA_REGENERATION_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f4125c, + addr = 0x00f4225c, }, { name = "DAMAGE_CRITICAL_HIT_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41210, + addr = 0x00f42214, }, { name = "GAMEEFFECT_GLOBAL_GORE_GORE_MULTIPLIER", type = CE_MemoryType.int_, - addr = 0x00f411f8, + addr = 0x00f421f8, }, { name = "GAMEEFFECT_EXTRA_MONEY_TRICK_KILL_MULTIPLIER", type = CE_MemoryType.int_, - addr = 0x00f41d88, + addr = 0x00f42d88, }, { name = "GAME_OVER_DAMAGE_FLASH_FADE_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f411e8, + addr = 0x00f421e8, }, { name = "INGESTION_AMOUNT_PER_CELL_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41110, + addr = 0x00f42110, }, { name = "INGESTION_SATIATION_PER_CELL", type = CE_MemoryType.uint32_t, - addr = 0x00f41c44, + addr = 0x00f42c44, }, { name = "INGESTION_OVERINGESTION_MSG_PERIOD", type = CE_MemoryType.uint32_t, - addr = 0x00f41ddc, + addr = 0x00f42ddc, }, { name = "INGESTION_LIMIT_SLOW_MOVEMENT", type = CE_MemoryType.float_, - addr = 0x00f41088, + addr = 0x00f42088, }, { name = "INGESTION_LIMIT_DAMAGE", type = CE_MemoryType.float_, - addr = 0x00f41cc0, + addr = 0x00f42cc0, }, { name = "INGESTION_LIMIT_EXPLODING", type = CE_MemoryType.float_, - addr = 0x00f41ca4, + addr = 0x00f42ca4, }, { name = "INGESTION_LIMIT_EXPLOSION", type = CE_MemoryType.float_, - addr = 0x00f41268, + addr = 0x00f42268, }, { name = "GAMEPLAY_CHARACTER_LIQUID_FORCES_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00ff7a47, + addr = 0x00ff8a77, }, { name = "COOP_RESPAWN_TIMER_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f42268, + addr = 0x00f43268, }, { name = "DROP_LEVEL_1", type = CE_MemoryType.float_, - addr = 0x00f41080, + addr = 0x00f42080, }, { name = "DROP_LEVEL_2", type = CE_MemoryType.float_, - addr = 0x00f4226c, + addr = 0x00f4326c, }, { name = "DROP_LEVEL_3", type = CE_MemoryType.float_, - addr = 0x00f41104, + addr = 0x00f42104, }, { name = "DROP_LEVEL_4", type = CE_MemoryType.float_, - addr = 0x00f410b8, + addr = 0x00f420b8, }, { name = "DROP_LEVEL_5", type = CE_MemoryType.float_, - addr = 0x00f41058, + addr = 0x00f42058, }, { name = "DROP_LEVEL_6", type = CE_MemoryType.float_, - addr = 0x00f41d08, + addr = 0x00f42d08, }, { name = "DROP_LEVEL_7", type = CE_MemoryType.float_, - addr = 0x00f41d30, + addr = 0x00f42d30, }, { name = "DROP_LEVEL_8", type = CE_MemoryType.float_, - addr = 0x00f4105c, + addr = 0x00f4205c, }, { name = "DROP_LEVEL_9", type = CE_MemoryType.float_, - addr = 0x00f41dd0, - }, - { - name = "BIOME_MAP", - type = CE_MemoryType.std_string, - addr = 0x00f43ec8, + addr = 0x00f42dd0, }, { name = "BIOME_APPARITION_CHANCE", type = CE_MemoryType.int_, - addr = 0x00f410cc, + addr = 0x00f420cc, }, { name = "BIOME_RANDOM_BLOCK_CHANCE", type = CE_MemoryType.float_, - addr = 0x00f41c40, + addr = 0x00f42c40, }, { name = "BIOME_USE_BIG_WANG", type = CE_MemoryType.bool_, - addr = 0x00f411f2, + addr = 0x00f421f2, }, { name = "BIOME_PATH_FIND_HEIGHT_LIMIT", type = CE_MemoryType.int_, - addr = 0x00f41e5c, + addr = 0x00f4325c, }, { name = "BIOME_PATH_FIND_WORLD_POS_MIN_X", type = CE_MemoryType.int_, - addr = 0x00f41158, + addr = 0x00f42154, }, { name = "BIOME_PATH_FIND_WORLD_POS_MAX_X", type = CE_MemoryType.int_, - addr = 0x00f41c3c, + addr = 0x00f42c3c, }, { name = "WORLD_SEED", type = CE_MemoryType.uint32_t, - addr = 0x00ff7a18, + addr = 0x00ff8a44, }, { name = "NUM_ORBS_TOTAL", type = CE_MemoryType.int_, - addr = 0x00f410c8, + addr = 0x00f420c8, }, { name = "CAMERA_MOUSE_INTERPOLATION_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41134, + addr = 0x00f42134, }, { name = "CAMERA_GAMEPAD_INTERPOLATION_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41090, + addr = 0x00f42090, }, { name = "CAMERA_GAMEPAD_MAX_DISTANCE", type = CE_MemoryType.float_, - addr = 0x00f41b68, + addr = 0x00f42b68, }, { name = "CAMERA_POSITION_INTERPOLATION_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41cac, + addr = 0x00f42cac, }, { name = "CAMERA_DISTANCE_INTERPOLATION_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41170, + addr = 0x00f42170, }, { name = "CAMERA_NO_MOVE_BUFFER_NEAR_PLAYER", type = CE_MemoryType.float_, - addr = 0x00ff5a30, + addr = 0x00ff6a60, }, { name = "CAMERA_NO_MOVE_BUFFER_NEAR_VIEWPORT_EDGE", type = CE_MemoryType.float_, - addr = 0x00f41138, + addr = 0x00f4213c, }, { name = "CAMERA_RECOIL_ATTACK_SPEED", type = CE_MemoryType.float_, - addr = 0x00f4112c, + addr = 0x00f4212c, }, { name = "CAMERA_RECOIL_RELEASE_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41db0, + addr = 0x00f42dac, }, { name = "CAMERA_RECOIL_AMOUNT", type = CE_MemoryType.float_, - addr = 0x00f412ec, + addr = 0x00f422f0, }, { name = "MULTIPLAYER_CAMERA_SMOOTHING", type = CE_MemoryType.float_, - addr = 0x00f410a8, + addr = 0x00f420a8, }, { name = "MULTIPLAYER_CAMERA_MAX_SMOOTH_DISTANCE", type = CE_MemoryType.float_, - addr = 0x00f41b8c, + addr = 0x00f42b8c, }, { name = "CAMERA_IS_UI_OPEN", type = CE_MemoryType.bool_, - addr = 0x00ff7a45, + addr = 0x00ff8a75, }, { name = "PLAYER_USE_NEW_JETPACK", type = CE_MemoryType.bool_, - addr = 0x00ff5616, + addr = 0x00ff6646, }, { name = "DOUBLE_CLICK_MAX_SPAN_SECONDS", type = CE_MemoryType.float_, - addr = 0x00f41070, + addr = 0x00f42070, }, { name = "ESC_QUITS_GAME", type = CE_MemoryType.bool_, - addr = 0x00ff5a5c, + addr = 0x00ff6a8c, }, { name = "GAMEPAD_AIMING_VECTOR_SMOOTHING_COEFF", type = CE_MemoryType.float_, - addr = 0x00f41dc4, + addr = 0x00f42dc4, }, { name = "CONTROLS_AIMING_VECTOR_FULL_LENGTH_PIXELS", type = CE_MemoryType.float_, - addr = 0x00f41078, + addr = 0x00f42078, }, { name = "GAMEPAD_SHOT_VIBRATION_FORCE_MIN", type = CE_MemoryType.float_, - addr = 0x00f41b74, + addr = 0x00f42b74, }, { name = "GAMEPAD_SHOT_VIBRATION_FORCE_COEFF", type = CE_MemoryType.float_, - addr = 0x00f41e1c, + addr = 0x00f42e1c, }, { name = "GAMEPAD_SHOT_VIBRATION_TIME_COEFF", type = CE_MemoryType.float_, - addr = 0x00f41204, + addr = 0x00f42204, }, { name = "GAMEPAD_ANALOG_FLYING_LOW", type = CE_MemoryType.float_, - addr = 0x00f410f4, + addr = 0x00f420f4, }, { name = "GAMEPAD_ANALOG_FLYING_HIGH", type = CE_MemoryType.float_, - addr = 0x00f4111c, + addr = 0x00f4211c, }, { name = "RAGDOLL_FX_EXPLOSION_ROTATION", type = CE_MemoryType.float_, - addr = 0x00f41c8c, + addr = 0x00f42c8c, }, { name = "RAGDOLL_BLOOD_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41b50, + addr = 0x00f42b50, }, { name = "RAGDOLL_FIRE_DEATH_IGNITE_EVERY_N_PIXEL", type = CE_MemoryType.int_, - addr = 0x00f41b54, + addr = 0x00f42b58, }, { name = "RAGDOLL_IMPULSE_RANDOMNESS", type = CE_MemoryType.float_, - addr = 0x00f410d4, + addr = 0x00f420d4, }, { name = "RAGDOLL_OWN_VELOCITY_IMPULSE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41344, + addr = 0x00f42344, }, { name = "RAGDOLL_CRITICAL_HIT_FORCE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41cc4, + addr = 0x00f42cc4, }, { name = "DAMAGE_BLOOD_AMOUNT_MIN", type = CE_MemoryType.int_, - addr = 0x00f41e3c, + addr = 0x00f42e3c, }, { name = "DAMAGE_BLOOD_AMOUNT_MAX", type = CE_MemoryType.int_, - addr = 0x00f410d0, + addr = 0x00f420d0, }, { name = "DAMAGE_FIRE_DAMAGE_MAX_HP_MIN_BOUND", type = CE_MemoryType.float_, - addr = 0x00f4109c, + addr = 0x00f4209c, }, { name = "DAMAGE_BLOOD_SPRAY_CHANCE", type = CE_MemoryType.int_, - addr = 0x00f41b80, + addr = 0x00f42b80, }, { name = "EXPLOSION_FACTORY_GORE_FX_PROBABLITY", type = CE_MemoryType.int_, - addr = 0x00f410e8, + addr = 0x00f420e8, }, { name = "EXPLOSION_FACTORY_GORE_FX_HOLE_PROBABILITY", type = CE_MemoryType.int_, - addr = 0x00f4108c, + addr = 0x00f4208c, }, { name = "EXPLOSION_FACTORY_GORE_FX_BLOOD_STAIN_COLOR", type = CE_MemoryType.uint32_t, - addr = 0x00f41174, + addr = 0x00f42174, }, { name = "GRID_MAX_UPDATES_PER_FRAME", type = CE_MemoryType.int_, - addr = 0x00f41e58, + addr = 0x00f43258, }, { name = "GRID_FLEXIBLE_MAX_UPDATES", type = CE_MemoryType.bool_, - addr = 0x00ff5625, + addr = 0x00ff6655, }, { name = "GRID_MIN_UPDATES_PER_FRAME", type = CE_MemoryType.int_, - addr = 0x00f41150, + addr = 0x00f42150, }, { name = "CELLFACTORY_CELLDATA_MAX_COUNT", type = CE_MemoryType.int_, - addr = 0x00f41b60, + addr = 0x00f42b60, }, { name = "PARTICLE_EMITTER_MAX_PARTICLES", type = CE_MemoryType.int_, - addr = 0x00f41b64, + addr = 0x00f42b64, }, { name = "VIRTUAL_RESOLUTION_X", type = CE_MemoryType.int_, - addr = 0x00f41c48, + addr = 0x00f42c48, }, { name = "VIRTUAL_RESOLUTION_Y", type = CE_MemoryType.int_, - addr = 0x00f410dc, + addr = 0x00f420dc, }, { name = "VIRTUAL_RESOLUTION_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f41284, + addr = 0x00f42284, }, { name = "VIRTUAL_RESOLUTION_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00f411dc, + addr = 0x00f421d8, }, { name = "GRID_RENDER_BORDER", type = CE_MemoryType.int_, - addr = 0x00f41e30, + addr = 0x00f42e30, }, { name = "GRID_RENDER_TILE_SIZE", type = CE_MemoryType.int_, - addr = 0x00f411e4, + addr = 0x00f421e4, }, { name = "DRAW_PARALLAX_BACKGROUND", type = CE_MemoryType.bool_, - addr = 0x00f41cb4, + addr = 0x00f42cb4, }, { name = "DRAW_PARALLAX_BACKGROUND_BEFORE_DEPTH", type = CE_MemoryType.float_, - addr = 0x00f410fc, + addr = 0x00f420fc, }, { name = "RENDER_PARALLAX_BACKGROUND_SHADER_GRADIENT", type = CE_MemoryType.bool_, - addr = 0x00ff79db, + addr = 0x00ff8a0b, }, { name = "RENDER_SKYLIGHT_MAX_REDUCTION_AMOUNT", type = CE_MemoryType.float_, - addr = 0x00f41d2c, + addr = 0x00f42d2c, }, { name = "RENDER_SKYLIGHT_ABOVE_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f41144, + addr = 0x00f42144, }, { name = "RENDER_SKYLIGHT_SIDES_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f411d8, + addr = 0x00f421dc, }, { name = "RENDER_SKYLIGHT_TOTAL_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f41cc8, + addr = 0x00f42cc8, }, { name = "RENDER_FIRE_LO_TIME", type = CE_MemoryType.float_, - addr = 0x00f411f4, + addr = 0x00f421f4, }, { name = "RENDER_FIRE_LO_SCALE", type = CE_MemoryType.float_, - addr = 0x00f4116c, + addr = 0x00f4216c, }, { name = "RENDER_FIRE_LO_FORCE", type = CE_MemoryType.float_, - addr = 0x00f412fc, + addr = 0x00f422fc, }, { name = "RENDER_FIRE_HI_TIME", type = CE_MemoryType.float_, - addr = 0x00f410bc, + addr = 0x00f420bc, }, { name = "RENDER_FIRE_HI_SCALE", type = CE_MemoryType.float_, - addr = 0x00f410e0, + addr = 0x00f420e0, }, { name = "RENDER_FIRE_HI_FORCE", type = CE_MemoryType.float_, - addr = 0x00ff5628, + addr = 0x00ff6658, }, { name = "RENDER_FIRE_GRAVITY", type = CE_MemoryType.float_, - addr = 0x00f4126c, + addr = 0x00f4226c, }, { name = "RENDER_FIRE_LIFETIME_MIN", type = CE_MemoryType.int_, - addr = 0x00f41e38, + addr = 0x00f42e38, }, { name = "RENDER_FIRE_LIFETIME_MAX", type = CE_MemoryType.int_, - addr = 0x00f411d4, + addr = 0x00f421d4, }, { name = "RENDER_FIRE_GLOW_ALPHA", type = CE_MemoryType.float_, - addr = 0x00f41118, + addr = 0x00f42118, }, { name = "RENDER_FIRE_SHARP_ALPHA", type = CE_MemoryType.float_, - addr = 0x00f41e2c, + addr = 0x00f42e2c, }, { name = "RENDER_POTION_PARTICLE_MAX_COLOR_COMPONENT", type = CE_MemoryType.float_, - addr = 0x00f41d8c, + addr = 0x00f42d8c, }, { name = "RENDER_color_grading_LERP_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41ca0, + addr = 0x00f42ca0, }, { name = "TELEPORT_FLASH_COLOR_R", type = CE_MemoryType.float_, - addr = 0x00ff640c, + addr = 0x00ff743c, }, { name = "TELEPORT_FLASH_COLOR_G", type = CE_MemoryType.float_, - addr = 0x00ff6418, + addr = 0x00ff7448, }, { name = "TELEPORT_FLASH_COLOR_B", type = CE_MemoryType.float_, - addr = 0x00ff7a98, + addr = 0x00ff8ac8, }, { name = "AUDIO_GAMEEFFECT_FIRE_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f411e0, + addr = 0x00f421e0, }, { name = "AUDIO_FIRE_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f41dd8, + addr = 0x00f42dd8, }, { name = "AUDIO_MAGICAL_MATERIAL_WEIGHT", type = CE_MemoryType.float_, - addr = 0x00f41114, + addr = 0x00f42114, }, { name = "AUDIO_GAME_START_FADE_FRAME", type = CE_MemoryType.float_, - addr = 0x00f41200, + addr = 0x00f42200, }, { name = "AUDIO_GAME_START_FADE_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41108, + addr = 0x00f42108, }, { name = "AUDIO_MUSIC_VOLUME_DEFAULT", type = CE_MemoryType.float_, - addr = 0x00f410f0, + addr = 0x00f420f0, }, { name = "AUDIO_MUSIC_QUIET_FADE_DOWN_SPEED", type = CE_MemoryType.float_, - addr = 0x00f4123c, + addr = 0x00f4223c, }, { name = "AUDIO_MUSIC_NORMAL_FADE_DOWN_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41d94, + addr = 0x00f42d94, }, { name = "AUDIO_MUSIC_NORMAL_FADE_UP_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41d4c, + addr = 0x00f42d4c, }, { name = "AUDIO_MUSIC_ACTION_FADE_DOWN_SPEED", type = CE_MemoryType.float_, - addr = 0x00f4120c, + addr = 0x00f4220c, }, { name = "AUDIO_MUSIC_ACTION_FADE_UP_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41d10, + addr = 0x00f42d10, }, { name = "AUDIO_MUSIC_LOW_ENERGY_TRIGGER_COOLDOWN_SECONDS", type = CE_MemoryType.double_, - addr = 0x00f41178, + addr = 0x00f42178, }, { name = "AUDIO_MUSIC_FORCED_QUIETNESS_TRIGGERS_AFTER_SECONDS", type = CE_MemoryType.int_, - addr = 0x00f41264, + addr = 0x00f42264, }, { name = "AUDIO_MUSIC_FORCED_QUIETNESS_DURATION_SECONDS", type = CE_MemoryType.int_, - addr = 0x00f4107c, + addr = 0x00f4207c, }, { name = "AUDIO_COLLISION_SIZE_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f411b8, + addr = 0x00f421b8, }, { name = "AUDIO_COLLISION_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41208, + addr = 0x00f42208, }, { name = "AUDIO_COLLISION_KICK_SIZE", type = CE_MemoryType.float_, - addr = 0x00f41d58, + addr = 0x00f42d58, }, { name = "AUDIO_COLLISION_COOLDOWN_SECONDS", type = CE_MemoryType.float_, - addr = 0x00f41180, + addr = 0x00f42180, }, { name = "AUDIO_COLLISION_STATIC_WALL_INTENSITY", type = CE_MemoryType.float_, - addr = 0x00f41d28, + addr = 0x00f42d28, }, { name = "AUDIO_COLLISION_STATIC_WALL_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41d54, + addr = 0x00f42d54, }, { name = "AUDIO_PHYSICS_BREAK_MASS_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f41c98, + addr = 0x00f42c98, }, { name = "AUDIO_CHARACTER_LIQUID_SPLASH_INTENSITY_MIN", type = CE_MemoryType.float_, - addr = 0x00ff79dc, + addr = 0x00ff8a0c, }, { name = "AUDIO_CHARACTER_LIQUID_SPLASH_INTENSITY_MAX", type = CE_MemoryType.float_, - addr = 0x00f41da0, + addr = 0x00f42da0, }, { name = "AUDIO_CHARACTER_LIQUID_SPLASH_INTENSITY_SPEED_DIV", type = CE_MemoryType.float_, - addr = 0x00f41cb0, + addr = 0x00f42cb0, }, { name = "AUDIO_EXPLOSION_NO_SOUND_BELOW_RADIUS", type = CE_MemoryType.float_, - addr = 0x00f41288, + addr = 0x00f42288, }, { name = "AUDIO_EXPLOSION_SMALL_SOUND_MAX_RADIUS", type = CE_MemoryType.float_, - addr = 0x00f41e24, + addr = 0x00f42e24, }, { name = "AUDIO_PICK_GOLD_SAND_MIN_AMOUNT_FOR_SOUND", type = CE_MemoryType.int_, - addr = 0x00f4115c, + addr = 0x00f4215c, }, { name = "AUDIO_PICK_GOLD_SAND_AMOUNT_ACCUMULATION_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41b48, + addr = 0x00f42b48, }, { name = "AUDIO_AMBIENCE_ALTITUDE_SCALE", type = CE_MemoryType.float_, - addr = 0x00f41304, - }, - { - name = "AUDIO_CREDITS_TRACK_NAME", - type = CE_MemoryType.std_string, - addr = 0x00f43960, + addr = 0x00f42304, }, { name = "PATHFINDING_DISTANCE_FIELD_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41087, + addr = 0x00f42087, }, { name = "STREAMING_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41064, + addr = 0x00f42064, }, { name = "STREAMING_FREQUENCY", type = CE_MemoryType.double_, - addr = 0x00f41278, + addr = 0x00f42278, }, { name = "STREAMING_CHUNK_TARGET", type = CE_MemoryType.int_, - addr = 0x00f41dcc, + addr = 0x00f42dcc, }, { name = "STREAMING_PERSISTENT_WORLD", type = CE_MemoryType.bool_, - addr = 0x00f411f3, + addr = 0x00f421f3, }, { name = "STREAMING_AUTOSAVE_PERIOD_SECONDS", type = CE_MemoryType.int_, - addr = 0x00f41164, + addr = 0x00f42164, }, { name = "INVENTORY_ICON_SIZE", type = CE_MemoryType.int_, - addr = 0x00f41db4, + addr = 0x00f42db4, }, { name = "INVENTORY_STASH_X", type = CE_MemoryType.float_, - addr = 0x00f41d74, + addr = 0x00f42d74, }, { name = "INVENTORY_STASH_Y", type = CE_MemoryType.float_, - addr = 0x00f412f0, + addr = 0x00f422ec, }, { name = "INVENTORY_DEBUG_X", type = CE_MemoryType.float_, - addr = 0x00f41db8, + addr = 0x00f42db8, }, { name = "INVENTORY_DEBUG_Y", type = CE_MemoryType.float_, - addr = 0x00f41d84, + addr = 0x00f42d84, }, { name = "UI_SNAP_TO_NEAREST_INTEGER_SCALE", type = CE_MemoryType.bool_, - addr = 0x00f410c0, + addr = 0x00f420c0, }, { name = "UI_BARS_SCALE", type = CE_MemoryType.float_, - addr = 0x00f41d20, + addr = 0x00f42d20, }, { name = "UI_BARS_POS_X", type = CE_MemoryType.float_, - addr = 0x00f41b84, + addr = 0x00f42b84, }, { name = "UI_BARS_POS_Y", type = CE_MemoryType.float_, - addr = 0x00f4114c, + addr = 0x00f4214c, }, { name = "UI_BARS2_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f41da8, + addr = 0x00f42da8, }, { name = "UI_PLAYER_FULL_STATS_POS_X", type = CE_MemoryType.float_, - addr = 0x00f412d0, + addr = 0x00f422cc, }, { name = "UI_PLAYER_FULL_STATS_POS_Y", type = CE_MemoryType.float_, - addr = 0x00f41c9c, + addr = 0x00f42c9c, }, { name = "UI_PLAYER_FULL_STATS_COLUMN2_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f410a4, + addr = 0x00f420a4, }, { name = "UI_PLAYER_FULL_STATS_COLUMN3_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f41dc8, + addr = 0x00f42dc8, }, { name = "UI_STAT_BAR_EXTRA_SPACING", type = CE_MemoryType.float_, - addr = 0x00f42264, + addr = 0x00f43264, }, { name = "UI_STAT_BAR_ICON_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00ff5a44, + addr = 0x00ff6a74, }, { name = "UI_STAT_BAR_TEXT_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f41098, + addr = 0x00f42098, }, { name = "UI_STAT_BAR_TEXT_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00ff55e4, + addr = 0x00ff6614, }, { name = "UI_QUICKBAR_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00ff5c00, + addr = 0x00ff6c30, }, { name = "UI_QUICKBAR_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00ff79f8, + addr = 0x00ff8a2c, }, { name = "UI_INVENTORY_BACKGROUND_POSITION_X", type = CE_MemoryType.float_, - addr = 0x00ff7a08, + addr = 0x00ff8a38, }, { name = "UI_INVENTORY_BACKGROUND_POSITION_Y", type = CE_MemoryType.float_, - addr = 0x00ff55c8, + addr = 0x00ff65f8, }, -}) -table_extend(developer_items, { { name = "UI_FULL_INVENTORY_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f4110c, + addr = 0x00f4210c, }, { name = "UI_IMPORTANT_MESSAGE_POS_Y", type = CE_MemoryType.int_, - addr = 0x00f412f4, + addr = 0x00f422f4, }, +}) +table_extend(developer_items, { { name = "UI_IMPORTANT_MESSAGE_TITLE_SCALE", type = CE_MemoryType.float_, - addr = 0x00f41d7c, + addr = 0x00f42d7c, }, { name = "UI_LOW_HP_THRESHOLD", type = CE_MemoryType.float_, - addr = 0x00f41238, + addr = 0x00f4221c, }, { name = "UI_LOW_HP_WARNING_FLASH_FREQUENCY", type = CE_MemoryType.float_, - addr = 0x00f4121c, + addr = 0x00f42238, }, { name = "UI_PIXEL_FONT_GAME_LOG", type = CE_MemoryType.bool_, - addr = 0x00f41085, + addr = 0x00f42085, }, { name = "UI_PAUSE_MENU_LAYOUT_TOP_EDGE_PERCENTAGE", type = CE_MemoryType.int_, - addr = 0x00f41d34, + addr = 0x00f42d34, }, { name = "UI_GAME_OVER_MENU_LAYOUT_TOP_EDGE_PERCENTAGE", type = CE_MemoryType.int_, - addr = 0x00f41148, + addr = 0x00f42148, }, { name = "UI_WOBBLE_SPEED", type = CE_MemoryType.float_, - addr = 0x00f4133c, + addr = 0x00f4233c, }, { name = "UI_WOBBLE_AMOUNT_DEGREES", type = CE_MemoryType.float_, - addr = 0x00f41e34, + addr = 0x00f42e34, }, { name = "UI_GAMEOVER_SCREEN_BOX_FROM_TOP_PERCENT", type = CE_MemoryType.float_, - addr = 0x00f41310, + addr = 0x00f42310, }, { name = "UI_GAMEOVER_SCREEN_BOX_FROM_SIDE_PERCENT", type = CE_MemoryType.float_, - addr = 0x00f411b4, + addr = 0x00f421b4, }, { name = "UI_GAMEOVER_SCREEN_BOX_FROM_BOTTOM_PERCENT", type = CE_MemoryType.float_, - addr = 0x00f412e4, + addr = 0x00f422e4, }, { name = "UI_GAMEOVER_SCREEN_MUSIC_CUE_TIMER_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41d48, + addr = 0x00f42d48, }, { name = "UI_COOP_QUICK_INVENTORY_HEIGHT", type = CE_MemoryType.float_, - addr = 0x00f41100, + addr = 0x00f42100, }, { name = "UI_COOP_STAT_BARS_HEIGHT", type = CE_MemoryType.float_, - addr = 0x00f4128c, + addr = 0x00f4228c, }, { name = "UI_SCALE_IN_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41cbc, + addr = 0x00f42cbc, }, { name = "UI_DAMAGE_INDICATOR_RANDOM_OFFSET", type = CE_MemoryType.float_, - addr = 0x00f4106c, + addr = 0x00f42068, }, { name = "UI_ITEM_STAND_OVER_INFO_BOX_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f412d4, + addr = 0x00f422d4, }, { name = "UI_ITEM_STAND_OVER_INFO_BOX_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00f41160, + addr = 0x00f42160, }, { name = "UI_MOUSE_WORLD_HOVER_TEXT_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f412cc, + addr = 0x00f422d0, }, { name = "UI_MOUSE_WORLD_HOVER_TEXT_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00f41c94, + addr = 0x00f42c94, }, { name = "UI_MAX_PERKS_VISIBLE", type = CE_MemoryType.int_, - addr = 0x00f41094, + addr = 0x00f42094, }, { name = "UI_LOCALIZE_RECORD_TEXT", type = CE_MemoryType.bool_, - addr = 0x00ff640a, + addr = 0x00ff743a, }, { name = "UI_DISPLAY_NUMBERS_WITH_KS_AND_MS", type = CE_MemoryType.bool_, - addr = 0x00f41168, + addr = 0x00f42168, }, { name = "MAIN_MENU_BG_OFFSET_X", type = CE_MemoryType.float_, - addr = 0x00f41154, + addr = 0x00f42158, }, { name = "MAIN_MENU_BG_OFFSET_Y", type = CE_MemoryType.float_, - addr = 0x00f41dd4, + addr = 0x00f42dd4, }, { name = "MAIN_MENU_BG_OFFSET_Y_END", type = CE_MemoryType.float_, - addr = 0x00f41c38, + addr = 0x00f42c38, }, { name = "MAIN_MENU_BG_TWEEN_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41c90, + addr = 0x00f42c90, }, { name = "USE_CUSTOM_THREADPOOL", type = CE_MemoryType.bool_, - addr = 0x00f41d26, + addr = 0x00f42d26, }, { name = "BOX2D_FREEZE_STUCK_BODIES", type = CE_MemoryType.bool_, - addr = 0x00f41daf, + addr = 0x00f42db3, }, { name = "BOX2D_THREAD_MAX_WAIT_IN_MS", type = CE_MemoryType.float_, - addr = 0x00f41dc0, + addr = 0x00f42dc0, }, { name = "CREDITS_SCROLL_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41260, + addr = 0x00f42260, }, { name = "CREDITS_SCROLL_END_OFFSET_EXTRA", type = CE_MemoryType.float_, - addr = 0x00f411ec, + addr = 0x00f421ec, }, { name = "CREDITS_SCROLL_SKIP_SPEED_MULTIPLIER", type = CE_MemoryType.float_, - addr = 0x00f4130c, + addr = 0x00f4230c, }, { name = "INTRO_WEATHER_FOG", type = CE_MemoryType.float_, - addr = 0x00f41d0c, + addr = 0x00f42d0c, }, { name = "INTRO_WEATHER_RAIN", type = CE_MemoryType.float_, - addr = 0x00f41d40, + addr = 0x00f42d40, }, { name = "SETTINGS_MIN_RESOLUTION_X", type = CE_MemoryType.int_, - addr = 0x00f41060, + addr = 0x00f42060, }, { name = "SETTINGS_MIN_RESOLUTION_Y", type = CE_MemoryType.int_, - addr = 0x00f41308, + addr = 0x00f42308, }, { name = "STEAM_CLOUD_SIZE_WARNING", type = CE_MemoryType.bool_, - addr = 0x00ff7a43, + addr = 0x00ff8a74, }, { name = "DEBUG_KEYS_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41122, + addr = 0x00f42122, }, { name = "DEBUG_EXTRA_SCREENSHOT_KEYS_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41067, + addr = 0x00f42067, }, { name = "DEBUG_USE_PRELOAD", type = CE_MemoryType.bool_, - addr = 0x00f41169, + addr = 0x00f42169, }, { name = "DEBUG_USE_DEBUG_PRELOAD", type = CE_MemoryType.bool_, - addr = 0x00ff5a3f, + addr = 0x00ff6a6f, }, { name = "DEBUG_TREES", type = CE_MemoryType.bool_, - addr = 0x00ff79ff, + addr = 0x00ff8a2b, }, { name = "DEBUG_PIXEL_SCENES", type = CE_MemoryType.bool_, - addr = 0x00ff5bfb, + addr = 0x00ff6c2b, }, { name = "DEBUG_TELEPORT", type = CE_MemoryType.bool_, - addr = 0x00ff5626, + addr = 0x00ff6656, }, { name = "DEBUG_SI_TYPE", type = CE_MemoryType.int_, - addr = 0x00ff5c04, + addr = 0x00ff6c34, }, { name = "DEBUG_AUDIO_DEV_MODE", type = CE_MemoryType.bool_, - addr = 0x00ff55d1, + addr = 0x00ff6601, }, { name = "DEBUG_AUDIO_MUTE", type = CE_MemoryType.bool_, - addr = 0x00ff55d3, + addr = 0x00ff6603, }, { name = "DEBUG_AUDIO_MUSIC_MUTE", type = CE_MemoryType.bool_, - addr = 0x00ff55e2, + addr = 0x00ff660e, }, { name = "DEBUG_AUDIO_VOLUME", type = CE_MemoryType.float_, - addr = 0x00f41b58, + addr = 0x00f42b54, }, { name = "DEBUG_TEST_SYMBOL_CLASSIFIER", type = CE_MemoryType.bool_, - addr = 0x00ff6415, + addr = 0x00ff7445, }, { name = "DEBUG_STREAMING_DISABLE_SAVING", type = CE_MemoryType.bool_, - addr = 0x00ff79d9, + addr = 0x00ff8a09, }, { name = "DEBUG_DRAW_ANIMAL_AI_STATE", type = CE_MemoryType.bool_, - addr = 0x00ff5a74, + addr = 0x00ff6aa4, }, { name = "DEBUG_PRINT_COMPONENT_UPDATOR_ORDER", type = CE_MemoryType.bool_, - addr = 0x00ff5bfa, + addr = 0x00ff6c2a, }, { name = "DEBUG_SKYLIGHT_NO_SIMD", type = CE_MemoryType.bool_, - addr = 0x00ff560a, + addr = 0x00ff663a, }, { name = "DEBUG_DISABLE_MOUSE_SCROLL_WHEEL", type = CE_MemoryType.bool_, - addr = 0x00ff7a46, + addr = 0x00ff8a76, }, { name = "DEBUG_NO_SAVEGAME_CLEAR_ON_GAME_OVER", type = CE_MemoryType.bool_, - addr = 0x00ff7a72, + addr = 0x00ff8aa2, }, { name = "DEBUG_CAMERA_SHAKE_OFFSET", type = CE_MemoryType.float_, - addr = 0x00ff5bfc, + addr = 0x00ff6c2c, }, { name = "DEBUG_FREE_CAMERA_SPEED", type = CE_MemoryType.float_, - addr = 0x00f41218, + addr = 0x00f42218, }, { name = "DEBUG_DISABLE_POSTFX_DITHERING", type = CE_MemoryType.bool_, - addr = 0x00ff7a5e, - }, - { - name = "DEBUG_SCREENSHOTS_VIDEO_PATH_PREFIX", - type = CE_MemoryType.std_string, - addr = 0x00f43eb0, + addr = 0x00ff8a8e, }, { name = "DEBUG_GIF_WIDTH", type = CE_MemoryType.int_, - addr = 0x00f410f8, + addr = 0x00f420f8, }, { name = "DEBUG_GIF_HEIGHT", type = CE_MemoryType.int_, - addr = 0x00f410ac, + addr = 0x00f420ac, }, { name = "DEBUG_GIF_RECORD_60FPS", type = CE_MemoryType.bool_, - addr = 0x00ff7a9e, + addr = 0x00ff8ace, }, { name = "DEBUG_SPRITE_UV_GEN_REPORT_MISSING_FILES", type = CE_MemoryType.bool_, - addr = 0x00ff560b, + addr = 0x00ff663b, }, { name = "DEBUG_NO_PAUSE_ON_WINDOW_FOCUS_LOST", type = CE_MemoryType.bool_, - addr = 0x00ff79fe, + addr = 0x00ff8a2a, }, { name = "DEBUG_DEMO_MODE", type = CE_MemoryType.bool_, - addr = 0x00ff55d2, + addr = 0x00ff6602, }, { name = "DEBUG_DEMO_MODE_RESET_TIMEOUT_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f41d78, + addr = 0x00f42d78, }, { name = "DEBUG_DEMO_MODE_RESET_WARNING_TIME_FRAMES", type = CE_MemoryType.int_, - addr = 0x00f412c8, + addr = 0x00f422c8, }, { name = "DEBUG_DISABLE_PHYSICSBODY_OUT_OF_BOUNDS_WARNING", type = CE_MemoryType.bool_, - addr = 0x00ff5a77, + addr = 0x00ff6aa7, }, { name = "DEBUG_ENABLE_AUTOSAVE", type = CE_MemoryType.bool_, - addr = 0x00f41e28, + addr = 0x00f42e28, }, { name = "DEBUG_AUDIO_WRITE_TO_FILE", type = CE_MemoryType.bool_, - addr = 0x00ff5a5d, + addr = 0x00ff6a8d, }, { name = "DEBUG_NO_LOGO_SPLASHES", type = CE_MemoryType.bool_, - addr = 0x00ff55ee, + addr = 0x00ff661e, }, { name = "DEBUG_TEST_SAVE_SPAWN_X", type = CE_MemoryType.float_, - addr = 0x00f41d18, + addr = 0x00f42d18, }, { name = "DEBUG_INTRO_PLAY_ALWAYS", type = CE_MemoryType.bool_, - addr = 0x00ff7a28, + addr = 0x00ff8a58, }, { name = "DEBUG_REPLAY_RECORDER_FPS", type = CE_MemoryType.int_, - addr = 0x00f410ec, + addr = 0x00f420ec, }, { name = "DEBUG_F12_OPEN_FOG_OF_WAR", type = CE_MemoryType.bool_, - addr = 0x00f41281, + addr = 0x00f42281, }, { name = "DEBUG_ALWAYS_COMPLETE_THE_GAME", type = CE_MemoryType.bool_, - addr = 0x00ff55f9, + addr = 0x00ff6629, }, { name = "DEBUG_SKIP_RELEASE_NOTES", type = CE_MemoryType.bool_, - addr = 0x00ff55cd, + addr = 0x00ff65fe, }, { name = "DEBUG_SKIP_MAIN_MENU", type = CE_MemoryType.bool_, - addr = 0x00ff7a76, + addr = 0x00ff8aa6, }, { name = "DEBUG_SKIP_ALL_START_MENUS", type = CE_MemoryType.bool_, - addr = 0x00ff560d, + addr = 0x00ff663d, }, { name = "DEBUG_PLAYER_NEVER_DIES", type = CE_MemoryType.bool_, - addr = 0x00ff55fb, + addr = 0x00ff662b, }, { name = "DEBUG_ALWAYS_GET_UNLOCKS", type = CE_MemoryType.bool_, - addr = 0x00ff7a64, + addr = 0x00ff8a94, }, { name = "DEBUG_PROFILE_ALLOCATOR", type = CE_MemoryType.bool_, - addr = 0x00ff55fa, + addr = 0x00ff662a, }, { name = "DEBUG_STREAMING_INTEGRATION_DEV_MODE", type = CE_MemoryType.bool_, - addr = 0x00ff55ce, + addr = 0x00ff65fd, }, { name = "DEBUG_UI_ALL_THE_CARDS_WIDTH", type = CE_MemoryType.int_, - addr = 0x00f41214, + addr = 0x00f42210, }, { name = "DEBUG_UI_ALL_THE_CARDS_HEIGHT", type = CE_MemoryType.int_, - addr = 0x00f41d60, + addr = 0x00f42d60, }, { name = "DEBUG_UI_ALL_THE_CARDS_DISPLAY_EXTRA_INFO", type = CE_MemoryType.bool_, - addr = 0x00f41b7d, + addr = 0x00f42b79, }, { name = "DEBUG_PERSISTENT_FLAGS_DISABLED", type = CE_MemoryType.bool_, - addr = 0x00ff5608, + addr = 0x00ff6638, }, { name = "DEBUG_LOG_LEVEL", type = CE_MemoryType.int_, - addr = 0x00f410a0, + addr = 0x00f420a0, }, { name = "DEBUG_LOG_STD_COUT", type = CE_MemoryType.bool_, - addr = 0x00f41e29, + addr = 0x00f42e29, }, { name = "DEBUG_LOG_SOLID_BACKGROUND", type = CE_MemoryType.int_, - addr = 0x00f41b5c, + addr = 0x00f42b5c, }, { name = "DEBUG_LOG_TODO_ERRORS", type = CE_MemoryType.bool_, - addr = 0x00f4116b, + addr = 0x00f4216b, }, { name = "DEBUG_LOG_INSTANT_FLUSH", type = CE_MemoryType.bool_, - addr = 0x00ff5624, + addr = 0x00ff6654, }, { name = "DEBUG_LOG_NEVER_VISIBLE", type = CE_MemoryType.bool_, - addr = 0x00ff79fc, + addr = 0x00ff8a28, }, { name = "DEBUG_ALWAYS_RANDOM_SEED", type = CE_MemoryType.bool_, - addr = 0x00ff55cc, + addr = 0x00ff65fc, }, { name = "DEBUG_ALWAYS_RANDOM_START_POS", type = CE_MemoryType.bool_, - addr = 0x00ff79f1, + addr = 0x00ff8a22, }, { name = "DEBUG_LUA_REPORT_SLOW_SCRIPTS", type = CE_MemoryType.bool_, - addr = 0x00ff6417, + addr = 0x00ff7447, }, { name = "DEBUG_LUA", type = CE_MemoryType.bool_, - addr = 0x00ff6409, + addr = 0x00ff7439, }, { name = "DEBUG_LUA_REPORT_PRINT_FILES", type = CE_MemoryType.bool_, - addr = 0x00ff7a75, + addr = 0x00ff8aa5, }, { name = "DEBUG_LUA_LOG_BIOME_SPAWN_SCRIPTS", type = CE_MemoryType.bool_, - addr = 0x00ff7a5f, + addr = 0x00ff8a8f, }, { name = "DEBUG_LUA_REPORT_BIOME_SPAWN_ERRORS", type = CE_MemoryType.bool_, - addr = 0x00f41065, + addr = 0x00f42065, }, { name = "DEBUG_GAME_LOG_SHOW_DRAWN_ACTIONS", type = CE_MemoryType.bool_, - addr = 0x00ff560c, + addr = 0x00ff663c, }, { name = "DEBUG_LOG_STREAMING_STATS", type = CE_MemoryType.bool_, - addr = 0x00f41b7c, + addr = 0x00f42b78, }, { name = "DEBUG_LOG_LIFETIME_COMPONENT_DANGLING_PARENTS", type = CE_MemoryType.bool_, - addr = 0x00ff5a76, + addr = 0x00ff6aa6, }, { name = "DEBUG_OLLI_CONFIG", type = CE_MemoryType.bool_, - addr = 0x00ff7a9f, + addr = 0x00ff8acf, }, { name = "DEBUG_GENERATE_BIG_WANG_MAP", type = CE_MemoryType.bool_, - addr = 0x00ff55d0, + addr = 0x00ff6600, }, { name = "DEBUG_CRASH_IF_OLD_VERSION", type = CE_MemoryType.bool_, - addr = 0x00f41086, + addr = 0x00f42086, }, { name = "DEBUG_RESTART_GAME_IF_OLD_VERSION", type = CE_MemoryType.bool_, - addr = 0x00ff7a5d, + addr = 0x00ff8a8d, }, { name = "DEBUG_CAMERABOUND_DISPLAY_ENTITIES", type = CE_MemoryType.bool_, - addr = 0x00ff5609, + addr = 0x00ff6639, }, { name = "DEBUG_PROFILER_CAPTURE_OLLI_STYLE", type = CE_MemoryType.bool_, - addr = 0x00f410c1, + addr = 0x00f420c1, }, { name = "DEBUG_PROFILER_CAPTURE_PETRI_STYLE", type = CE_MemoryType.bool_, - addr = 0x00ff7a41, + addr = 0x00ff8a71, }, { name = "DEBUG_PAUSE_BOX2D", type = CE_MemoryType.bool_, - addr = 0x00ff7a65, + addr = 0x00ff8a95, }, { name = "DEBUG_PAUSE_GRID_UPDATE", type = CE_MemoryType.bool_, - addr = 0x00ff7a9c, + addr = 0x00ff8acc, }, { name = "DEBUG_PAUSE_SIMULATION", type = CE_MemoryType.bool_, - addr = 0x00ff5614, + addr = 0x00ff6644, }, { name = "DEBUG_SCREENSHOTTER_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41b7e, + addr = 0x00f42b7a, }, { name = "DEBUG_SCREENSHOTTER_SAVE_PPNG", type = CE_MemoryType.bool_, - addr = 0x00f41084, - }, - { - name = "DEBUG_SCREENSHOTTER_FFMPEG_PATH", - type = CE_MemoryType.std_string, - addr = 0x00f42378, + addr = 0x00f42084, }, { name = "DEBUG_PETRI_TAKE_RANDOM_SHADERSHOT", type = CE_MemoryType.bool_, - addr = 0x00ff55ed, + addr = 0x00ff661d, }, { name = "DEBUG_THREADED_WORLD_CREATION", type = CE_MemoryType.bool_, - addr = 0x00f4116a, + addr = 0x00f4216a, }, { name = "DEBUG_PETRI_START", type = CE_MemoryType.bool_, - addr = 0x00ff5617, + addr = 0x00ff6647, }, { name = "DEBUG_ATTRACT_MODE", type = CE_MemoryType.bool_, - addr = 0x00ff7a44, - }, - { - name = "DEBUG_PREV_OPENED_ENTITY", - type = CE_MemoryType.std_string, - addr = 0x00f43668, + addr = 0x00ff8a73, }, { name = "DEBUG_CTRL_O_USES_PREV_ENTITY_ALWAYS", type = CE_MemoryType.bool_, - addr = 0x00ff6408, + addr = 0x00ff7438, }, { name = "DEBUG_WANG", type = CE_MemoryType.bool_, - addr = 0x00ff7a14, + addr = 0x00ff8a48, }, { name = "DEBUG_WANG_PATH", type = CE_MemoryType.bool_, - addr = 0x00ff6416, + addr = 0x00ff7446, }, { name = "DEBUG_FULL_WANG_MAPS", type = CE_MemoryType.bool_, - addr = 0x00ff7a40, + addr = 0x00ff8a70, }, { name = "DEBUG_MATERIAL_AREA_CHECKER", type = CE_MemoryType.bool_, - addr = 0x00ff79fd, + addr = 0x00ff8a29, }, { name = "DEBUG_COLLISION_TRIGGERS", type = CE_MemoryType.bool_, - addr = 0x00ff7a74, + addr = 0x00ff8aa4, }, { name = "DEBUG_SINGLE_THREADED_LOADING", type = CE_MemoryType.bool_, - addr = 0x00ff5a5f, + addr = 0x00ff6a8f, }, { name = "DEBUG_TEXT_ENABLE_WORK_MODE", type = CE_MemoryType.bool_, - addr = 0x00ff55ef, + addr = 0x00ff661f, }, { name = "DEBUG_TEXT_WRITE_MISSING_TRANSLATIONS", type = CE_MemoryType.bool_, - addr = 0x00ff6414, + addr = 0x00ff7444, }, { name = "DEBUG_HOTLOAD_MATERIAL_EDGES", type = CE_MemoryType.bool_, - addr = 0x00ff79f2, + addr = 0x00ff8a21, }, { name = "DEBUG_IMGUI_HOT_LOAD_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41b7f, + addr = 0x00f42b7b, }, { name = "_DEBUG_DONT_LOAD_OTHER_MAGIC_NUMBERS", type = CE_MemoryType.bool_, - addr = 0x00ff7a67, + addr = 0x00ff8a97, }, { name = "_DEBUG_DONT_SAVE_MAGIC_NUMBERS", type = CE_MemoryType.bool_, - addr = 0x00ff7a66, + addr = 0x00ff8a96, }, { name = "DESIGN_DAILY_RANDOM_STARTING_ITEMS", type = CE_MemoryType.bool_, - addr = 0x00f41cb6, + addr = 0x00f42cb6, }, { name = "DESIGN_NEW_GAME_PLUS_HP_SCALE_MIN", type = CE_MemoryType.float_, - addr = 0x00f41124, + addr = 0x00f42124, }, { name = "DESIGN_NEW_GAME_PLUS_HP_SCALE_MAX", type = CE_MemoryType.float_, - addr = 0x00f41270, + addr = 0x00f42270, }, { name = "DESIGN_NEW_GAME_PLUS_ATTACK_SPEED", type = CE_MemoryType.float_, - addr = 0x00f412e8, + addr = 0x00f422e8, }, { name = "DESIGN_PLAYER_START_RAYCAST_COARSE_TO_GROUND", type = CE_MemoryType.bool_, - addr = 0x00ff7a15, + addr = 0x00ff8a49, }, { name = "DESIGN_PLAYER_START_TELEPORT_TO_GROUND", type = CE_MemoryType.bool_, - addr = 0x00f41d27, + addr = 0x00f42d27, }, { name = "DESIGN_PLAYER_ALWAYS_TELEPORT_TO_GROUND", type = CE_MemoryType.bool_, - addr = 0x00ff560f, + addr = 0x00ff663f, }, { name = "DESIGN_PLAYER_START_POS_X", type = CE_MemoryType.float_, - addr = 0x00f41274, + addr = 0x00f42274, }, { name = "DESIGN_PLAYER_START_POS_Y", type = CE_MemoryType.float_, - addr = 0x00f41e20, + addr = 0x00f42e20, }, { name = "DESIGN_RANDOM_STARTING_ITEMS", type = CE_MemoryType.bool_, - addr = 0x00ff5615, + addr = 0x00ff6645, }, { name = "DESIGN_POLYMORPH_PLAYER_POLYMORPH_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41cb5, + addr = 0x00f42cb5, }, { name = "DESIGN_POLYMORPH_CONTROLS_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00f41cb7, + addr = 0x00f42cb7, }, { name = "DESIGN_PLAYER_PICKUP_ENABLED", type = CE_MemoryType.bool_, - addr = 0x00ff7a42, + addr = 0x00ff8a72, }, { name = "DESIGN_CARDS_MUST_BE_IDENTIFIED", type = CE_MemoryType.bool_, - addr = 0x00f41d24, + addr = 0x00f42d24, }, { name = "DESIGN_WAND_SLOTS_ARE_CONSUMED", type = CE_MemoryType.bool_, - addr = 0x00f41dae, + addr = 0x00f42db2, }, { name = "DESIGN_ITEMS_CAN_BE_EATEN", type = CE_MemoryType.bool_, - addr = 0x00f41280, + addr = 0x00f42280, }, { name = "DESIGN_ITEMCHEST_DROPS_ACTIONS", type = CE_MemoryType.bool_, - addr = 0x00f41121, + addr = 0x00f42121, }, { name = "DESIGN_ENEMY_HEALTH_DROPS", type = CE_MemoryType.bool_, - addr = 0x00f41dad, + addr = 0x00f42db1, }, { name = "DESIGN_ENEMY_2X_MONEY_DROPS", type = CE_MemoryType.bool_, - addr = 0x00f41123, + addr = 0x00f42123, }, { name = "DESIGN_FIRE_DAMAGE_BASED_ON_MAX_HP", type = CE_MemoryType.bool_, - addr = 0x00f410c3, + addr = 0x00f420c3, }, { name = "DESIGN_AGGRO_INDICATOR", type = CE_MemoryType.bool_, - addr = 0x00f411f0, + addr = 0x00f421f0, }, { name = "DESIGN_CARD_SYMBOL_UNLOCKS", type = CE_MemoryType.bool_, - addr = 0x00f41d25, + addr = 0x00f42d25, }, { name = "DESIGN_BLOOD_RESTORES_HP", type = CE_MemoryType.bool_, - addr = 0x00ff7a71, + addr = 0x00ff8aa0, }, { name = "DESIGN_MATERIAL_INGESTION_STATUS_FX", type = CE_MemoryType.bool_, - addr = 0x00ff7a17, + addr = 0x00ff8a4b, }, { name = "DESIGN_RANDOMIZE_TEMPLE_CONTENTS", type = CE_MemoryType.bool_, - addr = 0x00ff55cf, + addr = 0x00ff65ff, }, { name = "DESIGN_TEMPLE_CHECK_FOR_LEAKS", type = CE_MemoryType.bool_, - addr = 0x00f41066, + addr = 0x00f42066, }, { name = "DESIGN_PLAYER_PHYSICS_KILLS_DONT_TRICK_KILL", type = CE_MemoryType.bool_, - addr = 0x00ff7a73, + addr = 0x00ff8aa3, }, { name = "DESIGN_DAY_CYCLE_SPEED", type = CE_MemoryType.float_, - addr = 0x00f410e4, + addr = 0x00f420e4, }, { name = "DESIGN_SPELL_VISUALIZER", type = CE_MemoryType.bool_, - addr = 0x00ff640b, + addr = 0x00ff743b, }, { name = "DESIGN_RELOAD_ALL_THE_TIME", type = CE_MemoryType.bool_, - addr = 0x00f41283, + addr = 0x00f42283, }, + }) diff --git a/component-explorer/magic_numbers.lua b/component-explorer/unsafe/magic_numbers.lua similarity index 61% rename from component-explorer/magic_numbers.lua rename to component-explorer/unsafe/magic_numbers.lua index 11e442e..bb1a483 100644 --- a/component-explorer/magic_numbers.lua +++ b/component-explorer/unsafe/magic_numbers.lua @@ -1,12 +1,12 @@ -local ffi = require("ffi") - +---@module 'component-explorer.utils.strings' local string_util = dofile_once("mods/component-explorer/utils/strings.lua") -local memory_display = dofile_once("mods/component-explorer/memory_display.lua") -dofile_once("mods/component-explorer/memory_type.lua") -dofile_once("mods/component-explorer/magic_number_items.lua") +---@module 'component-explorer.unsafe.memory_display' +local memory_display = dofile_once("mods/component-explorer/unsafe/memory_display.lua") + +dofile_once("mods/component-explorer/unsafe/memory_type.lua") +dofile_once("mods/component-explorer/unsafe/magic_number_items.lua") -window_open_magic_numbers = false local search = "" @@ -20,8 +20,11 @@ end function show_magic_numbers() local should_show + local window_open_magic_numbers = GlobalsGetValue("ue.mn_window") == "1" should_show, window_open_magic_numbers = imgui.Begin("Magic Numbers", window_open_magic_numbers) + GlobalsSetValue("ue.mn_window", window_open_magic_numbers and "1" or "0") + if should_show then local search_changed search_changed, search = imgui.InputText("Search", search) diff --git a/component-explorer/unsafe/main.lua b/component-explorer/unsafe/main.lua new file mode 100644 index 0000000..e3deaa8 --- /dev/null +++ b/component-explorer/unsafe/main.lua @@ -0,0 +1,71 @@ +-- Loading imgui early so it's available when other files are loaded +imgui = load_imgui({version="1.7.0", mod="Unsafe Explorer"}) + +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + +---@module 'component-explorer.logger' +dofile_once("mods/component-explorer/unsafe/logger.lua") + +---@module 'component-explorer.unsafe.win32' +local win32 = dofile_once("mods/component-explorer/unsafe/win32.lua") + +dofile_once("mods/component-explorer/unsafe/noita_version.lua") + +---@module 'component-explorer.unsafe.user_scripts_window' +local uswindow = dofile_once("mods/component-explorer/unsafe/user_scripts_window.lua") + + +if is_steam_version() then + dofile_once("mods/component-explorer/unsafe/magic_numbers.lua") + dofile_once("mods/component-explorer/unsafe/debug.lua") +end + +function OnWorldPreUpdate() + local link = GlobalsGetValue("ue.link") + if link ~= "" then + GlobalsSetValue("ue.link", "") + win32.open(link) + end +end + +function OnWorldInitialized() + GlobalsSetValue("ue.logs_window", ce_settings.get("window_open_logs") and "1" or "0") + GlobalsSetValue("ue.logs_overlay", ce_settings.get("overlay_open_logs") and "1" or "0") + + GlobalsSetValue("ue.mn_window", "0") + GlobalsSetValue("ue.debug_window", "0") + + GlobalsSetValue("ue.steam", is_steam_version() and "1" or "") +end + +function update_ui(paused, current_frame_run) + if GlobalsGetValue("ue.logs_window") == "1" then + draw_log_window() + end + + if GlobalsGetValue("ue.logs_overlay") == "1" then + draw_log_overlay() + end + + if + GlobalsGetValue("ce.console") == "1" and + ce_settings.get("window_open_user_scripts") + then + local script = uswindow.draw_user_scripts_window() + if script then + GlobalsSetValue("ue.us_cmd", script) + end + end + + if is_steam_version() then + if GlobalsGetValue("ue.mn_window") == "1" then + show_magic_numbers() + end + if GlobalsGetValue("ue.debug_window") == "1" then + show_debug() + end + end +end + +dofile("mods/component-explorer/lib/ui_callbacks.lua") diff --git a/component-explorer/memory_display.lua b/component-explorer/unsafe/memory_display.lua similarity index 100% rename from component-explorer/memory_display.lua rename to component-explorer/unsafe/memory_display.lua diff --git a/component-explorer/memory_type.lua b/component-explorer/unsafe/memory_type.lua similarity index 100% rename from component-explorer/memory_type.lua rename to component-explorer/unsafe/memory_type.lua diff --git a/component-explorer/utils/noita_version.lua b/component-explorer/unsafe/noita_version.lua similarity index 74% rename from component-explorer/utils/noita_version.lua rename to component-explorer/unsafe/noita_version.lua index 407e3b1..ff9c5db 100644 --- a/component-explorer/utils/noita_version.lua +++ b/component-explorer/unsafe/noita_version.lua @@ -1,13 +1,13 @@ -local win32 = dofile_once("mods/component-explorer/utils/win32.lua") +local win32 = dofile_once("mods/component-explorer/unsafe/win32.lua") -- These are offsets in the exe, not the addresses as they are loaded in memory. local steam_identifiers = { { - location = 0x00a00208, - string = "Noita-Build-Mar 11 2023-14:09:24", + location = 0x00a013c0, + string = "Noita-Build-Aug 29 2023-19:59:58", }, { - location = 0x00b3ecba, + location = 0x00b3feea, string = "steam_api.dll", }, } @@ -18,6 +18,9 @@ function is_steam_version() -- Changed to true if all checks succeed steam_version = false local nf = io.open(win32.get_exe_path(), "rb") + if not nf then + return false + end for _, identifier in ipairs(steam_identifiers) do nf:seek("set", identifier.location) diff --git a/component-explorer/unsafe/user_scripts.lua b/component-explorer/unsafe/user_scripts.lua new file mode 100644 index 0000000..73d2f55 --- /dev/null +++ b/component-explorer/unsafe/user_scripts.lua @@ -0,0 +1,32 @@ +local win32 = dofile_once("mods/component-explorer/unsafe/win32.lua") +local us = dofile_once("mods/component-explorer/user_scripts.lua") + +local us_unsafe = {} + +win32.create_directory(us.directory_path) + +local SCRIPTS_TREE_FETCH_EVERY = 60 * 3 + +local cached_scripts_tree = {} +local scripts_tree_last_time_fetched = nil + +local function fetch_scripts_tree() + return win32.list_dir_contents(us.directory_path .. "\\*.lua") +end + +function us_unsafe.get_scripts_tree() + local frame_num = GameGetFrameNum() + if + scripts_tree_last_time_fetched and + frame_num - scripts_tree_last_time_fetched < SCRIPTS_TREE_FETCH_EVERY + then + return cached_scripts_tree + end + + scripts_tree_last_time_fetched = frame_num + cached_scripts_tree = fetch_scripts_tree() + + return cached_scripts_tree +end + +return us_unsafe diff --git a/component-explorer/unsafe/user_scripts_window.lua b/component-explorer/unsafe/user_scripts_window.lua new file mode 100644 index 0000000..f088ffa --- /dev/null +++ b/component-explorer/unsafe/user_scripts_window.lua @@ -0,0 +1,55 @@ +---@module 'component-explorer.user_scripts' +local us = dofile_once("mods/component-explorer/user_scripts.lua") +---@module 'component-explorer.unsafe.user_scripts' +local us_unsafe = dofile_once("mods/component-explorer/unsafe/user_scripts.lua") + +---@module 'component-explorer.utils.strings' +local string_util = dofile_once("mods/component-explorer/utils/strings.lua") + +---@module 'component-explorer.unsafe.win32' +local win32 = dofile_once("mods/component-explorer/unsafe/win32.lua") + +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") + +local uswindow = {} + +local search = "" + +function uswindow.draw_user_scripts_window() + local should_show + local open = ce_settings.get("window_open_user_scripts") + should_show, open = imgui.Begin("User Scripts", open) + ce_settings.set("window_open_user_scripts", open) + + if not should_show then + return + end + + if imgui.Button("Open script folder") then + win32.explore(us.directory_path) + end + + local _ + _, search = imgui.InputText("Search", search) + + local ret = nil + + local files = us_unsafe.get_scripts_tree() + for _, file in ipairs(files) do + if + not us.is_hidden(file) and + string_util.ifind(file, search, 1, true) + then + if imgui.Button(file) then + ret = file + end + end + end + + imgui.End() + + return ret +end + +return uswindow diff --git a/component-explorer/utils/win32.lua b/component-explorer/unsafe/win32.lua similarity index 100% rename from component-explorer/utils/win32.lua rename to component-explorer/unsafe/win32.lua diff --git a/component-explorer/user_scripts.lua b/component-explorer/user_scripts.lua index e32ef33..2920959 100644 --- a/component-explorer/user_scripts.lua +++ b/component-explorer/user_scripts.lua @@ -1,57 +1,37 @@ -local ffi = require("ffi") -local win32 = dofile_once("mods/component-explorer/utils/win32.lua") +local ModTextFileGetContent = ModTextFileGetContent local us = {} us.directory_path = "user-scripts" -win32.create_directory(us.directory_path) +function us.make_path(script_name) + return "mods/../" .. us.directory_path .. "/" .. script_name:lower() +end +---@param script_name string +---@return any function us.user_script(script_name) -- mods/../ prevents the game from complaining about wrong script paths. - return loadfile("mods/../" .. us.directory_path .. "/" .. script_name)() + return loadfile(us.make_path(script_name))() end -function us.user_script_call_string(script_name) - return 'return user_script("' .. script_name .. '")' -end - -local SCRIPTS_TREE_FETCH_EVERY = 60 * 3 - -local cached_scripts_tree = {} -local scripts_tree_last_time_fetched = nil - -local function fetch_scripts_tree() - return win32.list_dir_contents(us.directory_path .. "\\*.lua") +---@param script_name string +---@return boolean +function us.exists(script_name) + local content = ModTextFileGetContent(script_name) + return content ~= nil and content ~= "" end -function us.get_scripts_tree() - local frame_num = GameGetFrameNum() - if - scripts_tree_last_time_fetched and - frame_num - scripts_tree_last_time_fetched < SCRIPTS_TREE_FETCH_EVERY - then - return cached_scripts_tree - end - - scripts_tree_last_time_fetched = frame_num - cached_scripts_tree = fetch_scripts_tree() - - return cached_scripts_tree -end - -function us.is_hidden(filename) - return #filename >= 1 and string.sub(filename, 1, 1) == "_" +---@param script_name string +---@return string +function us.user_script_call_string(script_name) + return 'return user_script("' .. script_name .. '")' end -function us.exists(filename) - filename = filename:lower() - for _, v in ipairs(us.get_scripts_tree()) do - if filename == v:lower() then - return true - end - end - return false +---@param script_name string +---@return boolean +function us.is_hidden(script_name) + return script_name:sub(1, 1) == "_" end return us diff --git a/component-explorer/user_scripts_window.lua b/component-explorer/user_scripts_window.lua deleted file mode 100644 index 21a5adc..0000000 --- a/component-explorer/user_scripts_window.lua +++ /dev/null @@ -1,44 +0,0 @@ -local us = dofile_once("mods/component-explorer/user_scripts.lua") -local string_util = dofile_once("mods/component-explorer/utils/strings.lua") -local win32 = dofile_once("mods/component-explorer/utils/win32.lua") - -local uswindow = {} - -local search = "" - -function uswindow.draw_user_scripts_window(console) - local should_show - should_show, console.user_scripts_open = - imgui.Begin("User Scripts", console.user_scripts_open) - - if not should_show then - return - end - - if imgui.Button("Open script folder") then - win32.explore(us.directory_path) - end - - local search_changed - search_changed, search = imgui.InputText("Search", search) - - local ret = nil - - local files = us.get_scripts_tree() - for _, file in ipairs(files) do - if - not us.is_hidden(file) and - string_util.ifind(file, search, 1, true) - then - if imgui.Button(file) then - ret = file - end - end - end - - imgui.End() - - return ret -end - -return uswindow diff --git a/component-explorer/utils/settings_util.lua b/component-explorer/utils/ce_settings.lua similarity index 64% rename from component-explorer/utils/settings_util.lua rename to component-explorer/utils/ce_settings.lua index 185f184..41aed72 100644 --- a/component-explorer/utils/settings_util.lua +++ b/component-explorer/utils/ce_settings.lua @@ -1,3 +1,5 @@ +local ce_settings = {} + local mod_id = "component-explorer" local settings = {} @@ -13,21 +15,24 @@ local function load_setting_value(key) return value end -function load_settings() +function ce_settings.load() settings = {} end -function setting_get(key) +function ce_settings.get(key) + return load_setting_value(key) + --[[ if settings[key] == nil then settings[key] = load_setting_value(key) end return settings[key] + --]] end -function setting_set(key, value) - if setting_get(key) ~= value then - ModSettingSet(mod_id .. "." .. key, value) - settings[key] = value - end +function ce_settings.set(key, value) + ModSettingSet(mod_id .. "." .. key, value) + settings[key] = value end + +return ce_settings diff --git a/component-explorer/xml_serialise.lua b/component-explorer/xml_serialise.lua index 9a8a219..81dc3e5 100644 --- a/component-explorer/xml_serialise.lua +++ b/component-explorer/xml_serialise.lua @@ -1,11 +1,13 @@ local nxml = dofile_once("mods/component-explorer/deps/nxml.lua") -dofile_once("mods/component-explorer/utils/settings_util.lua") + +---@module 'component-explorer.utils.ce_settings' +local ce_settings = dofile_once("mods/component-explorer/utils/ce_settings.lua") local xml_serialise = {} -xml_serialise.use_tabs = setting_get("xml_indent_char") == "tab" -xml_serialise.space_count = setting_get("xml_space_count") -xml_serialise.include_privates = setting_get("xml_include_privates") +xml_serialise.use_tabs = ce_settings.get("xml_indent_char") == "tab" +xml_serialise.space_count = ce_settings.get("xml_space_count") +xml_serialise.include_privates = ce_settings.get("xml_include_privates") function xml_serialise.button() _, xml_serialise.use_tabs = imgui.Checkbox("Use tabs", xml_serialise.use_tabs) diff --git a/mod.xml.in b/mod.xml.in index 9b8d9dd..afc865e 100644 --- a/mod.xml.in +++ b/mod.xml.in @@ -1,6 +1,6 @@ diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index 6c0d092..60c0eef 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -1,18 +1,21 @@ set(CPACK_PACKAGE_NAME "ComponentExplorer") set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") -set(CPACK_PACKAGE_VENDOR "dextercd#7326") +set(CPACK_PACKAGE_VENDOR "dextercd") set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) -set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) -set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) -set(CPACK_GENERATOR ZIP) +set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP) -set(CPACK_PACKAGE_FILE_NAME +set(CPACK_ARCHIVE_COMPONENTEXPLORER_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") +set(CPACK_ARCHIVE_COMPONENTEXPLORER-UNSAFE_FILE_NAME "UnsafeExplorer") + +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) +set(CPACK_GENERATOR ZIP) set(CPACK_COMPONENTS_ALL ComponentExplorer + ComponentExplorer-Unsafe ) set(CPACK_VERBATIM_VARIABLES ON) diff --git a/unsafe-explorer/init.lua b/unsafe-explorer/init.lua new file mode 100644 index 0000000..6fc0fd5 --- /dev/null +++ b/unsafe-explorer/init.lua @@ -0,0 +1 @@ +dofile("mods/component-explorer/unsafe/init.lua") diff --git a/unsafe-explorer/mod.xml b/unsafe-explorer/mod.xml new file mode 100644 index 0000000..252b845 --- /dev/null +++ b/unsafe-explorer/mod.xml @@ -0,0 +1,6 @@ +