Skip to content

Commit c318707

Browse files
committed
New UImGuiTheme release and updated client-side bar
1 parent b88bcba commit c318707

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
#include "CClientSideBar.h"
2+
#include <ImGui/ClientSideBar.hpp>
3+
4+
void UImGui_ClientSideBar_Begin()
5+
{
6+
UImGui::ClientSideBar::Begin();
7+
}
8+
9+
void UImGui_ClientSideBar_End(float deltaTime, UImGui_ClientSideBarFlags flags, UImGui_FVector4 destructiveColor, UImGui_FVector4 destructiveColorActive) noexcept
10+
{
11+
UImGui::ClientSideBar::End(deltaTime, flags, destructiveColor, destructiveColorActive);
12+
}

Framework/C/Rendering/CClientSideBar.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <C/CDefines.h>
3+
#include <C/CTypes.h>
34

45
#ifdef __cplusplus
56
extern "C"
@@ -22,9 +23,9 @@ extern "C"
2223
// Event Safety - Post-begin
2324
UIMGUI_PUBLIC_API void UImGui_ClientSideBar_Begin();
2425

25-
// Renders the bar. In C++, flags defaults to UIMGUI_CLIENT_SIDE_BAR_FLAG_ALL
26+
// Renders the bar. In C++, flags defaults to UIMGUI_CLIENT_SIDE_BAR_FLAG_ALL, { 0.753f, 0.110f, 0.157f, 1.0f }, { 0.972f, 0.894f, 0.360f, 1.0f }
2627
// Event Safety - Post-begin
27-
UIMGUI_PUBLIC_API void UImGui_ClientSideBar_End(float deltaTime, UImGui_ClientSideBarFlags flags) noexcept;
28+
UIMGUI_PUBLIC_API void UImGui_ClientSideBar_End(float deltaTime, UImGui_ClientSideBarFlags flags, UImGui_FVector4 destructiveColor, UImGui_FVector4 destructiveColorActive) noexcept;
2829
#ifdef __cplusplus
2930
}
3031
#endif

Framework/Renderer/ImGui/ClientSideBar.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void UImGui::ClientSideBar::Begin() noexcept
1515
ImGui::BeginGroup();
1616
}
1717

18-
void UImGui::ClientSideBar::End(float deltaTime, UImGui::ClientSideBarFlags flags) noexcept
18+
void UImGui::ClientSideBar::End(float deltaTime, UImGui::ClientSideBarFlags flags, FVector4 destructiveColor, FVector4 destructiveColorActive) noexcept
1919
{
2020
// Create an invisible button that fills up all available space but leaves enough for the buttons
2121
static float width = 0;
@@ -32,7 +32,7 @@ void UImGui::ClientSideBar::End(float deltaTime, UImGui::ClientSideBarFlags flag
3232
if (flags & UIMGUI_CLIENT_SIDE_BAR_FLAG_MAXIMISE_BUTTON)
3333
renderMaximiseButton(width, style);
3434
if (flags & UIMGUI_CLIENT_SIDE_BAR_FLAG_CLOSE_BUTTON)
35-
renderCloseButton(width, style);
35+
renderCloseButton(width, style, destructiveColor, destructiveColorActive);
3636

3737
ImGui::PopStyleColor(3);
3838
ImGui::EndGroup();
@@ -81,10 +81,10 @@ void UImGui::ClientSideBar::renderMaximiseButton(float& width, const ImGuiStyle&
8181
drawList->AddLine(max, { max.x, min.y }, ImGui::ColorConvertFloat4ToU32(style.Colors[ImGuiCol_Text]));
8282
}
8383

84-
void UImGui::ClientSideBar::renderCloseButton(float& width, const ImGuiStyle& style) noexcept
84+
void UImGui::ClientSideBar::renderCloseButton(float& width, const ImGuiStyle& style, FVector4 destructiveColor, FVector4 destructiveColorActive) noexcept
8585
{
86-
ImGui::PushStyleColor(ImGuiCol_ButtonActive, IM_COL32(255, 123, 99, 255)); // TODO: This should be fixed when using UImGuiTheme
87-
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32(192, 28, 40, 255)); // TODO: This should be fixed when using UImGuiTheme
86+
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::ColorConvertFloat4ToU32({ destructiveColor.x, destructiveColor.y, destructiveColor.z, destructiveColor.w }));
87+
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertFloat4ToU32({ destructiveColorActive.x, destructiveColorActive.y, destructiveColorActive.z, destructiveColorActive.w }));
8888

8989
if (ImGui::SmallButton(" ##uimgui_internal_invisible_close_button"))
9090
UImGui::Instance::shutdown();

Framework/Renderer/ImGui/ClientSideBar.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <C/Rendering/CClientSideBar.h>
3+
#include <Types.hpp>
34

45
struct ImGuiStyle;
56

@@ -20,10 +21,10 @@ namespace UImGui
2021

2122
// Renders the bar
2223
// Event Safety - Post-begin
23-
static void End(float deltaTime, ClientSideBarFlags flags = UIMGUI_CLIENT_SIDE_BAR_FLAG_ALL) noexcept;
24+
static void End(float deltaTime, ClientSideBarFlags flags = UIMGUI_CLIENT_SIDE_BAR_FLAG_ALL, FVector4 destructiveColor = { 0.753f, 0.110f, 0.157f, 1.0f }, FVector4 destructiveColorActive = { 0.972f, 0.894f, 0.360f, 1.0f }) noexcept;
2425
private:
2526
static void renderMinimiseButton(float& width, const ImGuiStyle& style) noexcept;
2627
static void renderMaximiseButton(float& width, const ImGuiStyle& style) noexcept;
27-
static void renderCloseButton(float& width, const ImGuiStyle& style) noexcept;
28+
static void renderCloseButton(float& width, const ImGuiStyle& style, FVector4 destructiveColor, FVector4 destructiveColorActive) noexcept;
2829
};
2930
}

0 commit comments

Comments
 (0)