Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran clang-format #719

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# add .clang-format
c3eaefbd993dd0f3c8b9d440b7d5b9cc7528732c

# Ran clang-format before sort-include update
5462e5d96ad2e409f90bb21d33c22e5580ba3260
2 changes: 1 addition & 1 deletion UE4SS/include/ExceptionHandling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define UE4SS_ERROR_OUTPUTTER() \
if (!Output::has_internal_error()) \
{ \
Output::send<LogLevel::Error>(STR("Error: {}\n"), ensure_str(e.what())); \
Output::send<LogLevel::Error>(STR("Error: {}\n"), ensure_str(e.what())); \
} \
else \
{ \
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/GUI/GUITab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace RC::GUI

public:
GUITab() = delete;
GUITab(StringViewType name, RenderFunctionType render_function) : tab_name(name), render_function(render_function){};
GUITab(StringViewType name, RenderFunctionType render_function) : tab_name(name), render_function(render_function) {};
GUITab(StringViewType name, RenderFunctionType render_function, CppUserModBase* owner)
: tab_name(name), render_function(render_function), owner(owner){};
: tab_name(name), render_function(render_function), owner(owner) {};
~GUITab() = default;

private:
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/GUI/ImGuiUtility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace RC::GUI
ImGuiInputTextCallback callback = 0,
void* user_data = 0,
float* previous_max_scroll_y = nullptr);
auto ImGui_Splitter(bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size = -1.0f)
-> bool;
auto ImGui_Splitter(
bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size = -1.0f) -> bool;
auto ImGui_GetID(int int_id) -> ImGuiID;
auto ImGui_TreeNodeEx(const char* label, int int_id, ImGuiTreeNodeFlags flags = 0) -> bool;
auto ImGui_TreeNodeEx(const char* label, void* ptr_id, ImGuiTreeNodeFlags flags = 0) -> bool;
Expand Down
8 changes: 2 additions & 6 deletions UE4SS/include/GUI/LiveView/Filter/SearchFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ namespace RC::GUI::Filter

template <typename T>
concept CanPreEval = requires(T t) {
{
T::pre_eval(std::declval<UObject*>())
};
{ T::pre_eval(std::declval<UObject*>()) };
};

template <typename T>
concept CanPostEval = requires(T t) {
{
T::post_eval(std::declval<UObject*>())
};
{ T::post_eval(std::declval<UObject*>()) };
};

template <typename T>
Expand Down
4 changes: 1 addition & 3 deletions UE4SS/include/LuaCustomMemberFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ namespace RC::UnrealRuntimeTypes

template <typename T>
concept HasStaticClassMemberFunction = requires(T t) {
{
T::StaticClass()
};
{ T::StaticClass() };
};

struct ArrayTest
Expand Down
6 changes: 4 additions & 2 deletions UE4SS/include/LuaLibrary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ namespace RC::LuaLibrary
__declspec(dllexport) auto set_script_variable_int32(const char* mod_name, const char* variable_name, int32_t new_value, ReturnValue&) -> void;

using SetScriptVariableDefaultDataSignature = void (*)(const char*, const char*, DefaultDataStruct&, ReturnValue&);
__declspec(dllexport) auto set_script_variable_default_data(const char* mod_name, const char* variable_name, DefaultDataStruct& external_data, ReturnValue&)
-> void;
__declspec(dllexport) auto set_script_variable_default_data(const char* mod_name,
const char* variable_name,
DefaultDataStruct& external_data,
ReturnValue&) -> void;

using CallScriptFunctionSignature = void (*)(const char*, const char*, ReturnValue&, ScriptFuncReturnValue&);
__declspec(dllexport) auto call_script_function(const char* mod_name, const char* function_name, ReturnValue&, ScriptFuncReturnValue&) -> void;
Expand Down
7 changes: 4 additions & 3 deletions UE4SS/include/LuaType/LuaUObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ namespace RC::LuaType
RC_UE4SS_API auto push_functionproperty(const FunctionPusherParams&) -> void;
// Push to Lua -> END

auto handle_unreal_property_value(const Operation operation, const LuaMadeSimple::Lua&, Unreal::UObject* base, Unreal::FName property_name, Unreal::FField* field)
-> void;
auto handle_unreal_property_value(
const Operation operation, const LuaMadeSimple::Lua&, Unreal::UObject* base, Unreal::FName property_name, Unreal::FField* field) -> void;

auto is_a_implementation(const LuaMadeSimple::Lua& lua) -> int;

Expand Down Expand Up @@ -601,7 +601,8 @@ No overload found for function 'UObject.ProcessConsoleExec'.
auto executor = lua.get_userdata<LuaType::UObject>();

auto ar = Unreal::FOutputDevice{};
auto return_value = lua_object.get_remote_cpp_object()->ProcessConsoleExec(FromCharTypePtr<TCHAR>(cmd.c_str()), ar, executor.get_remote_cpp_object());
auto return_value =
lua_object.get_remote_cpp_object()->ProcessConsoleExec(FromCharTypePtr<TCHAR>(cmd.c_str()), ar, executor.get_remote_cpp_object());

