Skip to content

Commit

Permalink
Merge branch 'all-in-one-vs2022' into all-in-one-vs2022-wpo
Browse files Browse the repository at this point in the history
  • Loading branch information
themrdemonized committed Jan 13, 2025
2 parents 5b93073 + 622b1ad commit 978acda
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions gamedata/configs/ui/ui_ctrl_hdr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "ui\ui_ctrl_hdr_16.xml"
23 changes: 23 additions & 0 deletions gamedata/configs/ui/ui_ctrl_hdr_16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

<w>
<ctrl_hdr x="115" y="400" width="800" height="300" stretch="1">
<frame x="0" y="0" width="802" height="300" stretch="1">
<texture r="0" g="0" b="0" a="150">ui_icons_PDA_tooltips</texture>
</frame>

<cap_main x="0" y="10" width="800" height="30" stretch="1">
<text r="250" g="250" b="250" font="letterica18" align="c" vert_align="c">ui_mm_video_basic_lighting</text>
</cap_main>

<scroll x="20" y="50" width="760" height="225" right_ident="0" left_ident="0" top_indent="0" bottom_indent="0" vert_interval="0" always_show_scroll="0"/>
<st x="0" y="0" width="622" height="30"/>

<cap x="0" y="-2" width="100" height="20" stretch="1">
<text r="200" g="200" b="200" font="letterica16" align="l" vert_align="c">ui_mm_video_basic_gamma</text>
</cap>
<track x="330" y="0" width="300" height="16" stretch="1" step="1.0"/>
<num x="640" y="-2" width="100" height="20" stretch="1">
<text complex_mode="1" r="200" g="150" b="100" align="l" vert_align="c" font="letterica16"/>
</num>
</ctrl_hdr>
</w>
34 changes: 21 additions & 13 deletions gamedata/scripts/ui_options_modded_exes.script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/WeaponBinoculars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 978acda

Please sign in to comment.