Skip to content

Commit

Permalink
UObjectHook: Also disable custom depth
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jan 25, 2024
1 parent 7576bc5 commit 6e8457c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mods/UObjectHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,8 @@ void UObjectHook::update_persistent_states() {
obj_primcomp->set_visibility(true, false);
}
} else {
obj_primcomp->set_render_custom_depth(false);

if (!obj_primcomp->set_render_in_main_pass(false).has_value()) {
obj_primcomp->set_visibility(false, false);
}
Expand Down Expand Up @@ -2420,6 +2422,11 @@ void UObjectHook::ui_handle_scene_component(sdk::USceneComponent* comp) {

if (ImGui::Checkbox("Visible", &visible)) {
if (comp->is_a(prim_comp_t)) {
// dont have a good way of telling what the original value was
if (!visible) {
prim_comp->set_render_custom_depth(false);
}

if (!prim_comp->set_render_in_main_pass(visible).has_value()) {
comp->set_visibility(visible, false);
}
Expand Down

0 comments on commit 6e8457c

Please sign in to comment.