diff --git a/README.md b/README.md index 95961b85..deb772cc 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,9 @@ How to compile exes: 6. For successful compilation, **the latest build tools with MFC and ATL libraries is required** ## Changelog +**2025.01.13** +* privatepirate: Fixed HDR Settings UI + **2024.12.11** * Fix of "Fail to detach scope from some weapons" (https://github.com/themrdemonized/xray-monolith/issues/114) diff --git a/gamedata/configs/ui/ui_ctrl_hdr.xml b/gamedata/configs/ui/ui_ctrl_hdr.xml new file mode 100644 index 00000000..e36f4bd4 --- /dev/null +++ b/gamedata/configs/ui/ui_ctrl_hdr.xml @@ -0,0 +1 @@ +#include "ui\ui_ctrl_hdr_16.xml" \ No newline at end of file diff --git a/gamedata/configs/ui/ui_ctrl_hdr_16.xml b/gamedata/configs/ui/ui_ctrl_hdr_16.xml new file mode 100644 index 00000000..fd7cb0a0 --- /dev/null +++ b/gamedata/configs/ui/ui_ctrl_hdr_16.xml @@ -0,0 +1,23 @@ + + + + + ui_icons_PDA_tooltips + + + + ui_mm_video_basic_lighting + + + + + + + ui_mm_video_basic_gamma + + + + + + + \ No newline at end of file diff --git a/gamedata/scripts/ui_options_modded_exes.script b/gamedata/scripts/ui_options_modded_exes.script index 83294f66..39e121c7 100644 --- a/gamedata/scripts/ui_options_modded_exes.script +++ b/gamedata/scripts/ui_options_modded_exes.script @@ -939,27 +939,30 @@ function init_opt_base() self.xml = CScriptXmlInit() local xml = self.xml - xml:ParseFile ("ui_options.xml") + xml:ParseFile ("ui_ctrl_hdr.xml") - self.dialog = xml:InitStatic("ctrl_lighting", self) - self.dialog:SetWndPos(vector2():set(self.dialog:GetWndPos().x, 400)) - self.dialog:SetWndSize(vector2():set(self.dialog:GetWidth(), 300)) + self.dialog = xml:InitStatic("ctrl_hdr", self) + -- self.dialog:SetWndPos(vector2():set(self.dialog:GetWndPos().x - 150, 400)) + -- self.dialog:SetWndSize(vector2():set(self.dialog:GetWidth() + 300, 300)) - self.frame = xml:InitFrame("ctrl_lighting:frame", self.dialog) - self.frame:SetWndSize(vector2():set(self.frame:GetWidth(), 300)) + self.frame = xml:InitFrame("ctrl_hdr:frame", self.dialog) + -- self.frame:SetWndSize(vector2():set(self.frame:GetWidth() + 300, 300)) - local cap = xml:InitStatic("ctrl_lighting:cap_main",self.dialog) + local cap = xml:InitStatic("ctrl_hdr:cap_main",self.dialog) + -- local cap_pos = cap:GetWndPos() cap:TextControl():SetText("Offsets") + -- cap:SetWndPos(vector2():set(cap_pos.x + 150, cap_pos.y)) - self.scroll = xml:InitScrollView("ctrl_lighting:scroll", self.dialog) - self.scroll:SetWndSize(vector2():set(self.scroll:GetWidth(), 225)) + self.scroll = xml:InitScrollView("ctrl_hdr:scroll", self.dialog) + -- self.scroll:SetWndSize(vector2():set(self.scroll:GetWidth() + 300, 225)) self.scroll:Clear() self.Track = {} self.Value = {} self.Num = {} for i=1, #hdr_live_editing_commands do - local _st = xml:InitStatic("ctrl_lighting:st", nil) + local _st = xml:InitStatic("ctrl_hdr:st", nil) + local tbl = hdr_live_editing_commands[i] local name = tbl.id @@ -978,7 +981,7 @@ function init_opt_base() value = tonumber(value) end - local cap = xml:InitStatic("ctrl_lighting:cap", _st) + local cap = xml:InitStatic("ctrl_hdr:cap", _st) cap:TextControl():SetText(game.translate_string(("ui_mm_modded_exes_%s"):format(name))) local function getMinOrMax(min) @@ -999,12 +1002,17 @@ function init_opt_base() local max = getMinOrMax() local val = tonumber(value) - self.Track[i] = xml:InitTrackBar("ctrl_lighting:track", _st) + self.Track[i] = xml:InitTrackBar("ctrl_hdr:track", _st) + -- local track_pos = self.Track[i]:GetWndPos() + -- self.Track[i]:SetWndPos(vector2():set(track_pos.x + 250, track_pos.y)) self.Track[i]:SetStep(step) self.Track[i]:SetOptFBounds(min, max) self.Track[i]:SetFValue(val) self.Value[i] = val - self.Num[i] = xml:InitTextWnd("ctrl_lighting:num", _st) + self.Num[i] = xml:InitTextWnd("ctrl_hdr:num", _st) + -- self.Num[i]:SetWndSize(vector2():set(self.Num[i]:GetWidth() + 50, self.Num[i]:GetHeight())) + -- local num_pos = self.Num[i]:GetWndPos() + -- self.Num[i]:SetWndPos(vector2():set(num_pos.x + 250, num_pos.y)) local display_text = val if tbl.type == "list" then diff --git a/src/xrGame/Weapon.cpp b/src/xrGame/Weapon.cpp index d1dd3bf8..af3aacfd 100644 --- a/src/xrGame/Weapon.cpp +++ b/src/xrGame/Weapon.cpp @@ -3085,7 +3085,7 @@ void CWeapon::ZoomDec() float f = GetZoomFactor() * power + delta; if (useNewZoomDeltaAlgorithm) - f = GetZoomFactor() * power / delta; + f = GetZoomFactor() * power / max(delta, 0.001f); clamp(f, m_zoom_params.m_fScopeZoomFactor * power, min_zoom_factor); SetZoomFactor(f / power); diff --git a/src/xrGame/WeaponBinoculars.cpp b/src/xrGame/WeaponBinoculars.cpp index 8d13f9a2..0f856011 100644 --- a/src/xrGame/WeaponBinoculars.cpp +++ b/src/xrGame/WeaponBinoculars.cpp @@ -163,7 +163,7 @@ void CWeaponBinoculars::ZoomDec() GetZoomData(m_zoom_params.m_fScopeZoomFactor, m_zoom_params.m_fZoomStepCount, delta, min_zoom_factor); } - float f = useNewZoomDeltaAlgorithm ? GetZoomFactor() / delta : GetZoomFactor() + delta; + float f = useNewZoomDeltaAlgorithm ? GetZoomFactor() / max(delta, 0.001f) : GetZoomFactor() + delta; clamp(f, m_zoom_params.m_fScopeZoomFactor, min_zoom_factor); SetZoomFactor(f); czoom = f;