From 88e7439d6c55e0f20d1ae2128a31326602b6bb88 Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Mon, 15 Dec 2025 10:57:26 -0700 Subject: [PATCH 1/7] enum Colors --- Harbour/include/MenuScreen.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Harbour/include/MenuScreen.h b/Harbour/include/MenuScreen.h index 1350903..39f3430 100644 --- a/Harbour/include/MenuScreen.h +++ b/Harbour/include/MenuScreen.h @@ -6,7 +6,7 @@ namespace HarbourGUI { - enum screenID { + const enum screenID { MyLibrary, AllGames, Settings, @@ -17,4 +17,14 @@ namespace HarbourGUI { void downloadsScreen(std::vector& downloads); void settingsScreen(); void helpScreen(); + + const enum Colors { + BlueGray, + DarkBlue, + LightBlue, + Green, + Teal, + Red, + Gray + }; } \ No newline at end of file From bd66bccba2e3423364e329433fd27f69575ad822 Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Mon, 15 Dec 2025 14:34:33 -0700 Subject: [PATCH 2/7] Add ColorManager [wip] --- Harbour/include/MenuScreen.h | 64 +++++++++++++++++++++++++++- Harbour/include/utils/ColorManager.h | 25 +++++++++++ Harbour/src/MenuScreen.cpp | 13 ++++++ Harbour/src/utils/ColorManager.cpp | 2 + 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 Harbour/include/utils/ColorManager.h create mode 100644 Harbour/src/utils/ColorManager.cpp diff --git a/Harbour/include/MenuScreen.h b/Harbour/include/MenuScreen.h index 39f3430..954841c 100644 --- a/Harbour/include/MenuScreen.h +++ b/Harbour/include/MenuScreen.h @@ -27,4 +27,66 @@ namespace HarbourGUI { Red, Gray }; -} \ No newline at end of file + + ImVec4 getColor(Colors color); + ImVec4 userColorProf = {}; +} + +/* +Nice, you found it! `0.1, 0.1, 0.15, 1.0` is a nice dark bluish-gray — easy on the eyes and doesn’t clash with ImGui’s default colors. + +Here are some suggestions for alternative color schemes and the general “feel” they give: + +--- + +### **1. Green-themed** + +* `0.05, 0.1, 0.05, 1.0` ? very dark forest green, calm and natural +* Works well with beige/tan or light green accent buttons +* Gives a “terminal + nature” vibe + +--- + +### **2. Red-themed** + +* `0.15, 0.05, 0.05, 1.0` ? dark maroon / burgundy +* Good for alert-heavy UI or if you want a warm, energetic feel +* Red can be tiring if the UI is used a lot, so best for accents + +--- + +### **3. Gray-themed / Neutral** + +* `0.1, 0.1, 0.1, 1.0` ? almost black, very neutral +* `0.15, 0.15, 0.15, 1.0` ? slightly lighter, good for soft contrast +* Easy on eyes, very professional, works well with any highlight color (green/red/blue/yellow) + +--- + +### **4. Blue / Nautical** + +* `0.05, 0.05, 0.2, 1.0` ? navy, classic dark blue +* Fits your “nautical” theme perfectly +* Works with white, teal, or gold highlights + +--- + +### **5. Teal / Sci-Fi** + +* `0.05, 0.15, 0.15, 1.0` ? dark teal +* Gives a techy, slightly futuristic look +* Accent with cyan or orange + +--- + +**Tips for choosing a scheme:** + +* Keep background darker than your text for readability. +* Use 1–2 accent colors for highlights/buttons to avoid visual clutter. +* If you plan to make this customizable, consider saving the RGBA in a JSON settings file so users can pick a color in the UI. + +--- + +If you want, I can mock up a **few ready-to-use RGBA palettes** for Harbour/SoH that would look good with ImGui’s default widgets — could save you time experimenting. Do you want me to do that? + +*/ diff --git a/Harbour/include/utils/ColorManager.h b/Harbour/include/utils/ColorManager.h new file mode 100644 index 0000000..ce0c48a --- /dev/null +++ b/Harbour/include/utils/ColorManager.h @@ -0,0 +1,25 @@ +#pragma once + +namespace HarbourUtils { + class ColorManager { + public: + ColorManager(); + + public: + //Getters/setters + + private: + const enum Colors { + BlueGray, + DarkBlue, + LightBlue, + Green, + Teal, + Red, + Gray + }; + + ImVec4 m_backgroundColor = {}; + + }; +} diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index c479069..da89b35 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -53,3 +53,16 @@ void HarbourGUI::helpScreen() ImGui::Text("Coming soon..."); } + +ImVec4 HarbourGUI::getColor(Colors color) +{ + ImVec4 i = {}; + switch (color) { + case BlueGray: + i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + break; + default: + i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + } + return i; +} diff --git a/Harbour/src/utils/ColorManager.cpp b/Harbour/src/utils/ColorManager.cpp new file mode 100644 index 0000000..2761239 --- /dev/null +++ b/Harbour/src/utils/ColorManager.cpp @@ -0,0 +1,2 @@ +#include "ColorManager.h" + From 69c901ccaa380f7c25b8e6772218170eb950b3ad Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Tue, 16 Dec 2025 17:36:38 -0700 Subject: [PATCH 3/7] colormanager wip --- CMakeLists.txt | 5 ++- Harbour/include/App.h | 3 ++ Harbour/include/GameCard.h | 3 +- Harbour/include/MenuScreen.h | 14 -------- Harbour/include/utils/ColorManager.h | 15 ++++++-- Harbour/include/utils/FileManager.h | 4 +-- Harbour/include/utils/LoadImage.h | 1 - Harbour/src/App.cpp | 4 +-- Harbour/src/GameCard.cpp | 5 ++- Harbour/src/MenuScreen.cpp | 30 +++++++++------- Harbour/src/utils/ColorManager.cpp | 51 +++++++++++++++++++++++++++- Harbour/src/utils/FileManager.cpp | 5 +++ Harbour/src/utils/LoadImage.cpp | 1 + 13 files changed, 98 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2c5ed9..f8b8b89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,10 @@ add_executable(Harbour Harbour/src/main.cpp Harbour/src/App.cpp Harbour/src/GameCard.cpp - Harbour/src/utils/FileManager.cpp - Harbour/include/MenuScreen.h + Harbour/src/utils/FileManager.cpp Harbour/src/MenuScreen.cpp - Harbour/include/utils/LoadImage.h Harbour/src/utils/LoadImage.cpp + Harbour/src/utils/ColorManager.cpp ) target_include_directories(Harbour PRIVATE diff --git a/Harbour/include/App.h b/Harbour/include/App.h index 160729c..3d6da69 100644 --- a/Harbour/include/App.h +++ b/Harbour/include/App.h @@ -11,6 +11,7 @@ #include "GameCard.h" #include "utils/FileManager.h" +#include "utils/ColorManager.h" #include "MenuScreen.h" namespace Harbour { @@ -38,6 +39,8 @@ namespace Harbour { private: HarbourUtils::FileManager m_fileManager = {}; + HarbourUtils::ColorManager m_colorManager = {}; + void constructLibraryFromJSON(std::vector& output, std::string lib); }; diff --git a/Harbour/include/GameCard.h b/Harbour/include/GameCard.h index 05e6864..0de47a0 100644 --- a/Harbour/include/GameCard.h +++ b/Harbour/include/GameCard.h @@ -1,6 +1,5 @@ #pragma once -#include "utils/LoadImage.h" #include namespace Harbour { @@ -26,7 +25,7 @@ namespace Harbour { std::string m_version; const char* m_thumbnailFilePath = nullptr; - GLuint m_texture = 0; + unsigned int m_texture = 0; //GLuint equivalent }; } \ No newline at end of file diff --git a/Harbour/include/MenuScreen.h b/Harbour/include/MenuScreen.h index 954841c..387aefb 100644 --- a/Harbour/include/MenuScreen.h +++ b/Harbour/include/MenuScreen.h @@ -1,6 +1,5 @@ #pragma once -#include "imgui.h" #include #include "GameCard.h" @@ -17,19 +16,6 @@ namespace HarbourGUI { void downloadsScreen(std::vector& downloads); void settingsScreen(); void helpScreen(); - - const enum Colors { - BlueGray, - DarkBlue, - LightBlue, - Green, - Teal, - Red, - Gray - }; - - ImVec4 getColor(Colors color); - ImVec4 userColorProf = {}; } /* diff --git a/Harbour/include/utils/ColorManager.h b/Harbour/include/utils/ColorManager.h index ce0c48a..6cc4157 100644 --- a/Harbour/include/utils/ColorManager.h +++ b/Harbour/include/utils/ColorManager.h @@ -1,5 +1,7 @@ #pragma once +struct ImVec4; + namespace HarbourUtils { class ColorManager { public: @@ -7,18 +9,25 @@ namespace HarbourUtils { public: //Getters/setters + ImVec4 getBackground() const; + ImVec4 getThemeColor(); + void drawBackground() const; private: + void setBackgroundColor(); + const enum Colors { - BlueGray, - DarkBlue, - LightBlue, + BlueGray, //Default + DarkBlue, //0.0, 0.0, 0.25, 1.0 + LightBlue, //0.43 0.52 0.89 Green, Teal, Red, Gray }; + Colors m_currentColorTheme = {}; + ImVec4 m_backgroundColor = {}; }; diff --git a/Harbour/include/utils/FileManager.h b/Harbour/include/utils/FileManager.h index 35a18ce..ead16cd 100644 --- a/Harbour/include/utils/FileManager.h +++ b/Harbour/include/utils/FileManager.h @@ -1,9 +1,7 @@ #pragma once -#include -#include + #include #include -#include namespace HarbourUtils { class FileManager { diff --git a/Harbour/include/utils/LoadImage.h b/Harbour/include/utils/LoadImage.h index bd143fb..b5b5070 100644 --- a/Harbour/include/utils/LoadImage.h +++ b/Harbour/include/utils/LoadImage.h @@ -3,7 +3,6 @@ #pragma once #include -#include "imgui.h" #define _CRT_SECURE_NO_WARNINGS #include "stb/stb_image.h" diff --git a/Harbour/src/App.cpp b/Harbour/src/App.cpp index 09acf4e..e9b8fba 100644 --- a/Harbour/src/App.cpp +++ b/Harbour/src/App.cpp @@ -105,9 +105,7 @@ void Harbour::App::run() ImGui::Render(); - glViewport(0, 0, 1280, 720); - glClearColor(0.1f, 0.1f, 0.15f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); + m_colorManager.drawBackground(); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); SDL_GL_SwapWindow(m_window); } diff --git a/Harbour/src/GameCard.cpp b/Harbour/src/GameCard.cpp index 6574b4c..49de529 100644 --- a/Harbour/src/GameCard.cpp +++ b/Harbour/src/GameCard.cpp @@ -1,6 +1,9 @@ #include "GameCard.h" -#include +#include "utils/LoadImage.h" + +#include +#include Harbour::GameCard::GameCard() { diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index da89b35..bd015d8 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -1,3 +1,4 @@ +#include #include "MenuScreen.h" #include "GameCard.h" @@ -42,6 +43,11 @@ void HarbourGUI::settingsScreen() ImGui::Text("Settings"); ImGui::PopFont(); + const char* schemes[] = { "Blue Gray", "Dark Blue" }; + int current = 1; + + ImGui::Combo("Color Schemes", ¤t, "Blue Gray\0Dark Blue", 4); + ImGui::Text("Coming soon..."); } @@ -54,15 +60,15 @@ void HarbourGUI::helpScreen() ImGui::Text("Coming soon..."); } -ImVec4 HarbourGUI::getColor(Colors color) -{ - ImVec4 i = {}; - switch (color) { - case BlueGray: - i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); - break; - default: - i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); - } - return i; -} +//ImVec4 HarbourGUI::getColor(Colors color) +//{ +// ImVec4 i = {}; +// switch (color) { +// case BlueGray: +// i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); +// break; +// default: +// i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); +// } +// return i; +//} diff --git a/Harbour/src/utils/ColorManager.cpp b/Harbour/src/utils/ColorManager.cpp index 2761239..c54b2c3 100644 --- a/Harbour/src/utils/ColorManager.cpp +++ b/Harbour/src/utils/ColorManager.cpp @@ -1,2 +1,51 @@ -#include "ColorManager.h" +#include +#include + +#include "utils/ColorManager.h" + +HarbourUtils::ColorManager::ColorManager() +{ + //Load theme from user settings and change accordingly + m_currentColorTheme = BlueGray; + this->setBackgroundColor(); +} + +ImVec4 HarbourUtils::ColorManager::getBackground() const +{ + return m_backgroundColor; +} + +ImVec4 HarbourUtils::ColorManager::getThemeColor() +{ + return ImVec4(); +} + +void HarbourUtils::ColorManager::drawBackground() const +{ + glViewport(0, 0, 1280, 720); + glClearColor( + m_backgroundColor.x, + m_backgroundColor.y, + m_backgroundColor.z, + m_backgroundColor.w + ); + glClear(GL_COLOR_BUFFER_BIT); + +} + +void HarbourUtils::ColorManager::setBackgroundColor() +{ + switch (m_currentColorTheme) { + case BlueGray: + m_backgroundColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + break; + case DarkBlue: + m_backgroundColor = ImVec4(0.0f, 0.0f, 0.25f, 1.0f); + break; + case LightBlue: + m_backgroundColor = ImVec4(0.43f, 0.52f, 0.89f, 1.0f); + default: + m_backgroundColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + } +} diff --git a/Harbour/src/utils/FileManager.cpp b/Harbour/src/utils/FileManager.cpp index d6b554d..734df3d 100644 --- a/Harbour/src/utils/FileManager.cpp +++ b/Harbour/src/utils/FileManager.cpp @@ -1,7 +1,12 @@ #include "utils/FileManager.h" #include +#include +#include + #include +#include + void HarbourUtils::FileManager::createNewDirectory(std::string dir) { diff --git a/Harbour/src/utils/LoadImage.cpp b/Harbour/src/utils/LoadImage.cpp index cffd6a4..be2cbf1 100644 --- a/Harbour/src/utils/LoadImage.cpp +++ b/Harbour/src/utils/LoadImage.cpp @@ -1,5 +1,6 @@ #define STB_IMAGE_IMPLEMENTATION +#include #include "utils/LoadImage.h" // Simple helper function to load an image into a OpenGL texture with common settings From 218324305adb7fbe5f8dac6df3236dbf0cb694ce Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Wed, 17 Dec 2025 10:50:46 -0700 Subject: [PATCH 4/7] functional color changing --- Harbour/include/App.h | 1 + Harbour/include/MenuScreen.h | 4 +- Harbour/include/utils/ColorManager.h | 23 +-- Harbour/src/App.cpp | 216 +++++++++++++-------------- Harbour/src/MenuScreen.cpp | 11 +- Harbour/src/utils/ColorManager.cpp | 11 +- Harbour/src/utils/FileManager.cpp | 66 ++++---- 7 files changed, 173 insertions(+), 159 deletions(-) diff --git a/Harbour/include/App.h b/Harbour/include/App.h index 3d6da69..068b865 100644 --- a/Harbour/include/App.h +++ b/Harbour/include/App.h @@ -43,5 +43,6 @@ namespace Harbour { void constructLibraryFromJSON(std::vector& output, std::string lib); + }; } diff --git a/Harbour/include/MenuScreen.h b/Harbour/include/MenuScreen.h index 387aefb..2a03a12 100644 --- a/Harbour/include/MenuScreen.h +++ b/Harbour/include/MenuScreen.h @@ -2,7 +2,7 @@ #include #include "GameCard.h" - +#include "utils/ColorManager.h" namespace HarbourGUI { const enum screenID { @@ -14,7 +14,7 @@ namespace HarbourGUI { void MyLibraryScreen(std::vector& myLibrary); void downloadsScreen(std::vector& downloads); - void settingsScreen(); + void settingsScreen(HarbourUtils::ColorManager& colorManager); void helpScreen(); } diff --git a/Harbour/include/utils/ColorManager.h b/Harbour/include/utils/ColorManager.h index 6cc4157..dd40f0f 100644 --- a/Harbour/include/utils/ColorManager.h +++ b/Harbour/include/utils/ColorManager.h @@ -3,6 +3,16 @@ struct ImVec4; namespace HarbourUtils { + const enum Colors { + BlueGray, //Default + DarkBlue, //0.0, 0.0, 0.25, 1.0 + LightBlue, //0.43 0.52 0.89 + Green, + Teal, + Red, + Gray + }; + class ColorManager { public: ColorManager(); @@ -10,22 +20,13 @@ namespace HarbourUtils { public: //Getters/setters ImVec4 getBackground() const; - ImVec4 getThemeColor(); + int getThemeColor() const; void drawBackground() const; + void setThemeColor(int colorTheme); private: void setBackgroundColor(); - const enum Colors { - BlueGray, //Default - DarkBlue, //0.0, 0.0, 0.25, 1.0 - LightBlue, //0.43 0.52 0.89 - Green, - Teal, - Red, - Gray - }; - Colors m_currentColorTheme = {}; ImVec4 m_backgroundColor = {}; diff --git a/Harbour/src/App.cpp b/Harbour/src/App.cpp index e9b8fba..8cd8671 100644 --- a/Harbour/src/App.cpp +++ b/Harbour/src/App.cpp @@ -11,148 +11,148 @@ Harbour::App::App() { this->init(); - this->constructLibraryFromJSON(m_library, "library/myGames.json"); - this->constructLibraryFromJSON(m_allGames, "library/allGames.json"); - - m_fileManager.checkLatestVersions(); + this->constructLibraryFromJSON(m_library, "library/myGames.json"); + this->constructLibraryFromJSON(m_allGames, "library/allGames.json"); + + m_fileManager.checkLatestVersions(); } Harbour::App::~App() { - this->shutdown(); + this->shutdown(); } void Harbour::App::init() { - SDL_Init(SDL_INIT_VIDEO); - m_window = SDL_CreateWindow("Harbour of Harkinian", - SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 1280, 720, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE); + SDL_Init(SDL_INIT_VIDEO); + m_window = SDL_CreateWindow("Harbour of Harkinian", + SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + 1280, 720, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE); - SDL_GLContext gl_context = SDL_GL_CreateContext(m_window); - gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress); + SDL_GLContext gl_context = SDL_GL_CreateContext(m_window); + gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress); - IMGUI_CHECKVERSION(); - ImGui::CreateContext(); + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); - io.Fonts->AddFontFromFileTTF("./assets/Fonts/montserrat/Montserrat-Regular.otf", 16.0f); + ImGuiIO& io = ImGui::GetIO(); + io.Fonts->AddFontFromFileTTF("./assets/Fonts/montserrat/Montserrat-Regular.otf", 16.0f); - ImGui_ImplSDL2_InitForOpenGL(m_window, gl_context); - ImGui_ImplOpenGL3_Init("#version 150"); + ImGui_ImplSDL2_InitForOpenGL(m_window, gl_context); + ImGui_ImplOpenGL3_Init("#version 150"); } void Harbour::App::shutdown() { - ImGui_ImplOpenGL3_Shutdown(); - ImGui_ImplSDL2_Shutdown(); - ImGui::DestroyContext(); - SDL_DestroyWindow(m_window); - SDL_Quit(); + ImGui_ImplOpenGL3_Shutdown(); + ImGui_ImplSDL2_Shutdown(); + ImGui::DestroyContext(); + SDL_DestroyWindow(m_window); + SDL_Quit(); } void Harbour::App::run() { - SDL_Event event; - while (m_isRunning) { - while (SDL_PollEvent(&event)) { - ImGui_ImplSDL2_ProcessEvent(&event); - if (event.type == SDL_QUIT) m_isRunning = false; - } - - ImGui_ImplOpenGL3_NewFrame(); - ImGui_ImplSDL2_NewFrame(); - ImGui::NewFrame(); - - ImGui::SetNextWindowPos(ImVec2(0, 0)); - ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize); - - ImGui::Begin("MainOverlay", nullptr, - ImGuiWindowFlags_NoDecoration | - ImGuiWindowFlags_NoBackground | - ImGuiWindowFlags_NoMove | - ImGuiWindowFlags_MenuBar - ); - //for directly into the window - - if (ImGui::BeginMenuBar()) { - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); - HarbourGUI::screenID next = {}; - if (ImGui::Button("My Library")) { - next = HarbourGUI::MyLibrary; - this->switchScreens(next); - } - if (ImGui::Button("All Games")) { - next = HarbourGUI::AllGames; - this->switchScreens(next); - } - if (ImGui::Button("Settings")) { - next = HarbourGUI::Settings; - this->switchScreens(next); - } - if (ImGui::Button("Help Center")) { - next = HarbourGUI::HelpCenter; - this->switchScreens(next); - } - ImGui::PopStyleColor(); - - ImGui::EndMenuBar(); - } - - this->drawCurrentScreen(); - - ImGui::End(); - - - ImGui::Render(); + SDL_Event event; + while (m_isRunning) { + while (SDL_PollEvent(&event)) { + ImGui_ImplSDL2_ProcessEvent(&event); + if (event.type == SDL_QUIT) m_isRunning = false; + } + + ImGui_ImplOpenGL3_NewFrame(); + ImGui_ImplSDL2_NewFrame(); + ImGui::NewFrame(); + + ImGui::SetNextWindowPos(ImVec2(0, 0)); + ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize); + + ImGui::Begin("MainOverlay", nullptr, + ImGuiWindowFlags_NoDecoration | + ImGuiWindowFlags_NoBackground | + ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_MenuBar + ); + //for directly into the window + + if (ImGui::BeginMenuBar()) { + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); + HarbourGUI::screenID next = {}; + if (ImGui::Button("My Library")) { + next = HarbourGUI::MyLibrary; + this->switchScreens(next); + } + if (ImGui::Button("All Games")) { + next = HarbourGUI::AllGames; + this->switchScreens(next); + } + if (ImGui::Button("Settings")) { + next = HarbourGUI::Settings; + this->switchScreens(next); + } + if (ImGui::Button("Help Center")) { + next = HarbourGUI::HelpCenter; + this->switchScreens(next); + } + ImGui::PopStyleColor(); + + ImGui::EndMenuBar(); + } + + this->drawCurrentScreen(); + + ImGui::End(); + + + ImGui::Render(); m_colorManager.drawBackground(); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - SDL_GL_SwapWindow(m_window); - } + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + SDL_GL_SwapWindow(m_window); + } } void Harbour::App::switchScreens(HarbourGUI::screenID& id) { - m_screenID = id; + m_screenID = id; } void Harbour::App::drawCurrentScreen() { - switch (m_screenID) { - case HarbourGUI::MyLibrary: - { - HarbourGUI::MyLibraryScreen(m_library); - break; - } - case HarbourGUI::AllGames: - { - HarbourGUI::downloadsScreen(m_allGames); - break; - } - case HarbourGUI::Settings: - { - HarbourGUI::settingsScreen(); - break; - } - case HarbourGUI::HelpCenter: - { - HarbourGUI::helpScreen(); - break; - } - default: - HarbourGUI::MyLibraryScreen(m_library); - } + switch (m_screenID) { + case HarbourGUI::MyLibrary: + { + HarbourGUI::MyLibraryScreen(m_library); + break; + } + case HarbourGUI::AllGames: + { + HarbourGUI::downloadsScreen(m_allGames); + break; + } + case HarbourGUI::Settings: + { + HarbourGUI::settingsScreen(m_colorManager); + break; + } + case HarbourGUI::HelpCenter: + { + HarbourGUI::helpScreen(); + break; + } + default: + HarbourGUI::MyLibraryScreen(m_library); + } } void Harbour::App::constructLibraryFromJSON(std::vector& output, std::string lib) { - auto res = m_fileManager.readJSON(lib); + auto res = m_fileManager.readJSON(lib); - if (res.size() == 0) return; + if (res.size() == 0) return; - for (size_t i = 0; i < res.size(); i++) { - std::cout << res[i].at("name") << std::endl << res[i].at("version") << std::endl; - output.emplace_back(res[i].at("name"), res[i].at("version")); - } + for (size_t i = 0; i < res.size(); i++) { + std::cout << res[i].at("name") << std::endl << res[i].at("version") << std::endl; + output.emplace_back(res[i].at("name"), res[i].at("version")); + } } diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index bd015d8..6b44338 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -2,6 +2,8 @@ #include "MenuScreen.h" #include "GameCard.h" +#include + //MyLibraryScreen helped by AI in deciding the parameters after //ThatCodingFrog thought of the idea of how to pass data void HarbourGUI::MyLibraryScreen(std::vector& myLibrary) @@ -37,16 +39,19 @@ void HarbourGUI::downloadsScreen(std::vector& downloads) //Read data from allGames.json, then run loop based on results to draw thumbnails w/ download buttons } -void HarbourGUI::settingsScreen() +void HarbourGUI::settingsScreen(HarbourUtils::ColorManager& colorManager) { ImGui::PushFont(NULL, 24.0f); ImGui::Text("Settings"); ImGui::PopFont(); const char* schemes[] = { "Blue Gray", "Dark Blue" }; - int current = 1; + int current = colorManager.getThemeColor(); - ImGui::Combo("Color Schemes", ¤t, "Blue Gray\0Dark Blue", 4); + if ( ImGui::Combo("Color Schemes", ¤t, "Blue Gray\0Dark Blue\0Light Blue", 4)) { + std::cout << current; + colorManager.setThemeColor(current); + } ImGui::Text("Coming soon..."); } diff --git a/Harbour/src/utils/ColorManager.cpp b/Harbour/src/utils/ColorManager.cpp index c54b2c3..ee10487 100644 --- a/Harbour/src/utils/ColorManager.cpp +++ b/Harbour/src/utils/ColorManager.cpp @@ -15,9 +15,9 @@ ImVec4 HarbourUtils::ColorManager::getBackground() const return m_backgroundColor; } -ImVec4 HarbourUtils::ColorManager::getThemeColor() +int HarbourUtils::ColorManager::getThemeColor() const { - return ImVec4(); + return m_currentColorTheme; } void HarbourUtils::ColorManager::drawBackground() const @@ -33,6 +33,12 @@ void HarbourUtils::ColorManager::drawBackground() const } +void HarbourUtils::ColorManager::setThemeColor(int colorTheme) +{ + m_currentColorTheme = (Colors)colorTheme; + this->setBackgroundColor(); +} + void HarbourUtils::ColorManager::setBackgroundColor() { switch (m_currentColorTheme) { @@ -44,6 +50,7 @@ void HarbourUtils::ColorManager::setBackgroundColor() break; case LightBlue: m_backgroundColor = ImVec4(0.43f, 0.52f, 0.89f, 1.0f); + break; default: m_backgroundColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); } diff --git a/Harbour/src/utils/FileManager.cpp b/Harbour/src/utils/FileManager.cpp index 734df3d..568ca4e 100644 --- a/Harbour/src/utils/FileManager.cpp +++ b/Harbour/src/utils/FileManager.cpp @@ -49,49 +49,49 @@ nlohmann::json HarbourUtils::FileManager::readJSON(std::string file) //WriteCallback generated by AI, based on https://gist.github.com/whoshuu/2dc858b8730079602044 //If anyone knows better cURL usage or documentation (especially for C++), it would be appreciated greatly static size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* s) { - size_t totalSize = size * nmemb; - s->append((char*)contents, totalSize); - return totalSize; + size_t totalSize = size * nmemb; + s->append((char*)contents, totalSize); + return totalSize; } std::string HarbourUtils::FileManager::makeCURLRequest(const char* url) { - CURL* curl = curl_easy_init(); - std::string response; + CURL* curl = curl_easy_init(); + std::string response; - if (curl) { - // Set URL - curl_easy_setopt(curl, CURLOPT_URL, url); + if (curl) { + // Set URL + curl_easy_setopt(curl, CURLOPT_URL, url); - // Set User-Agent (required by GitHub API) - curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-example/1.0"); + // Set User-Agent (required by GitHub API) + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-example/1.0"); - // Set callback to capture response - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); + // Set callback to capture response + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); - // Perform request - CURLcode res = curl_easy_perform(curl); + // Perform request + CURLcode res = curl_easy_perform(curl); - if (res == CURLE_OK) { - //std::cout << "Response: " << response << std::endl; - } - else { - std::cerr << "Request failed: " << curl_easy_strerror(res) << std::endl; - } + if (res == CURLE_OK) { + //std::cout << "Response: " << response << std::endl; + } + else { + std::cerr << "Request failed: " << curl_easy_strerror(res) << std::endl; + } - curl_easy_cleanup(curl); - } + curl_easy_cleanup(curl); + } - return response; + return response; } void HarbourUtils::FileManager::checkLatestVersions() { - //Get/check install links for versions based on version + //Get/check install links for versions based on version #if defined(_WIN32) - auto latest = this->checkShipVersion(); - auto installed = this->readJSON("library/myGames.json"); + auto latest = this->checkShipVersion(); + auto installed = this->readJSON("library/myGames.json"); #elif defined(__linux__) @@ -102,18 +102,18 @@ void HarbourUtils::FileManager::checkLatestVersions() nlohmann::json HarbourUtils::FileManager::checkShipVersion() { - nlohmann::json ship = nlohmann::json::parse( makeCURLRequest("https://api.github.com/repos/HarbourMasters/Shipwright/releases/latest") ); - //std::cout << ship << std::endl; - return ship; + nlohmann::json ship = nlohmann::json::parse( makeCURLRequest("https://api.github.com/repos/HarbourMasters/Shipwright/releases/latest") ); + //std::cout << ship << std::endl; + return ship; } nlohmann::json HarbourUtils::FileManager::check2ShipVersion() { - this->makeCURLRequest("https://api.github.com/repos/HarbourMasters/2Ship2Harkinian/releases/latest"); - return nlohmann::json(); + this->makeCURLRequest("https://api.github.com/repos/HarbourMasters/2Ship2Harkinian/releases/latest"); + return nlohmann::json(); } nlohmann::json HarbourUtils::FileManager::checkStarShipVersion() { - return nlohmann::json(); + return nlohmann::json(); } From 310c0ce1a54c07e2b40eea81f31439086e4cc173 Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Wed, 17 Dec 2025 11:00:01 -0700 Subject: [PATCH 5/7] use array rather than string --- Harbour/src/MenuScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index 6b44338..edb4eca 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -45,10 +45,10 @@ void HarbourGUI::settingsScreen(HarbourUtils::ColorManager& colorManager) ImGui::Text("Settings"); ImGui::PopFont(); - const char* schemes[] = { "Blue Gray", "Dark Blue" }; + const char* schemes[] = { "Blue Gray", "Dark Blue", "Light Blue" }; int current = colorManager.getThemeColor(); - if ( ImGui::Combo("Color Schemes", ¤t, "Blue Gray\0Dark Blue\0Light Blue", 4)) { + if ( ImGui::Combo("Background Color", ¤t, schemes, IM_ARRAYSIZE(schemes)) ) { std::cout << current; colorManager.setThemeColor(current); } From 2eff49d5d2940f21a627458467c6b45630e86a39 Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Wed, 17 Dec 2025 17:29:35 -0700 Subject: [PATCH 6/7] Add some more colors --- Harbour/include/utils/ColorManager.h | 13 +++++++------ Harbour/src/MenuScreen.cpp | 20 ++++++-------------- Harbour/src/utils/ColorManager.cpp | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Harbour/include/utils/ColorManager.h b/Harbour/include/utils/ColorManager.h index dd40f0f..b437aeb 100644 --- a/Harbour/include/utils/ColorManager.h +++ b/Harbour/include/utils/ColorManager.h @@ -7,10 +7,11 @@ namespace HarbourUtils { BlueGray, //Default DarkBlue, //0.0, 0.0, 0.25, 1.0 LightBlue, //0.43 0.52 0.89 - Green, - Teal, - Red, - Gray + Green, //0.05, 0.2, 0.05 + Teal, //0.05, 0.25, 0.25 + DarkRed, //0.2, 0.05, 0.05 + LightRed, //0.85, 0.25, 0.25 + DarkGray, //0.15, 0.15, 0.15 }; class ColorManager { @@ -27,9 +28,9 @@ namespace HarbourUtils { private: void setBackgroundColor(); - Colors m_currentColorTheme = {}; + Colors m_currentColorTheme = {}; //Doesn't do much yet, add load by file - ImVec4 m_backgroundColor = {}; + ImVec4 m_backgroundColor = {}; //Set by setBackgroundColor() and m_currentColorTheme }; } diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index edb4eca..ce5f7ee 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -45,7 +45,12 @@ void HarbourGUI::settingsScreen(HarbourUtils::ColorManager& colorManager) ImGui::Text("Settings"); ImGui::PopFont(); - const char* schemes[] = { "Blue Gray", "Dark Blue", "Light Blue" }; + const char* schemes[] = { + "Blue Gray", "Dark Blue", "Light Blue", + "Green", "Teal", "Dark Red", "Light Red", "Dark Gray" + //Currently needs to follow order of Colors enum or it will break + }; + int current = colorManager.getThemeColor(); if ( ImGui::Combo("Background Color", ¤t, schemes, IM_ARRAYSIZE(schemes)) ) { @@ -64,16 +69,3 @@ void HarbourGUI::helpScreen() ImGui::Text("Coming soon..."); } - -//ImVec4 HarbourGUI::getColor(Colors color) -//{ -// ImVec4 i = {}; -// switch (color) { -// case BlueGray: -// i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); -// break; -// default: -// i = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); -// } -// return i; -//} diff --git a/Harbour/src/utils/ColorManager.cpp b/Harbour/src/utils/ColorManager.cpp index ee10487..7e4dfe0 100644 --- a/Harbour/src/utils/ColorManager.cpp +++ b/Harbour/src/utils/ColorManager.cpp @@ -51,6 +51,21 @@ void HarbourUtils::ColorManager::setBackgroundColor() case LightBlue: m_backgroundColor = ImVec4(0.43f, 0.52f, 0.89f, 1.0f); break; + case Green: + m_backgroundColor = ImVec4(0.05f, 0.2f, 0.05f, 1.0f); + break; + case Teal: + m_backgroundColor = ImVec4(0.05f, 0.25f, 0.25f, 1.0f); + break; + case DarkRed: + m_backgroundColor = ImVec4(0.2f, 0.05f, 0.05f, 1.0f); + break; + case LightRed: + m_backgroundColor = ImVec4(0.85f, 0.25f, 0.25f, 1.0f); + break; + case DarkGray: + m_backgroundColor = ImVec4(0.15f, 0.15f, 0.15f, 1.0f); + break; default: m_backgroundColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); } From 14ef699dc292e6ab9d5ac9198e7540134d18591d Mon Sep 17 00:00:00 2001 From: ThatCodingFrog Date: Thu, 18 Dec 2025 11:18:33 -0700 Subject: [PATCH 7/7] more color stuff --- Harbour/include/utils/ColorManager.h | 6 ++ Harbour/src/App.cpp | 7 ++ Harbour/src/MenuScreen.cpp | 4 ++ Harbour/src/utils/ColorManager.cpp | 100 +++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) diff --git a/Harbour/include/utils/ColorManager.h b/Harbour/include/utils/ColorManager.h index b437aeb..c6cf560 100644 --- a/Harbour/include/utils/ColorManager.h +++ b/Harbour/include/utils/ColorManager.h @@ -27,10 +27,16 @@ namespace HarbourUtils { private: void setBackgroundColor(); + void setAccentColor(); + void setHoverColor(); + void setMenuBarColor(); Colors m_currentColorTheme = {}; //Doesn't do much yet, add load by file ImVec4 m_backgroundColor = {}; //Set by setBackgroundColor() and m_currentColorTheme + ImVec4 m_menuBarColor = {}; //The menu bar background, only changes on certain themes + ImVec4 m_accentColor = {}; //Dropdowns, other UI + ImVec4 m_hoverColor = {}; //Buttons when hovered }; } diff --git a/Harbour/src/App.cpp b/Harbour/src/App.cpp index 8cd8671..b234755 100644 --- a/Harbour/src/App.cpp +++ b/Harbour/src/App.cpp @@ -35,6 +35,13 @@ void Harbour::App::init() IMGUI_CHECKVERSION(); ImGui::CreateContext(); + int read = ImGuiCol_MenuBarBg; + + std::cout << ImGui::GetStyle().Colors[read].x << std::endl; + std::cout << ImGui::GetStyle().Colors[read].y << std::endl; + std::cout << ImGui::GetStyle().Colors[read].z << std::endl; + std::cout << ImGui::GetStyle().Colors[read].w << std::endl; + ImGuiIO& io = ImGui::GetIO(); io.Fonts->AddFontFromFileTTF("./assets/Fonts/montserrat/Montserrat-Regular.otf", 16.0f); diff --git a/Harbour/src/MenuScreen.cpp b/Harbour/src/MenuScreen.cpp index ce5f7ee..9c7c065 100644 --- a/Harbour/src/MenuScreen.cpp +++ b/Harbour/src/MenuScreen.cpp @@ -53,11 +53,15 @@ void HarbourGUI::settingsScreen(HarbourUtils::ColorManager& colorManager) int current = colorManager.getThemeColor(); + //ImGui::PushStyleColor(ImGuiCol_PopupBg, ImVec4(0.8f, 0.0f, 0.0f, 1.0f)); + if ( ImGui::Combo("Background Color", ¤t, schemes, IM_ARRAYSIZE(schemes)) ) { std::cout << current; colorManager.setThemeColor(current); } + //ImGui::PopStyleColor(); + ImGui::Text("Coming soon..."); } diff --git a/Harbour/src/utils/ColorManager.cpp b/Harbour/src/utils/ColorManager.cpp index 7e4dfe0..5a13a03 100644 --- a/Harbour/src/utils/ColorManager.cpp +++ b/Harbour/src/utils/ColorManager.cpp @@ -37,6 +37,9 @@ void HarbourUtils::ColorManager::setThemeColor(int colorTheme) { m_currentColorTheme = (Colors)colorTheme; this->setBackgroundColor(); + this->setMenuBarColor(); + this->setAccentColor(); + this->setHoverColor(); } void HarbourUtils::ColorManager::setBackgroundColor() @@ -71,3 +74,100 @@ void HarbourUtils::ColorManager::setBackgroundColor() } } +void HarbourUtils::ColorManager::setAccentColor() +{ + //Build off of StyleColorsDark() in imgui_draw.cpp + float alpha = 0.94f; + + switch (m_currentColorTheme) { + case BlueGray: + m_accentColor = ImVec4(0.1f, 0.1f, 0.15f, alpha); + break; + case DarkBlue: + m_accentColor = ImVec4(0.0f, 0.0f, 0.25f, alpha); + break; + case LightBlue: + m_accentColor = ImVec4(0.43f, 0.52f, 0.89f, alpha); + break; + case Green: + m_accentColor = ImVec4(0.05f, 0.2f, 0.05f, alpha); + break; + case Teal: + m_accentColor = ImVec4(0.05f, 0.25f, 0.25f, alpha); + break; + case DarkRed: + m_accentColor = ImVec4(0.2f, 0.05f, 0.05f, alpha); + break; + case LightRed: + m_accentColor = ImVec4(0.55f, 0.15f, 0.15f, alpha); + break; + case DarkGray: + m_accentColor = ImVec4(0.15f, 0.15f, 0.15f, alpha); + break; + default: + m_accentColor = ImVec4(0.1f, 0.1f, 0.15f, alpha); + } + + ImGui::GetStyle().Colors[ImGuiCol_PopupBg] = m_accentColor; + ImGui::GetStyle().Colors[ImGuiCol_FrameBg] = m_accentColor; + +} + +void HarbourUtils::ColorManager::setHoverColor() +{ + switch (m_currentColorTheme) { + case BlueGray: + m_hoverColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + break; + case DarkBlue: + m_hoverColor = ImVec4(0.0f, 0.0f, 0.25f, 1.0f); + break; + case LightBlue: + m_hoverColor = ImVec4(0.43f, 0.52f, 0.89f, 1.0f); + break; + case Green: + m_hoverColor = ImVec4(0.05f, 0.2f, 0.05f, 1.0f); + break; + case Teal: + m_hoverColor = ImVec4(0.05f, 0.25f, 0.25f, 1.0f); + break; + case DarkRed: + m_hoverColor = ImVec4(0.2f, 0.05f, 0.05f, 1.0f); + break; + case LightRed: + m_menuBarColor = ImVec4(0.55f, 0.15f, 0.15f, 1.0f); + break; + case DarkGray: + m_hoverColor = ImVec4(0.15f, 0.15f, 0.15f, 1.0f); + break; + default: + m_hoverColor = ImVec4(0.1f, 0.1f, 0.15f, 1.0f); + } +} + +void HarbourUtils::ColorManager::setMenuBarColor() +{ + switch (m_currentColorTheme) + { + /*case HarbourUtils::BlueGray: + break; + case HarbourUtils::DarkBlue: + break; + case HarbourUtils::LightBlue: + break; + case HarbourUtils::Green: + break; + case HarbourUtils::Teal: + break; + case HarbourUtils::DarkRed: + break; + case HarbourUtils::DarkGray: + break;*/ + case LightRed: + m_menuBarColor = ImVec4(0.55f, 0.15f, 0.15f, 1.0f); + break; + default: + m_menuBarColor = ImVec4(0.14f, 0.14f, 0.14f, 1.0f); + } + ImGui::GetStyle().Colors[ImGuiCol_MenuBarBg] = m_menuBarColor; +}