lua.set_bool(return_value);
return 1;
Expand Down
6 changes: 2 additions & 4 deletions UE4SS/include/Mod/CppMod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,15 @@ namespace RC
LuaMadeSimple::Lua& async_lua,
std::vector<LuaMadeSimple::Lua*>& hook_luas) -> void;

auto fire_on_lua_start(LuaMadeSimple::Lua& lua, LuaMadeSimple::Lua& main_lua, LuaMadeSimple::Lua& async_lua, std::vector<LuaMadeSimple::Lua*>& hook_luas)
-> void;
auto fire_on_lua_start(LuaMadeSimple::Lua& lua, LuaMadeSimple::Lua& main_lua, LuaMadeSimple::Lua& async_lua, std::vector<LuaMadeSimple::Lua*>& hook_luas) -> void;

auto fire_on_lua_stop(StringViewType mod_name,
LuaMadeSimple::Lua& lua,
LuaMadeSimple::Lua& main_lua,
LuaMadeSimple::Lua& async_lua,
std::vector<LuaMadeSimple::Lua*>& hook_luas) -> void;

auto fire_on_lua_stop(LuaMadeSimple::Lua& lua, LuaMadeSimple::Lua& main_lua, LuaMadeSimple::Lua& async_lua, std::vector<LuaMadeSimple::Lua*>& hook_luas)
-> void;
auto fire_on_lua_stop(LuaMadeSimple::Lua& lua, LuaMadeSimple::Lua& main_lua, LuaMadeSimple::Lua& async_lua, std::vector<LuaMadeSimple::Lua*>& hook_luas) -> void;

auto fire_unreal_init() -> void override;
auto fire_ui_init() -> void override;
Expand Down
8 changes: 5 additions & 3 deletions UE4SS/include/Mod/CppUserModBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ namespace RC
{
}

RC_UE4SS_API virtual auto render_tab() -> void{};
RC_UE4SS_API virtual auto render_tab() -> void {};

protected:
RC_UE4SS_API auto register_tab(StringViewType tab_name, GUI::GUITab::RenderFunctionType) -> void;
RC_UE4SS_API auto register_keydown_event(Input::Key, const Input::EventCallbackCallable&, uint8_t custom_data = 0) -> void;
RC_UE4SS_API auto register_keydown_event(Input::Key, const Input::Handler::ModifierKeyArray&, const Input::EventCallbackCallable&, uint8_t custom_data = 0)
-> void;
RC_UE4SS_API auto register_keydown_event(Input::Key,
const Input::Handler::ModifierKeyArray&,
const Input::EventCallbackCallable&,
uint8_t custom_data = 0) -> void;
};
} // namespace RC
7 changes: 3 additions & 4 deletions UE4SS/include/Mod/Mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace RC
StringType m_mod_name;
std::filesystem::path m_mod_path;


protected:
// Whether the mod can be installed
// This is true by default and is only false if the state of the mod won't allow for a successful installation
Expand Down Expand Up @@ -63,12 +62,12 @@ namespace RC
// Main update from the program
virtual auto fire_update() -> void;

virtual auto fire_unreal_init() -> void{};
virtual auto fire_unreal_init() -> void {};

virtual auto fire_ui_init() -> void{};
virtual auto fire_ui_init() -> void {};

// Called once when the program is starting, after mods are setup but before any mods have been started
virtual auto fire_program_start() -> void{};
virtual auto fire_program_start() -> void {};

// Async update
// Used when the main update function would block other mods from executing their scripts
Expand Down
5 changes: 3 additions & 2 deletions UE4SS/include/SDKGenerator/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ namespace RC
auto generate_delegate_name(Unreal::FProperty* property, const File::StringType& context_name) -> File::StringType;
auto get_native_class_name(Unreal::UClass* uclass, bool interface_name = false) -> File::StringType;
auto get_native_struct_name(Unreal::UScriptStruct* script_struct) -> File::StringType;
auto get_native_delegate_type_name(Unreal::UFunction* signature_function, Unreal::UClass* current_class = nullptr, bool strip_outer_name = false)
-> File::StringType;
auto get_native_delegate_type_name(Unreal::UFunction* signature_function,
Unreal::UClass* current_class = nullptr,
bool strip_outer_name = false) -> File::StringType;
auto is_delegate_signature_function(Unreal::UFunction* signature_function) -> bool;
auto strip_delegate_signature_postfix(Unreal::UFunction* signature_function) -> File::StringType;
} // namespace UEGenerator
Expand Down
7 changes: 3 additions & 4 deletions UE4SS/include/SDKGenerator/UEHeaderGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ namespace RC::UEGenerator
const CaseInsensitiveSet& blacklisted_property_names,
bool generate_as_override = false) -> void;

