Skip to content

Commit

Permalink
win32 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangff committed Feb 19, 2024
1 parent caf04ab commit 15244b0
Show file tree
Hide file tree
Showing 62 changed files with 1,225 additions and 1,156 deletions.
6 changes: 3 additions & 3 deletions UE4SS/include/GUI/GUITab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ namespace RC::GUI
private:
RenderFunctionType render_function{};
CppUserModBase* owner{};
StringType tab_name{};
UEStringType tab_name{};

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

Expand Down
8 changes: 4 additions & 4 deletions UE4SS/include/GUI/LiveView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ namespace RC::GUI
Output::Targets<Output::FileDevice> output{};
FProperty* property{};
UObject* container{};
StringType object_name{};
StringType property_name{};
StringType property_value{};
UEStringType object_name{};
UEStringType property_name{};
UEStringType property_value{};
size_t hash{};
std::string history{};
float history_previous_max_scroll_y{};
Expand All @@ -77,7 +77,7 @@ namespace RC::GUI
std::pair<int, int> function_hook_ids{};

Watch() = delete;
Watch(StringType&& object_name, StringType&& property_name);
Watch(UEStringType&& object_name, UEStringType&& property_name);
};

private:
Expand Down
2 changes: 1 addition & 1 deletion UE4SS/include/GUI/LiveView/Filter/DefaultObjectsOnly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RC::GUI::Filter
class DefaultObjectsOnly
{
public:
static inline StringType s_debug_name{STR("DefaultObjectsOnly")};
static inline UEStringType s_debug_name{STR("DefaultObjectsOnly")};
static inline bool s_enabled{};

static auto pre_eval(UObject* object) -> bool
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/GUI/LiveView/Filter/ExcludeClassName.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace RC::GUI::Filter
class ExcludeClassName
{
public:
static inline StringType s_debug_name{STR("ExcludeClassName")};
static inline StringType s_value{};
static inline UEStringType s_debug_name{STR("ExcludeClassName")};
static inline UEStringType s_value{};
static inline std::string s_internal_value{};

static auto post_eval(UObject* object) -> bool
Expand Down
2 changes: 1 addition & 1 deletion UE4SS/include/GUI/LiveView/Filter/FunctionParamFlags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace RC::GUI::Filter
class FunctionParamFlags
{
public:
static inline StringType s_debug_name{STR("FunctionParamFlags")};
static inline UEStringType s_debug_name{STR("FunctionParamFlags")};
static inline bool s_enabled{};
static inline std::array<bool, 255> s_checkboxes{};
static inline EPropertyFlags s_value{};
Expand Down
4 changes: 2 additions & 2 deletions UE4SS/include/GUI/LiveView/Filter/HasProperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace RC::GUI::Filter
class HasProperty
{
public:
static inline StringType s_debug_name{STR("HasProperty")};
static inline StringType s_value{};
static inline UEStringType s_debug_name{STR("HasProperty")};
static inline UEStringType s_value{};
static inline std::string s_internal_value{};

static auto post_eval(UObject* object) -> bool
Expand Down
2 changes: 1 addition & 1 deletion UE4SS/include/GUI/LiveView/Filter/HasPropertyType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RC::GUI::Filter
class HasPropertyType
{
public:
static inline StringType s_debug_name{STR("HasPropertyType")};
static inline UEStringType s_debug_name{STR("HasPropertyType")};
static inline FName s_value{};
static inline std::string s_internal_value{};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RC::GUI::Filter
class IncludeDefaultObjects
{
public:
static inline StringType s_debug_name{STR("IncludeDefaultObjects")};
static inline UEStringType s_debug_name{STR("IncludeDefaultObjects")};
static inline bool s_enabled{true};

static auto pre_eval(UObject* object) -> bool
Expand Down
2 changes: 1 addition & 1 deletion UE4SS/include/GUI/LiveView/Filter/InstancesOnly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RC::GUI::Filter
class InstancesOnly
{
public:
static inline StringType s_debug_name{STR("InstancesOnly")};
static inline UEStringType s_debug_name{STR("InstancesOnly")};
static inline bool s_enabled{};
static auto pre_eval(UObject* object) -> bool
{
Expand Down
2 changes: 1 addition & 1 deletion UE4SS/include/GUI/LiveView/Filter/NonInstancesOnly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RC::GUI::Filter
class NonInstancesOnly
{
public:
static inline StringType s_debug_name{STR("NonInstancesOnly")};
static inline UEStringType s_debug_name{STR("NonInstancesOnly")};
static inline bool s_enabled{};

static auto pre_eval(UObject* object) -> bool
Expand Down
8 changes: 4 additions & 4 deletions UE4SS/include/Mod/CppMod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace RC
typedef void (*uninstall_type)(CppUserModBase*);

private:
SystemStringType m_dlls_path;
UEStringType m_dlls_path;
#ifdef WIN32
HMODULE m_main_dll_module = NULL;
DLL_DIRECTORY_COOKIE m_dlls_path_cookie = NULL;
Expand All @@ -39,7 +39,7 @@ namespace RC
CppUserModBase* m_mod = nullptr;

public:
CppMod(UE4SSProgram&, SystemStringType&& mod_name, SystemStringType&& mod_path);
CppMod(UE4SSProgram&, UEStringType&& mod_name, UEStringType&& mod_path);
CppMod(CppMod&) = delete;
CppMod(CppMod&&) = delete;
~CppMod() override;
Expand All @@ -57,7 +57,7 @@ namespace RC
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(SystemStringViewType mod_name,
auto fire_on_lua_stop(UEStringViewType mod_name,
LuaMadeSimple::Lua& lua,
LuaMadeSimple::Lua& main_lua,
LuaMadeSimple::Lua& async_lua,
Expand All @@ -69,6 +69,6 @@ namespace RC
auto fire_unreal_init() -> void override;
auto fire_program_start() -> void override;
auto fire_update() -> void override;
auto fire_dll_load(SystemStringViewType dll_name) -> void;
auto fire_dll_load(UEStringViewType dll_name) -> void;
};
} // namespace RC
28 changes: 14 additions & 14 deletions UE4SS/include/Mod/CppUserModBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ namespace RC
{
struct ModMetadata
{
const SystemStringType ModName{};
const SystemStringType ModVersion{};
const SystemStringType ModDescription{};
const SystemStringType ModAuthors{};
const SystemStringType ModIntendedSDKVersion{};
const UEStringType ModName{};
const UEStringType ModVersion{};
const UEStringType ModDescription{};
const UEStringType ModAuthors{};
const UEStringType ModIntendedSDKVersion{};
};

namespace LuaMadeSimple
Expand All @@ -34,11 +34,11 @@ namespace RC
std::vector<std::shared_ptr<GUI::GUITab>> GUITabs{};
#endif
public:
SystemStringType ModName{};
SystemStringType ModVersion{};
SystemStringType ModDescription{};
SystemStringType ModAuthors{};
SystemStringType ModIntendedSDKVersion{};
UEStringType ModName{};
UEStringType ModVersion{};
UEStringType ModDescription{};
UEStringType ModAuthors{};
UEStringType ModIntendedSDKVersion{};

public:
RC_UE4SS_API CppUserModBase();
Expand Down Expand Up @@ -68,7 +68,7 @@ namespace RC
* @param async_lua This is the Lua instance for asynchronous things like ExecuteAsync and ExecuteWithDelay.
* @param hook_luas This is a container of Lua instances that are used for game-thread hooks like ExecuteInGameThread.
*/
RC_UE4SS_API virtual auto on_lua_start(SystemStringViewType mod_name,
RC_UE4SS_API virtual auto on_lua_start(UEStringViewType mod_name,
LuaMadeSimple::Lua& lua,
LuaMadeSimple::Lua& main_lua,
LuaMadeSimple::Lua& async_lua,
Expand Down Expand Up @@ -99,7 +99,7 @@ namespace RC
* @param async_lua This is the Lua instance for asynchronous things like ExecuteAsync and ExecuteWithDelay.
* @param hook_luas This is a container of Lua instances that are used for game-thread hooks like ExecuteInGameThread.
*/
RC_UE4SS_API virtual auto on_lua_stop(SystemStringViewType mod_name,
RC_UE4SS_API virtual auto on_lua_stop(UEStringViewType mod_name,
LuaMadeSimple::Lua& lua,
LuaMadeSimple::Lua& main_lua,
LuaMadeSimple::Lua& async_lua,
Expand All @@ -121,15 +121,15 @@ namespace RC
{
}

RC_UE4SS_API virtual auto on_dll_load(SystemStringType dll_name) -> void
RC_UE4SS_API virtual auto on_dll_load(UEStringViewType dll_name) -> void
{
}

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

protected:
RC_UE4SS_API auto register_tab(SystemStringViewType tab_name, GUI::GUITab::RenderFunctionType) -> void;
RC_UE4SS_API auto register_tab(UEStringViewType tab_name, GUI::GUITab::RenderFunctionType) -> void;
#endif
};
} // namespace RC
6 changes: 3 additions & 3 deletions UE4SS/include/Mod/Mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace RC

protected:
#pragma warning(disable : 4251)
SystemStringType m_mod_name;
SystemStringType m_mod_path;
UEStringType m_mod_name;
UEStringType m_mod_path;
#pragma warning(default : 4251)

protected:
Expand All @@ -45,7 +45,7 @@ namespace RC
};

public:
Mod(UE4SSProgram&, SystemStringType&& mod_name, SystemStringType&& mod_path);
Mod(UE4SSProgram&, UEStringType&& mod_name, UEStringType&& mod_path);
virtual ~Mod() = default;

public:
Expand Down
Loading

0 comments on commit 15244b0

Please sign in to comment.