feat: Debug HUD Overlay X/Y sliders (0..3440 / -1440..1440 UI px, defaults 25/0) — live position sync in element update, no mission restart needed
This commit is contained in:
@@ -178,6 +178,24 @@ local widgets = {
|
|||||||
setting_id = "debug_hud",
|
setting_id = "debug_hud",
|
||||||
type = "checkbox",
|
type = "checkbox",
|
||||||
default_value = false,
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -77,6 +77,26 @@ local localization = {
|
|||||||
["zh-cn"] = "在屏幕左侧显示实时文本面板:当前标记目标、冷却、骷髅/狗状态及服务器接受结果。下个任务开始时生效。",
|
["zh-cn"] = "在屏幕左侧显示实时文本面板:当前标记目标、冷却、骷髅/狗状态及服务器接受结果。下个任务开始时生效。",
|
||||||
["zh-tw"] = "在螢幕左側顯示即時文字面板:目前標記目標、冷卻、骷髏/狗狀態及伺服器接受結果。下個任務開始時生效。",
|
["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 = {
|
omni_mark = {
|
||||||
en = "360° Marking",
|
en = "360° Marking",
|
||||||
["zh-cn"] = "全向标记",
|
["zh-cn"] = "全向标记",
|
||||||
|
|||||||
@@ -73,6 +73,17 @@ HudElementAutoMarkDebug.update = function (self, dt, t, ui_renderer, render_sett
|
|||||||
end
|
end
|
||||||
self._rebuild_time = 0.2
|
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 buf = mod.debug_hud_last
|
||||||
local text = table.concat(buf, "\n")
|
local text = table.concat(buf, "\n")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user