@@ -98,6 +98,10 @@ void Graphics::on_draw_ui() {
9898 }
9999
100100 if (m_ultrawide_fix->value ()) {
101+ m_ultrawide_constrain_ui->draw (" Ultrawide: Constrain UI to 16:9" );
102+ if (m_ultrawide_constrain_ui->value ()) {
103+ m_ultrawide_constrain_child_ui->draw (" Ultrawide: Constrain Child UI to 16:9" );
104+ }
101105 m_ultrawide_vertical_fov->draw (" Ultrawide: Enable Vertical FOV" );
102106 m_ultrawide_custom_fov->draw (" Ultrawide: Override FOV" );
103107 m_ultrawide_fov_multiplier->draw (" Ultrawide: FOV Multiplier" );
@@ -309,6 +313,12 @@ void Graphics::fix_ui_element(REComponent* gui_element) {
309313 return ;
310314 }
311315
316+ const auto go_name = utility::re_string::get_view (game_object->name );
317+
318+ if (go_name == L" BlackFade" ) {
319+ return ; // Don't do anything with the black fade, it should be taking over the whole screen
320+ }
321+
312322 const auto gui_component = utility::re_component::find<REComponent*>(game_object->transform , " via.gui.GUI" );
313323
314324 if (gui_component == nullptr ) {
@@ -350,6 +360,18 @@ void Graphics::fix_ui_element(REComponent* gui_element) {
350360 set_res_adjust_scale->call <void >(sdk::get_thread_context (), view, (int32_t )via::gui::ResolutionAdjustScale::FitSmallRatioAxis);
351361 set_res_adjust_anchor->call <void >(sdk::get_thread_context (), view, (int32_t )via::gui::ResolutionAdjustAnchor::CenterCenter);
352362 set_resolution_adjust->call <void >(sdk::get_thread_context (), view, true ); // Causes the options to be applied/used
363+
364+ static const auto get_child = view_t ->get_method (" get_Child" );
365+
366+ if (get_child != nullptr && m_ultrawide_constrain_child_ui->value ()) {
367+ const auto child = get_child->call <::REManagedObject*>(sdk::get_thread_context (), view);
368+
369+ if (child != nullptr ) {
370+ set_res_adjust_scale->call <void >(sdk::get_thread_context (), child, (int32_t )via::gui::ResolutionAdjustScale::FitSmallRatioAxis);
371+ set_res_adjust_anchor->call <void >(sdk::get_thread_context (), child, (int32_t )via::gui::ResolutionAdjustAnchor::CenterCenter);
372+ set_resolution_adjust->call <void >(sdk::get_thread_context (), child, true ); // Causes the options to be applied/used
373+ }
374+ }
353375 }
354376}
355377
@@ -365,9 +387,15 @@ bool Graphics::on_pre_gui_draw_element(REComponent* gui_element, void* primitive
365387 // TODO: Check how this interacts with the other games, could be useful for them too.
366388#if defined(SF6)
367389 fix_ui_element (gui_element);
390+ #else
391+ if (m_ultrawide_constrain_ui->value ()) {
392+ fix_ui_element (gui_element);
393+ }
368394#endif
369395
370396 auto game_object = utility::re_component::get_game_object (gui_element);
397+ static auto letter_box_behavior_t = sdk::find_type_definition (" app.LetterBoxBehavior" );
398+ static auto letter_box_behavior_retype = letter_box_behavior_t != nullptr ? letter_box_behavior_t ->get_type () : nullptr ;
371399
372400 if (game_object != nullptr && game_object->transform != nullptr ) {
373401 const auto name = utility::re_string::get_string (game_object->name );
@@ -379,6 +407,18 @@ bool Graphics::on_pre_gui_draw_element(REComponent* gui_element, void* primitive
379407 case " GUIEventPillar" _fnv:
380408 game_object->shouldDraw = false ;
381409 return false ;
410+
411+ case " Gui_ui0211" _fnv: // Kunitsu-Gami
412+ if (letter_box_behavior_t != nullptr ) {
413+ auto letter_box_behavior = utility::re_component::find<REComponent*>(game_object->transform , letter_box_behavior_retype);
414+
415+ if (letter_box_behavior != nullptr ) {
416+ game_object->shouldDraw = false ;
417+ return false ;
418+ }
419+ }
420+
421+ break ;
382422
383423#if defined(DD2)
384424 case " ui012203" _fnv:
0 commit comments