feat: Initial UI

This commit is contained in:
Hyblocker committed 2025-11-28 11:52:53 +01:00
1 parent c1316d0ac4
commit 0ba44ca476
1 file changed
+10 -5
+10 -5
View File
@@ -1,5 +1,6 @@
#include "user_interface.h"
#include "constants.h"
#include "localisation.h"
namespace spacecal {
@@ -8,11 +9,10 @@ namespace spacecal {
inline void BuildVersionInfo() {
ImGui::SetNextWindowPos(ImVec2(10.0f, ImGui::GetWindowHeight() - ImGui::GetFrameHeightWithSpacing()));
ImGui::BeginChild("spacecal_version_box", ImVec2(ImGui::GetWindowWidth() - 20.0f, ImGui::GetFrameHeightWithSpacing() * 2), ImGuiChildFlags_None);
ImGui::Text("Space Calibrator Nova v" SPACECAL_VERSION_STRING);
if (bIsRunningInOverlay)
{
ImGui::SameLine();
ImGui::Text(" - close VR overlay to use mouse");
if (bIsRunningInOverlay) {
ImGui::Text(LOCALE_FORMAT("app_title_vr", "Space Calibrator Nova", SPACECAL_VERSION_STRING).c_str());
} else {
ImGui::Text(LOCALE_FORMAT("app_title", "Space Calibrator Nova", SPACECAL_VERSION_STRING).c_str());
}
ImGui::EndChild();
}
@@ -21,6 +21,9 @@ namespace spacecal {
bIsRunningInOverlay = isOverlay;
auto& io = ImGui::GetIO();
// disable ctrl + tab, pointless in a VR overlay https://github.com/ocornut/imgui/issues/7987
ImGui::Shortcut(ImGuiMod_Ctrl | ImGuiKey_Tab, ImGuiInputFlags_RouteGlobal);
constexpr ImGuiWindowFlags k_bareWindowFlags =
ImGuiWindowFlags_NoTitleBar |
ImGuiWindowFlags_NoResize |
@@ -34,6 +37,8 @@ namespace spacecal {
ImGui::Begin("Space Calibrator", nullptr, k_bareWindowFlags);
// @TODO: Build ui
BuildVersionInfo();
ImGui::End();
}