auto generate_property_value(UStruct* ustruct, FProperty* property, void* object, GeneratedSourceFile& implementation_file, const StringType& property_scope)
-> void;
auto generate_property_value(
UStruct* ustruct, FProperty* property, void* object, GeneratedSourceFile& implementation_file, const StringType& property_scope) -> void;
auto generate_function_implementation(UClass* uclass,
UFunction* function,
GeneratedSourceFile& implementation_file,
Expand Down Expand Up @@ -309,8 +309,7 @@ namespace RC::UEGenerator
auto static determine_primary_game_module_name() -> StringType;

public:
auto add_module_and_sub_module_dependencies(std::set<StringType>& out_module_dependencies, const StringType& module_name, bool add_self_module = true)
-> void;
auto add_module_and_sub_module_dependencies(std::set<StringType>& out_module_dependencies, const StringType& module_name, bool add_self_module = true) -> void;
auto static collect_blacklisted_property_names(UObject* property) -> CaseInsensitiveSet;

auto static generate_object_pre_declaration(UObject* object) -> std::vector<std::vector<StringType>>;
Expand Down
6 changes: 4 additions & 2 deletions UE4SS/include/UE4SSProgram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ namespace RC
FMBNI_ExtraPredicate extra_predicate = {}) -> Mod*;

public:
RC_UE4SS_API static auto dump_uobject(Unreal::UObject* object, std::unordered_set<Unreal::FField*>* dumped_fields, StringType& out_line, bool is_below_425)
-> void;
RC_UE4SS_API static auto dump_uobject(Unreal::UObject* object,
std::unordered_set<Unreal::FField*>* dumped_fields,
StringType& out_line,
bool is_below_425) -> void;
RC_UE4SS_API static auto dump_xproperty(Unreal::FProperty* property, StringType& out_line) -> void;
RC_UE4SS_API static auto dump_all_objects_and_properties(const File::StringType& output_path_and_file_name) -> void;

Expand Down
3 changes: 1 addition & 2 deletions UE4SS/include/UnrealDef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ namespace RC
template <typename T>
using TArray = Unreal::TArray<T>;
using UFunction = Unreal::UFunction;

template <typename T1, typename T2, typename T3, typename T4>
using TMap = Unreal::TMap<T1, T2, T3, T4>;
using FMapProperty = Unreal::FMapProperty;


using UnrealScriptFunction = Unreal::UnrealScriptFunction;
using FFrame = Unreal::FFrame;
Expand Down
4 changes: 3 additions & 1 deletion UE4SS/proxy_generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ int _tmain(int argc, TCHAR* argv[])
cpp_file << " }" << endl;
cpp_file << " else" << endl;
cpp_file << " {" << endl;
cpp_file << " MessageBox(nullptr, L\"Failed to load UE4SS.dll. Please see the docs on correct installation: https://docs.ue4ss.com/installation-guide\", L\"UE4SS Error\", MB_OK | MB_ICONERROR);" << endl;
cpp_file << " MessageBox(nullptr, L\"Failed to load UE4SS.dll. Please see the docs on correct installation: "
"https://docs.ue4ss.com/installation-guide\", L\"UE4SS Error\", MB_OK | MB_ICONERROR);"
<< endl;
cpp_file << " ExitProcess(0);" << endl;
cpp_file << " }" << endl;
cpp_file << " }" << endl;
Expand Down
3 changes: 2 additions & 1 deletion UE4SS/src/CrashDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace RC
const auto now = time_point_cast<seconds>(system_clock::now());
const StringType dump_path = fmt::format(STR("{}\\crash_{:%Y_%m_%d_%H_%M_%S}.dmp"), StringType{UE4SSProgram::get_program().get_working_directory()}, now);

const HANDLE file = CreateFileW(FromCharTypePtr<wchar_t>(dump_path.c_str()), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
const HANDLE file =
CreateFileW(FromCharTypePtr<wchar_t>(dump_path.c_str()), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

if (file == INVALID_HANDLE_VALUE)
{
Expand Down
6 changes: 4 additions & 2 deletions UE4SS/src/GUI/Dumpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ namespace RC::GUI::Dumpers

if (Version::IsAtMost(4, 19))
{
const auto materials = *mesh->GetValuePtrByPropertyName<TArray<FStaticMaterial_419AndBelow>>(FromCharTypePtr<TCHAR>(STR("StaticMaterials")));
const auto materials =
*mesh->GetValuePtrByPropertyName<TArray<FStaticMaterial_419AndBelow>>(FromCharTypePtr<TCHAR>(STR("StaticMaterials")));
if (materials.GetData())
{
actor_buffer.append(STR("Materials=("));
Expand All @@ -206,7 +207,8 @@ namespace RC::GUI::Dumpers
}
else
{
const auto& materials = *mesh->GetValuePtrByPropertyName<TArray<FStaticMaterial_420AndAbove>>(FromCharTypePtr<TCHAR>(STR("StaticMaterials")));
const auto& materials =
*mesh->GetValuePtrByPropertyName<TArray<FStaticMaterial_420AndAbove>>(FromCharTypePtr<TCHAR>(STR("StaticMaterials")));
if (materials.GetData())
{
actor_buffer.append(STR("Materials=("));
Expand Down
Loading
Loading