Skip to content

Commit

Permalink
Ultrawide: Add Constrain UI to 16:9 option
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jul 2, 2024
1 parent f4b3400 commit 1f64981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mods/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void Graphics::on_draw_ui() {
}

if (m_ultrawide_fix->value()) {
m_ultrawide_constrain_ui->draw("Ultrawide: Constrain UI to 16:9");
m_ultrawide_vertical_fov->draw("Ultrawide: Enable Vertical FOV");
m_ultrawide_custom_fov->draw("Ultrawide: Override FOV");
m_ultrawide_fov_multiplier->draw("Ultrawide: FOV Multiplier");
Expand Down Expand Up @@ -365,6 +366,10 @@ bool Graphics::on_pre_gui_draw_element(REComponent* gui_element, void* primitive
// TODO: Check how this interacts with the other games, could be useful for them too.
#if defined(SF6)
fix_ui_element(gui_element);
#else
if (m_ultrawide_constrain_ui->value()) {
fix_ui_element(gui_element);
}
#endif

auto game_object = utility::re_component::get_game_object(gui_element);
Expand Down
2 changes: 2 additions & 0 deletions src/mods/Graphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class Graphics : public Mod {
const ModToggle::Ptr m_ultrawide_fix{ ModToggle::create(generate_name("UltrawideFix"), false) };
const ModToggle::Ptr m_ultrawide_vertical_fov{ ModToggle::create(generate_name("UltrawideFixVerticalFOV_V2"), false) };
const ModToggle::Ptr m_ultrawide_custom_fov{ModToggle::create(generate_name("UltrawideCustomFOV"), false)};
const ModToggle::Ptr m_ultrawide_constrain_ui{ModToggle::create(generate_name("UltrawideConstrainUI"), false)};
const ModSlider::Ptr m_ultrawide_fov_multiplier{ ModSlider::create(generate_name("UltrawideFOVMultiplier_V2"), 0.01f, 3.0f, 1.0f) };
const ModToggle::Ptr m_disable_gui{ ModToggle::create(generate_name("DisableGUI"), false) };
const ModToggle::Ptr m_force_render_res_to_window{ ModToggle::create(generate_name("ForceRenderResToWindow"), false) };
Expand Down Expand Up @@ -234,6 +235,7 @@ class Graphics : public Mod {
*m_ultrawide_fix,
*m_ultrawide_vertical_fov,
*m_ultrawide_custom_fov,
*m_ultrawide_constrain_ui,
*m_ultrawide_fov_multiplier,
*m_disable_gui,
*m_force_render_res_to_window,
Expand Down

0 comments on commit 1f64981

Please sign in to comment.