Skip to content

Commit 087e753

Browse files
committed
fix xmake fix back
diff bug rebase bug windows only rebase bug on tui fix rebase bug fix setting resolve rebase bug rebase bug rebase bug rebase bug
1 parent 98bc01e commit 087e753

File tree

10 files changed

+34
-57
lines changed

10 files changed

+34
-57
lines changed

UE4SS/include/GUI/TUI.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ namespace RC::GUI
99
public:
1010
auto init() -> void override;
1111
auto imgui_backend_newframe() -> void override;
12-
auto create_window() -> void override;
12+
auto create_window(int loc_x, int loc_y, int size_x, int size_y) -> void override;
1313
auto exec_message_loop(bool* exit_requested) -> void override;
1414
auto shutdown() -> void override;
1515
auto cleanup() -> void override;
1616
auto get_window_handle() -> void* override;
1717
auto get_window_size() -> WindowSize override;
18+
auto get_window_position() -> WindowPosition override;
1819
auto on_gfx_backend_set() -> void override;
1920
};
2021

UE4SS/include/Mod/CppUserModBase.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ namespace RC
136136
RC_UE4SS_API virtual auto render_tab() -> void{};
137137

138138
protected:
139-
RC_UE4SS_API auto register_tab(std::wstring_view tab_name, GUI::GUITab::RenderFunctionType) -> void;
139+
RC_UE4SS_API auto register_tab(UEStringViewType tab_name, GUI::GUITab::RenderFunctionType) -> void;
140140
RC_UE4SS_API auto register_keydown_event(Input::Key, const Input::EventCallbackCallable&, uint8_t custom_data = 0) -> void;
141141
RC_UE4SS_API auto register_keydown_event(Input::Key, const Input::Handler::ModifierKeyArray&, const Input::EventCallbackCallable&, uint8_t custom_data = 0)
142142
-> void;

UE4SS/src/GUI/GUI.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifdef HAS_D3D11
1414
#include <GUI/DX11.hpp>
1515
#endif
16+
#else
17+
#define sscanf_s sscanf
1618
#endif
1719

1820
#ifdef HAS_GLFW
@@ -504,17 +506,19 @@ namespace RC::GUI
504506
IMGUI_CHECKVERSION();
505507
ImGui::CreateContext();
506508
ImGuiIO& io = ImGui::GetIO();
507-
m_imgui_ini_file = to_string(StringType{UE4SSProgram::get_program().get_working_directory()} + STR("\\imgui.ini"));
509+
m_imgui_ini_file = to_string_path(std::filesystem::path {UE4SSProgram::get_program().get_working_directory()} / SYSSTR("imgui.ini"));
508510
io.IniFilename = m_imgui_ini_file.c_str();
509511

510512
// Add .ini handle for UserData type
513+
#ifdef WIN32
511514
ImGuiSettingsHandler ini_handler;
512515
ini_handler.TypeName = "UE4SSData";
513516
ini_handler.TypeHash = ImHashStr("UE4SSData");
514517
ini_handler.ReadOpenFn = imgui_ue4ss_data_read_open;
515518
ini_handler.ReadLineFn = imgui_ue4ss_data_read_line;
516519
ini_handler.WriteAllFn = imgui_ue4ss_data_write_all;
517520
ImGui::AddSettingsHandler(&ini_handler);
521+
#endif
518522

519523
ImGui::LoadIniSettingsFromDisk(m_imgui_ini_file.c_str());
520524

UE4SS/src/GUI/LiveView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ namespace RC::GUI
350350
}
351351

352352
auto json_file =
353-
File::open(std::filesystem::path{UE4SSProgram::get_program().get_working_directory()} / SYSSTR("UE4SS-config") SYSSTR("liveview")SYSSTR("filters.meta.json")),
353+
File::open(std::filesystem::path{UE4SSProgram::get_program().get_working_directory()} / SYSSTR("UE4SS-config") SYSSTR("liveview")SYSSTR("filters.meta.json"),
354354
File::OpenFor::Writing,
355355
File::OverwriteExistingFile::Yes,
356356
File::CreateIfNonExistent::Yes);
@@ -409,7 +409,7 @@ namespace RC::GUI
409409
static auto internal_load_filters_from_disk() -> void
410410
{
411411
const auto json_file =
412-
File::open(std::filesystem::path{UE4SSProgram::get_program().get_working_directory()} / SYSSTR("UE4SS-config") / SYSSTR("liveview") / SYSSTR("filters.meta.json")),
412+
File::open(std::filesystem::path{UE4SSProgram::get_program().get_working_directory()} / SYSSTR("UE4SS-config") / SYSSTR("liveview") / SYSSTR("filters.meta.json"),
413413
File::OpenFor::Reading,
414414
File::OverwriteExistingFile::No,
415415
File::CreateIfNonExistent::Yes);

UE4SS/src/GUI/Platform/TUI/TUI.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ namespace RC::GUI
5858
}
5959
}
6060

61-
void Backend_TUI::create_window()
61+
void Backend_TUI::create_window(int loc_x, int loc_y, int size_x, int size_y)
6262
{
6363
// Do nothing
6464
}
6565

