From 65623a4769ad6694f4fac22d08e506c7c627cdd0 Mon Sep 17 00:00:00 2001 From: yamashi Date: Sun, 29 May 2022 15:17:09 +0200 Subject: [PATCH 1/4] tweak: move all requires to the root xmake.lua and use docking branch of imgui (ci skip) --- Code/admin/xmake.lua | 3 +- Code/components/crash_handler/xmake.lua | 2 -- Code/components/es_loader/xmake.lua | 2 -- Code/immersive_launcher/xmake.lua | 2 -- Code/xmake.lua | 2 -- Libraries/xmake.lua | 16 ---------- xmake.lua | 40 ++++++++++++++++++++++++- 7 files changed, 40 insertions(+), 27 deletions(-) diff --git a/Code/admin/xmake.lua b/Code/admin/xmake.lua index 4afec7f04..b72cf751c 100644 --- a/Code/admin/xmake.lua +++ b/Code/admin/xmake.lua @@ -1,5 +1,4 @@ -add_requires("magnum", { configs = { sdl2 = true }}) -add_requires("magnum-integration", { configs = { imgui = true }}) + target("Admin") set_kind("binary") diff --git a/Code/components/crash_handler/xmake.lua b/Code/components/crash_handler/xmake.lua index 04057ee43..5a1417596 100644 --- a/Code/components/crash_handler/xmake.lua +++ b/Code/components/crash_handler/xmake.lua @@ -1,4 +1,2 @@ -add_requires("sentry-native", { configs = { backend = "crashpad" } }) - component("CrashHandler") add_packages("sentry-native") diff --git a/Code/components/es_loader/xmake.lua b/Code/components/es_loader/xmake.lua index b20e121e4..effe90573 100644 --- a/Code/components/es_loader/xmake.lua +++ b/Code/components/es_loader/xmake.lua @@ -1,5 +1,3 @@ -add_requires("zlib") - component("ESLoader") set_pcxxheader("stdafx.h") add_headerfiles("stdafx.h", {prefixdir = "ESLoader"}) diff --git a/Code/immersive_launcher/xmake.lua b/Code/immersive_launcher/xmake.lua index e4027fb0e..fb8f1c7a3 100644 --- a/Code/immersive_launcher/xmake.lua +++ b/Code/immersive_launcher/xmake.lua @@ -65,8 +65,6 @@ local function build_launcher() "sentry-native") end -add_requires("sentry-native") - target("SkyrimImmersiveLauncher") set_basename("SkyrimTogether") add_defines( diff --git a/Code/xmake.lua b/Code/xmake.lua index 16b92b36c..941d311da 100644 --- a/Code/xmake.lua +++ b/Code/xmake.lua @@ -1,5 +1,3 @@ -add_requires("glm") - if is_plat("windows") then includes("client") includes("immersive_elf") diff --git a/Libraries/xmake.lua b/Libraries/xmake.lua index 8bc97b6f8..8189ddca5 100644 --- a/Libraries/xmake.lua +++ b/Libraries/xmake.lua @@ -2,23 +2,7 @@ lib_dir = os.curdir() directx_dir = lib_dir .. "/DXSDK" -add_requireconfs("cpp-httplib", {configs = {ssl = true}}) -add_requires( - "tiltedcore", - "cryptopp", - "spdlog", - "cpp-httplib", - "gtest", - "mem") - --- all libraries listed here are under frequent change, and are thus not quired via --- the xmake package manager, we intend to change this in the future though. - if is_plat("windows") then - add_requires( - "discord", - "imgui") - includes("./TiltedUI") includes("./TiltedReverse") includes("./TiltedHooks") diff --git a/xmake.lua b/xmake.lua index c4c850822..dda99bf5b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -25,7 +25,45 @@ if has_config("unitybuild") then add_rules("c++.unity_build", {batchsize = 12}) end -add_requires("entt", "recastnavigation") +package("magnum-integration-docking") + set_base("magnum-integration") + on_load("windows", "linux", "macosx", function (package) + local configdeps = {bullet = "bullet3", + eigen = "eigen3", + glm = "glm", + imgui = "imgui v1.87-docking"} + for config, dep in pairs(configdeps) do + if package:config(config) then + package:add("deps", dep) + end + end + end) +package_end() + +add_requires( + "entt", + "recastnavigation", + "tiltedcore", + "cryptopp", + "spdlog", + "cpp-httplib", + "gtest", + "mem", + "glm", + "sentry-native", + "magnum", + "magnum-integration-docking", + "zlib") + +add_requireconfs("cpp-httplib", {configs = {ssl = true}}) +add_requireconfs("sentry-native", { configs = { backend = "crashpad" } }) +add_requireconfs("magnum", { configs = { sdl2 = true }}) +add_requireconfs("magnum-integration-docking", { configs = { imgui = true }}) +add_requireconfs("magnum-integration-docking.magnum", { configs = { sdl2 = true }}) + +if is_plat("windows") then + add_requires("discord", "imgui v1.87-docking") +end before_build(function (target) import("modules.version") From 85cf1e2f8cbc0d37027b27ee0385fbdaccee74e7 Mon Sep 17 00:00:00 2001 From: yamashi Date: Sun, 29 May 2022 15:25:18 +0200 Subject: [PATCH 2/4] tweak: enable imgui docking (ci skip) --- Code/components/imgui/ImGuiDriver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/components/imgui/ImGuiDriver.cpp b/Code/components/imgui/ImGuiDriver.cpp index 484c45e3d..be316dde4 100644 --- a/Code/components/imgui/ImGuiDriver.cpp +++ b/Code/components/imgui/ImGuiDriver.cpp @@ -87,6 +87,9 @@ ImGuiDriver::ImGuiDriver() ImGui::CreateContext(); auto& io = ImGui::GetIO(); + + io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; + InstallClipboardHandlers(io); // io.IniFilename = nullptr; From 61e299494fa05b47f1dd9bff4790b2cd720d0338 Mon Sep 17 00:00:00 2001 From: yamashi Date: Sun, 29 May 2022 15:35:31 +0200 Subject: [PATCH 3/4] tweak: dock windows in the viewport (ci skip) --- Code/client/Services/Generic/ImguiService.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/client/Services/Generic/ImguiService.cpp b/Code/client/Services/Generic/ImguiService.cpp index d8dc3fa5f..7433f9459 100644 --- a/Code/client/Services/Generic/ImguiService.cpp +++ b/Code/client/Services/Generic/ImguiService.cpp @@ -42,6 +42,8 @@ void ImguiService::Render() const ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); + ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode); + m_drawSignal.publish(); ImGui::Render(); From 5b48b834dd4fb3f60fc33851e2d01fb387be88e0 Mon Sep 17 00:00:00 2001 From: yamashi Date: Sun, 29 May 2022 16:19:12 +0200 Subject: [PATCH 4/4] tweak: reduce xmake spaghetti (ci skip) --- xmake.lua | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/xmake.lua b/xmake.lua index dda99bf5b..f5ded2cdd 100644 --- a/xmake.lua +++ b/xmake.lua @@ -25,21 +25,6 @@ if has_config("unitybuild") then add_rules("c++.unity_build", {batchsize = 12}) end -package("magnum-integration-docking") - set_base("magnum-integration") - on_load("windows", "linux", "macosx", function (package) - local configdeps = {bullet = "bullet3", - eigen = "eigen3", - glm = "glm", - imgui = "imgui v1.87-docking"} - for config, dep in pairs(configdeps) do - if package:config(config) then - package:add("deps", dep) - end - end - end) -package_end() - add_requires( "entt", "recastnavigation", @@ -52,14 +37,15 @@ add_requires( "glm", "sentry-native", "magnum", - "magnum-integration-docking", + "magnum-integration", "zlib") add_requireconfs("cpp-httplib", {configs = {ssl = true}}) add_requireconfs("sentry-native", { configs = { backend = "crashpad" } }) add_requireconfs("magnum", { configs = { sdl2 = true }}) -add_requireconfs("magnum-integration-docking", { configs = { imgui = true }}) -add_requireconfs("magnum-integration-docking.magnum", { configs = { sdl2 = true }}) +add_requireconfs("magnum-integration", { configs = { imgui = true }}) +add_requireconfs("magnum-integration.magnum", { configs = { sdl2 = true }}) +add_requireconfs("magnum-integration.imgui", {version = "v1.87-docking", override = true}) if is_plat("windows") then add_requires("discord", "imgui v1.87-docking")