From de6e18711851a44a4bde3a0757a7a7bf096cdc07 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 14:32:19 +0300 Subject: [PATCH 01/16] draft --- src/sdltiles.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index e7884ebff7f1c..5344295aa660c 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3722,6 +3722,74 @@ void catacurses::init_interface() color_loader().load( windowsPalette ); init_colors(); + ImGuiStyle& style = ImGui::GetStyle(); + + SDL_Color BLACK = windowsPalette[0]; + float BlackR = static_cast(BLACK.r) / 255.0f; + float BlackG = static_cast(BLACK.g) / 255.0f; + float BlackB = static_cast(BLACK.b) / 255.0f; + + SDL_Color BLUE = windowsPalette[4]; + float BlueR = static_cast(BLUE.r) / 255.0f; + float BlueG = static_cast(BLUE.g) / 255.0f; + float BlueB = static_cast(BLUE.b) / 255.0f; + + SDL_Color GRAY = windowsPalette[7]; + float GrayR = static_cast(GRAY.r) / 255.0f; + float GrayG = static_cast(GRAY.g) / 255.0f; + float GrayB = static_cast(GRAY.b) / 255.0f; + + SDL_Color DGRAY = windowsPalette[8]; + float DGrayR = static_cast(DGRAY.r) / 255.0f; + float DGrayG = static_cast(DGRAY.g) / 255.0f; + float DGrayB = static_cast(DGRAY.b) / 255.0f; + + SDL_Color WHITE = windowsPalette[15]; + float WhiteR = static_cast(WHITE.r) / 255.0f; + float WhiteG = static_cast(WHITE.g) / 255.0f; + float WhiteB = static_cast(WHITE.b) / 255.0f; + + style.Colors[ImGuiCol_Text] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_TextDisabled] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_WindowBg] = ImVec4(BlackR, BlackG, BlackB, 0.50f); + style.Colors[ImGuiCol_ChildBg] = ImVec4(BlackR, BlackG, BlackB, 0.00f); + style.Colors[ImGuiCol_PopupBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_Border] = ImVec4(WhiteR, WhiteG, WhiteB, 0.50f); + style.Colors[ImGuiCol_BorderShadow] = ImVec4(BlueR, BlueG, BlueB, 0.00f); + style.Colors[ImGuiCol_FrameBg] = ImVec4(DGrayR, DGrayG, DGrayB, 0.54f); + style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(BlackR, BlackG, BlackB, 0.40f); + style.Colors[ImGuiCol_FrameBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 0.67f); + style.Colors[ImGuiCol_TitleBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_TitleBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(BlueR, BlueG, BlueB, 0.51f); + style.Colors[ImGuiCol_MenuBarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(GrayR, GrayG, GrayB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_CheckMark] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_SliderGrab] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_Button] = ImVec4(DGrayR, DGrayG, DGrayB, 0.20f); + style.Colors[ImGuiCol_ButtonHovered] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_ButtonActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_Header] = ImVec4(BlueR, BlueG, BlueB, 0.30f); + style.Colors[ImGuiCol_HeaderHovered] = ImVec4(BlackR, BlackG, BlackB, 0.80f); + style.Colors[ImGuiCol_HeaderActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_Separator] = ImVec4(BlueR, BlueG, BlueB, 0.50f); + style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.80f); + style.Colors[ImGuiCol_SeparatorActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_ResizeGrip] = ImVec4(WhiteR, WhiteG, WhiteB, 0.20f); + style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.70f); + style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_Tab] = ImVec4(BlackR, BlackG, BlackB, 0.90f); + style.Colors[ImGuiCol_TabHovered] = ImVec4(BlueR, BlueG, BlueB, 0.80f); + style.Colors[ImGuiCol_TabActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_TabUnfocused] = ImVec4(BlackR, BlackG, BlackB, 0.90f); + style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_NavHighlight] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + // initialize sound set load_soundset(); From 8f1e0ed12d082c5bd9a7e0d945f256085c4950ad Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:01:12 +0300 Subject: [PATCH 02/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 5344295aa660c..4613674c5ac9b 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3725,9 +3725,9 @@ void catacurses::init_interface() ImGuiStyle& style = ImGui::GetStyle(); SDL_Color BLACK = windowsPalette[0]; - float BlackR = static_cast(BLACK.r) / 255.0f; - float BlackG = static_cast(BLACK.g) / 255.0f; - float BlackB = static_cast(BLACK.b) / 255.0f; + float BlackR = static_cast( BLACK.r ) / 255.0f; + float BlackG = static_cast( BLACK.g ) / 255.0f; + float BlackB = static_cast( BLACK.b ) / 255.0f; SDL_Color BLUE = windowsPalette[4]; float BlueR = static_cast(BLUE.r) / 255.0f; From ca828ff2d132b2afb0e45e8ddef5406d311a956d Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:27 +0300 Subject: [PATCH 03/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 4613674c5ac9b..e1ebd55a38a7c 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3722,7 +3722,7 @@ void catacurses::init_interface() color_loader().load( windowsPalette ); init_colors(); - ImGuiStyle& style = ImGui::GetStyle(); + ImGuiStyle &style = ImGui::GetStyle(); SDL_Color BLACK = windowsPalette[0]; float BlackR = static_cast( BLACK.r ) / 255.0f; From 5b58dfa9b1baa61f3471a491798415a4b8153cb4 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:42 +0300 Subject: [PATCH 04/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index e1ebd55a38a7c..d7292b4c3cff5 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3730,9 +3730,9 @@ void catacurses::init_interface() float BlackB = static_cast( BLACK.b ) / 255.0f; SDL_Color BLUE = windowsPalette[4]; - float BlueR = static_cast(BLUE.r) / 255.0f; - float BlueG = static_cast(BLUE.g) / 255.0f; - float BlueB = static_cast(BLUE.b) / 255.0f; + float BlueR = static_cast( BLUE.r ) / 255.0f; + float BlueG = static_cast( BLUE.g ) / 255.0f; + float BlueB = static_cast( BLUE.b ) / 255.0f; SDL_Color GRAY = windowsPalette[7]; float GrayR = static_cast(GRAY.r) / 255.0f; From f7a67b24113097bddd76e8c565cd7873c1556a5c Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:50 +0300 Subject: [PATCH 05/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index d7292b4c3cff5..a92ce26f1da61 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3735,9 +3735,9 @@ void catacurses::init_interface() float BlueB = static_cast( BLUE.b ) / 255.0f; SDL_Color GRAY = windowsPalette[7]; - float GrayR = static_cast(GRAY.r) / 255.0f; - float GrayG = static_cast(GRAY.g) / 255.0f; - float GrayB = static_cast(GRAY.b) / 255.0f; + float GrayR = static_cast( GRAY.r ) / 255.0f; + float GrayG = static_cast( GRAY.g ) / 255.0f; + float GrayB = static_cast( GRAY.b ) / 255.0f; SDL_Color DGRAY = windowsPalette[8]; float DGrayR = static_cast(DGRAY.r) / 255.0f; From a652fdea5fdfada80ea8d13f9d9616b15ff16001 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:56 +0300 Subject: [PATCH 06/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index a92ce26f1da61..71ab83e76038a 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3740,9 +3740,9 @@ void catacurses::init_interface() float GrayB = static_cast( GRAY.b ) / 255.0f; SDL_Color DGRAY = windowsPalette[8]; - float DGrayR = static_cast(DGRAY.r) / 255.0f; - float DGrayG = static_cast(DGRAY.g) / 255.0f; - float DGrayB = static_cast(DGRAY.b) / 255.0f; + float DGrayR = static_cast( DGRAY.r ) / 255.0f; + float DGrayG = static_cast( DGRAY.g ) / 255.0f; + float DGrayB = static_cast( DGRAY.b ) / 255.0f; SDL_Color WHITE = windowsPalette[15]; float WhiteR = static_cast(WHITE.r) / 255.0f; From 917530f4cd4861e95d8d80acf37a9a9cd3162e4f Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:04:12 +0300 Subject: [PATCH 07/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 88 ++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 71ab83e76038a..88cf777f8b15e 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3745,50 +3745,50 @@ void catacurses::init_interface() float DGrayB = static_cast( DGRAY.b ) / 255.0f; SDL_Color WHITE = windowsPalette[15]; - float WhiteR = static_cast(WHITE.r) / 255.0f; - float WhiteG = static_cast(WHITE.g) / 255.0f; - float WhiteB = static_cast(WHITE.b) / 255.0f; - - style.Colors[ImGuiCol_Text] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_TextDisabled] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_WindowBg] = ImVec4(BlackR, BlackG, BlackB, 0.50f); - style.Colors[ImGuiCol_ChildBg] = ImVec4(BlackR, BlackG, BlackB, 0.00f); - style.Colors[ImGuiCol_PopupBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_Border] = ImVec4(WhiteR, WhiteG, WhiteB, 0.50f); - style.Colors[ImGuiCol_BorderShadow] = ImVec4(BlueR, BlueG, BlueB, 0.00f); - style.Colors[ImGuiCol_FrameBg] = ImVec4(DGrayR, DGrayG, DGrayB, 0.54f); - style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(BlackR, BlackG, BlackB, 0.40f); - style.Colors[ImGuiCol_FrameBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 0.67f); - style.Colors[ImGuiCol_TitleBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_TitleBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(BlueR, BlueG, BlueB, 0.51f); - style.Colors[ImGuiCol_MenuBarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(GrayR, GrayG, GrayB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_CheckMark] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_SliderGrab] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_Button] = ImVec4(DGrayR, DGrayG, DGrayB, 0.20f); - style.Colors[ImGuiCol_ButtonHovered] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_ButtonActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_Header] = ImVec4(BlueR, BlueG, BlueB, 0.30f); - style.Colors[ImGuiCol_HeaderHovered] = ImVec4(BlackR, BlackG, BlackB, 0.80f); - style.Colors[ImGuiCol_HeaderActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_Separator] = ImVec4(BlueR, BlueG, BlueB, 0.50f); - style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.80f); - style.Colors[ImGuiCol_SeparatorActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_ResizeGrip] = ImVec4(WhiteR, WhiteG, WhiteB, 0.20f); - style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.70f); - style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_Tab] = ImVec4(BlackR, BlackG, BlackB, 0.90f); - style.Colors[ImGuiCol_TabHovered] = ImVec4(BlueR, BlueG, BlueB, 0.80f); - style.Colors[ImGuiCol_TabActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_TabUnfocused] = ImVec4(BlackR, BlackG, BlackB, 0.90f); - style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_NavHighlight] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + float WhiteR = static_cast( WHITE.r ) / 255.0f; + float WhiteG = static_cast( WHITE.g ) / 255.0f; + float WhiteB = static_cast( WHITE.b ) / 255.0f; + + style.Colors[ImGuiCol_Text] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_TextDisabled] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_WindowBg] = ImVec4( BlackR, BlackG, BlackB, 0.50f ); + style.Colors[ImGuiCol_ChildBg] = ImVec4( BlackR, BlackG, BlackB, 0.00f ); + style.Colors[ImGuiCol_PopupBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_Border] = ImVec4( WhiteR, WhiteG, WhiteB, 0.50f ); + style.Colors[ImGuiCol_BorderShadow] = ImVec4( BlueR, BlueG, BlueB, 0.00f ); + style.Colors[ImGuiCol_FrameBg] = ImVec4( DGrayR, DGrayG, DGrayB, 0.54f ); + style.Colors[ImGuiCol_FrameBgHovered] = ImVec4( BlackR, BlackG, BlackB, 0.40f ); + style.Colors[ImGuiCol_FrameBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 0.67f ); + style.Colors[ImGuiCol_TitleBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_TitleBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4( BlueR, BlueG, BlueB, 0.51f ); + style.Colors[ImGuiCol_MenuBarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4( GrayR, GrayG, GrayB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_CheckMark] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_SliderGrab] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_SliderGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_Button] = ImVec4( DGrayR, DGrayG, DGrayB, 0.20f ); + style.Colors[ImGuiCol_ButtonHovered] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_ButtonActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_Header] = ImVec4( BlueR, BlueG, BlueB, 0.30f ); + style.Colors[ImGuiCol_HeaderHovered] = ImVec4( BlackR, BlackG, BlackB, 0.80f ); + style.Colors[ImGuiCol_HeaderActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_Separator] = ImVec4( BlueR, BlueG, BlueB, 0.50f ); + style.Colors[ImGuiCol_SeparatorHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.80f ); + style.Colors[ImGuiCol_SeparatorActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_ResizeGrip] = ImVec4( WhiteR, WhiteG, WhiteB, 0.20f ); + style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.70f ); + style.Colors[ImGuiCol_ResizeGripActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_Tab] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); + style.Colors[ImGuiCol_TabHovered] = ImVec4( BlueR, BlueG, BlueB, 0.80f ); + style.Colors[ImGuiCol_TabActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_TabUnfocused] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); + style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_TextSelectedBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_NavHighlight] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); // initialize sound set load_soundset(); From d4c978db072baa1aa6098011c91bc99c0f664e70 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 14:32:19 +0300 Subject: [PATCH 08/16] draft --- src/sdltiles.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index db5b41d145e38..f870357a3232f 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3723,6 +3723,74 @@ void catacurses::init_interface() color_loader().load( windowsPalette ); init_colors(); + ImGuiStyle& style = ImGui::GetStyle(); + + SDL_Color BLACK = windowsPalette[0]; + float BlackR = static_cast(BLACK.r) / 255.0f; + float BlackG = static_cast(BLACK.g) / 255.0f; + float BlackB = static_cast(BLACK.b) / 255.0f; + + SDL_Color BLUE = windowsPalette[4]; + float BlueR = static_cast(BLUE.r) / 255.0f; + float BlueG = static_cast(BLUE.g) / 255.0f; + float BlueB = static_cast(BLUE.b) / 255.0f; + + SDL_Color GRAY = windowsPalette[7]; + float GrayR = static_cast(GRAY.r) / 255.0f; + float GrayG = static_cast(GRAY.g) / 255.0f; + float GrayB = static_cast(GRAY.b) / 255.0f; + + SDL_Color DGRAY = windowsPalette[8]; + float DGrayR = static_cast(DGRAY.r) / 255.0f; + float DGrayG = static_cast(DGRAY.g) / 255.0f; + float DGrayB = static_cast(DGRAY.b) / 255.0f; + + SDL_Color WHITE = windowsPalette[15]; + float WhiteR = static_cast(WHITE.r) / 255.0f; + float WhiteG = static_cast(WHITE.g) / 255.0f; + float WhiteB = static_cast(WHITE.b) / 255.0f; + + style.Colors[ImGuiCol_Text] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_TextDisabled] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_WindowBg] = ImVec4(BlackR, BlackG, BlackB, 0.50f); + style.Colors[ImGuiCol_ChildBg] = ImVec4(BlackR, BlackG, BlackB, 0.00f); + style.Colors[ImGuiCol_PopupBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_Border] = ImVec4(WhiteR, WhiteG, WhiteB, 0.50f); + style.Colors[ImGuiCol_BorderShadow] = ImVec4(BlueR, BlueG, BlueB, 0.00f); + style.Colors[ImGuiCol_FrameBg] = ImVec4(DGrayR, DGrayG, DGrayB, 0.54f); + style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(BlackR, BlackG, BlackB, 0.40f); + style.Colors[ImGuiCol_FrameBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 0.67f); + style.Colors[ImGuiCol_TitleBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_TitleBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(BlueR, BlueG, BlueB, 0.51f); + style.Colors[ImGuiCol_MenuBarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(GrayR, GrayG, GrayB, 1.00f); + style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_CheckMark] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_SliderGrab] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_Button] = ImVec4(DGrayR, DGrayG, DGrayB, 0.20f); + style.Colors[ImGuiCol_ButtonHovered] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_ButtonActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_Header] = ImVec4(BlueR, BlueG, BlueB, 0.30f); + style.Colors[ImGuiCol_HeaderHovered] = ImVec4(BlackR, BlackG, BlackB, 0.80f); + style.Colors[ImGuiCol_HeaderActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); + style.Colors[ImGuiCol_Separator] = ImVec4(BlueR, BlueG, BlueB, 0.50f); + style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.80f); + style.Colors[ImGuiCol_SeparatorActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_ResizeGrip] = ImVec4(WhiteR, WhiteG, WhiteB, 0.20f); + style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.70f); + style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); + style.Colors[ImGuiCol_Tab] = ImVec4(BlackR, BlackG, BlackB, 0.90f); + style.Colors[ImGuiCol_TabHovered] = ImVec4(BlueR, BlueG, BlueB, 0.80f); + style.Colors[ImGuiCol_TabActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_TabUnfocused] = ImVec4(BlackR, BlackG, BlackB, 0.90f); + style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(BlackR, BlackG, BlackB, 1.00f); + style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + style.Colors[ImGuiCol_NavHighlight] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + // initialize sound set load_soundset(); From 5ed90b223690561831f7bf8cd3a0ca942a4c3d4d Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:01:12 +0300 Subject: [PATCH 09/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index f870357a3232f..50e064cd1ceb6 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3726,9 +3726,9 @@ void catacurses::init_interface() ImGuiStyle& style = ImGui::GetStyle(); SDL_Color BLACK = windowsPalette[0]; - float BlackR = static_cast(BLACK.r) / 255.0f; - float BlackG = static_cast(BLACK.g) / 255.0f; - float BlackB = static_cast(BLACK.b) / 255.0f; + float BlackR = static_cast( BLACK.r ) / 255.0f; + float BlackG = static_cast( BLACK.g ) / 255.0f; + float BlackB = static_cast( BLACK.b ) / 255.0f; SDL_Color BLUE = windowsPalette[4]; float BlueR = static_cast(BLUE.r) / 255.0f; From b1198d30f96a7e960adf617f8ba1ad95010c2e68 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:27 +0300 Subject: [PATCH 10/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 50e064cd1ceb6..f24e68fe5e7fb 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3723,7 +3723,7 @@ void catacurses::init_interface() color_loader().load( windowsPalette ); init_colors(); - ImGuiStyle& style = ImGui::GetStyle(); + ImGuiStyle &style = ImGui::GetStyle(); SDL_Color BLACK = windowsPalette[0]; float BlackR = static_cast( BLACK.r ) / 255.0f; From 8571f2f0cc5939a5da4d0c323c7af968d163f09e Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:42 +0300 Subject: [PATCH 11/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index f24e68fe5e7fb..25cfe5e99dd1c 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3731,9 +3731,9 @@ void catacurses::init_interface() float BlackB = static_cast( BLACK.b ) / 255.0f; SDL_Color BLUE = windowsPalette[4]; - float BlueR = static_cast(BLUE.r) / 255.0f; - float BlueG = static_cast(BLUE.g) / 255.0f; - float BlueB = static_cast(BLUE.b) / 255.0f; + float BlueR = static_cast( BLUE.r ) / 255.0f; + float BlueG = static_cast( BLUE.g ) / 255.0f; + float BlueB = static_cast( BLUE.b ) / 255.0f; SDL_Color GRAY = windowsPalette[7]; float GrayR = static_cast(GRAY.r) / 255.0f; From b455ae567de0db6861d365f52f1624d5896ff4bd Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:50 +0300 Subject: [PATCH 12/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 25cfe5e99dd1c..83b0dd59696de 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3736,9 +3736,9 @@ void catacurses::init_interface() float BlueB = static_cast( BLUE.b ) / 255.0f; SDL_Color GRAY = windowsPalette[7]; - float GrayR = static_cast(GRAY.r) / 255.0f; - float GrayG = static_cast(GRAY.g) / 255.0f; - float GrayB = static_cast(GRAY.b) / 255.0f; + float GrayR = static_cast( GRAY.r ) / 255.0f; + float GrayG = static_cast( GRAY.g ) / 255.0f; + float GrayB = static_cast( GRAY.b ) / 255.0f; SDL_Color DGRAY = windowsPalette[8]; float DGrayR = static_cast(DGRAY.r) / 255.0f; From 7e7f0efb26a1c06f03209f94e99a2e921bb6bcc2 Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:03:56 +0300 Subject: [PATCH 13/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 83b0dd59696de..8950f5e56dc46 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3741,9 +3741,9 @@ void catacurses::init_interface() float GrayB = static_cast( GRAY.b ) / 255.0f; SDL_Color DGRAY = windowsPalette[8]; - float DGrayR = static_cast(DGRAY.r) / 255.0f; - float DGrayG = static_cast(DGRAY.g) / 255.0f; - float DGrayB = static_cast(DGRAY.b) / 255.0f; + float DGrayR = static_cast( DGRAY.r ) / 255.0f; + float DGrayG = static_cast( DGRAY.g ) / 255.0f; + float DGrayB = static_cast( DGRAY.b ) / 255.0f; SDL_Color WHITE = windowsPalette[15]; float WhiteR = static_cast(WHITE.r) / 255.0f; From 1c5a22d2e33512f87f71b1ed207af0ebfd9f070e Mon Sep 17 00:00:00 2001 From: vetal l Date: Wed, 4 Sep 2024 15:04:12 +0300 Subject: [PATCH 14/16] Update src/sdltiles.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/sdltiles.cpp | 88 ++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 8950f5e56dc46..4ed96f1681b1f 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3746,50 +3746,50 @@ void catacurses::init_interface() float DGrayB = static_cast( DGRAY.b ) / 255.0f; SDL_Color WHITE = windowsPalette[15]; - float WhiteR = static_cast(WHITE.r) / 255.0f; - float WhiteG = static_cast(WHITE.g) / 255.0f; - float WhiteB = static_cast(WHITE.b) / 255.0f; - - style.Colors[ImGuiCol_Text] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_TextDisabled] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_WindowBg] = ImVec4(BlackR, BlackG, BlackB, 0.50f); - style.Colors[ImGuiCol_ChildBg] = ImVec4(BlackR, BlackG, BlackB, 0.00f); - style.Colors[ImGuiCol_PopupBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_Border] = ImVec4(WhiteR, WhiteG, WhiteB, 0.50f); - style.Colors[ImGuiCol_BorderShadow] = ImVec4(BlueR, BlueG, BlueB, 0.00f); - style.Colors[ImGuiCol_FrameBg] = ImVec4(DGrayR, DGrayG, DGrayB, 0.54f); - style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(BlackR, BlackG, BlackB, 0.40f); - style.Colors[ImGuiCol_FrameBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 0.67f); - style.Colors[ImGuiCol_TitleBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_TitleBgActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(BlueR, BlueG, BlueB, 0.51f); - style.Colors[ImGuiCol_MenuBarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(GrayR, GrayG, GrayB, 1.00f); - style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_CheckMark] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_SliderGrab] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_Button] = ImVec4(DGrayR, DGrayG, DGrayB, 0.20f); - style.Colors[ImGuiCol_ButtonHovered] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_ButtonActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_Header] = ImVec4(BlueR, BlueG, BlueB, 0.30f); - style.Colors[ImGuiCol_HeaderHovered] = ImVec4(BlackR, BlackG, BlackB, 0.80f); - style.Colors[ImGuiCol_HeaderActive] = ImVec4(DGrayR, DGrayG, DGrayB, 1.00f); - style.Colors[ImGuiCol_Separator] = ImVec4(BlueR, BlueG, BlueB, 0.50f); - style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.80f); - style.Colors[ImGuiCol_SeparatorActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_ResizeGrip] = ImVec4(WhiteR, WhiteG, WhiteB, 0.20f); - style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(WhiteR, WhiteG, WhiteB, 0.70f); - style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(WhiteR, WhiteG, WhiteB, 1.00f); - style.Colors[ImGuiCol_Tab] = ImVec4(BlackR, BlackG, BlackB, 0.90f); - style.Colors[ImGuiCol_TabHovered] = ImVec4(BlueR, BlueG, BlueB, 0.80f); - style.Colors[ImGuiCol_TabActive] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_TabUnfocused] = ImVec4(BlackR, BlackG, BlackB, 0.90f); - style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(BlackR, BlackG, BlackB, 1.00f); - style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(BlueR, BlueG, BlueB, 1.00f); - style.Colors[ImGuiCol_NavHighlight] = ImVec4(BlueR, BlueG, BlueB, 1.00f); + float WhiteR = static_cast( WHITE.r ) / 255.0f; + float WhiteG = static_cast( WHITE.g ) / 255.0f; + float WhiteB = static_cast( WHITE.b ) / 255.0f; + + style.Colors[ImGuiCol_Text] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_TextDisabled] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_WindowBg] = ImVec4( BlackR, BlackG, BlackB, 0.50f ); + style.Colors[ImGuiCol_ChildBg] = ImVec4( BlackR, BlackG, BlackB, 0.00f ); + style.Colors[ImGuiCol_PopupBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_Border] = ImVec4( WhiteR, WhiteG, WhiteB, 0.50f ); + style.Colors[ImGuiCol_BorderShadow] = ImVec4( BlueR, BlueG, BlueB, 0.00f ); + style.Colors[ImGuiCol_FrameBg] = ImVec4( DGrayR, DGrayG, DGrayB, 0.54f ); + style.Colors[ImGuiCol_FrameBgHovered] = ImVec4( BlackR, BlackG, BlackB, 0.40f ); + style.Colors[ImGuiCol_FrameBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 0.67f ); + style.Colors[ImGuiCol_TitleBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_TitleBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4( BlueR, BlueG, BlueB, 0.51f ); + style.Colors[ImGuiCol_MenuBarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4( GrayR, GrayG, GrayB, 1.00f ); + style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_CheckMark] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_SliderGrab] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_SliderGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_Button] = ImVec4( DGrayR, DGrayG, DGrayB, 0.20f ); + style.Colors[ImGuiCol_ButtonHovered] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_ButtonActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_Header] = ImVec4( BlueR, BlueG, BlueB, 0.30f ); + style.Colors[ImGuiCol_HeaderHovered] = ImVec4( BlackR, BlackG, BlackB, 0.80f ); + style.Colors[ImGuiCol_HeaderActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); + style.Colors[ImGuiCol_Separator] = ImVec4( BlueR, BlueG, BlueB, 0.50f ); + style.Colors[ImGuiCol_SeparatorHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.80f ); + style.Colors[ImGuiCol_SeparatorActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_ResizeGrip] = ImVec4( WhiteR, WhiteG, WhiteB, 0.20f ); + style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.70f ); + style.Colors[ImGuiCol_ResizeGripActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); + style.Colors[ImGuiCol_Tab] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); + style.Colors[ImGuiCol_TabHovered] = ImVec4( BlueR, BlueG, BlueB, 0.80f ); + style.Colors[ImGuiCol_TabActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_TabUnfocused] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); + style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); + style.Colors[ImGuiCol_TextSelectedBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_NavHighlight] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); // initialize sound set load_soundset(); From 51f5958eb9cc833f86567c67920ed6261c0041d6 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Thu, 5 Sep 2024 17:23:18 -0700 Subject: [PATCH 15/16] simplify using color identifiers and the implicit constructor This should be easier to follow and easier to maintain. --- src/sdltiles.cpp | 105 ++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 65 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 4ed96f1681b1f..ecc6530369200 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3725,71 +3725,46 @@ void catacurses::init_interface() ImGuiStyle &style = ImGui::GetStyle(); - SDL_Color BLACK = windowsPalette[0]; - float BlackR = static_cast( BLACK.r ) / 255.0f; - float BlackG = static_cast( BLACK.g ) / 255.0f; - float BlackB = static_cast( BLACK.b ) / 255.0f; - - SDL_Color BLUE = windowsPalette[4]; - float BlueR = static_cast( BLUE.r ) / 255.0f; - float BlueG = static_cast( BLUE.g ) / 255.0f; - float BlueB = static_cast( BLUE.b ) / 255.0f; - - SDL_Color GRAY = windowsPalette[7]; - float GrayR = static_cast( GRAY.r ) / 255.0f; - float GrayG = static_cast( GRAY.g ) / 255.0f; - float GrayB = static_cast( GRAY.b ) / 255.0f; - - SDL_Color DGRAY = windowsPalette[8]; - float DGrayR = static_cast( DGRAY.r ) / 255.0f; - float DGrayG = static_cast( DGRAY.g ) / 255.0f; - float DGrayB = static_cast( DGRAY.b ) / 255.0f; - - SDL_Color WHITE = windowsPalette[15]; - float WhiteR = static_cast( WHITE.r ) / 255.0f; - float WhiteG = static_cast( WHITE.g ) / 255.0f; - float WhiteB = static_cast( WHITE.b ) / 255.0f; - - style.Colors[ImGuiCol_Text] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_TextDisabled] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); - style.Colors[ImGuiCol_WindowBg] = ImVec4( BlackR, BlackG, BlackB, 0.50f ); - style.Colors[ImGuiCol_ChildBg] = ImVec4( BlackR, BlackG, BlackB, 0.00f ); - style.Colors[ImGuiCol_PopupBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); - style.Colors[ImGuiCol_Border] = ImVec4( WhiteR, WhiteG, WhiteB, 0.50f ); - style.Colors[ImGuiCol_BorderShadow] = ImVec4( BlueR, BlueG, BlueB, 0.00f ); - style.Colors[ImGuiCol_FrameBg] = ImVec4( DGrayR, DGrayG, DGrayB, 0.54f ); - style.Colors[ImGuiCol_FrameBgHovered] = ImVec4( BlackR, BlackG, BlackB, 0.40f ); - style.Colors[ImGuiCol_FrameBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 0.67f ); - style.Colors[ImGuiCol_TitleBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); - style.Colors[ImGuiCol_TitleBgActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); - style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4( BlueR, BlueG, BlueB, 0.51f ); - style.Colors[ImGuiCol_MenuBarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); - style.Colors[ImGuiCol_ScrollbarBg] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); - style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); - style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4( GrayR, GrayG, GrayB, 1.00f ); - style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_CheckMark] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_SliderGrab] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_SliderGrabActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_Button] = ImVec4( DGrayR, DGrayG, DGrayB, 0.20f ); - style.Colors[ImGuiCol_ButtonHovered] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); - style.Colors[ImGuiCol_ButtonActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); - style.Colors[ImGuiCol_Header] = ImVec4( BlueR, BlueG, BlueB, 0.30f ); - style.Colors[ImGuiCol_HeaderHovered] = ImVec4( BlackR, BlackG, BlackB, 0.80f ); - style.Colors[ImGuiCol_HeaderActive] = ImVec4( DGrayR, DGrayG, DGrayB, 1.00f ); - style.Colors[ImGuiCol_Separator] = ImVec4( BlueR, BlueG, BlueB, 0.50f ); - style.Colors[ImGuiCol_SeparatorHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.80f ); - style.Colors[ImGuiCol_SeparatorActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_ResizeGrip] = ImVec4( WhiteR, WhiteG, WhiteB, 0.20f ); - style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4( WhiteR, WhiteG, WhiteB, 0.70f ); - style.Colors[ImGuiCol_ResizeGripActive] = ImVec4( WhiteR, WhiteG, WhiteB, 1.00f ); - style.Colors[ImGuiCol_Tab] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); - style.Colors[ImGuiCol_TabHovered] = ImVec4( BlueR, BlueG, BlueB, 0.80f ); - style.Colors[ImGuiCol_TabActive] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); - style.Colors[ImGuiCol_TabUnfocused] = ImVec4( BlackR, BlackG, BlackB, 0.90f ); - style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4( BlackR, BlackG, BlackB, 1.00f ); - style.Colors[ImGuiCol_TextSelectedBg] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); - style.Colors[ImGuiCol_NavHighlight] = ImVec4( BlueR, BlueG, BlueB, 1.00f ); + style.Colors[ImGuiCol_Text] = c_white; + style.Colors[ImGuiCol_TextDisabled] = c_dark_gray; + style.Colors[ImGuiCol_WindowBg] = c_black; + style.Colors[ImGuiCol_ChildBg] = c_black; + style.Colors[ImGuiCol_PopupBg] = c_black; + style.Colors[ImGuiCol_Border] = c_white; + style.Colors[ImGuiCol_BorderShadow] = c_blue; + style.Colors[ImGuiCol_FrameBg] = c_dark_gray; + style.Colors[ImGuiCol_FrameBgHovered] = c_black; + style.Colors[ImGuiCol_FrameBgActive] = c_dark_gray; + style.Colors[ImGuiCol_TitleBg] = c_blue; + style.Colors[ImGuiCol_TitleBgActive] = c_dark_gray; + style.Colors[ImGuiCol_TitleBgCollapsed] = c_blue; + style.Colors[ImGuiCol_MenuBarBg] = c_black; + style.Colors[ImGuiCol_ScrollbarBg] = c_black; + style.Colors[ImGuiCol_ScrollbarGrab] = c_dark_gray; + style.Colors[ImGuiCol_ScrollbarGrabHovered] = c_light_gray; + style.Colors[ImGuiCol_ScrollbarGrabActive] = c_white; + style.Colors[ImGuiCol_CheckMark] = c_white; + style.Colors[ImGuiCol_SliderGrab] = c_white; + style.Colors[ImGuiCol_SliderGrabActive] = c_white; + style.Colors[ImGuiCol_Button] = c_dark_gray; + style.Colors[ImGuiCol_ButtonHovered] = c_dark_gray; + style.Colors[ImGuiCol_ButtonActive] = c_blue; + style.Colors[ImGuiCol_Header] = c_blue; + style.Colors[ImGuiCol_HeaderHovered] = c_black; + style.Colors[ImGuiCol_HeaderActive] = c_dark_gray; + style.Colors[ImGuiCol_Separator] = c_blue; + style.Colors[ImGuiCol_SeparatorHovered] = c_white; + style.Colors[ImGuiCol_SeparatorActive] = c_white; + style.Colors[ImGuiCol_ResizeGrip] = c_light_gray; + style.Colors[ImGuiCol_ResizeGripHovered] = c_white; + style.Colors[ImGuiCol_ResizeGripActive] = c_white; + style.Colors[ImGuiCol_Tab] = c_black; + style.Colors[ImGuiCol_TabHovered] = c_blue; + style.Colors[ImGuiCol_TabActive] = c_blue; + style.Colors[ImGuiCol_TabUnfocused] = c_black; + style.Colors[ImGuiCol_TabUnfocusedActive] = c_black; + style.Colors[ImGuiCol_TextSelectedBg] = c_blue; + style.Colors[ImGuiCol_NavHighlight] = c_blue; // initialize sound set load_soundset(); From e4615ba757410203c6bd089d5823ed7239aa4e19 Mon Sep 17 00:00:00 2001 From: vetal l Date: Fri, 6 Sep 2024 11:06:52 +0300 Subject: [PATCH 16/16] move this into appropriate file --- src/color.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ src/sdltiles.cpp | 43 ------------------------------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/color.cpp b/src/color.cpp index 10932e6f8df85..7fd3224786334 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -539,6 +539,49 @@ void init_colors() {"C", {c_cyan, to_translation( "cyan" )}}, {"c", {c_light_cyan, to_translation( "light cyan" )}}, {"P", {c_pink, to_translation( "pink" )}}, {"m", {c_magenta, to_translation( "magenta" )}} }; + + ImGuiStyle &style = ImGui::GetStyle(); + + style.Colors[ImGuiCol_Text] = c_white; + style.Colors[ImGuiCol_TextDisabled] = c_dark_gray; + style.Colors[ImGuiCol_WindowBg] = c_black; + style.Colors[ImGuiCol_ChildBg] = c_black; + style.Colors[ImGuiCol_PopupBg] = c_black; + style.Colors[ImGuiCol_Border] = c_white; + style.Colors[ImGuiCol_BorderShadow] = c_blue; + style.Colors[ImGuiCol_FrameBg] = c_dark_gray; + style.Colors[ImGuiCol_FrameBgHovered] = c_black; + style.Colors[ImGuiCol_FrameBgActive] = c_dark_gray; + style.Colors[ImGuiCol_TitleBg] = c_blue; + style.Colors[ImGuiCol_TitleBgActive] = c_dark_gray; + style.Colors[ImGuiCol_TitleBgCollapsed] = c_blue; + style.Colors[ImGuiCol_MenuBarBg] = c_black; + style.Colors[ImGuiCol_ScrollbarBg] = c_black; + style.Colors[ImGuiCol_ScrollbarGrab] = c_dark_gray; + style.Colors[ImGuiCol_ScrollbarGrabHovered] = c_light_gray; + style.Colors[ImGuiCol_ScrollbarGrabActive] = c_white; + style.Colors[ImGuiCol_CheckMark] = c_white; + style.Colors[ImGuiCol_SliderGrab] = c_white; + style.Colors[ImGuiCol_SliderGrabActive] = c_white; + style.Colors[ImGuiCol_Button] = c_dark_gray; + style.Colors[ImGuiCol_ButtonHovered] = c_dark_gray; + style.Colors[ImGuiCol_ButtonActive] = c_blue; + style.Colors[ImGuiCol_Header] = c_blue; + style.Colors[ImGuiCol_HeaderHovered] = c_black; + style.Colors[ImGuiCol_HeaderActive] = c_dark_gray; + style.Colors[ImGuiCol_Separator] = c_blue; + style.Colors[ImGuiCol_SeparatorHovered] = c_white; + style.Colors[ImGuiCol_SeparatorActive] = c_white; + style.Colors[ImGuiCol_ResizeGrip] = c_light_gray; + style.Colors[ImGuiCol_ResizeGripHovered] = c_white; + style.Colors[ImGuiCol_ResizeGripActive] = c_white; + style.Colors[ImGuiCol_Tab] = c_black; + style.Colors[ImGuiCol_TabHovered] = c_blue; + style.Colors[ImGuiCol_TabActive] = c_blue; + style.Colors[ImGuiCol_TabUnfocused] = c_black; + style.Colors[ImGuiCol_TabUnfocusedActive] = c_black; + style.Colors[ImGuiCol_TextSelectedBg] = c_blue; + style.Colors[ImGuiCol_NavHighlight] = c_blue; } nc_color invert_color( const nc_color &c ) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index ecc6530369200..db5b41d145e38 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3723,49 +3723,6 @@ void catacurses::init_interface() color_loader().load( windowsPalette ); init_colors(); - ImGuiStyle &style = ImGui::GetStyle(); - - style.Colors[ImGuiCol_Text] = c_white; - style.Colors[ImGuiCol_TextDisabled] = c_dark_gray; - style.Colors[ImGuiCol_WindowBg] = c_black; - style.Colors[ImGuiCol_ChildBg] = c_black; - style.Colors[ImGuiCol_PopupBg] = c_black; - style.Colors[ImGuiCol_Border] = c_white; - style.Colors[ImGuiCol_BorderShadow] = c_blue; - style.Colors[ImGuiCol_FrameBg] = c_dark_gray; - style.Colors[ImGuiCol_FrameBgHovered] = c_black; - style.Colors[ImGuiCol_FrameBgActive] = c_dark_gray; - style.Colors[ImGuiCol_TitleBg] = c_blue; - style.Colors[ImGuiCol_TitleBgActive] = c_dark_gray; - style.Colors[ImGuiCol_TitleBgCollapsed] = c_blue; - style.Colors[ImGuiCol_MenuBarBg] = c_black; - style.Colors[ImGuiCol_ScrollbarBg] = c_black; - style.Colors[ImGuiCol_ScrollbarGrab] = c_dark_gray; - style.Colors[ImGuiCol_ScrollbarGrabHovered] = c_light_gray; - style.Colors[ImGuiCol_ScrollbarGrabActive] = c_white; - style.Colors[ImGuiCol_CheckMark] = c_white; - style.Colors[ImGuiCol_SliderGrab] = c_white; - style.Colors[ImGuiCol_SliderGrabActive] = c_white; - style.Colors[ImGuiCol_Button] = c_dark_gray; - style.Colors[ImGuiCol_ButtonHovered] = c_dark_gray; - style.Colors[ImGuiCol_ButtonActive] = c_blue; - style.Colors[ImGuiCol_Header] = c_blue; - style.Colors[ImGuiCol_HeaderHovered] = c_black; - style.Colors[ImGuiCol_HeaderActive] = c_dark_gray; - style.Colors[ImGuiCol_Separator] = c_blue; - style.Colors[ImGuiCol_SeparatorHovered] = c_white; - style.Colors[ImGuiCol_SeparatorActive] = c_white; - style.Colors[ImGuiCol_ResizeGrip] = c_light_gray; - style.Colors[ImGuiCol_ResizeGripHovered] = c_white; - style.Colors[ImGuiCol_ResizeGripActive] = c_white; - style.Colors[ImGuiCol_Tab] = c_black; - style.Colors[ImGuiCol_TabHovered] = c_blue; - style.Colors[ImGuiCol_TabActive] = c_blue; - style.Colors[ImGuiCol_TabUnfocused] = c_black; - style.Colors[ImGuiCol_TabUnfocusedActive] = c_black; - style.Colors[ImGuiCol_TextSelectedBg] = c_blue; - style.Colors[ImGuiCol_NavHighlight] = c_blue; - // initialize sound set load_soundset();