Skip to content

Commit

Permalink
UObjectHook: Remove Destroy Component button
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Nov 6, 2023
1 parent f00255b commit 7065d0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mods/UObjectHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,11 +1551,11 @@ void UObjectHook::ui_handle_object(sdk::UObject* object) {
}

if (uclass->is_a(sdk::UActorComponent::static_class())) {
if (ImGui::Button("Destroy Component")) {
/*if (ImGui::Button("Destroy Component")) {
auto comp = (sdk::UActorComponent*)object;
comp->destroy_component();
}
}*/
}

if (uclass->is_a(sdk::USceneComponent::static_class())) {
Expand Down Expand Up @@ -1617,12 +1617,12 @@ void UObjectHook::ui_handle_scene_component(sdk::USceneComponent* comp) {
save_state_logic(m_path.path());
}
} else {
const auto component_name = comp->get_class()->get_fname().to_string() + L" " + comp->get_fname().to_string();
const auto component_name = utility::narrow(comp->get_class()->get_fname().to_string() + L" " + comp->get_fname().to_string());

// Check if any of our bases can reach this component through their components list.
bool found_any = false;
for (const auto& allowed_base : s_allowed_bases) {
const auto possible_path = std::vector<std::string>{allowed_base, "Components", utility::narrow(component_name)};
const auto possible_path = std::vector<std::string>{allowed_base, "Components", component_name};
const auto path = StatePath{possible_path};
const auto resolved = path.resolve();

Expand Down

0 comments on commit 7065d0f

Please sign in to comment.