Index: binaries/data/mods/mod/gui/gui.rng =================================================================== --- binaries/data/mods/mod/gui/gui.rng +++ binaries/data/mods/mod/gui/gui.rng @@ -591,6 +591,11 @@ + + + + + Index: source/gui/ObjectTypes/CList.cpp =================================================================== --- source/gui/ObjectTypes/CList.cpp +++ source/gui/ObjectTypes/CList.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -368,7 +368,9 @@ cliparea.left = GetScrollBar(0).GetOuterRect().right; } - DrawText(canvas, i, textColor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), cliparea); + const CGUIColor& finalTextColor = (drawSelected && static_cast(selected) == i && *m_TextColorSelected)? m_TextColorSelected : textColor; + + DrawText(canvas, i, finalTextColor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), cliparea); } // Draw scrollbars on top of the content Index: source/gui/ObjectTypes/COList.h =================================================================== --- source/gui/ObjectTypes/COList.h +++ source/gui/ObjectTypes/COList.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -38,6 +38,7 @@ COListColumn& operator=(COListColumn&&) = delete; CGUIColor m_TextColor; + CGUIColor m_TextColorSelected; CStr m_Id; float m_Width; CGUISimpleSetting m_Heading; // CGUIString?? Index: source/gui/ObjectTypes/COList.cpp =================================================================== --- source/gui/ObjectTypes/COList.cpp +++ source/gui/ObjectTypes/COList.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2024 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -219,6 +219,11 @@ if (!CGUI::ParseString(&m_pGUI, attr_value.FromUTF8(), column.m_TextColor)) LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.data(), attr_value.c_str()); } + if (attr_name == "colorSelected") + { + if (!CGUI::ParseString(&m_pGUI, attr_value.FromUTF8(), column.m_TextColorSelected)) + LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.data(), attr_value.c_str()); + } else if (attr_name == "hidden") { bool hidden = false; @@ -435,8 +440,10 @@ cliparea2.right = std::min(cliparea2.right, textPos.X + width); cliparea2.bottom = std::min(cliparea2.bottom, textPos.Y + rowHeight); + const CGUIColor& finalTextColor = (drawSelected && static_cast(selected) == i && column.m_TextColorSelected)? column.m_TextColorSelected : column.m_TextColor; + // Draw list item - DrawText(canvas, objectsCount * (i +/*Heading*/1) + colIdx, column.m_TextColor, textPos, cliparea2); + DrawText(canvas, objectsCount * (i +/*Heading*/1) + colIdx, finalTextColor, textPos, cliparea2); xpos += width; } }