diff --git a/src/game/Instance.h b/src/game/Instance.h index 9048ee8..1390636 100644 --- a/src/game/Instance.h +++ b/src/game/Instance.h @@ -47,6 +47,8 @@ namespace Game uint32_t AssetCount = 0; uint32_t AssetHandles[MaxAssets]{0}; char AssetHandlePaths[MaxAssets][128]; + bool ShowImguiDemo = false; + uint8_t DebugCardRotation = 0; }; struct GameInstance diff --git a/src/game/Level.cpp b/src/game/Level.cpp index 98e5684..a7ac29d 100644 --- a/src/game/Level.cpp +++ b/src/game/Level.cpp @@ -75,7 +75,7 @@ namespace Game needReset |= PuzzleTiles.Setup(storagePtr, needReset); needReset |= UIQuads.Setup(storagePtr, needReset); - Generated::Setup(); + Puzzle::Setup(); bx::Error err; bx::DirectoryReader dirIter; @@ -257,10 +257,9 @@ namespace Game { player.PlayerCamTransform.UpdateMatrix(); bgfx::setViewTransform(viewId, player.PlayerCamTransform.M.M, proj); - bgfx::dbgTextPrintf(1, 0, 0b1100, " "); } - // Cubes.Render(models, materials); + Cubes.Render(models, materials); Tests.Render(models, materials); PuzzleTiles.Render(models, materials); UIQuads.Render(models, materials); @@ -337,9 +336,8 @@ namespace Game for (int32_t cardI = 0; cardI < Data.PlacedCardCount; ++cardI) { Generated::PlacedPuzzleCard& card = Data.PlacedCards[cardI]; - if (!Generated::IsValid(card.RefCard)) continue; - const Generated::StaticPuzzleCard& cData = - Generated::GetCard(Generated::GetStaticPuzzleData(), card.RefCard); + if (!Puzzle::IsValid(card.RefCard)) continue; + const Generated::StaticPuzzleCard& cData = Puzzle::GetCard(card.RefCard); level.PuzzleTiles.Get(TileHandles[cardI]).EData.ModelHandle = cData.ModelHandle; auto& quad = level.UIQuads.Get(UIPlacedCards[cardI]); diff --git a/src/game/Level.h b/src/game/Level.h index 505e0b3..e19cf98 100644 --- a/src/game/Level.h +++ b/src/game/Level.h @@ -71,6 +71,7 @@ namespace Game T* Data = nullptr; uint32_t EntitySize = 0; T InvalidObject{}; + bool IsEnabled = true; public: // Returns true if size changed @@ -119,6 +120,7 @@ namespace Game void Render(const Model* models, const Material* materials) { + if (!IsEnabled) return; for (uint16_t i = 0; i < Count; ++i) { Get({i}).EData.Render(models, materials); diff --git a/src/game/Puzzle.cpp b/src/game/Puzzle.cpp index b6b3164..66deed9 100644 --- a/src/game/Puzzle.cpp +++ b/src/game/Puzzle.cpp @@ -1,8 +1,10 @@ +#include "Global.h" +#include "Instance.h" #include "Log.h" #include "Puzzle.h" -#include "bx/string.h" #include "bx/bx.h" +#include "bx/string.h" #include "imgui.h" #include #include @@ -19,8 +21,11 @@ namespace Generated::StaticPuzzleData StaticData; } // namespace -namespace Generated +namespace Puzzle { + constexpr float UIPuzBoxSize = 26; + using namespace Generated; + void Setup() { LOG("Setting up static puzzle data"); @@ -54,10 +59,10 @@ namespace Generated } ser.Finish(); } - const StaticPuzzleCard& GetCard(const StaticPuzzleData& data, StaticPuzzleCardHandle H) + const StaticPuzzleCard& GetCard(StaticPuzzleCardHandle H) { assert(IsValid(H)); - return data.Cards[H.Idx]; + return GetStaticPuzzleData().Cards[H.Idx]; } bool IsValid(StaticPuzzleCardHandle h) @@ -65,6 +70,11 @@ namespace Generated return h.Idx != UINT16_MAX; } + const char* GetShortNodeName(const PuzzleElementType::Enum node) + { + return PuzzleElementType::ShortName[node]; + } + uint8_t GetRemainingCount(const PuzzleCardStack& stack) { assert(stack.MaxAvailableCount >= stack.UsedCount); @@ -84,30 +94,63 @@ namespace Generated if (offsetX >= 0 && offsetX < Puzzle::Config::CardSize && offsetY >= 0 && offsetY < Puzzle::Config::CardSize) { - PuzzleElementType::Enum cardVal = - GetCardNodeAt(GetCard(GetStaticPuzzleData(), card.RefCard), offsetX, offsetY); + PuzzleElementType::Enum cardVal = GetCardNodeAt(GetCard(card.RefCard), card.Rotation, offsetX, offsetY); if (cardVal != PuzzleElementType::None) return cardVal; } } return puz.BackgroundTiles[pos.Y * Puzzle::Config::MaxPuzzleSizeCards + pos.X]; } - PuzzleElementType::Enum GetCardNodeAt(const StaticPuzzleCard& card, int8_t x, int8_t y) + PuzzleElementType::Enum GetCardNodeAt(const StaticPuzzleCard& card, uint8_t rotation, int8_t x, int8_t y) { assert(x >= 0 && x < Puzzle::Config::CardSize); assert(y >= 0 && y < Puzzle::Config::CardSize); - // TODO: account for card rotation - return card.Elements[y * Puzzle::Config::CardSize + x]; + uint8_t arrX = x; + uint8_t arrY = y; + if (rotation == 1) + { + arrX = y; + arrY = Config::CardSize - x - 1; + } + else if (rotation == 2) + { + arrX = Config::CardSize - x - 1; + arrY = Config::CardSize - y - 1; + } + else if (rotation == 3) + { + arrX = Config::CardSize - y - 1; + arrY = x; + } + + return card.Elements[arrY * Puzzle::Config::CardSize + arrX]; } - PuzzleElementType::Enum& EditCardNodeAt(StaticPuzzleCard& card, int8_t x, int8_t y) + PuzzleElementType::Enum& EditCardNodeAt(StaticPuzzleCard& card, uint8_t rotation, int8_t x, int8_t y) { assert(x >= 0 && x < Puzzle::Config::CardSize); assert(y >= 0 && y < Puzzle::Config::CardSize); - // TODO: account for card rotation - return card.Elements[y * Puzzle::Config::CardSize + x]; + uint8_t arrX = x; + uint8_t arrY = y; + if (rotation == 1) + { + arrX = y; + arrY = Config::CardSize - x - 1; + } + else if (rotation == 2) + { + arrX = Config::CardSize - x - 1; + arrY = Config::CardSize - y - 1; + } + else if (rotation == 3) + { + arrX = Config::CardSize - y - 1; + arrY = x; + } + + return card.Elements[arrY * Puzzle::Config::CardSize + arrX]; } bool PuzzleSolver::IsPuzzleSolved(const PuzzleData& puzzle) @@ -182,23 +225,41 @@ namespace Generated return (sourceType == PuzzleElementType::WaterIn && goalType == PuzzleElementType::WaterGoal) || (sourceType == PuzzleElementType::ElectricIn && goalType == PuzzleElementType::ElectricGoal); } - -} // namespace Generated - -namespace Generated -{ - constexpr float UIPuzBoxSize = 26; + void DrawCard(const StaticPuzzleCard& card, uint8_t rotation, ImVec2 pos) + { + auto& drawList = *ImGui::GetWindowDrawList(); + for (int32_t y = 0; y < Puzzle::Config::CardSize; ++y) + { + for (int32_t x = 0; x < Puzzle::Config::CardSize; ++x) + { + ImGui::SetCursorScreenPos({pos.x + x * UIPuzBoxSize, pos.y + y * UIPuzBoxSize}); + ImGui::Text("%s", GetShortNodeName(GetCardNodeAt(card, rotation, x, y))); + } + } + for (int32_t y = 0; y <= Puzzle::Config::CardSize; ++y) + { + ImVec2 linePos = {pos.x, pos.y + y * UIPuzBoxSize}; + drawList.AddLine(linePos, + {linePos.x + Puzzle::Config::CardSize * UIPuzBoxSize, linePos.y}, + y % Puzzle::Config::CardSize == 0 ? 0xFFFFFFFF : 0x11FFFFFF); + } + for (int32_t x = 0; x <= Puzzle::Config::CardSize; ++x) + { + ImVec2 linePos = {pos.x + x * UIPuzBoxSize, pos.y}; + drawList.AddLine(linePos, + {linePos.x, linePos.y + Puzzle::Config::CardSize * UIPuzBoxSize}, + x % Puzzle::Config::CardSize == 0 ? 0xFFFFFFFF : 0x11FFFFFF); + } + ImGui::SetCursorScreenPos(pos); + ImGui::InvisibleButton("cardbn", + {Puzzle::Config::CardSize * UIPuzBoxSize, Puzzle::Config::CardSize * UIPuzBoxSize}); + } void WritePuzzleFilePath(char* buf, int32_t bufSize, uint16_t puzID) { bx::snprintf(buf, bufSize, "%s/%u.pzl", Puzzle::PuzzleFileDir, puzID); } - const char* GetShortNodeName(const PuzzleElementType::Enum node) - { - return PuzzleElementType::ShortName[node]; - } - bool RenderDebugUI(PuzzleData& obj) { bool dataChanged = false; @@ -215,6 +276,11 @@ namespace Generated ImGui::End(); return false; } + ImGui::SameLine(); + if (ImGui::Button("Reload")) + { + // TODO + } int32_t val = obj.ID; if (ImGui::InputInt("ID", &val)) { @@ -268,6 +334,7 @@ namespace Generated { uint32_t CardIdx = *reinterpret_cast(payload->Data); obj.PlacedCards[obj.PlacedCardCount].RefCard = {(uint16_t)CardIdx}; + obj.PlacedCardCount++; } ImGui::EndDragDropTarget(); } @@ -297,8 +364,55 @@ namespace Generated ImGui::SetCursorScreenPos(pos); ImGui::NewLine(); - if (ImGui::TreeNodeEx("Available Cards", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + bool bAvailOpen = + ImGui::TreeNodeEx("Available Cards", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed); + if (ImGui::BeginDragDropTarget()) { + if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("cardtype", 0)) + { + uint32_t CardIdx = *reinterpret_cast(payload->Data); + bool found = false; + for (int32_t i = 0; i < obj.AvailableCardCount; ++i) + { + if (obj.AvailableCards[i].RefCard.Idx == CardIdx) + { + obj.AvailableCards[i].MaxAvailableCount++; + found = true; + break; + } + } + if (!found) + { + if (obj.AvailableCardCount == BX_COUNTOF(obj.AvailableCards)) + { + LOG_ERROR("Available card limit reached!"); + } + else + { + auto& Card = obj.AvailableCards[obj.AvailableCardCount]; + Card.RefCard.Idx = CardIdx; + Card.MaxAvailableCount = 1; + obj.AvailableCardCount++; + } + } + dataChanged = true; + } + ImGui::EndDragDropTarget(); + } + if (bAvailOpen) + { + uint8_t debugRot = Game::GetInstance().DebugData.DebugCardRotation; + for (uint32_t i = 0; i < obj.AvailableCardCount; ++i) + { + auto& card = obj.AvailableCards[i]; + DrawCard(GetCard(card.RefCard), debugRot, ImGui::GetCursorScreenPos()); + if (ImGui::BeginDragDropSource()) + { + ImGui::SetDragDropPayload("availcard", &i, sizeof(i)); + DrawCard(GetCard(card.RefCard), debugRot, ImGui::GetCursorScreenPos()); + ImGui::EndDragDropSource(); + } + } ImGui::TreePop(); } } @@ -323,7 +437,10 @@ namespace Generated return isVisible; } +} // namespace Puzzle +namespace Generated +{ PuzPos operator+=(PuzPos lhs, const PuzPos& rhs) { lhs.X += rhs.X; diff --git a/src/game/Puzzle.h b/src/game/Puzzle.h index cb9fac7..cf18d5d 100644 --- a/src/game/Puzzle.h +++ b/src/game/Puzzle.h @@ -1,12 +1,16 @@ #pragma once #include "Serial.h" #include +#include #include "../../gen/Generated.h" namespace Puzzle { + using namespace Generated; + constexpr const char* PuzzleFileDir = "game/data/puzzles/"; + struct Config { static constexpr uint32_t CardSize = 2; @@ -19,23 +23,18 @@ namespace Puzzle static constexpr uint32_t MaxAvailableStacks = 16; static constexpr uint32_t MaxGoalPositions = 16; }; -} // namespace Puzzle - -namespace Generated -{ - PuzPos operator+=(PuzPos lhs, const PuzPos& rhs); - PuzPos operator+(PuzPos lhs, const PuzPos& rhs); void Setup(); StaticPuzzleData& GetStaticPuzzleData(); void LoadStaticPuzzleData(); void SaveStaticPuzzleData(); - const StaticPuzzleCard& GetCard(const StaticPuzzleData& data, StaticPuzzleCardHandle H); + const StaticPuzzleCard& GetCard(StaticPuzzleCardHandle H); bool IsValid(StaticPuzzleCardHandle h); uint8_t GetRemainingCount(const PuzzleCardStack& stack); PuzzleElementType::Enum GetNodeAt(const PuzzleData& puz, PuzPos pos); - PuzzleElementType::Enum GetCardNodeAt(const StaticPuzzleCard& card, int8_t x, int8_t y); - PuzzleElementType::Enum& EditCardNodeAt(StaticPuzzleCard& card, int8_t x, int8_t y); + PuzzleElementType::Enum GetCardNodeAt(const StaticPuzzleCard& card, uint8_t rotation, int8_t x, int8_t y); + PuzzleElementType::Enum& EditCardNodeAt(StaticPuzzleCard& card, uint8_t rotation, int8_t x, int8_t y); + void DrawCard(const StaticPuzzleCard& card, uint8_t rotation, ImVec2 pos); struct PuzzleSolver { @@ -50,4 +49,10 @@ namespace Generated bool IsValidSource(PuzzleElementType::Enum sourceType, PuzzleElementType::Enum goalType); }; bool RenderDebugUI(PuzzleData& obj); +} // namespace Puzzle + +namespace Generated +{ + PuzPos operator+=(PuzPos lhs, const PuzPos& rhs); + PuzPos operator+(PuzPos lhs, const PuzPos& rhs); } // namespace Generated diff --git a/src/game/Setup.cpp b/src/game/Setup.cpp index 6629110..5d026cd 100644 --- a/src/game/Setup.cpp +++ b/src/game/Setup.cpp @@ -48,7 +48,7 @@ namespace Game instance.UsedScratchAmount = 0; SetShared(shared); SetInstance(instance); - Generated::LoadStaticPuzzleData(); + Puzzle::LoadStaticPuzzleData(); SetupInstance.Rendering.Setup(); instance.GameLevel.Setup(shared.Game); instance.IsInitialized = true; diff --git a/src/game/data/puzzles/0.pzl b/src/game/data/puzzles/0.pzl index 289083a..074df81 100644 --- a/src/game/data/puzzles/0.pzl +++ b/src/game/data/puzzles/0.pzl @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:017e1fab623e2bce8a32933f1945242335279d895b43204802630fa47e653386 +oid sha256:2162216c620c252d35d2a0339f07dd729b6aa1665eec7477245f39afcc76fc65 size 5820 diff --git a/src/game/rendering/Rendering.cpp b/src/game/rendering/Rendering.cpp index 5c1c140..663026c 100644 --- a/src/game/rendering/Rendering.cpp +++ b/src/game/rendering/Rendering.cpp @@ -23,7 +23,9 @@ #include #include "imgui-helper.h" +#include "imgui-style.h" #include "imgui.h" +#include "imgui_internal.h" using namespace std::chrono_literals; @@ -371,6 +373,7 @@ namespace Game Materials[0] = Material::LoadFromShader("vert", "frag", MainViewID, Textures[0].Handle, Textures[0].SamplerHandle); imguiCreate(); + SetImguiStyle(); if (!ImGui_ImplSDL3_InitForOther(shared.Window.SDLWindow)) { @@ -460,6 +463,11 @@ namespace Game auto& debug = GetInstance().DebugData; if (UIVisible == UIVisibilityState::Debug) { + if (ImGui::IsMouseClicked(ImGuiMouseButton_Right)) + { + debug.DebugCardRotation++; + if (debug.DebugCardRotation >= 4) debug.DebugCardRotation = 0; + } if (ImGui::Begin("Rendering")) { if (LastShaderLoadTime >= 0.0f) @@ -479,10 +487,18 @@ namespace Game ImGui::SameLine(); if (ImGui::Button("Reload Level")) { - auto& lvl = GetInstance().GameLevel; - lvl = {}; - lvl.Setup(shared.Game); + level = {}; + level.Setup(shared.Game); } + ImGui::Checkbox("Show ImGui Demo", &debug.ShowImguiDemo); + if (debug.ShowImguiDemo) ImGui::ShowDemoWindow(&debug.ShowImguiDemo); + ImGui::Separator(); + + ImGui::Checkbox("Cubes", &level.Cubes.IsEnabled); + ImGui::Checkbox("Tests", &level.Tests.IsEnabled); + ImGui::Checkbox("PuzzleTiles", &level.PuzzleTiles.IsEnabled); + ImGui::Checkbox("UIQuads", &level.UIQuads.IsEnabled); + if (ImGui::Button("Dithergen")) { DitherGen(DitherTextures, DitherRecursion); @@ -568,22 +584,22 @@ namespace Game ImGui::End(); if (debug.SelectedDebugLevel < BX_COUNTOF(level.Puzzles)) { - if (!Generated::RenderDebugUI(level.Puzzles[debug.SelectedDebugLevel].Data)) + if (!Puzzle::RenderDebugUI(level.Puzzles[debug.SelectedDebugLevel].Data)) { debug.SelectedDebugLevel = UINT16_MAX; } } if (ImGui::Begin("Cards")) { - Generated::StaticPuzzleData& staticData = Generated::GetStaticPuzzleData(); + Generated::StaticPuzzleData& staticData = Puzzle::GetStaticPuzzleData(); if (ImGui::Button("Save")) { - Generated::SaveStaticPuzzleData(); + Puzzle::SaveStaticPuzzleData(); } ImGui::SameLine(); if (ImGui::Button("Reload")) { - Generated::LoadStaticPuzzleData(); + Puzzle::LoadStaticPuzzleData(); } for (int32_t i = 0; i < BX_COUNTOF(staticData.Cards); ++i) @@ -597,7 +613,7 @@ namespace Game ImGui::Selectable(cardName); if (ImGui::BeginDragDropSource()) { - ImGui::Text("Card %i", i); + Puzzle::DrawCard(card, debug.DebugCardRotation, ImGui::GetCursorScreenPos()); ImGui::SetDragDropPayload("cardtype", &i, sizeof(i)); ImGui::EndDragDropSource(); } @@ -610,7 +626,7 @@ namespace Game { if (x > 0) ImGui::SameLine(); ImGui::PushID(x); - auto& node = Generated::EditCardNodeAt(card, x, y); + auto& node = Puzzle::EditCardNodeAt(card, 0, x, y); if (ImGui::Button(Generated::PuzzleElementType::ShortName[node], {26, 24})) { int32_t newVal = int32_t(node) + 1; diff --git a/src/game/rendering/imgui-style.cpp b/src/game/rendering/imgui-style.cpp new file mode 100644 index 0000000..3710e95 --- /dev/null +++ b/src/game/rendering/imgui-style.cpp @@ -0,0 +1,64 @@ +#include "imgui-style.h" + +void SetImguiStyle() +{ + ImVec4* colors = ImGui::GetStyle().Colors; + colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); + colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); + colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f); + colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f); + colors[ImGuiCol_Border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f); + colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_FrameBg] = ImVec4(0.16f, 0.29f, 0.48f, 0.54f); + colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); + colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); + colors[ImGuiCol_TitleBg] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f); + colors[ImGuiCol_TitleBgActive] = ImVec4(0.16f, 0.29f, 0.48f, 1.00f); + colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f); + colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f); + colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f); + colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f); + colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f); + colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f); + colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f); + colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f); + colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f); + colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f); + colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); + colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_Separator] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f); + colors[ImGuiCol_SeparatorHovered] = ImVec4(0.10f, 0.40f, 0.75f, 0.78f); + colors[ImGuiCol_SeparatorActive] = ImVec4(0.10f, 0.40f, 0.75f, 1.00f); + colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.20f); + colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f); + colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); + colors[ImGuiCol_TabHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f); + colors[ImGuiCol_Tab] = ImVec4(0.18f, 0.35f, 0.58f, 0.86f); + colors[ImGuiCol_TabSelected] = ImVec4(0.20f, 0.41f, 0.68f, 1.00f); + colors[ImGuiCol_TabSelectedOverline] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_TabDimmed] = ImVec4(0.07f, 0.10f, 0.15f, 0.97f); + colors[ImGuiCol_TabDimmedSelected] = ImVec4(0.14f, 0.26f, 0.42f, 1.00f); + colors[ImGuiCol_TabDimmedSelectedOverline] = ImVec4(0.50f, 0.50f, 0.50f, 0.00f); + colors[ImGuiCol_DockingPreview] = ImVec4(0.26f, 0.59f, 0.98f, 0.70f); + colors[ImGuiCol_DockingEmptyBg] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f); + colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f); + colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); + colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); + colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); + colors[ImGuiCol_TableHeaderBg] = ImVec4(0.19f, 0.19f, 0.20f, 1.00f); + colors[ImGuiCol_TableBorderStrong] = ImVec4(0.31f, 0.31f, 0.35f, 1.00f); + colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f); + colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f); + colors[ImGuiCol_TextLink] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); + colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); + colors[ImGuiCol_NavCursor] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); + colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); + colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); +} diff --git a/src/game/rendering/imgui-style.h b/src/game/rendering/imgui-style.h new file mode 100644 index 0000000..858573a --- /dev/null +++ b/src/game/rendering/imgui-style.h @@ -0,0 +1,4 @@ +#pragma once +#include + +void SetImguiStyle();