66+
WindowPosition Backend_TUI::get_window_position()
67+
{
68+
return {0, 0};
69+
}
70+
6671
void Backend_TUI::exec_message_loop(bool* exit_requested)
6772
{
6873
ImTui_ImplNcurses_ProcessEvent();

UE4SS/src/UE4SSProgram.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
#include <Unreal/World.hpp>
5858
#include <UnrealDef.hpp>
5959

60+
#ifdef WIN32
6061
#include <polyhook2/PE/IatHook.hpp>
62+
#endif
63+
6164
#include <Platform.hpp>
6265

6366
namespace RC
@@ -463,10 +466,10 @@ namespace RC
463466
else
464467
{
465468
// Check for legacy locations and update paths accordingly
466-
resolaved_settings_file = File::get_path_if_exists(m_legacy_root_directory, m_settings_file_name);
467-
if (resolaved_settings_file)
469+
auto resolaved_legacy_settings_file = File::get_path_if_exists(m_legacy_root_directory, m_settings_file_name);
470+
if (resolaved_legacy_settings_file)
468471
{
469-
m_settings_path_and_file = *resolaved_settings_file;
472+
m_settings_path_and_file = *resolaved_legacy_settings_file;
470473
} else {
471474
throw std::runtime_error{"UE4SS-Settings.ini file not found"};
472475
}
@@ -1444,11 +1447,6 @@ namespace RC
14441447
return m_module_file_path_str;
14451448
}
14461449

1447-
auto UE4SSProgram::get_game_executable_directory() -> File::StringViewType
1448-
{
1449-
return m_game_executable_directory.c_str();
1450-
}
1451-
14521450
auto UE4SSProgram::get_working_directory() -> SystemStringViewType
14531451
{
14541452
m_working_directory_str = to_system_string(m_working_directory);

deps/first/Input/include/Input/Handler.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ namespace RC::Input
2929
ModifierKeys required_modifier_keys{};
3030
EventCallbackCallable callback{};
3131
uint8_t custom_data{};
32-
<<<<<<< HEAD
3332
void* custom_data2{};
3433
bool requires_modifier_keys{};
3534
bool is_down{};
36-
=======
37-
>>>>>>> 83b273a (Add input source for Linux TUI and update input handler initialization)
3835
};
3936

4037
struct KeySet

deps/third/xmake.lua

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
includes("zycore")
2-
includes("zydis")
3-
includes("polyhook_2")
4-
includes("glaze")
5-
-- includes("imtui")
6-
includes("imgui")
7-
includes("glad")
8-
includes("raw_pdb")
9-
10-
add_requires("zycore v1.5.0", { debug = is_mode_debug(), configs = { runtimes = get_mode_runtimes() } })
11-
add_requires("zydis v4.1.0", { debug = is_mode_debug(), configs = { runtimes = get_mode_runtimes() } })
12-
add_requires("polyhook_2", { debug = is_mode_debug(), configs = { runtimes = get_mode_runtimes() } })
1+
includes("glad")

deps/xmake.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
includes("first")
33
-- Third party dependencies
44
includes("third")
5+
-- Third party dependencies repository
6+
-- Everything that is an xmake package should be inside of this repository
7+
add_repositories("third-party deps/third-repo", { rootdir = get_config("ue4ssRoot") })
8+
9+
add_requires("zycore v1.5.0", { debug = is_mode_debug(), configs = {runtimes = get_mode_runtimes()} })
10+
add_requires("zydis v4.1.0", { debug = is_mode_debug(), configs = {runtimes = get_mode_runtimes()} })
11+
add_requires("polyhook_2", { debug = is_mode_debug(), configs = {runtimes = get_mode_runtimes()} })

xmake.lua

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,18 @@
1-
set_xmakever("2.9.2")
21
-- We should use `get_config("ue4ssRoot")` instead of `os.projectdir()` or `$(projectdir)`.
32
-- This is because os.projectdir() will return a higher parent dir
43
-- when UE4SS is sub-moduled/`include("UE4SS")` in another xmake project.
54
set_config("ue4ssRoot", os.scriptdir())
65

7-
includes("tools/xmakescripts/build_configs.lua")
8-
includes("tools/xmakescripts/configurations.lua")
9-
10-
add_rules(get_unreal_rules())
11-
12-
-- Restrict the compilation modes/configs.
13-
set_allowedplats("windows", "linux")
14-
if is_plat("windows") then
15-
set_allowedarchs("x64")
16-
elseif is_plat("linux") then
17-
set_allowedarchs("x86_64")
18-
set_defaultarchs("x86_64")
19-
set_toolchains("clang", "rust")
20-
end
21-
set_allowedmodes(get_compilation_modes())
22-
23-
if is_plat("windows") then
24-
set_defaultmode("Game__Shipping__Win64")
25-
set_runtimes(get_mode_runtimes())
26-
elseif is_plat("linux") then
27-
set_defaultmode("Game__Shipping__Linux")
28-
end
29-
30-
-- All non-binary outputs are stored in the Intermediates dir.
6+
-- All non-binary outputs are written to the Intermediates dir.
317
set_config("buildir", "Intermediates")
328

339
-- Any lua modules in this directory can be imported in the script scope by using
3410
-- /modules/my_module.lua import("my_module")
3511
-- /modules/rules/my_module.lua import("rules.my_module")
3612
add_moduledirs("tools/xmakescripts/modules")
3713

38-
-- Load our rule files into the global scope.
39-
includes("tools/xmakescripts/rules/**.lua")
14+
-- Load the build_rules file into the global scope.
15+
includes("tools/xmakescripts/rules/build_rules.lua")
4016

4117
-- Generate the mode rules.
4218
local modes = generate_compilation_modes()
@@ -121,4 +97,4 @@ function ue4ss_init()
12197
end
12298
end
12399

124-
ue4ss_init()
100+
ue4ss_init()

0 commit comments

Comments
 (0)