From 58b1764f4ab57975c1900fb0b7e9ce3717373eea Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 4 Oct 2026 09:59:34 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20Debug=20HUD=20Overlay=20X/Y=20sliders?= =?UTF-8?q?=20(0..3440=20/=20-1440..1440=20UI=20px,=20defaults=2025/0)=20?= =?UTF-8?q?=E2=80=94=20live=20position=20sync=20in=20element=20update,=20n?= =?UTF-8?q?o=20mission=20restart=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/mods/AutoMark/AutoMark_data.lua | 18 +++++++++++++++++ .../mods/AutoMark/AutoMark_localization.lua | 20 +++++++++++++++++++ .../mods/AutoMark/ui/hud_element_debug.lua | 11 ++++++++++ 3 files changed, 49 insertions(+) diff --git a/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua b/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua index 3d5ce9a..705c2ab 100644 --- a/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua +++ b/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua @@ -178,6 +178,24 @@ local widgets = { setting_id = "debug_hud", type = "checkbox", default_value = false, + sub_widgets = { + { + setting_id = "debug_hud_x", + type = "numeric", + default_value = 25, + range = { 0, 3440 }, + unit_text = "px", + decimals_number = 0, + }, + { + setting_id = "debug_hud_y", + type = "numeric", + default_value = 0, + range = { -1440, 1440 }, + unit_text = "px", + decimals_number = 0, + }, + }, }, }, }, diff --git a/AutoMark/scripts/mods/AutoMark/AutoMark_localization.lua b/AutoMark/scripts/mods/AutoMark/AutoMark_localization.lua index f38ed52..5330f28 100644 --- a/AutoMark/scripts/mods/AutoMark/AutoMark_localization.lua +++ b/AutoMark/scripts/mods/AutoMark/AutoMark_localization.lua @@ -77,6 +77,26 @@ local localization = { ["zh-cn"] = "在屏幕左侧显示实时文本面板:当前标记目标、冷却、骷髅/狗状态及服务器接受结果。下个任务开始时生效。", ["zh-tw"] = "在螢幕左側顯示即時文字面板:目前標記目標、冷卻、骷髏/狗狀態及伺服器接受結果。下個任務開始時生效。", }, + debug_hud_x = { + en = "Overlay X", + ["zh-cn"] = "面板横坐标", + ["zh-tw"] = "面板橫座標", + }, + debug_hud_y = { + en = "Overlay Y", + ["zh-cn"] = "面板纵坐标", + ["zh-tw"] = "面板縱座標", + }, + debug_hud_x_tooltip = { + en = "Distance from the left edge of the screen, in UI pixels. Applies immediately.", + ["zh-cn"] = "距屏幕左边缘的距离(UI像素),立即生效。", + ["zh-tw"] = "距螢幕左緣的距離(UI像素),立即生效。", + }, + debug_hud_y_tooltip = { + en = "Vertical offset from screen middle (positive = down), in UI pixels. Applies immediately.", + ["zh-cn"] = "相对屏幕垂直中线的偏移(正值向下),单位UI像素,立即生效。", + ["zh-tw"] = "相對螢幕垂直中線的偏移(正值向下),單位UI像素,立即生效。", + }, omni_mark = { en = "360° Marking", ["zh-cn"] = "全向标记", diff --git a/AutoMark/scripts/mods/AutoMark/ui/hud_element_debug.lua b/AutoMark/scripts/mods/AutoMark/ui/hud_element_debug.lua index a2489c7..d2997ba 100644 --- a/AutoMark/scripts/mods/AutoMark/ui/hud_element_debug.lua +++ b/AutoMark/scripts/mods/AutoMark/ui/hud_element_debug.lua @@ -73,6 +73,17 @@ HudElementAutoMarkDebug.update = function (self, dt, t, ui_renderer, render_sett end self._rebuild_time = 0.2 + local panel = self._ui_scenegraph and self._ui_scenegraph.panel + if panel and panel.local_position then + local lp = panel.local_position + local x = mod.settings.debug_hud_x or 25 + local y = mod.settings.debug_hud_y or 0 + if lp[1] ~= x or lp[2] ~= y then + lp[1] = x + lp[2] = y + end + end + local buf = mod.debug_hud_last local text = table.concat(buf, "\n")