Skip to content

Commit

Permalink
Made enum values use their display name when appropriate in the live …
Browse files Browse the repository at this point in the history
…view tab
  • Loading branch information
UE4SS committed Oct 16, 2023
1 parent 4634348 commit 606a5b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UE4SS/src/GUI/LiveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <Unreal/Property/FArrayProperty.hpp>
#include <Unreal/Property/FBoolProperty.hpp>
#include <Unreal/Property/FObjectProperty.hpp>
#include <Unreal/Property/FEnumProperty.hpp>
#include <Unreal/UClass.hpp>
#include <Unreal/UEnum.hpp>
#include <Unreal/UFunction.hpp>
Expand Down Expand Up @@ -1385,6 +1386,13 @@ namespace RC::GUI
}
render_property_value_context_menu(tree_node_id);
}
else if (auto enum_property = CastField<FEnumProperty>(property); enum_property)
{
auto value_raw = std::bit_cast<uint8*>(container_ptr);
auto value_as_string = Unreal::UKismetNodeHelperLibrary::GetEnumeratorUserFriendlyName(enum_property->GetEnum(), *value_raw);
ImGui::SameLine();
ImGui::Text("%S", value_as_string.c_str());
}
else
{
ImGui::SameLine();
Expand Down

0 comments on commit 606a5b8

Please sign in to comment.