99#include " stb_image.h"
1010
1111// include font and assets
12+ #include " imgui_assets.h"
1213#include " font_kenney.h"
1314#include " font_roboto.h"
14- #include " utils/controller_image.h"
15-
16-
17- void SetupImGuiStyle () {
18- // Dark Ruda style by Raikiri from ImThemes
19- ImGuiStyle& style = ImGui::GetStyle ();
20-
21- style.Alpha = 1 .0f ;
22- style.DisabledAlpha = 0 .6f ;
23- style.WindowPadding = ImVec2 (8 .0f , 8 .0f );
24- style.WindowRounding = 0 .0f ;
25- style.WindowBorderSize = 1 .0f ;
26- style.WindowMinSize = ImVec2 (32 .0f , 32 .0f );
27- style.WindowTitleAlign = ImVec2 (0 .0f , 0 .5f );
28- style.WindowMenuButtonPosition = ImGuiDir_Left;
29- style.ChildRounding = 0 .0f ;
30- style.ChildBorderSize = 1 .0f ;
31- style.PopupRounding = 0 .0f ;
32- style.PopupBorderSize = 1 .0f ;
33- style.FramePadding = ImVec2 (4 .0f , 3 .0f );
34- style.FrameRounding = 4 .0f ;
35- style.FrameBorderSize = 0 .0f ;
36- style.ItemSpacing = ImVec2 (8 .0f , 4 .0f );
37- style.ItemInnerSpacing = ImVec2 (4 .0f , 4 .0f );
38- style.CellPadding = ImVec2 (4 .0f , 2 .0f );
39- style.IndentSpacing = 21 .0f ;
40- style.ColumnsMinSpacing = 6 .0f ;
41- style.ScrollbarSize = 14 .0f ;
42- style.ScrollbarRounding = 9 .0f ;
43- style.GrabMinSize = 10 .0f ;
44- style.GrabRounding = 4 .0f ;
45- style.TabRounding = 4 .0f ;
46- style.TabBorderSize = 0 .0f ;
47- // style.TabMinWidthForCloseButton = 0.0f;
48- style.ColorButtonPosition = ImGuiDir_Right;
49- style.ButtonTextAlign = ImVec2 (0 .5f , 0 .5f );
50- style.SelectableTextAlign = ImVec2 (0 .0f , 0 .0f );
51-
52- style.Colors [ImGuiCol_Text] = ImVec4 (0 .9490196f , 0 .95686275f , 0 .9764706f , 1 .0f );
53- style.Colors [ImGuiCol_TextDisabled] = ImVec4 (0 .35686275f , 0 .41960785f , 0 .46666667f , 1 .0f );
54- style.Colors [ImGuiCol_WindowBg] = ImVec4 (0 .10980392f , 0 .14901961f , 0 .16862746f , 1 .0f );
55- style.Colors [ImGuiCol_ChildBg] = ImVec4 (0 .14901961f , 0 .1764706f , 0 .21960784f , 1 .0f );
56- style.Colors [ImGuiCol_PopupBg] = ImVec4 (0 .078431375f , 0 .078431375f , 0 .078431375f , 0 .94f );
57- style.Colors [ImGuiCol_Border] = ImVec4 (0 .078431375f , 0 .09803922f , 0 .11764706f , 1 .0f );
58- style.Colors [ImGuiCol_BorderShadow] = ImVec4 (0 .0f , 0 .0f , 0 .0f , 0 .0f );
59- style.Colors [ImGuiCol_FrameBg] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 1 .0f );
60- style.Colors [ImGuiCol_FrameBgHovered] = ImVec4 (0 .11764706f , 0 .2f , 0 .2784314f , 1 .0f );
61- style.Colors [ImGuiCol_FrameBgActive] = ImVec4 (0 .08627451f , 0 .11764706f , 0 .13725491f , 1 .0f );
62- style.Colors [ImGuiCol_TitleBg] = ImVec4 (0 .08627451f , 0 .11764706f , 0 .13725491f , 0 .65f );
63- style.Colors [ImGuiCol_TitleBgActive] = ImVec4 (0 .078431375f , 0 .09803922f , 0 .11764706f , 1 .0f );
64- style.Colors [ImGuiCol_TitleBgCollapsed] = ImVec4 (0 .0f , 0 .0f , 0 .0f , 0 .51f );
65- style.Colors [ImGuiCol_MenuBarBg] = ImVec4 (0 .14901961f , 0 .1764706f , 0 .21960784f , 1 .0f );
66- style.Colors [ImGuiCol_ScrollbarBg] = ImVec4 (0 .019607844f , 0 .019607844f , 0 .019607844f , 0 .39f );
67- style.Colors [ImGuiCol_ScrollbarGrab] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 1 .0f );
68- style.Colors [ImGuiCol_ScrollbarGrabHovered] = ImVec4 (0 .1764706f , 0 .21960784f , 0 .24705882f , 1 .0f );
69- style.Colors [ImGuiCol_ScrollbarGrabActive] = ImVec4 (0 .08627451f , 0 .20784314f , 0 .30980393f , 1 .0f );
70- style.Colors [ImGuiCol_CheckMark] = ImVec4 (0 .2784314f , 0 .5568628f , 1 .0f , 1 .0f );
71- style.Colors [ImGuiCol_SliderGrab] = ImVec4 (0 .2784314f , 0 .5568628f , 1 .0f , 1 .0f );
72- style.Colors [ImGuiCol_SliderGrabActive] = ImVec4 (0 .36862746f , 0 .60784316f , 1 .0f , 1 .0f );
73- style.Colors [ImGuiCol_Button] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 1 .0f );
74- style.Colors [ImGuiCol_ButtonHovered] = ImVec4 (0 .2784314f , 0 .5568628f , 1 .0f , 1 .0f );
75- style.Colors [ImGuiCol_ButtonActive] = ImVec4 (0 .05882353f , 0 .5294118f , 0 .9764706f , 1 .0f );
76- style.Colors [ImGuiCol_Header] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 0 .55f );
77- style.Colors [ImGuiCol_HeaderHovered] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .8f );
78- style.Colors [ImGuiCol_HeaderActive] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 1 .0f );
79- style.Colors [ImGuiCol_Separator] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 1 .0f );
80- style.Colors [ImGuiCol_SeparatorHovered] = ImVec4 (0 .09803922f , 0 .4f , 0 .7490196f , 0 .78f );
81- style.Colors [ImGuiCol_SeparatorActive] = ImVec4 (0 .09803922f , 0 .4f , 0 .7490196f , 1 .0f );
82- style.Colors [ImGuiCol_ResizeGrip] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .25f );
83- style.Colors [ImGuiCol_ResizeGripHovered] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .67f );
84- style.Colors [ImGuiCol_ResizeGripActive] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .95f );
85- style.Colors [ImGuiCol_Tab] = ImVec4 (0 .10980392f , 0 .14901961f , 0 .16862746f , 1 .0f );
86- style.Colors [ImGuiCol_TabHovered] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .8f );
87- style.Colors [ImGuiCol_TabActive] = ImVec4 (0 .2f , 0 .24705882f , 0 .28627452f , 1 .0f );
88- style.Colors [ImGuiCol_TabUnfocused] = ImVec4 (0 .10980392f , 0 .14901961f , 0 .16862746f , 1 .0f );
89- style.Colors [ImGuiCol_TabUnfocusedActive] = ImVec4 (0 .10980392f , 0 .14901961f , 0 .16862746f , 1 .0f );
90- style.Colors [ImGuiCol_PlotLines] = ImVec4 (0 .60784316f , 0 .60784316f , 0 .60784316f , 1 .0f );
91- style.Colors [ImGuiCol_PlotLinesHovered] = ImVec4 (1 .0f , 0 .42745098f , 0 .34901962f , 1 .0f );
92- style.Colors [ImGuiCol_PlotHistogram] = ImVec4 (0 .8980392f , 0 .69803923f , 0 .0f , 1 .0f );
93- style.Colors [ImGuiCol_PlotHistogramHovered] = ImVec4 (1 .0f , 0 .6f , 0 .0f , 1 .0f );
94- style.Colors [ImGuiCol_TableHeaderBg] = ImVec4 (0 .1882353f , 0 .1882353f , 0 .2f , 1 .0f );
95- style.Colors [ImGuiCol_TableBorderStrong] = ImVec4 (0 .30980393f , 0 .30980393f , 0 .34901962f , 1 .0f );
96- style.Colors [ImGuiCol_TableBorderLight] = ImVec4 (0 .22745098f , 0 .22745098f , 0 .24705882f , 1 .0f );
97- style.Colors [ImGuiCol_TableRowBg] = ImVec4 (0 .0f , 0 .0f , 0 .0f , 0 .0f );
98- style.Colors [ImGuiCol_TableRowBgAlt] = ImVec4 (1 .0f , 1 .0f , 1 .0f , 0 .06f );
99- style.Colors [ImGuiCol_TextSelectedBg] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 0 .35f );
100- style.Colors [ImGuiCol_DragDropTarget] = ImVec4 (1 .0f , 1 .0f , 0 .0f , 0 .9f );
101- style.Colors [ImGuiCol_NavHighlight] = ImVec4 (0 .25882354f , 0 .5882353f , 0 .9764706f , 1 .0f );
102- style.Colors [ImGuiCol_NavWindowingHighlight] = ImVec4 (1 .0f , 1 .0f , 1 .0f , 0 .7f );
103- style.Colors [ImGuiCol_NavWindowingDimBg] = ImVec4 (0 .8f , 0 .8f , 0 .8f , 0 .2f );
104- style.Colors [ImGuiCol_ModalWindowDimBg] = ImVec4 (0 .8f , 0 .8f , 0 .8f , 0 .35f );
105- }
15+
10616
10717RND_Renderer::ImGuiOverlay::ImGuiOverlay (VkCommandBuffer cb, VkExtent2D fbRes, VkFormat fbFormat): m_outputRes(fbRes) {
10818 ImGui::CreateContext ();
@@ -825,14 +735,6 @@ void RND_Renderer::ImGuiOverlay::DrawHelpMenu() {
825735 DrawSettingRow (" Stick Direction Threshold" , [&]() {
826736 settings.axisThreshold .AddToGUI (&changed, windowWidth.x , 0 .1f , 0 .9f );
827737 });
828-
829- DrawSettingRow (" Reset Input Thresholds" , [&]() {
830- if (ImGui::Button (" Reset##InputThresholds" )) {
831- settings.stickDeadzone = ModSettings::kDefaultStickDeadzone ;
832- settings.axisThreshold = ModSettings::kDefaultAxisThreshold ;
833- changed = true ;
834- }
835- });
836738 }
837739 else {
838740 ImGui::Text (" " );
@@ -858,8 +760,8 @@ void RND_Renderer::ImGuiOverlay::DrawHelpMenu() {
858760 }
859761
860762 ImGui::NewLine ();
861- DrawSettingRow (" Reset All Options " , [&]() {
862- if (ImGui::Button (" Reset" )) {
763+ DrawSettingRow (" " , [&]() {
764+ if (ImGui::Button (" Reset All Settings " )) {
863765 auto options = settings.GetOptions ();
864766 for (int i = 0 ; i < options.size (); ++i) {
865767 options[i]->Reset ();
@@ -868,7 +770,6 @@ void RND_Renderer::ImGuiOverlay::DrawHelpMenu() {
868770 }
869771 });
870772
871-
872773 ImGui::EndTabItem ();
873774 }
874775
0 commit comments