From 432337dfa73c1c978a39687ee73fb6f21314d901 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Mon, 15 Apr 2024 04:24:38 -0700 Subject: [PATCH 01/11] * UPD: [xrUICore/xrEngine] (OXR) Extend CUIOptionsItem to allow Fvector3 and Fvector4 --- src/xrEngine/XR_IOConsole.h | 2 ++ src/xrEngine/XR_IOConsole_get.cpp | 21 +++++++++++++++++++++ src/xrUICore/Options/UIOptionsItem.cpp | 24 ++++++++++++++++++++++++ src/xrUICore/Options/UIOptionsItem.h | 6 ++++++ 4 files changed, 53 insertions(+) diff --git a/src/xrEngine/XR_IOConsole.h b/src/xrEngine/XR_IOConsole.h index 16ff543d420..52bde2c8e9a 100644 --- a/src/xrEngine/XR_IOConsole.h +++ b/src/xrEngine/XR_IOConsole.h @@ -148,6 +148,8 @@ class ENGINE_API CConsole : const xr_token* GetXRToken(pcstr cmd) const; Fvector GetFVector(pcstr cmd) const; Fvector* GetFVectorPtr(pcstr cmd) const; + Fvector4 GetFVector4(pcstr cmd) const; + Fvector4* GetFVector4Ptr(pcstr cmd) const; IConsole_Command* GetCommand(pcstr cmd) const; protected: diff --git a/src/xrEngine/XR_IOConsole_get.cpp b/src/xrEngine/XR_IOConsole_get.cpp index 3782b3cc329..79e63a7e55a 100644 --- a/src/xrEngine/XR_IOConsole_get.cpp +++ b/src/xrEngine/XR_IOConsole_get.cpp @@ -115,3 +115,24 @@ Fvector CConsole::GetFVector(pcstr cmd) const } return Fvector().set(0.0f, 0.0f, 0.0f); } + +Fvector4* CConsole::GetFVector4Ptr(pcstr cmd) const +{ + IConsole_Command* cc = GetCommand(cmd); + CCC_Vector4* cf = dynamic_cast(cc); + if (cf) + { + return cf->GetValuePtr(); + } + return NULL; +} + +Fvector4 CConsole::GetFVector4(pcstr cmd) const +{ + Fvector4* pV = GetFVector4Ptr(cmd); + if (pV) + { + return *pV; + } + return Fvector4().set(0.0f, 0.0f, 0.0f, 0.0f); +} diff --git a/src/xrUICore/Options/UIOptionsItem.cpp b/src/xrUICore/Options/UIOptionsItem.cpp index d00ca40ed63..8782cac0072 100644 --- a/src/xrUICore/Options/UIOptionsItem.cpp +++ b/src/xrUICore/Options/UIOptionsItem.cpp @@ -83,6 +83,30 @@ const xr_token* CUIOptionsItem::GetOptToken() const return Console->GetXRToken(m_entry.c_str()); } +Fvector3 CUIOptionsItem::GetOptVector3Value() const +{ + return Console->GetFVector(m_entry.c_str()); +} + +void CUIOptionsItem::SaveOptVector3Value(Fvector3 val) const +{ + string512 command; + xr_sprintf(command, "%s %f %f %f", m_entry.c_str(), val.x, val.y, val.z); + Console->Execute(command); +} + +Fvector4 CUIOptionsItem::GetOptVector4Value() const +{ + return Console->GetFVector4(m_entry.c_str()); +} + +void CUIOptionsItem::SaveOptVector4Value(Fvector4 val) const +{ + string512 command; + xr_sprintf(command, "%s %f %f %f", m_entry.c_str(), val.x, val.y, val.z, val.w); + Console->Execute(command); +} + void CUIOptionsItem::SaveOptValue() { if (!IsChangedOptValue()) diff --git a/src/xrUICore/Options/UIOptionsItem.h b/src/xrUICore/Options/UIOptionsItem.h index c2c0ced5f87..4c79900c22a 100644 --- a/src/xrUICore/Options/UIOptionsItem.h +++ b/src/xrUICore/Options/UIOptionsItem.h @@ -51,6 +51,12 @@ class XRUICORE_API CUIOptionsItem pcstr GetOptTokenValue() const; const xr_token* GetOptToken() const; + Fvector3 GetOptVector3Value() const; + void SaveOptVector3Value(Fvector3 val) const; + + Fvector4 GetOptVector4Value() const; + void SaveOptVector4Value(Fvector4 val) const; + shared_str m_entry; ESystemDepends m_dep; From 882337b5a680d839a2f2ccb21398d1986d3bd65c Mon Sep 17 00:00:00 2001 From: yohjimane Date: Tue, 16 Apr 2024 23:50:39 -0700 Subject: [PATCH 02/11] * UPD: [xrUICore] (OXR) Extended UITrackBar to allow additional static label --- src/xrUICore/TrackBar/UITrackBar.cpp | 6 ++++++ src/xrUICore/TrackBar/UITrackBar.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xrUICore/TrackBar/UITrackBar.cpp b/src/xrUICore/TrackBar/UITrackBar.cpp index e131f5311e8..aaee035f85d 100644 --- a/src/xrUICore/TrackBar/UITrackBar.cpp +++ b/src/xrUICore/TrackBar/UITrackBar.cpp @@ -28,6 +28,11 @@ CUITrackBar::CUITrackBar() AttachChild(m_static); m_static->SetAutoDelete(true); + m_label = xr_new("Value as text 2"); + m_label->Enable(false); + AttachChild(m_label); + m_label->SetAutoDelete(true); + m_b_mouse_capturer = false; } @@ -145,6 +150,7 @@ void CUITrackBar::Draw() CUI_IB_FrameLineWnd::Draw(); m_pSlider->Draw(); m_static->Draw(); + m_label->Draw(); } void CUITrackBar::Update() diff --git a/src/xrUICore/TrackBar/UITrackBar.h b/src/xrUICore/TrackBar/UITrackBar.h index 289ff9b36bb..a7e2ac70daf 100644 --- a/src/xrUICore/TrackBar/UITrackBar.h +++ b/src/xrUICore/TrackBar/UITrackBar.h @@ -36,7 +36,8 @@ class XRUICORE_API CUITrackBar final : public CUI_IB_FrameLineWnd, public CUIOpt pcstr GetDebugType() override { return "CUITrackBar"; } - CUIStatic* m_static; + CUIStatic* m_static; // value + CUIStatic* m_label; // label shared_str m_static_format; protected: From 51345f7c233a51c19f0d43b18703fbf7f62517e5 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Mon, 15 Apr 2024 22:57:28 -0700 Subject: [PATCH 03/11] * UPD: [xrGame/xrUICore] MultiTrackBar component + SSS settings, hud_fov setting --- res/gamedata/configs/text/eng/openxray.xml | 37 ++ .../configs/text/eng/ssfx_ui_florafixes.xml | 72 +++ .../text/eng/ssfx_ui_hud_raindrops.xml | 92 +++ .../eng/ssfx_ui_interactive_grass_mcm.xml | 134 +++++ .../configs/text/eng/ssfx_ui_rain.xml | 100 ++++ .../text/eng/ssfx_ui_rain_footsteps.xml | 77 +++ .../text/eng/ssfx_ui_shadow_cascades_mcm.xml | 86 +++ .../configs/text/eng/ssfx_ui_strings_mcm.xml | 77 +++ .../configs/text/eng/ssfx_ui_wet_gloss.xml | 68 +++ .../configs/text/eng/ssfx_ui_wet_surfaces.xml | 142 +++++ .../configs/text/eng/ssfx_ui_wpn_dof_mcm.xml | 76 +++ res/gamedata/configs/ui/ui_mm_opt_16.xml | 13 +- .../configs/ui/ui_mm_shader_options_16.xml | 548 ++++++++++++++++++ res/gamedata/scripts/bind_stalker.script | 9 +- res/gamedata/scripts/ui_mm_opt_main.script | 40 +- res/gamedata/scripts/ui_mm_opt_video.script | 3 + .../ui_mm_opt_video_shader_options.script | 66 +++ src/Layers/xrRender/xrRender_console.cpp | 8 +- src/xrEngine/IGame_Persistent.h | 2 + src/xrEngine/IGame_Persistent_Effects.cpp | 18 +- src/xrEngine/xr_ioc_cmd.cpp | 2 + src/xrGame/ScriptXMLInit.cpp | 10 + src/xrGame/ScriptXMLInit.h | 2 + src/xrUICore/Buttons/UIButton_script.cpp | 8 +- .../MultiTrackBar/UIMultiTrackBar.cpp | 238 ++++++++ src/xrUICore/MultiTrackBar/UIMultiTrackBar.h | 103 ++++ src/xrUICore/Options/UIOptionsItem.cpp | 4 +- src/xrUICore/TrackBar/UITrackBar.cpp | 4 + src/xrUICore/TrackBar/UITrackBar.h | 17 +- src/xrUICore/XML/UIXmlInitBase.cpp | 116 ++++ src/xrUICore/XML/UIXmlInitBase.h | 2 + src/xrUICore/xrUICore.vcxproj | 2 + src/xrUICore/xrUICore.vcxproj.filters | 9 + 33 files changed, 2160 insertions(+), 25 deletions(-) create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_florafixes.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_hud_raindrops.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_interactive_grass_mcm.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_rain.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_rain_footsteps.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_shadow_cascades_mcm.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_strings_mcm.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_wet_gloss.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_wet_surfaces.xml create mode 100644 res/gamedata/configs/text/eng/ssfx_ui_wpn_dof_mcm.xml create mode 100644 res/gamedata/configs/ui/ui_mm_shader_options_16.xml create mode 100644 res/gamedata/scripts/ui_mm_opt_video_shader_options.script create mode 100644 src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp create mode 100644 src/xrUICore/MultiTrackBar/UIMultiTrackBar.h diff --git a/res/gamedata/configs/text/eng/openxray.xml b/res/gamedata/configs/text/eng/openxray.xml index 7d11350be53..7019a5974d0 100644 --- a/res/gamedata/configs/text/eng/openxray.xml +++ b/res/gamedata/configs/text/eng/openxray.xml @@ -159,4 +159,41 @@ Spanish + + Shader Options + + + Back to Basic Settings + + + + Default + + + + + Shadow Cascades Settings + + + Near cascades size + + + Mid cascades size + + + Far cascades size + + + + Grass shadows Settings + + + Grass shadows quality + + + Grass shadows distance ( Sun ) + + + Grass shadows max distance + diff --git a/res/gamedata/configs/text/eng/ssfx_ui_florafixes.xml b/res/gamedata/configs/text/eng/ssfx_ui_florafixes.xml new file mode 100644 index 00000000000..591b5bc204f --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_florafixes.xml @@ -0,0 +1,72 @@ + + + + + + + + + Flora Fixes + + + + + Flora Fixes & Improvements - Settings + + + + + SubSurface Scattering Intensity + + + + Intensity of the flora SubSurface Scattering. + + + + SubSurface Scattering Color + + + + How much sun color is added to the flora SubSurface Scattering. 1.0 is 100% sun color. + + + + Grass Specular + + + + Specular value when the grass is dry. Be careful when adjusting the value, try with small changes and check the result. + + + + Wet Grass Specular + + + + Specular value when the grass is wet. Be careful when adjusting the value, try with small changes and check the result. + + + + Trees/Bushes Specular + + + + Specular when trees and bushes are dry. Be careful when adjusting the value, try with small changes and check the result. + + + + Wet Trees/Bushes Specular + + + + Specular when trees and bushes are wet. Be careful when adjusting the value, try with small changes and check the result. + + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_hud_raindrops.xml b/res/gamedata/configs/text/eng/ssfx_ui_hud_raindrops.xml new file mode 100644 index 00000000000..ece017fbd9b --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_hud_raindrops.xml @@ -0,0 +1,92 @@ + + + + + + + + + HUD Raindrops - Settings + + + + + Raindrops density + + + + Quantity and size of the raindrops. + + + + Reflection intensity + + + + Intensity of the raindrops reflection. + + + + Refraction intensity + + + + Intensity of the raindrops refraction. + + + + + Animation speed + + + + Raindrops animation speed. + + + + Build up speed + + + + Value to adjust the build up speed of raindrops on HUD elements. + + + + Drying speed + + + + Value to adjust the drying speed of HUD elements. + + + + Raindrops size + + + + Set the raindrops size. + + + + + Raindrops gloss + + + + Adjust the gloss intensity of raindrops. + + + + Extra overall gloss ( When wet ) + + + + Adjust the overall gloss of HUD elements when is raining. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_interactive_grass_mcm.xml b/res/gamedata/configs/text/eng/ssfx_ui_interactive_grass_mcm.xml new file mode 100644 index 00000000000..686cbdd43a2 --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_interactive_grass_mcm.xml @@ -0,0 +1,134 @@ + + + + + + + + + Interactive Grass + + + + + Interative Grass Settings + + + + Enabled + + + + [ RESTART REQUIERED ] Enable/Disable interactive grass. + + + + Max number of interactions + + + + [ RESTART REQUIERED ] Maximum number of simultaneous interactions. Higher values can decrease performance. + + + + Max distance + + + + Maximum distance to render grass interactions. + + + + Player interaction + + + + Enable/Disable player interaction with grass. + + + + Mutants shockwave + + + + Enable/Disable Pseudogiants and Burers shockwave effects. + + + + Bending radius + + + + Adjust the radius of the bending effect when characters walk on grass. + + + + Horizontal strength + + + + Adjust the strength of the horizontal displacement when characters walk on grass. + + + + Vertical strength + + + + Adjust the strength of the vertical displacement when characters walk on grass. + + + + Explosions intensity + + + + Option to adjust the shockwave overall intensity. + + + + Explosions speed + + + + Option to adjust the shockwave propagation speed. + + + + Shooting strength + + + + Strength of the displacement generated by firearms shots. + + + + Shooting range + + + + Range of the displacement of the shooting effect. + + + + Anomalies interaction + + + + Enable/disable the interaction between grass and anomalies. + + + + Anomalies Max distance + + + + This value defines the maximum distance to render the interactions between anomalies and grass. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_rain.xml b/res/gamedata/configs/text/eng/ssfx_ui_rain.xml new file mode 100644 index 00000000000..d4bef695d9d --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_rain.xml @@ -0,0 +1,100 @@ + + + + + + + + + Rain - Settings + + + + + Render quality + + + + LOW : Basic refraction rendering. - MEDIUM : Basic rendering plus discard of incorrect refraction. - HIGH : Full refraction with extra reflection sample. + + + + Rain speed + + + + Speed of the falling. + + + + Rain length + + + + Length of the raindrop. + + + + Rain width + + + + Width of the raindrop. + + + + + Rain transparency + + + + Transparency of the overall effect. + + + + Rain brightness + + + + How brigth is the base color of the raindrop. + + + + Rain refraction + + + + Intensity of the refraction effect. + + + + Rain reflection + + + + Transparency of the reflection effect. + + + + + Splash transparency + + + + Transparency of the rain splashes. + + + + Splash refraction + + + + Intensity of the rain splashes refraction. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_rain_footsteps.xml b/res/gamedata/configs/text/eng/ssfx_ui_rain_footsteps.xml new file mode 100644 index 00000000000..87b255da8f2 --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_rain_footsteps.xml @@ -0,0 +1,77 @@ + + + + + + + + + Footsteps - Settings + + + + + Main volume + + + + Main volume for the footsteps. + + + + Volume variation + + + + This add a random variation ( the set value ) to the footsteps volume. + + + + + Multiplier without rain + + + + Volume multiplier when isn't raining but wetness is still high. + + + + Multiplier when walking + + + + Volume multiplier when the player is walking. + + + + Multiplier when running + + + + Volume multiplier when the player is running. + + + + + Jump volume + + + + Volume of the jumping sound effect. + + + + Land volume + + + + Volume of the land sound effect. + + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_shadow_cascades_mcm.xml b/res/gamedata/configs/text/eng/ssfx_ui_shadow_cascades_mcm.xml new file mode 100644 index 00000000000..7a98bfa43b4 --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_shadow_cascades_mcm.xml @@ -0,0 +1,86 @@ + + + + + + + + + Shadow Cascades + + + + + Shadow Cascades Settings + + + + Near cascades size + + + + Try to use a lower size value to improve the quality of your sun shadows. + + + + Mid cascades size + + + + Try to use a lower size value to improve the quality of your sun shadows. + + + + Far cascades size + + + + This cascade define the final rendering distance of your sun shadows. Lower values will improve performance, higher values will improve your distant shadows at the cost of performance. + + + + Grass shadows quality + + + + [ LOW ] Grass shadows only render in the NEAR cascade. Default ANOMALY behavior. [ MEDIUM ] Grass will cast shadows in the NEAR and MID cascade. [ HIGH ] Grass shadows will be rendered in all cascades and sun volumetric rays. [ ULTRA ] All lights will cast grass shadows. + + + + Low ( ANOMALY Default ) + + + + Medium + + + + High + + + + Ultra ( Big performance hit ) + + + + Grass shadows distance ( Sun ) + + + + This value adjust the rendering distance of sun grass shadows. The value is porcentual to your grass rendering distance. Lower values will improve performance. + + + + Grass shadows max distance + + + + [ ULTRA QUALITY ONLY ] This value adjust the rendering distance of grass shadows for non-directional lights. Lower values will improve performance, but you might notice when the shadows stop being rendered. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_strings_mcm.xml b/res/gamedata/configs/text/eng/ssfx_ui_strings_mcm.xml new file mode 100644 index 00000000000..147a9c59d99 --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_strings_mcm.xml @@ -0,0 +1,77 @@ + + + + + + + + SSS Settings + + + + + General + + + + + Rain Enhances + + + + Rain + + + + Footsteps + + + + HUD Raindrops + + + + + Wetness + + + + Gloss + + + + Wet Surfaces + + + + + General Settings + + + + Acitvate SHADER BASED 2D SCOPES support + + + + + MODULE NOT INSTALLED + + + + Low + + + + Medium + + + + High + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_wet_gloss.xml b/res/gamedata/configs/text/eng/ssfx_ui_wet_gloss.xml new file mode 100644 index 00000000000..354893b51f9 --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_wet_gloss.xml @@ -0,0 +1,68 @@ + + + + + + + + + Gloss - Settings + + + + + Min Gloss + + + + Base value of gloss. If "Auto Gloss" is disabled, this value determine the gloss. + + + + Max Gloss + + + + When the "Auto Gloss" is enabled, this value will be the maximum value of gloss when wetness is at 100%. + + + + + Auto Gloss + + + + Enable/Disable the automatic adjustment of gloss based on wetness. If you want to manually set a fixed gloss value, disable this option and use the "Min Gloss" option to define your gloss. + + + + Auto Gloss Percentage + + + + This value is used to control the maximum value of gloss when full wetness is reached. ( 0 = 0% | 1 = 100% ) + + + + Specular Intensity + + + + Set the intensity of specular lighting. + + + + Specular Color + + + + Porcentage of the specular color. ( 0 = 0% | 1 = 100% ) + + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_wet_surfaces.xml b/res/gamedata/configs/text/eng/ssfx_ui_wet_surfaces.xml new file mode 100644 index 00000000000..dc401c50bfe --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_wet_surfaces.xml @@ -0,0 +1,142 @@ + + + + + + + + + Wet Surfaces - Settings + + + + + Wetness - Buildup speed + + + + Buildup speed. The higher the value the faster will be the buildup of wetness. ( Puddles and wet surfaces ) + + + + Wetness - Drying speed + + + + Drying time. The higher the value the faster will be the drying of wetness. ( Puddles and wet surfaces ) + + + + + Rain Ripples Scale + + + + Scale of rain ripples. The higher the value, bigger the size of the rain ripples. + + + + Rain Ripples Speed + + + + Set the speed of the Rain Ripples animation. ( The rain intensity defines the base speed ) + + + + Rain Ripples Min Speed + + + + Set the minimum speed of the Rain Ripples animation. + + + + Rain Ripples Intensity + + + + Set the intensity of the Rain Ripples. + + + + + Waterfall Scale + + + + Scale of waterfall effect. The higher the value, bigger the size. + + + + Waterfall Speed + + + + Set the speed of the falling. ( The rain intensity defines the base speed ) + + + + Waterfall Min Speed + + + + Set the minimum speed of the water falling. + + + + Waterfall Intensity + + + + Define the intensity of the waterfall effect. + + + + + Rain Cover Resolution + + + + Resolution of the rain cover rendering. Higher values generate sharpen covers at the expense of performance. + + + + Rain Cover Distance + + + + Distance of the rain cover rendering. Higher values are more performance expensive. + + + + + 64 + + + + 128 ( Recommended ) + + + + 256 + + + + 512 + + + + 1024 + + + + 2048 + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/eng/ssfx_ui_wpn_dof_mcm.xml b/res/gamedata/configs/text/eng/ssfx_ui_wpn_dof_mcm.xml new file mode 100644 index 00000000000..1ad20aab42e --- /dev/null +++ b/res/gamedata/configs/text/eng/ssfx_ui_wpn_dof_mcm.xml @@ -0,0 +1,76 @@ + + + + + + + + + Weapons DOF + + + + + Weapons DOF Settings + + + + Out of focus fade start [ AIMING ] + + + + Out of focus fade length [ AIMING ] + + + + Blur intensity [ AIMING ] ( 0 = Disable ) + + + + Peripheral Blur [ AIMING ] ( 0 = Disable ) + + + + + Out of focus fade start + + + + Out of focus fade length + + + + Blur intensity ( 0 = Disable ) + + + + Peripheral Blur ( 0 = Disable ) + + + + + DOF when Reloading + + + + DOF when using PDA + + + + DOF when using Inventory + + + + DOF when using Items ( FDDA ) + + + + DOF when looting mutants + + + \ No newline at end of file diff --git a/res/gamedata/configs/ui/ui_mm_opt_16.xml b/res/gamedata/configs/ui/ui_mm_opt_16.xml index 78d6b9cefe4..b1a2f9c7547 100644 --- a/res/gamedata/configs/ui/ui_mm_opt_16.xml +++ b/res/gamedata/configs/ui/ui_mm_opt_16.xml @@ -167,14 +167,21 @@ - ui_mm_advanced + ui_inGame2_button + + + + + + + ui_mm_shader_options ui_inGame2_button - + @@ -535,6 +542,8 @@ + #include "ui\ui_mm_shader_options_16.xml" + ui_mm_master_volume diff --git a/res/gamedata/configs/ui/ui_mm_shader_options_16.xml b/res/gamedata/configs/ui/ui_mm_shader_options_16.xml new file mode 100644 index 00000000000..003f8367905 --- /dev/null +++ b/res/gamedata/configs/ui/ui_mm_shader_options_16.xml @@ -0,0 +1,548 @@ + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_florafixes_title</text> + + + ui_mcm_ssfx_module_florafixes_sss_int_mcm + + + ui_mcm_ssfx_module_florafixes_sss_color_mcm + + + 0 + + + + + ui_mcm_ssfx_module_florafixes_grass_specular_mcm + + + ui_mcm_ssfx_module_florafixes_grass_specular_wet_mcm + + + ui_mcm_ssfx_module_florafixes_trees_specular_mcm + + + ui_mcm_ssfx_module_florafixes_trees_specular_wet_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_inter_grass_title</text> + + + + + + + + + + + + + + + 0 + + + + + + ui_mcm_ssfx_module_inter_grass_radius_mcm + + + ui_mcm_ssfx_module_inter_grass_horizontal_str_mcm + + + ui_mcm_ssfx_module_inter_grass_vertical_str_mcm + + + ui_mcm_ssfx_module_inter_grass_anomalies_distance_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_inter_grass_explosions_str_mcm + + + ui_mcm_ssfx_module_inter_grass_explosions_speed_mcm + + + ui_mcm_ssfx_module_inter_grass_shooting_str_mcm + + + ui_mcm_ssfx_module_inter_grass_shooting_range_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_shw_cascades_title</text> + + + ui_mcm_ssfx_module_shw_cascades_size_1_mcm + + + ui_mcm_ssfx_module_shw_cascades_size_2_mcm + + + ui_mcm_ssfx_module_shw_cascades_size_3_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_quality_mcm + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_distance_mcm + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_nondir_maxdistance_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_rain_title</text> + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_len_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_width_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_speed_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_quality_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_alpha_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_brightness_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_refraction_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_reflection_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_splash_alpha_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_splash_refraction_mcm + + + 0 + + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_hud_raindrops_title</text> + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_density_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_reflection_str_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_refraction_str_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_animation_speed_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_buildup_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_drying_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_size_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_gloss_mcm + + + 0 + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_wpn_dof_title</text> + + + ui_mcm_ssfx_module_wpn_dof_fadestart_mcm + + + ui_mcm_ssfx_module_wpn_dof_fadelen_mcm + + + ui_mcm_ssfx_module_wpn_dof_blur_mcm + + + ui_mcm_ssfx_module_wpn_dof_edgeblur_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_wpn_dof_aim_fadestart_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_fadelen_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_blur_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_edgeblur_mcm + + + 0 + + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_gloss_title</text> + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_min_gloss_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_max_gloss_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_specular_int_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_specular_color_mcm + + + 0 + + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_wet_surf_title</text> + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_buildup_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_dry_speed_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_size_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_min_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_intensity_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_size_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_min_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_intensity_mcm + + + 0 + + + + + ui_mm_simply_shader_opts + ui_inGame2_button + + + + + + + ui_mm_shader_options_default + ui_inGame2_button + + + + + diff --git a/res/gamedata/scripts/bind_stalker.script b/res/gamedata/scripts/bind_stalker.script index a51fc20c872..d2a841031ec 100644 --- a/res/gamedata/scripts/bind_stalker.script +++ b/res/gamedata/scripts/bind_stalker.script @@ -58,10 +58,11 @@ function actor_binder:net_spawn(data) self.already_jumped = false self.loaded = false benchmark.main() --' Distemper 06.2008 -- - ssfx_001_mcm.on_game_start() - ssfx_interactive_grass.on_game_start() - ssfx_shadow_cascades.on_game_start() - ssfx_weapons_dof.on_game_start() + + --ssfx_001_mcm.on_game_start() + --ssfx_interactive_grass.on_game_start() + --ssfx_shadow_cascades.on_game_start() + --ssfx_weapons_dof.on_game_start() return true end ---------------------------------------------------------------------------------------------------------------------- diff --git a/res/gamedata/scripts/ui_mm_opt_main.script b/res/gamedata/scripts/ui_mm_opt_main.script index 66e85e0f5c0..21f70d8540f 100644 --- a/res/gamedata/scripts/ui_mm_opt_main.script +++ b/res/gamedata/scripts/ui_mm_opt_main.script @@ -59,6 +59,12 @@ function options_dialog:InitControls() self.dlg_video_adv:Show (false) self.dialog:AttachChild (self.dlg_video_adv) xml:InitWindow ("tab_size", 0, self.dlg_video_adv) + + self.dlg_video_shader_options = ui_mm_opt_video_shader_options.opt_video_shader_options() + self.dlg_video_shader_options:InitControls(0,0, xml, self) + self.dlg_video_shader_options:Show (false) + self.dialog:AttachChild (self.dlg_video_shader_options) + xml:InitWindow ("tab_size", 0, self.dlg_video_shader_options) self.dlg_controls_gpad = ui_mm_opt_controls_gpad.opt_controls_gpad() self.dlg_controls_gpad:InitControls(0,0, xml, self) @@ -87,7 +93,6 @@ function options_dialog:InitControls() self.download_progress = xml:InitProgressBar ("progress_download", self) self.btn_cancel_download = xml:Init3tButton ("btn_cancel_download", self) self:Register (self.btn_cancel_download, "btn_cancel_download") - end function options_dialog:SetCurrentValues() @@ -102,6 +107,9 @@ function options_dialog:SetCurrentValues() opt:SetCurrentValues("mm_opt_video_adv") opt:SaveBackupValues("mm_opt_video_adv") + opt:SetCurrentValues("mm_opt_video_shader_options") + opt:SaveBackupValues("mm_opt_video_shader_options") + opt:SetCurrentValues("mm_opt_gameplay") opt:SaveBackupValues("mm_opt_gameplay") @@ -178,6 +186,7 @@ function options_dialog:InitCallBacks() self:AddCallback("btn_accept", ui_events.BUTTON_CLICKED, self.OnBtnAccept, self) self:AddCallback("btn_cancel", ui_events.BUTTON_CLICKED, self.OnBtnCancel, self) self:AddCallback("btn_default_graphic", ui_events.BUTTON_CLICKED, self.OnBtnDefGraph, self) + self:AddCallback("btn_default_shaders", ui_events.BUTTON_CLICKED, self.OnBtnDefShaders, self) self:AddCallback("btn_default_sound", ui_events.BUTTON_CLICKED, self.OnBtnDefSound, self) self:AddCallback("combo_preset", ui_events.LIST_ITEM_SELECT, self.OnPresetChanged, self) self:AddCallback("combo_shader_preset", ui_events.LIST_ITEM_SELECT, self.OnShaderPresetChanged, self) @@ -195,6 +204,11 @@ function options_dialog:InitCallBacks() self:AddCallback("btn_keyboard_controls", ui_events.BUTTON_CLICKED, self.OnBtnKbdControls, self) self:AddCallback("btn_gpad_default", ui_events.BUTTON_CLICKED, self.OnBtnGpadDefault, self) + self:AddCallback("btn_shader_options", ui_events.BUTTON_CLICKED, self.OnShaderOptionsSelected, self) + self:AddCallback("btn_shader_options_quit", ui_events.BUTTON_CLICKED, self.OnShaderOptionsQuit, self) + + + self:AddCallback("mb", ui_events.MESSAGE_BOX_YES_CLICKED, self.OnApplyChanges, self) self:AddCallback("mb", ui_events.MESSAGE_BOX_NO_CLICKED, self.OnDiscardChanges,self) -- self:AddCallback("trb_ssample", ui_events.BUTTON_CLICKED, self.UpdateDependControls, self) @@ -219,11 +233,13 @@ end function options_dialog:OnPresetChanged() local opt = COptionsManager() opt:SetCurrentValues ("mm_opt_video_adv") + opt:SetCurrentValues("mm_opt_video_shader_options") end function options_dialog:OnShaderPresetChanged() local opt = COptionsManager() opt:SetCurrentValues ("mm_opt_video_adv") + opt:SetCurrentValues("mm_opt_video_shader_options") local current_preset = self.combo_shader_preset:CurrentID() self.combo_color_grading_preset:Enable(current_preset ~= 0) @@ -234,6 +250,11 @@ function options_dialog:OnBtnDefGraph() opt:SendMessage2Group("mm_opt_video","set_default_value") end +function options_dialog:OnBtnDefShaders() + local opt = COptionsManager() + opt:SendMessage2Group("mm_opt_video_shader_options","set_default_value") +end + function options_dialog:OnBtnDefSound() local opt = COptionsManager() opt:SendMessage2Group("mm_opt_sound","set_default_value") @@ -256,6 +277,8 @@ function options_dialog:OnBtnAccept() --opt:SaveValues("mm_opt_controls_adv") opt:SaveValues("key_binding_gamepad") + opt:SaveValues("mm_opt_video_shader_options") + if opt:NeedVidRestart() then _G.b_discard_settings_shown = true self.message_box:InitMessageBox("message_box_yes_no") @@ -275,6 +298,7 @@ function options_dialog:OnBtnCancel() opt:UndoGroup ("mm_opt_video_preset") opt:UndoGroup ("mm_opt_video") opt:UndoGroup ("mm_opt_video_adv") + opt:UndoGroup("mm_opt_video_shader_options") opt:UndoGroup ("mm_opt_sound") opt:OptionsPostAccept () @@ -290,6 +314,8 @@ function options_dialog:OnTabChange() self.dlg_controls:Show (false) self.dlg_video_adv:Show (false) self.dlg_controls_gpad:Show(false) + self.dlg_video_shader_options:Show(false) + local ids = self.tab:GetActiveId() if ids == "video" then @@ -456,4 +482,14 @@ function options_dialog:OnMenuReloaded() self.message_box:SetText(string.format("%s %d% s", game.translate_string("ui_mm_confirm_changes"), 15, game.translate_string("mp_si_sec"))) self.message_box:ShowDialog(true) end -end \ No newline at end of file +end + +function options_dialog:OnShaderOptionsSelected() + self.dlg_video:Show (false) + self.dlg_video_shader_options:Show(true) +end + +function options_dialog:OnShaderOptionsQuit() + self.dlg_video:Show (true) + self.dlg_video_shader_options:Show(false) +end diff --git a/res/gamedata/scripts/ui_mm_opt_video.script b/res/gamedata/scripts/ui_mm_opt_video.script index 3e45fb81f95..c30e89b0768 100644 --- a/res/gamedata/scripts/ui_mm_opt_video.script +++ b/res/gamedata/scripts/ui_mm_opt_video.script @@ -49,6 +49,9 @@ function opt_video:InitControls(x, y, xml, handler) btn = xml:Init3tButton ("tab_video:btn_advanced", self) handler:Register (btn, "btn_advanced_graphic") + btn_shader = xml:Init3tButton ("tab_video:btn_shader_options", self) + handler:Register(btn_shader, "btn_shader_options") + -- Disable `combo_renderer` combobox control if `renderer` command locked local _enable = true if renderer_allow_override ~= nil then diff --git a/res/gamedata/scripts/ui_mm_opt_video_shader_options.script b/res/gamedata/scripts/ui_mm_opt_video_shader_options.script new file mode 100644 index 00000000000..38533784f7d --- /dev/null +++ b/res/gamedata/scripts/ui_mm_opt_video_shader_options.script @@ -0,0 +1,66 @@ +class "opt_video_shader_options" (CUIWindow) +function opt_video_shader_options:__init() super() +end + +function opt_video_shader_options:__finalize() +end + +function all_modes(render_id) + return true +end + +function opt_video_shader_options:InitControls(x, y, xml, handler) + local ctl + local _st + + self.scroll_v = xml:InitScrollView("video_shader_options:scroll_v", self) + + self:SetWndPos(vector2():set(x,y)) + self:SetWndSize(vector2():set(738,416)) + self:SetAutoDelete(true) + + -- Flora Fixes Module + xml:InitMultiTrackBar("video_shader_options:track_ssfx_florafixes_2", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_florafixes_1", self.scroll_v) + + -- Interactive Grass Module + xml:InitMultiTrackBar("video_shader_options:track_ssfx_grass_interactive", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_int_grass_params_1", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_int_grass_params_2", self.scroll_v) + + -- Rain Module + -- Main + xml:InitMultiTrackBar("video_shader_options:track_ssfx_rain_1", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_rain_2", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_rain_3", self.scroll_v) + + -- Footsteps + -- TODO implement rain footsteps logic + -- HUD + xml:InitMultiTrackBar("video_shader_options:track_ssfx_hud_rain_1", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_hud_rain_2", self.scroll_v) + + -- Shadow Cascades Module + xml:InitMultiTrackBar("video_shader_options:track_ssfx_shadow_cascades", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_grass_shadows", self.scroll_v) + + -- Wpn DOF Module + -- TODO add engine logic to support custom DOF values, this is disabled for now + -- xml:InitMultiTrackBar("video_shader_options:track_ssfx_wpn_dof_1", self.scroll_v) + -- xml:InitMultiTrackBar("video_shader_options:track_ssfx_wpn_dof_2", self.scroll_v) + + -- Gloss module + xml:InitMultiTrackBar("video_shader_options:track_ssfx_gloss", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_specular", self.scroll_v) + + -- Wet Surfaces + xml:InitMultiTrackBar("video_shader_options:track_ssfx_wetness_3", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_wetness_1", self.scroll_v) + xml:InitMultiTrackBar("video_shader_options:track_ssfx_wetness_2", self.scroll_v) + + btn = xml:Init3tButton("video_shader_options:btn_to_simply", self) + handler:Register(btn, "btn_shader_options_quit") + + btn = xml:Init3tButton("video_shader_options:btn_default_shaders", self) + handler:Register(btn, "btn_default_shaders") +end diff --git a/src/Layers/xrRender/xrRender_console.cpp b/src/Layers/xrRender/xrRender_console.cpp index b342d7bb7b0..bd62721c00b 100644 --- a/src/Layers/xrRender/xrRender_console.cpp +++ b/src/Layers/xrRender/xrRender_console.cpp @@ -276,8 +276,8 @@ extern ENGINE_API Fvector4 ps_ssfx_wpn_dof_1; extern ENGINE_API Fvector4 ps_ssfx_wpn_dof_2; extern ENGINE_API Fvector4 ps_ssfx_florafixes_1; extern ENGINE_API Fvector4 ps_ssfx_florafixes_2; -extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1; -extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2; +extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1_cfg; +extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2_cfg; extern ENGINE_API int ps_ssfx_is_underground; extern ENGINE_API int ps_ssfx_gloss_method; extern ENGINE_API float ps_ssfx_gloss_factor; @@ -1152,8 +1152,8 @@ void xrRender_initconsole() CMD4(CCC_Vector4, "ssfx_florafixes_1", &ps_ssfx_florafixes_1, Fvector4().set(0.0, 0.0, 0.0, 0.0), Fvector4().set(1.0, 1.0, 1.0, 1.0)); CMD4(CCC_Vector4, "ssfx_florafixes_2", &ps_ssfx_florafixes_2, Fvector4().set(0.0, 0.0, 0.0, 0.0), Fvector4().set(10.0, 1.0, 1.0, 1.0)); - CMD4(CCC_Vector4, "ssfx_wetsurfaces_1", &ps_ssfx_wetsurfaces_1, Fvector4().set(0.01, 0.01, 0.01, 0.01), Fvector4().set(2.0, 2.0, 2.0, 2.0)); - CMD4(CCC_Vector4, "ssfx_wetsurfaces_2", &ps_ssfx_wetsurfaces_2, Fvector4().set(0.01, 0.01, 0.01, 0.01), Fvector4().set(2.0, 2.0, 2.0, 2.0)); + CMD4(CCC_Vector4, "ssfx_wetsurfaces_1", &ps_ssfx_wetsurfaces_1_cfg, Fvector4().set(0.01, 0.01, 0.01, 0.01), Fvector4().set(2.0, 2.0, 2.0, 2.0)); + CMD4(CCC_Vector4, "ssfx_wetsurfaces_2", &ps_ssfx_wetsurfaces_2_cfg, Fvector4().set(0.01, 0.01, 0.01, 0.01), Fvector4().set(2.0, 2.0, 2.0, 2.0)); CMD4(CCC_Integer, "ssfx_is_underground", &ps_ssfx_is_underground, 0, 1); CMD4(CCC_Integer, "ssfx_gloss_method", &ps_ssfx_gloss_method, 0, 1); CMD4(CCC_Vector3, "ssfx_gloss_minmax", &ps_ssfx_gloss_minmax, Fvector3().set(0, 0, 0), Fvector3().set(1.0, 1.0, 1.0)); diff --git a/src/xrEngine/IGame_Persistent.h b/src/xrEngine/IGame_Persistent.h index 3c5200b06e3..abfbf11eb08 100644 --- a/src/xrEngine/IGame_Persistent.h +++ b/src/xrEngine/IGame_Persistent.h @@ -280,6 +280,8 @@ extern ENGINE_API Fvector4 ps_ssfx_int_grass_params_2; extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1; extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2; +extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1_cfg; +extern ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2_cfg; extern ENGINE_API float ps_ssfx_gloss_factor; extern ENGINE_API Fvector3 ps_ssfx_gloss_minmax; extern ENGINE_API Fvector4 ps_ssfx_lightsetup_1; diff --git a/src/xrEngine/IGame_Persistent_Effects.cpp b/src/xrEngine/IGame_Persistent_Effects.cpp index 941b0708f63..a4f9762f6bd 100644 --- a/src/xrEngine/IGame_Persistent_Effects.cpp +++ b/src/xrEngine/IGame_Persistent_Effects.cpp @@ -347,7 +347,6 @@ void IGame_Persistent::UpdateHudRaindrops() const const float ssfx_hud_raindrops_extragloss = ssfx_default_settings.extra_gloss; const float val_density = 0.15f * (3.5f - ssfx_hud_raindrops_density); // 0.5 ~3.0 const float val_texsize = 2.0f - ssfx_hud_raindrops_size; - ps_ssfx_hud_drops_2.set(val_density, val_texsize, ssfx_hud_raindrops_extragloss, ssfx_hud_raindrops_gloss); static float drops_int{}, drops_anim{}; const float Rain_factor = g_pGamePersistent->pEnvironment->CurrentEnv.rain_density; const float delta_time = Device.fTimeDelta; @@ -376,6 +375,7 @@ void IGame_Persistent::UpdateHudRaindrops() const drops_anim = 0.f; // Update shader data ps_ssfx_hud_drops_1.set(drops_anim, drops_int, ssfx_hud_raindrops_refle, ssfx_hud_raindrops_refra); + ps_ssfx_hud_drops_2.set(val_density, val_texsize, ssfx_hud_raindrops_extragloss, ssfx_hud_raindrops_gloss); } void IGame_Persistent::UpdateRainGloss() const @@ -385,15 +385,15 @@ void IGame_Persistent::UpdateRainGloss() const bool auto_gloss{ true }; // Automatic adjustment of gloss based on wetness. float auto_gloss_max{ 1.0f }; // Value to control the maximum value of gloss when full wetness is reached. ( 0 = 0% | 1 = 100% ) - float ripples_size{ 1.5f }; - float ripples_speed{ 1.4f }; - float ripples_min_speed{ 0.7f }; - float ripples_intensity{ 1.25f }; + float ripples_size{ ps_ssfx_wetsurfaces_1_cfg.x }; + float ripples_speed{ ps_ssfx_wetsurfaces_1_cfg.y }; + float ripples_min_speed{ ps_ssfx_wetsurfaces_1_cfg.z }; + float ripples_intensity{ ps_ssfx_wetsurfaces_1_cfg.w }; - float waterfall_size{ 1.2 }; - float waterfall_speed{ 1.5f }; - float waterfall_min_speed{ 0.2f }; - float waterfall_intensity{ 0.35f }; + float waterfall_size{ ps_ssfx_wetsurfaces_2_cfg.x }; + float waterfall_speed{ ps_ssfx_wetsurfaces_2_cfg.y }; + float waterfall_min_speed{ ps_ssfx_wetsurfaces_2_cfg.z }; + float waterfall_intensity{ ps_ssfx_wetsurfaces_2_cfg.w }; int cover_res{ 1 }; // Resolution of the rain cover rendering.(0 Low ~5 High) float cover_distance{ 30.f }; // Distance of the rain cover rendering.Higher values are more performance expensive. diff --git a/src/xrEngine/xr_ioc_cmd.cpp b/src/xrEngine/xr_ioc_cmd.cpp index 20db9fcbfbe..1efe021619b 100644 --- a/src/xrEngine/xr_ioc_cmd.cpp +++ b/src/xrEngine/xr_ioc_cmd.cpp @@ -608,6 +608,8 @@ ENGINE_API Fvector4 ps_ssfx_wpn_dof_1 = { .0f, .0f, .0f, .0f }; ENGINE_API Fvector4 ps_ssfx_wpn_dof_2 = { 0.15f, .0f, .0f, .0f }; ENGINE_API Fvector4 ps_ssfx_florafixes_1 = { 0.3f, 0.21f, 0.3f, 0.21f }; // Flora fixes 1 ENGINE_API Fvector4 ps_ssfx_florafixes_2 = { 2.0f, 1.0f, 0.0f, 0.0f }; // Flora fixes 2 +ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1_cfg = { 1.0f, 1.0f, 1.0f, 1.0f }; // Wet surfaces 1 +ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2_cfg = { 1.0f, 1.0f, 1.0f, 1.0f }; // Wet surfaces 2 ENGINE_API Fvector4 ps_ssfx_wetsurfaces_1 = { 1.0f, 1.0f, 1.0f, 1.0f }; // Wet surfaces 1 ENGINE_API Fvector4 ps_ssfx_wetsurfaces_2 = { 1.0f, 1.0f, 1.0f, 1.0f }; // Wet surfaces 2 ENGINE_API int ps_ssfx_is_underground = 0; diff --git a/src/xrGame/ScriptXMLInit.cpp b/src/xrGame/ScriptXMLInit.cpp index b4ef8c71623..83ac6eae9c8 100644 --- a/src/xrGame/ScriptXMLInit.cpp +++ b/src/xrGame/ScriptXMLInit.cpp @@ -17,6 +17,7 @@ #include "xrUICore/Static/UIAnimatedStatic.h" #include "ui/UISleepStatic.h" #include "xrUICore/TrackBar/UITrackBar.h" +#include "xrUICore/MultiTrackBar/UIMultiTrackBar.h" #include "ui/UICDkey.h" #include "ui/UIMapInfo.h" #include "ui/UIMMShniaga.h" @@ -243,6 +244,14 @@ CUITrackBar* CScriptXmlInit::InitTrackBar(LPCSTR path, CUIWindow* parent) return pWnd; } +CUIMultiTrackBar* CScriptXmlInit::InitMultiTrackBar(LPCSTR path, CUIWindow* parent) +{ + CUIMultiTrackBar* pWnd = xr_new(); + CUIXmlInit::InitMultiTrackBar(m_xml, path, 0, pWnd); + _attach_child(pWnd, parent); + return pWnd; +} + CUIProgressBar* CScriptXmlInit::InitProgressBar(LPCSTR path, CUIWindow* parent) { CUIProgressBar* pWnd = xr_new(); @@ -300,6 +309,7 @@ SCRIPT_EXPORT(CScriptXmlInit, (), .def("InitVerList", &CScriptXmlInit::InitVerList) .def("InitMapInfo", &CScriptXmlInit::InitMapInfo) .def("InitTrackBar", &CScriptXmlInit::InitTrackBar) + .def("InitMultiTrackBar", &CScriptXmlInit::InitMultiTrackBar) .def("InitCDkey", &CScriptXmlInit::InitCDkey) .def("InitMPPlayerName", &CScriptXmlInit::InitMPPlayerName) .def("InitKeyBinding", &CScriptXmlInit::InitKeyBinding) diff --git a/src/xrGame/ScriptXMLInit.h b/src/xrGame/ScriptXMLInit.h index 1d338c8e19f..e1c75a0a5c7 100644 --- a/src/xrGame/ScriptXMLInit.h +++ b/src/xrGame/ScriptXMLInit.h @@ -29,6 +29,7 @@ class CUIScrollView; class CUIListWnd; class CUIListBox; class CUIProgressBar; +class CUIMultiTrackBar; class CScriptXmlInit { @@ -56,6 +57,7 @@ class CScriptXmlInit CUIVersionList* InitVerList(LPCSTR path, CUIWindow* parent); CUIMapInfo* InitMapInfo(LPCSTR path, CUIWindow* parent); CUITrackBar* InitTrackBar(LPCSTR path, CUIWindow* parent); + CUIMultiTrackBar* InitMultiTrackBar(LPCSTR path, CUIWindow* parent); CUIEditBox* InitCDkey(LPCSTR path, CUIWindow* parent); CUIEditBox* InitMPPlayerName(LPCSTR path, CUIWindow* parent); CUIMMShniaga* InitMMShniaga(LPCSTR path, CUIWindow* parent); diff --git a/src/xrUICore/Buttons/UIButton_script.cpp b/src/xrUICore/Buttons/UIButton_script.cpp index 34ff9cf3d3a..af4f37dccbc 100644 --- a/src/xrUICore/Buttons/UIButton_script.cpp +++ b/src/xrUICore/Buttons/UIButton_script.cpp @@ -5,6 +5,7 @@ #include "SpinBox/UISpinNum.h" #include "SpinBox/UISpinText.h" #include "TrackBar/UITrackBar.h" +#include "MultiTrackBar/UIMultiTrackBar.h" #include "xrScriptEngine/ScriptExporter.hpp" SCRIPT_EXPORT(CUIButton, (CUIStatic, CUIWindow), @@ -63,5 +64,10 @@ SCRIPT_EXPORT(CUIButton, (CUIStatic, CUIWindow), .def("GetFValue", &CUITrackBar::GetFValue) .def("SetOptIBounds", &CUITrackBar::SetOptIBounds) .def("SetOptFBounds", &CUITrackBar::SetOptFBounds) - .def("SetCurrentValue", &CUITrackBar::SetCurrentOptValue)]; + .def("SetCurrentValue", &CUITrackBar::SetCurrentOptValue), + + class_("CUIMultiTrackBar") + .def(constructor<>()) + .def("GetValue", &CUIMultiTrackBar::GetValue) + .def("SetCurrentValue", &CUIMultiTrackBar::SetCurrentOptValue)]; }); diff --git a/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp new file mode 100644 index 00000000000..9ba52462cc2 --- /dev/null +++ b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp @@ -0,0 +1,238 @@ +#include "pch.hpp" +#include "UIMultiTrackBar.h" +#include "Buttons/UI3tButton.h" +#include "XML/UITextureMaster.h" +#include "xrEngine/xr_input.h" + +#include "Common/object_broker.h" + +#include "TrackBar/UITrackBar.h" + +constexpr pcstr UI_SLIDER_BAR = "ui_inGame2_opt_slider_bar"; + +constexpr pcstr UI_SLIDER_ENABLED = "ui_slider_e"; +constexpr pcstr UI_SLIDER_DISABLED = "ui_slider_d"; + +constexpr pcstr SLIDER_BOX_TEXTURE = "ui_inGame2_opt_slider_box"; +constexpr pcstr SLIDER_BOX_TEXTURE_E = "ui_inGame2_opt_slider_box_e"; + +constexpr pcstr SLIDER_BUTTON_TEXTURE = "ui_slider_button"; +constexpr pcstr SLIDER_BUTTON_TEXTURE_E = "ui_slider_button_e"; + +bool sortByOrder(CUITrackBar* A, CUITrackBar* B) { return A->GetOrder() < B->GetOrder(); } +bool sortByDisplayOrder(CUITrackBar* A, CUITrackBar* B) { return A->GetDisplayOrder() < B->GetDisplayOrder(); } + +CUIMultiTrackBar::CUIMultiTrackBar() + : m_b_invert(false), m_b_is_float(true), m_b_bound_already_set(false) +{ + Fvector4 zero{ 0.f, 0.f, 0.f, 0.f }; + m_f_val = zero; + m_f_opt_backup_value = zero; + m_pSliders = xr_new>(); + + m_static = xr_new("Value as text"); + m_static->Enable(false); + AttachChild(m_static); + m_static->SetAutoDelete(true); + + m_b_mouse_capturer = false; + + m_default_display_modifier = 1.f; +} + +bool CUIMultiTrackBar::OnMouseAction(float x, float y, EUIMessages mouse_action) +{ + CUIWindow::OnMouseAction(x, y, mouse_action); + + bool didAction = false; + + for (int i = 0; i < childCount; i++) + { + auto slider = GetTrackBarAtIdx(i); + if (slider->CursorOverWindow()) + { + didAction = slider->OnMouseAction(x, y, mouse_action); + } + } + + if (didAction) + { + SetCurrentOptValue(); + } + + return didAction; +} + +void CUIMultiTrackBar::InitTrackBars(Fvector2 pos, Fvector2 size, xr_vector& trackBarData) +{ + auto dataType = GetSaveDataType(); + Fvector4 initialData = GetOptVector4Value(); + Fvector3 initialData2 = GetOptVector3Value(); + xr_vector mapping = { "x", "y", "z", "w" }; + + if (dataType == SDT_Fvector3) + initialData = { initialData2.x, initialData2.y, initialData2.z, 0.f}; + + m_f_opt_backup_value = initialData; + m_f_val = initialData; + + int titleRow = m_static->IsEnabled(); + int rowCount = childCount; + if (titleRow) + rowCount += 1; + + for (int i = 0; i < childCount; i++) + { + auto slider = xr_new(); + AttachChild(slider); + slider->SetAutoDelete(true); + m_pSliders->emplace_back(slider); + + ChildTrackBarData sliderData = trackBarData[i]; + + slider->SetType(true); // hardcoded to float for now + slider->SetInvert(!!sliderData.isInverted); + slider->SetStep(sliderData.step); + slider->SetOptFBounds(sliderData.min, sliderData.max); + slider->SetBoundReady(true); + slider->SetOrder(i); + slider->SetDisplayOrder(sliderData.displayOrder); + slider->SetDisplayLabel(sliderData.displayLabel); + slider->m_f_opt_backup_value = sliderData.defaultValue; + + auto value = m_f_val[i]; + slider->SetFValue(m_f_val[i]); + slider->UpdatePos(); + slider->OnChangedOptValue(); + + string128 childEntry; + xr_sprintf(childEntry, "%s.%s", m_entry.c_str(), mapping[i]); + slider->m_entry = childEntry; + + float childDisplayModifier = sliderData.displayScale; + slider->SetDisplayModifier(childDisplayModifier); + } + + std::sort(m_pSliders->begin(), m_pSliders->end(), sortByDisplayOrder); + + for (int i = 0; i < childCount; i++) + { + auto slider = GetTrackBarAtIdx(i); + Fvector2 newPos; + newPos.set(pos.x, (i + titleRow) * GetHeight()); + slider->InitTrackBar(newPos, { size.x / 2.f, size.y }); + } + + +#ifdef DEBUG + Msg("UI DEBUG - final size of MultiTrackBar %s = %3.3f", m_entry.c_str(), m_wndSize.y * rowCount); +#endif + + m_wndPos = pos; + m_wndSize = { m_wndSize.x, m_wndSize.y * rowCount }; + InitIB(m_wndPos, m_wndSize); +} + +void CUIMultiTrackBar::Draw() +{ + CUI_IB_FrameLineWnd::Draw(); + for (auto m_pSlider : *m_pSliders) + { + m_pSlider->Draw(); + m_pSlider->m_static->Draw(); + } + + m_static->Draw(); +} + +void CUIMultiTrackBar::Update() +{ + CUIWindow::Update(); + + if (m_b_mouse_capturer) + { + if (!pInput->iGetAsyncKeyState(MOUSE_1)) + m_b_mouse_capturer = false; + } +} + +void CUIMultiTrackBar::SetCurrentOptValue() +{ + std::sort(m_pSliders->begin(), m_pSliders->end(), sortByOrder); + + for (int i = 0; i < childCount; i++) + { + auto slider = GetTrackBarAtIdx(i); + m_f_val[i] = slider->GetFValue(); + } + + std::sort(m_pSliders->begin(), m_pSliders->end(), sortByDisplayOrder); +} + +void CUIMultiTrackBar::SaveOptValue() +{ + std::sort(m_pSliders->begin(), m_pSliders->end(), sortByOrder); + + auto dataType = GetSaveDataType(); + switch (dataType) + { + case SDT_Fvector3: + SaveOptVector3Value(Fvector3{ m_f_val.x, m_f_val.y, m_f_val.z }); + break; + case SDT_Fvector4: + SaveOptVector4Value(m_f_val); + break; + } + + std::sort(m_pSliders->begin(), m_pSliders->end(), sortByDisplayOrder); +} + +bool CUIMultiTrackBar::IsChangedOptValue() const +{ + bool isChanged = !fsimilar(m_f_opt_backup_value.x, m_f_val.x) || !fsimilar(m_f_opt_backup_value.y, m_f_val.y) || !fsimilar(m_f_opt_backup_value.z, m_f_val.z); + return isChanged; +} + +void CUIMultiTrackBar::SaveBackUpOptValue() +{ + m_f_opt_backup_value = m_f_val; +} + +void CUIMultiTrackBar::UndoOptValue() +{ + m_f_val = m_f_opt_backup_value; + CUIOptionsItem::UndoOptValue(); +} + +void CUIMultiTrackBar::Enable(bool status) +{ + m_bIsEnabled = status; + SetCurrentState(m_bIsEnabled ? S_Enabled : S_Disabled); + + for (auto m_pSlider : *m_pSliders) + { + m_pSlider->Enable(m_bIsEnabled); + } +} + +void CUIMultiTrackBar::OnMessage(LPCSTR message) +{ + if (0 == xr_strcmp(message, "set_default_value")) + { + for (int i = 0; i < childCount; i++) + { + auto slider = GetTrackBarAtIdx(i); + slider->SetFValue(slider->m_f_opt_backup_value); + slider->UpdatePos(); + } + } +} + +void CUIMultiTrackBar::UpdatePos() +{ + for (int i = 0; i < childCount; i++) + { + auto slider = GetTrackBarAtIdx(i); + slider->UpdatePos(); + } +} diff --git a/src/xrUICore/MultiTrackBar/UIMultiTrackBar.h b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.h new file mode 100644 index 00000000000..342cf26dff5 --- /dev/null +++ b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.h @@ -0,0 +1,103 @@ +#pragma once +#include "xrUICore/Options/UIOptionsItem.h" +#include "xrUICore/InteractiveBackground/UI_IB_Static.h" + +class CUI3tButton; + +class CUITrackBar; + +class XRUICORE_API CUIMultiTrackBar final : public CUI_IB_FrameLineWnd, public CUIOptionsItem +{ +public: + enum SaveDataTypes + { + SDT_Fvector3, + SDT_Fvector4, + SDT_INVALID_DATA_TYPE + }; + + struct ChildTrackBarData { + int isInverted; + float min; + float max; + float step; + int displayOrder; + pcstr displayLabel; + float displayScale; + float defaultValue; + }; + + CUIMultiTrackBar(); + // CUIOptionsItem + virtual void SetCurrentOptValue(); // opt->current + virtual void SaveBackUpOptValue(); // current->backup + virtual void SaveOptValue(); // current->opt + virtual void UndoOptValue(); // backup->current + virtual bool IsChangedOptValue() const; // backup!=current + + virtual void Draw(); + virtual void Update(); + virtual bool OnMouseAction(float x, float y, EUIMessages mouse_action); + virtual void OnMessage(LPCSTR message); + // CUIWindow + void InitTrackBars(Fvector2 pos, Fvector2 size, xr_vector& trackBarData); + virtual void Enable(bool status); + + void SetDefaultInvert(bool v) { m_b_invert = v; } + bool GetDefaultInvert() const { return m_b_invert; }; + + void SetDefaultMin(float v) { m_default_min = v; } + float GetDefaultMin() const { return m_default_min; }; + void SetDefaultMax(float v) { m_default_max = v; } + float GetDefaultMax() const { return m_default_max; }; + + void SetDefaultStep(float step) { m_default_step = step; } + float GetDefaultStep() { return m_default_step; } + + void SetType(bool b_float) { m_b_is_float = b_float; }; + void SetBoundReady(bool b_ready) { m_b_bound_already_set = b_ready; }; + + Fvector4 GetValue() { return m_f_val; } + void SetChildCount(int count) { childCount = count; } + + SaveDataTypes GetSaveDataType() { return saveDataType; } + void SetSaveDataType(SaveDataTypes type) + { + saveDataType = type; + Msg("Yohji debug - set save data type %d", saveDataType); + } + + pcstr GetDebugType() override { return "CUIMultiTrackBar"; } + + CUIStatic* m_static; + shared_str m_static_format; + + CUITrackBar* GetTrackBarAtIdx(int idx) + { + return m_pSliders->at(idx); + } + + void UpdatePos(); + + void SetDisplayModifier(float v) { m_default_display_modifier = v; } + float GetDisplayModifier() { return m_default_display_modifier; } + + xr_vector childTrackBarData; + +protected: + xr_vector* m_pSliders{}; + bool m_b_invert; + bool m_b_is_float; + bool m_b_mouse_capturer; + bool m_b_bound_already_set; + + int childCount; + SaveDataTypes saveDataType{ SDT_INVALID_DATA_TYPE }; + + float m_default_step; + float m_default_min; + float m_default_max; + float m_default_display_modifier{ 1.f }; + Fvector4 m_f_val; + Fvector4 m_f_opt_backup_value; +}; diff --git a/src/xrUICore/Options/UIOptionsItem.cpp b/src/xrUICore/Options/UIOptionsItem.cpp index 8782cac0072..c7b5c62de10 100644 --- a/src/xrUICore/Options/UIOptionsItem.cpp +++ b/src/xrUICore/Options/UIOptionsItem.cpp @@ -91,7 +91,7 @@ Fvector3 CUIOptionsItem::GetOptVector3Value() const void CUIOptionsItem::SaveOptVector3Value(Fvector3 val) const { string512 command; - xr_sprintf(command, "%s %f %f %f", m_entry.c_str(), val.x, val.y, val.z); + xr_sprintf(command, "%s %f, %f, %f", m_entry.c_str(), val.x, val.y, val.z); Console->Execute(command); } @@ -103,7 +103,7 @@ Fvector4 CUIOptionsItem::GetOptVector4Value() const void CUIOptionsItem::SaveOptVector4Value(Fvector4 val) const { string512 command; - xr_sprintf(command, "%s %f %f %f", m_entry.c_str(), val.x, val.y, val.z, val.w); + xr_sprintf(command, "%s %f, %f, %f, %f", m_entry.c_str(), val.x, val.y, val.z, val.w); Console->Execute(command); } diff --git a/src/xrUICore/TrackBar/UITrackBar.cpp b/src/xrUICore/TrackBar/UITrackBar.cpp index aaee035f85d..53751219da4 100644 --- a/src/xrUICore/TrackBar/UITrackBar.cpp +++ b/src/xrUICore/TrackBar/UITrackBar.cpp @@ -34,6 +34,10 @@ CUITrackBar::CUITrackBar() m_label->SetAutoDelete(true); m_b_mouse_capturer = false; + + m_display_modifier = 1.f; + m_display_order = 1; + m_display_label = nullptr; } bool CUITrackBar::OnMouseAction(float x, float y, EUIMessages mouse_action) diff --git a/src/xrUICore/TrackBar/UITrackBar.h b/src/xrUICore/TrackBar/UITrackBar.h index a7e2ac70daf..78e9288c8ec 100644 --- a/src/xrUICore/TrackBar/UITrackBar.h +++ b/src/xrUICore/TrackBar/UITrackBar.h @@ -31,6 +31,16 @@ class XRUICORE_API CUITrackBar final : public CUI_IB_FrameLineWnd, public CUIOpt void SetCheck(bool b); int GetIValue() { return m_i_val; } float GetFValue() { return m_f_val; } + void SetDisplayModifier(float v) { m_display_modifier = v; } + float GetDisplayModifier() { return m_display_modifier ; } + void SetDisplayOrder(int v) { m_display_order = v; } + int GetDisplayOrder() { return m_display_order; } + void SetOrder(int v) { m_order = v; } + int GetOrder() { return m_order; } + void SetDisplayLabel(pcstr s) { m_display_label = s; } + pcstr GetDisplayLabel() { return m_display_label; } + + void SetFValue(float value) { m_f_val = value; } void SetOptIBounds(int imin, int imax); void SetOptFBounds(float fmin, float fmax); @@ -39,7 +49,6 @@ class XRUICORE_API CUITrackBar final : public CUI_IB_FrameLineWnd, public CUIOpt CUIStatic* m_static; // value CUIStatic* m_label; // label shared_str m_static_format; - protected: void UpdatePos(); void UpdatePosRelativeToMouse(); @@ -49,6 +58,10 @@ class XRUICORE_API CUITrackBar final : public CUI_IB_FrameLineWnd, public CUIOpt bool m_b_is_float; bool m_b_mouse_capturer; bool m_b_bound_already_set; + float m_display_modifier; + int m_display_order; + int m_order; + pcstr m_display_label; union { @@ -69,4 +82,6 @@ class XRUICORE_API CUITrackBar final : public CUI_IB_FrameLineWnd, public CUIOpt int m_i_opt_backup_value; }; }; + + friend class CUIMultiTrackBar; }; diff --git a/src/xrUICore/XML/UIXmlInitBase.cpp b/src/xrUICore/XML/UIXmlInitBase.cpp index 371d56845fe..b8158b8ecf9 100644 --- a/src/xrUICore/XML/UIXmlInitBase.cpp +++ b/src/xrUICore/XML/UIXmlInitBase.cpp @@ -13,6 +13,7 @@ #include "ListBox/UIListBox.h" #include "ComboBox/UIComboBox.h" #include "TrackBar/UITrackBar.h" +#include "MultiTrackBar/UIMultiTrackBar.h" #include "UITextureMaster.h" #include "Lines/UILines.h" @@ -1247,6 +1248,8 @@ bool CUIXmlInitBase::InitTrackBar(CUIXml& xml_doc, pcstr path, int index, CUITra pWnd->SetInvert(!!invert); const float step = xml_doc.ReadAttribFlt(path, index, "step", 0.1f); pWnd->SetStep(step); + const float displayModifier = xml_doc.ReadAttribFlt(path, index, "display_scale", 1.f); + pWnd->SetDisplayModifier(displayModifier); if (!is_integer) { @@ -1283,6 +1286,119 @@ bool CUIXmlInitBase::InitTrackBar(CUIXml& xml_doc, pcstr path, int index, CUITra return true; } +bool CUIXmlInitBase::InitMultiTrackBar(CUIXml& xml_doc, pcstr path, int index, CUIMultiTrackBar* pWnd, bool fatal /*= true*/) +{ + if (!InitWindow(xml_doc, path, 0, pWnd, fatal)) + return false; + + const int def_is_integer = xml_doc.ReadAttribInt(path, index, "is_integer", 0); + pWnd->SetType(!def_is_integer); + + const int def_invert = xml_doc.ReadAttribInt(path, index, "invert", 0); + pWnd->SetDefaultInvert(!!def_invert); + + const float def_step = xml_doc.ReadAttribFlt(path, index, "step", 0.1f); + pWnd->SetDefaultStep(def_step); + + const float def_min = xml_doc.ReadAttribFlt(path, index, "min", 0.1f); + pWnd->SetDefaultMin(def_min); + + const float def_max = xml_doc.ReadAttribFlt(path, index, "max", 0.1f); + pWnd->SetDefaultMax(def_max); + + const int childCount = xml_doc.ReadAttribInt(path, index, "child_count", 0); + pWnd->SetChildCount(childCount); + + const float defDisplayModifier = xml_doc.ReadAttribFlt(path, index, "display_scale", 1.f); + pWnd->SetDisplayModifier(defDisplayModifier); + + const int saveDataType = xml_doc.ReadAttribInt(path, index, "save_data_type", childCount); + if (saveDataType == 3) + { + pWnd->SetSaveDataType(CUIMultiTrackBar::SDT_Fvector3); + } + else if (saveDataType == 4) + { + pWnd->SetSaveDataType(CUIMultiTrackBar::SDT_Fvector4); + } + else + { + pWnd->SetSaveDataType(CUIMultiTrackBar::SDT_INVALID_DATA_TYPE); + } + + cpcstr entry = xml_doc.ReadAttrib(path, index, "entry"); + cpcstr group = xml_doc.ReadAttrib(path, index, "group"); + pWnd->AssignProps(entry, group); + + xr_vector mapping = { "x", "y", "z", "w" }; + xr_vector trackBarData; + trackBarData.reserve(childCount); + for (int i = 0; i < childCount; i++) + { + string128 min, max, step, isInt, invert, order, label, displayScale, defaultValue; + xr_sprintf(min, "%s_%s", mapping[i], "min"); + xr_sprintf(max, "%s_%s", mapping[i], "max"); + xr_sprintf(step, "%s_%s", mapping[i], "step"); + xr_sprintf(invert, "%s_%s", mapping[i], "invert"); + xr_sprintf(order, "%s_%s", mapping[i], "order"); + xr_sprintf(label, "%s_%s", mapping[i], "label"); + xr_sprintf(displayScale, "%s_%s", mapping[i], "display_scale"); + xr_sprintf(defaultValue, "%s_%s", mapping[i], "default"); + + const int is_invert = xml_doc.ReadAttribInt(path, index, invert, def_invert); + const float fmin = xml_doc.ReadAttribFlt(path, index, min, def_min); + const float fmax = xml_doc.ReadAttribFlt(path, index, max, def_max); + const float fstep = xml_doc.ReadAttribFlt(path, index, step, def_step); + const int displayOrder = xml_doc.ReadAttribInt(path, index, order, i); + const pcstr displayLabel = xml_doc.ReadAttrib(path, index, label, nullptr); + const float fDisplayScale = xml_doc.ReadAttribFlt(path, index, displayScale, defDisplayModifier); + const float fDefaultValue = xml_doc.ReadAttribFlt(path, index, defaultValue, fmin); + + trackBarData[i] = { is_invert, fmin, fmax, fstep, displayOrder, displayLabel, fDisplayScale, fDefaultValue }; + } + + string512 buf; + xr_sprintf(buf, "%s%s", path, ":title"); + if (xml_doc.NavigateToNode(buf, index)) + { + InitStatic(xml_doc, buf, index, pWnd->m_static); + pWnd->m_static->Enable(true); + } + + pWnd->InitTrackBars(pWnd->GetWndPos(), pWnd->GetWndSize(), trackBarData); + InitOptionsItem(xml_doc, path, 0, pWnd); + + for (int i = 0; i < childCount; i++) + { + auto trackBar = pWnd->GetTrackBarAtIdx(i); + xr_sprintf(buf, "%s%s", path, ":output_wnd"); + if (xml_doc.NavigateToNode(buf, index)) + { + const pcstr default_format = xml_doc.ReadAttrib(buf, index, "format", nullptr); + string128 format; + xr_sprintf(format, "%s_%s", mapping[i], "format"); + + InitStatic(xml_doc, buf, index, trackBar->m_static); + trackBar->m_static_format = xml_doc.ReadAttrib(path, index, format, default_format); + trackBar->m_static->Enable(true); + pWnd->UpdatePos(); + } + xr_sprintf(buf, "%s%s%s", path, ":cap_", mapping[i]); + if (xml_doc.NavigateToNode(buf, index)) + { + InitStatic(xml_doc, buf, index, trackBar->m_label); + + if (trackBar->GetDisplayLabel()) + trackBar->m_label->SetText(StringTable().translate(trackBar->GetDisplayLabel()).c_str()); + + trackBar->m_label->Enable(true); + pWnd->UpdatePos(); + } + } + + return true; +} + bool CUIXmlInitBase::InitComboBox(CUIXml& xml_doc, pcstr path, int index, CUIComboBox* pWnd) { u32 color; diff --git a/src/xrUICore/XML/UIXmlInitBase.h b/src/xrUICore/XML/UIXmlInitBase.h index ffb1bd062f4..f318619a1b6 100644 --- a/src/xrUICore/XML/UIXmlInitBase.h +++ b/src/xrUICore/XML/UIXmlInitBase.h @@ -30,6 +30,7 @@ class CUIListBox; class CUIDragDropListEx; class CUIComboBox; class CUITrackBar; +class CUIMultiTrackBar; class CUILines; class CGameFont; @@ -66,6 +67,7 @@ class XRUICORE_API CUIXmlInitBase static bool InitListBox(CUIXml& xml_doc, pcstr path, int index, CUIListBox* pWnd, bool fatal = true); static bool InitComboBox(CUIXml& xml_doc, pcstr path, int index, CUIComboBox* pWnd); static bool InitTrackBar(CUIXml& xml_doc, pcstr path, int index, CUITrackBar* pWnd, bool fatal = true); + static bool InitMultiTrackBar(CUIXml& xml_doc, pcstr path, int index, CUIMultiTrackBar* pWnd, bool fatal = true); static Frect GetFRect(const CUIXml& xml_doc, pcstr path, int index); static u32 GetColor(const CUIXml& xml_doc, pcstr path, int index, u32 def_clr); diff --git a/src/xrUICore/xrUICore.vcxproj b/src/xrUICore/xrUICore.vcxproj index 94fc70434fe..16e90066ab1 100644 --- a/src/xrUICore/xrUICore.vcxproj +++ b/src/xrUICore/xrUICore.vcxproj @@ -85,6 +85,7 @@ + @@ -153,6 +154,7 @@ + diff --git a/src/xrUICore/xrUICore.vcxproj.filters b/src/xrUICore/xrUICore.vcxproj.filters index 9cfc696907c..998cf36e51c 100644 --- a/src/xrUICore/xrUICore.vcxproj.filters +++ b/src/xrUICore/xrUICore.vcxproj.filters @@ -76,6 +76,9 @@ {5170a7a3-bd65-4f09-a9e4-74a6ec9e587c} + + {3aa5ca40-4798-4a76-8ecc-a22f3c70660b} + @@ -276,6 +279,9 @@ + + MultiTrackBar + @@ -458,6 +464,9 @@ + + MultiTrackBar + From 6ea2174930ae0fdf5e0958d9e328dd5e54c895b5 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Fri, 17 May 2024 07:44:38 -0700 Subject: [PATCH 04/11] * FIX: [xrUICore] detect changes with w value for multitrackbar fvector4 --- src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp index 9ba52462cc2..a4b15f1da68 100644 --- a/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp +++ b/src/xrUICore/MultiTrackBar/UIMultiTrackBar.cpp @@ -189,7 +189,7 @@ void CUIMultiTrackBar::SaveOptValue() bool CUIMultiTrackBar::IsChangedOptValue() const { - bool isChanged = !fsimilar(m_f_opt_backup_value.x, m_f_val.x) || !fsimilar(m_f_opt_backup_value.y, m_f_val.y) || !fsimilar(m_f_opt_backup_value.z, m_f_val.z); + bool isChanged = !fsimilar(m_f_opt_backup_value.x, m_f_val.x) || !fsimilar(m_f_opt_backup_value.y, m_f_val.y) || !fsimilar(m_f_opt_backup_value.z, m_f_val.z) || !fsimilar(m_f_opt_backup_value.w, m_f_val.w); return isChanged; } From 0a8268cce5dbff4ff5c4fbabe9da36965070794e Mon Sep 17 00:00:00 2001 From: yohjimane Date: Fri, 17 May 2024 08:02:08 -0700 Subject: [PATCH 05/11] * UPD: [gamedata] Add russian translations for SSS options --- .../configs/text/rus/ssfx_ui_florafixes.xml | 70 +++++++++ .../text/rus/ssfx_ui_hud_raindrops.xml | 91 ++++++++++++ .../rus/ssfx_ui_interactive_grass_mcm.xml | 136 +++++++++++++++++ .../configs/text/rus/ssfx_ui_rain.xml | 99 +++++++++++++ .../text/rus/ssfx_ui_rain_footsteps.xml | 75 ++++++++++ .../text/rus/ssfx_ui_shadow_cascades_mcm.xml | 86 +++++++++++ .../configs/text/rus/ssfx_ui_strings_mcm.xml | 75 ++++++++++ .../configs/text/rus/ssfx_ui_wet_gloss.xml | 65 +++++++++ .../configs/text/rus/ssfx_ui_wet_surfaces.xml | 138 ++++++++++++++++++ .../configs/text/rus/ssfx_ui_wpn_dof_mcm.xml | 75 ++++++++++ 10 files changed, 910 insertions(+) create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_florafixes.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_hud_raindrops.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_interactive_grass_mcm.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_rain.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_rain_footsteps.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_shadow_cascades_mcm.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_strings_mcm.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_wet_gloss.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml create mode 100644 res/gamedata/configs/text/rus/ssfx_ui_wpn_dof_mcm.xml diff --git a/res/gamedata/configs/text/rus/ssfx_ui_florafixes.xml b/res/gamedata/configs/text/rus/ssfx_ui_florafixes.xml new file mode 100644 index 00000000000..e845219e7e8 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_florafixes.xml @@ -0,0 +1,70 @@ + + + + + + + + Исправления Флоры + + + + + Исправления и улучшения флоры - настройки + + + + + Подповерхностное рассеивание + + + + Интенсивность подповерхностного рассеивания + + + + Цветность подповерхностного рассеивания + + + + Уровень влияния цвета солнца на цвет рассеивания. 1.0 = 100% цвета солнца + + + + Отражение света на сухой траве + + + + Настройка отражения света для сухой травы. Стоит аккуратнее подходить к настройке и изменять небольшими шагами + + + + Отражение света на мокрой траве + + + + Настройка отражения света для мокрой травы. Стоит аккуратнее подходить к настройке и изменять небольшими шагами + + + + Отражение света на сухих кустах и деревьях + + + + Настройка отражения света на сухих листьях и кустах. Стоит аккуратнее подходить к настройке и изменять небольшими шагами + + + + Отражение света на мокрых кустах и деревьях + + + + Настройка отражения света на мокрых кустах и деревьях. Стоит аккуратнее подходить к настройке и изменять небольшими шагами + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_hud_raindrops.xml b/res/gamedata/configs/text/rus/ssfx_ui_hud_raindrops.xml new file mode 100644 index 00000000000..91d39dd9094 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_hud_raindrops.xml @@ -0,0 +1,91 @@ + + + + + + + + Настройки капель дождя на руках/оружии + + + + + Частота + + + + Частота и размер капель + + + + Интенсивность отражений + + + + Интенсивность отражений капель дождя + + + + Интенсивность преломления + + + + Интенсивность преломления капель дождя + + + + + Скорость анимации + + + + Скорость анимации капель + + + + Скорость появления + + + + Настройка скорости появления капель на руках/оружии + + + + Скорость высыхания + + + + Настройка скорости пропадания капель + + + + Размер + + + + Величина капли + + + + + Блеск + + + + Интенсивность блеска капель + + + + Дополнительный блеск + + + + Настройка дополнительного блеска рук/оружия во время дождя + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_interactive_grass_mcm.xml b/res/gamedata/configs/text/rus/ssfx_ui_interactive_grass_mcm.xml new file mode 100644 index 00000000000..f0a887da7b2 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_interactive_grass_mcm.xml @@ -0,0 +1,136 @@ + + + + + + + + + Коллизия травы + + + + + Настройки коллизии травы + + + + Включено + + + + [ТРЕБУЕТСЯ ПЕРЕЗАПУСК] Включение/выключение коллизии. + + + + Максимальное кол-во срабатываний + + + + [ТРЕБУЕТСЯ ПЕРЕЗАПУСК] Максимальное кол-во единовременных срабатываний. Выше значение – больше нагрузка на систему. + + + + Максимальная дистанция + + + + Максимальное расстояние срабатывания. + + + + Распространяется на игрока + + + + Включить/Выключить реакцию травы на игрока. + + + + Ударная Волна от мутантов. + + + + Включить/Выключить реакцию травы на топот псевдогиганта или способности бюрера. + + + + Радиус изгиба + + + + Настройка радиуса изгиба травы, когда по ней ходит игрок. + + + + Горизонтальная интенсивность + + + + Настройка горизонтальной деформации тра?вы при столкновении с игроком. + + + + Вертикальная интенсивность. + + + + Настройка вертикальной деформации травы при столкновении с игроком. + + + + Интенсивность реакции на взрывы + + + + Настройка общей интенсивности реакции травы на взрывы/волны от ударов мутантов. + + + + Скорость распространения + + + + Настройка скорости распространения ударной волны по траве. + + + + Реакция на выстрел + + + + Интенсивность реакции травы на выстрелы. + + + + Расстояние от выстрела + + + + Расстояние реагирования травы на выстрел. + + + + Интерактивные аномалии + + + + Включает/Выключает взаимодействие травы с аномалиями. + + + + Максимальная дистанция срабатывания + + + + Дальность срабатывания влияния аномалий на траву. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_rain.xml b/res/gamedata/configs/text/rus/ssfx_ui_rain.xml new file mode 100644 index 00000000000..58622a5cd6f --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_rain.xml @@ -0,0 +1,99 @@ + + + + + + + + Дождь - Настройки + + + + + Качество Рендеринга + + + + НИЗКОЕ : Стандартный рендеринг - СРЕДНЕЕ : Стандартный рендеринг + правки некорректной обработки - ВЫСОКОЕ : Полноценная обработка с дополнительной обработкой отражений + + + + Скорость + + + + Скорость падения капель. + + + + Длина + + + + Длина капли дождя + + + + Ширина + + + + Ширина капли дождя + + + + + Прозрачность + + + + Общая прозрачность капель + + + + Яркость + + + + Насколько ярким будет базовый цвет капли + + + + Преломление + + + + Насколько интенсивным будет эффект преломления + + + + Отражение + + + + Прозрачность эффекта отражения + + + + + Прозрачность брызг + + + + Насколько прозрачными будут брызги от капель дождя + + + + Преломление брызг + + + + Интенсивность преломления брызгов от капель + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_rain_footsteps.xml b/res/gamedata/configs/text/rus/ssfx_ui_rain_footsteps.xml new file mode 100644 index 00000000000..56b706dbeb1 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_rain_footsteps.xml @@ -0,0 +1,75 @@ + + + + + + + + Шаги по лужам - Настройки + + + + + Общая громкость + + + + Общая громкость шагов + + + + Вариация громкости + + + + Добавляет вариативность громкости шагов + + + + + Множитель громкости без дождя + + + + Множитель громкости, когда дождь не идет, но всё ещё мокро + + + + Множитель громкости при ходьбе + + + + Множитель громкости во время ходьбы + + + + Множитель громкости при беге + + + + Множитель громкости во время бега + + + + + Громкость прыжка + + + + Сила звукового эффекта при прыжке + + + + Громкость приземления + + + + Сила звукового эффекта приземления + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_shadow_cascades_mcm.xml b/res/gamedata/configs/text/rus/ssfx_ui_shadow_cascades_mcm.xml new file mode 100644 index 00000000000..3b3ecaaa498 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_shadow_cascades_mcm.xml @@ -0,0 +1,86 @@ + + + + + + + + + Каскад Теней + + + + + Настройки Каскада теней + + + + Размер ближних каскадов + + + + Меньший Размер - Лучше качество теней от солнца. + + + + Размер средних каскадов + + + + Меньший размер - Лучше качество теней от Солнца + + + + Размер дальних каскадов + + + + Настройка для финального рендеринга Теней. Чем выше показатель - тем больше нагрузка на систему + + + + Качество теней от травы + + + + [ Низкие ] Тени от травы будут только на ближней дистанции. Стандартный рендеринг Anomaly. [ Средние ] Тени будут на ближней и средней дистанциях. [ Высокие ] Тени будут на всех каскадах и при использовании объемных солнечных лучей. [ Ультра ] Тени от травы будут при любом типе освещения. + + + + Низкие ( стандарт ANOMALY ) + + + + Средние + + + + Высокие + + + + Ультра ( Большая нагрузка на систему ) + + + + Дистанция отрисовки теней от травы ( тени от Солнца ) + + + + Этот показатель меняет дистанцию отрисовки теней от травы от солнечного света. Имеет процентное отношение с дистанцией прорисовки травы. Меньше значение - меньше нагрузка на систему. + + + + Дистанция прорисовки теней от травы + + + + [ Только для «Ультра» ] Этот показатель влияет на отрисовку теней при непрямом освещении. Меньше значение - меньше нагрузка на систему. При низких значениях тени могут не отрисовываться. + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_strings_mcm.xml b/res/gamedata/configs/text/rus/ssfx_ui_strings_mcm.xml new file mode 100644 index 00000000000..79964e05471 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_strings_mcm.xml @@ -0,0 +1,75 @@ + + + + + + + SSS Настройки + + + + + Основные + + + + + Улучшение Дождя + + + + Дождь + + + + Шаги + + + + Капли дождя + + + + Намокание + + + + Блеск + + + + Намокание Поверхностей + + + + + Основные настройки + + + + Поддеркжа Шейдерных 2D прицелов + + + + + Модуль не установлен + + + + Низкие + + + + Средние + + + + Высокие + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_wet_gloss.xml b/res/gamedata/configs/text/rus/ssfx_ui_wet_gloss.xml new file mode 100644 index 00000000000..2d40c3d87a7 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_wet_gloss.xml @@ -0,0 +1,65 @@ + + + + + + + + Блеск - настройки + + + + + Минимальный уровень + + + + Основной показатель блеска. Если "Автонастройка блеска" отключена - этот показатель будет статичным + + + + Максимальный уровень + + + + Когда "Автонастройка блеска" включена, - этот показатель будет применен при максимальном уровне намокания + + + + Автонастройка Блеска + + + + Автоматическая подстройка блеска. Варьируется между минимальным и максимальным уровнями, в зависимости от степени намокания + + + + Уровень влияния автонастройки блеска + + + + Влияние на максимальный уровень блеска при включенной автонастройке. 0 = 0%, 1 = 100% + + + + Интенсивность отражения света + + + + Настройка интенсивности светоотражения + + + + Цветность светоотражения + + + + Уровень насыщенности светоотражения + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml b/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml new file mode 100644 index 00000000000..5dd714e8f38 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml @@ -0,0 +1,138 @@ + + + + + + + + Wet Surfaces - Settings + + + + + Скорость намокания + + + + Настройка скорости проявления эффекта намокания и появления луж + + + + Скорость высыхания + + + + Настройка скорости высыхания. Чем выше показатель - тем быстрее пропадет эффект намокания и лужи + + + + Рябь от дождя + + + + Размер ряби от капель дождя + + + + Скорость ряби + + + + Настройка скорости анимации ряби на воде/лужах. Прямая зависимость от силы дождя + + + + Минимальная скорость анимации + + + + Настройка минимального показателя скорости анимации ряби от капель + + + + Интенсивность ряби + + + + Настройка интенсивности отображения ряби от капель дождя + + + + Размер капли дождя + + + + Чем выше показатель - тем больше размер капли + + + + Скорость дождя + + + + Настройка скорости падения капли дождя. Имеет зависимость от базового показателя в конфиге погоды + + + + Минимальная скорость падения капель + + + + Ниже этого показателя скорость опускаться не будет + + + + Интенсивность дождя + + + + Общая интенсивность эффекта дождя + + + + Качество эффекта дождя + + + + Общее разрешение падающих капель и брызг при попадании на землю. Чем выше показатель - тем выразительнее дождь, но больше нагрузка на систему + + + + Дистанция прорисовки дождя + + + + Насколько далеко дождь будет рендериться. Выше показатель - больше нагрузка на систему + + + + + 64 + + + + 128 ( рекомендовано ) + + + + 256 + + + + 512 + + + + 1024 + + + + 2048 + + + \ No newline at end of file diff --git a/res/gamedata/configs/text/rus/ssfx_ui_wpn_dof_mcm.xml b/res/gamedata/configs/text/rus/ssfx_ui_wpn_dof_mcm.xml new file mode 100644 index 00000000000..1c2cf088291 --- /dev/null +++ b/res/gamedata/configs/text/rus/ssfx_ui_wpn_dof_mcm.xml @@ -0,0 +1,75 @@ + + + + + + + + Глубина резкости оружия + + + + + Настройки глубины резкости оружия + + + + Точка начала размытия [прицеливание] + + + + Величина размытия [прицеливание] + + + + Интенсивность размытия [прицеливание] (0-отключено) + + + + Периферйное размытие [прицеливание] (0-отключено) + + + + + Точка начала размытия + + + + Величина размытия + + + + Интенсивность размытия (0-отключено) + + + + Периферийное размытие (0-отключено) + + + + + Глубина резкости при перезарядке + + + + Глубина резкости при использовании КПК + + + + Глубина резкости при открытии инвентаря + + + + Глубина резкости при анимации использования предметов (FDDA) + + + + Глубина резкости при свежевании + + + \ No newline at end of file From a0f74444206737bb8f6e0668d868b581ecbc0961 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Fri, 17 May 2024 08:09:53 -0700 Subject: [PATCH 06/11] FIX: [gamedata] missing russian translation for Wet Surfaces title --- res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml b/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml index 5dd714e8f38..b02e2e73acf 100644 --- a/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml +++ b/res/gamedata/configs/text/rus/ssfx_ui_wet_surfaces.xml @@ -10,7 +10,7 @@ - Wet Surfaces - Settings + Мокрые Поверхности - Настройки From a4e9cdd9473d98816097fcea5497e18e064e59bd Mon Sep 17 00:00:00 2001 From: yohjimane Date: Fri, 17 May 2024 08:13:38 -0700 Subject: [PATCH 07/11] * UPD: [gamedata] Add eng+rus translations for new shader options page, hud_fov option --- res/gamedata/configs/text/eng/openxray.xml | 28 ---------------------- res/gamedata/configs/text/rus/openxray.xml | 9 +++++++ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/res/gamedata/configs/text/eng/openxray.xml b/res/gamedata/configs/text/eng/openxray.xml index 7019a5974d0..fadc652c997 100644 --- a/res/gamedata/configs/text/eng/openxray.xml +++ b/res/gamedata/configs/text/eng/openxray.xml @@ -165,35 +165,7 @@ Back to Basic Settings - Default - - - - Shadow Cascades Settings - - - Near cascades size - - - Mid cascades size - - - Far cascades size - - - - Grass shadows Settings - - - Grass shadows quality - - - Grass shadows distance ( Sun ) - - - Grass shadows max distance - diff --git a/res/gamedata/configs/text/rus/openxray.xml b/res/gamedata/configs/text/rus/openxray.xml index 98fff6386d2..3e82430a08c 100644 --- a/res/gamedata/configs/text/rus/openxray.xml +++ b/res/gamedata/configs/text/rus/openxray.xml @@ -165,4 +165,13 @@ Испанский (Spanish) + + Настройки Шейдеров + + + Базовые + + + По умолчанию + From a1aa1832953ed3ac271f36aa68a8637129a750c9 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Fri, 17 May 2024 15:18:34 -0700 Subject: [PATCH 08/11] * UPD: [gamedata] Add default aspect ratio shader options page, fix some layout issues --- res/gamedata/configs/ui/ui_mm_opt.xml | 10 + res/gamedata/configs/ui/ui_mm_opt_16.xml | 2 +- .../configs/ui/ui_mm_shader_options.xml | 506 ++++++++++++++++++ .../configs/ui/ui_mm_shader_options_16.xml | 46 +- 4 files changed, 519 insertions(+), 45 deletions(-) create mode 100644 res/gamedata/configs/ui/ui_mm_shader_options.xml diff --git a/res/gamedata/configs/ui/ui_mm_opt.xml b/res/gamedata/configs/ui/ui_mm_opt.xml index ed8b11ab049..3174b441a91 100644 --- a/res/gamedata/configs/ui/ui_mm_opt.xml +++ b/res/gamedata/configs/ui/ui_mm_opt.xml @@ -172,6 +172,14 @@ + + + ui_mm_shader_options + ui_inGame2_button + + + + @@ -532,6 +540,8 @@ + #include "ui\ui_mm_shader_options.xml" + ui_mm_master_volume diff --git a/res/gamedata/configs/ui/ui_mm_opt_16.xml b/res/gamedata/configs/ui/ui_mm_opt_16.xml index b1a2f9c7547..d12e8c40057 100644 --- a/res/gamedata/configs/ui/ui_mm_opt_16.xml +++ b/res/gamedata/configs/ui/ui_mm_opt_16.xml @@ -175,7 +175,7 @@ - + ui_mm_shader_options ui_inGame2_button diff --git a/res/gamedata/configs/ui/ui_mm_shader_options.xml b/res/gamedata/configs/ui/ui_mm_shader_options.xml new file mode 100644 index 00000000000..99aa3db84bf --- /dev/null +++ b/res/gamedata/configs/ui/ui_mm_shader_options.xml @@ -0,0 +1,506 @@ + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_florafixes_title</text> + + + ui_mcm_ssfx_module_florafixes_sss_int_mcm + + + ui_mcm_ssfx_module_florafixes_sss_color_mcm + + + 0 + + + + + ui_mcm_ssfx_module_florafixes_grass_specular_mcm + + + ui_mcm_ssfx_module_florafixes_grass_specular_wet_mcm + + + ui_mcm_ssfx_module_florafixes_trees_specular_mcm + + + ui_mcm_ssfx_module_florafixes_trees_specular_wet_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_inter_grass_title</text> + + + + + + + + + + + + + + + 0 + + + + + + ui_mcm_ssfx_module_inter_grass_radius_mcm + + + ui_mcm_ssfx_module_inter_grass_horizontal_str_mcm + + + ui_mcm_ssfx_module_inter_grass_vertical_str_mcm + + + ui_mcm_ssfx_module_inter_grass_anomalies_distance_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_inter_grass_explosions_str_mcm + + + ui_mcm_ssfx_module_inter_grass_explosions_speed_mcm + + + ui_mcm_ssfx_module_inter_grass_shooting_str_mcm + + + ui_mcm_ssfx_module_inter_grass_shooting_range_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_shw_cascades_title</text> + + + ui_mcm_ssfx_module_shw_cascades_size_1_mcm + + + ui_mcm_ssfx_module_shw_cascades_size_2_mcm + + + ui_mcm_ssfx_module_shw_cascades_size_3_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_quality_mcm + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_distance_mcm + + + ui_mcm_ssfx_module_shw_cascades_grass_shw_nondir_maxdistance_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_rain_title</text> + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_len_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_width_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_speed_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_quality_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_alpha_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_brightness_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_refraction_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_reflection_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_splash_alpha_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_main_splash_refraction_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_hud_raindrops_title</text> + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_density_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_reflection_str_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_refraction_str_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_animation_speed_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_buildup_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_drying_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_size_mcm + + + ui_mcm_ssfx_module_ssfx_rain_module_ssfx_rain_hud_raindrops_gloss_mcm + + + 0 + + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_wpn_dof_title</text> + + + ui_mcm_ssfx_module_wpn_dof_fadestart_mcm + + + ui_mcm_ssfx_module_wpn_dof_fadelen_mcm + + + ui_mcm_ssfx_module_wpn_dof_blur_mcm + + + ui_mcm_ssfx_module_wpn_dof_edgeblur_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_wpn_dof_aim_fadestart_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_fadelen_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_blur_mcm + + + ui_mcm_ssfx_module_wpn_dof_aim_edgeblur_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_gloss_title</text> + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_min_gloss_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_max_gloss_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_specular_int_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_gloss_specular_color_mcm + + + 0 + + + + + + <text x="16" r="170" g="170" b="170" font="letterica18" align="l" vert_align="c">ui_mcm_ssfx_module_wet_surf_title</text> + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_buildup_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_dry_speed_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_size_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_min_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_ripples_intensity_mcm + + + 0 + + + + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_size_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_min_speed_mcm + + + ui_mcm_ssfx_module_ssfx_wetness_ssfx_wet_surf_waterfall_intensity_mcm + + + 0 + + + + + ui_mm_simply_shader_opts + ui_inGame2_button + + + + + + + ui_mm_shader_options_default + ui_inGame2_button + + + + + diff --git a/res/gamedata/configs/ui/ui_mm_shader_options_16.xml b/res/gamedata/configs/ui/ui_mm_shader_options_16.xml index 003f8367905..f6b65525461 100644 --- a/res/gamedata/configs/ui/ui_mm_shader_options_16.xml +++ b/res/gamedata/configs/ui/ui_mm_shader_options_16.xml @@ -283,21 +283,6 @@ - - - + - - - - - + ui_mm_shader_options_default ui_inGame2_button From 147c8c00d4566d0babcef7a0bad7a2344c8e9168 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Thu, 23 May 2024 22:16:24 -0700 Subject: [PATCH 09/11] * UPD: [gamedata] Add hud fov setting to options --- res/gamedata/configs/ui/ui_mm_opt.xml | 10 ++++++++++ res/gamedata/configs/ui/ui_mm_opt_16.xml | 10 ++++++++++ res/gamedata/scripts/ui_mm_opt_gameplay.script | 5 +++++ 3 files changed, 25 insertions(+) diff --git a/res/gamedata/configs/ui/ui_mm_opt.xml b/res/gamedata/configs/ui/ui_mm_opt.xml index 3174b441a91..a4f1ae4b6ab 100644 --- a/res/gamedata/configs/ui/ui_mm_opt.xml +++ b/res/gamedata/configs/ui/ui_mm_opt.xml @@ -640,6 +640,16 @@ + + ui_mm_hud_fov + + + + + 0 + + + ui_mm_show_crosshair diff --git a/res/gamedata/configs/ui/ui_mm_opt_16.xml b/res/gamedata/configs/ui/ui_mm_opt_16.xml index d12e8c40057..6d5583e0e57 100644 --- a/res/gamedata/configs/ui/ui_mm_opt_16.xml +++ b/res/gamedata/configs/ui/ui_mm_opt_16.xml @@ -642,6 +642,16 @@ + + ui_mm_hud_fov + + + + + 0 + + + ui_mm_show_crosshair diff --git a/res/gamedata/scripts/ui_mm_opt_gameplay.script b/res/gamedata/scripts/ui_mm_opt_gameplay.script index 7d052c87dc1..23f4228d747 100644 --- a/res/gamedata/scripts/ui_mm_opt_gameplay.script +++ b/res/gamedata/scripts/ui_mm_opt_gameplay.script @@ -39,6 +39,11 @@ function opt_gameplay:InitControls(x, y, xml, handler) xml:InitTrackBar("tab_gameplay:track_fov", _st) self.scroll_v:AddWindow(_st, true) + _st = xml:InitStatic("tab_gameplay:templ_item", nil) + xml:InitStatic("tab_gameplay:cap_hud_fov", _st) + xml:InitTrackBar("tab_gameplay:track_hud_fov", _st) + self.scroll_v:AddWindow(_st, true) + _st = xml:InitStatic("tab_gameplay:templ_item", nil) xml:InitStatic("tab_gameplay:cap_check_tips", _st) xml:InitCheck("tab_gameplay:check_tips", _st) From c836677d1f1d4243dd2c6319983991b86d47da79 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Thu, 23 May 2024 22:16:59 -0700 Subject: [PATCH 10/11] * UPD: [gamedata] Add missing translations for eng, rus --- res/gamedata/configs/text/eng/openxray.xml | 3 +++ res/gamedata/configs/text/rus/openxray.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/res/gamedata/configs/text/eng/openxray.xml b/res/gamedata/configs/text/eng/openxray.xml index fadc652c997..bfd0501f94e 100644 --- a/res/gamedata/configs/text/eng/openxray.xml +++ b/res/gamedata/configs/text/eng/openxray.xml @@ -159,6 +159,9 @@ Spanish + + HUD Field of View + Shader Options diff --git a/res/gamedata/configs/text/rus/openxray.xml b/res/gamedata/configs/text/rus/openxray.xml index 3e82430a08c..b7759a63318 100644 --- a/res/gamedata/configs/text/rus/openxray.xml +++ b/res/gamedata/configs/text/rus/openxray.xml @@ -165,6 +165,9 @@ Испанский (Spanish) + + Поле зрения HUD + Настройки Шейдеров From b56e9a4fc63f61660c0438e6683b3e047c68c908 Mon Sep 17 00:00:00 2001 From: yohjimane Date: Thu, 23 May 2024 22:17:30 -0700 Subject: [PATCH 11/11] * UPD: [xrUICore] Account for display_scale --- src/xrUICore/TrackBar/UITrackBar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xrUICore/TrackBar/UITrackBar.cpp b/src/xrUICore/TrackBar/UITrackBar.cpp index 53751219da4..359ccc79dc0 100644 --- a/src/xrUICore/TrackBar/UITrackBar.cpp +++ b/src/xrUICore/TrackBar/UITrackBar.cpp @@ -341,14 +341,15 @@ void CUITrackBar::UpdatePos() if (m_static->IsEnabled()) { + float displayModifier = GetDisplayModifier(); string256 buff; if (m_b_is_float) { - xr_sprintf(buff, (m_static_format == nullptr ? "%.1f" : m_static_format.c_str()), m_f_val); + xr_sprintf(buff, (m_static_format == nullptr ? "%.1f" : m_static_format.c_str()), m_f_val * displayModifier); } else { - xr_sprintf(buff, (m_static_format == nullptr ? "%d" : m_static_format.c_str()), m_i_val); + xr_sprintf(buff, (m_static_format == nullptr ? "%d" : m_static_format.c_str()), m_i_val * displayModifier); } m_static->TextItemControl()->SetTextST(buff); }