Changeset 28135 for ps

Timestamp:
Jul 3, 2024, 10:32:52 AM (7 days ago)
Author:
Stan
Message:

Finish implementing property "textcolor_selected" for list GUI objects
Fixes #6920
Patch by: @Vantha
Differential Revision: https://code.wildfiregames.com/D5269

Location:
ps/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/mod/gui/gui.rng

    r28120 r28135  
    593593        </optional>
    594594        <optional>
     595
     596
     597
     598
     599
    595600          <attribute name="heading"/>
    596601        </optional>
  • ps/trunk/source/gui/ObjectTypes/CList.cpp

    r27965 r28135  
    1 /* Copyright (C) 2021 Wildfire Games.
     1/* Copyright (C) 202 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    369369        }
    370370
    371         DrawText(canvas, i, textColor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), cliparea);
     371        const CGUIColor& finalTextColor = (drawSelected && static_cast<size_t>(selected) == i && *m_TextColorSelected) ? m_TextColorSelected : textColor;
     372
     373        DrawText(canvas, i, finalTextColor, rect.TopLeft() - CVector2D(0.f, scroll - m_ItemsYPositions[i]), cliparea);
    372374    }
    373375
  • ps/trunk/source/gui/ObjectTypes/COList.cpp

    r28120 r28135  
    220220                    LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.data(), attr_value.c_str());
    221221            }
     222
     223
     224
     225
     226
    222227            else if (attr_name == "hidden")
    223228            {
     
    436441            cliparea2.bottom = std::min(cliparea2.bottom, textPos.Y + rowHeight);
    437442
     443
     444
    438445            // Draw list item
    439             DrawText(canvas, objectsCount * (i +/*Heading*/1) + colIdx, column.m_TextColor, textPos, cliparea2);
     446            DrawText(canvas, objectsCount * (i +/*Heading*/1) + colIdx, TextColor, textPos, cliparea2);
    440447            xpos += width;
    441448        }
  • ps/trunk/source/gui/ObjectTypes/COList.h

    r27965 r28135  
    1 /* Copyright (C) 2023 Wildfire Games.
     1/* Copyright (C) 202 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    3939
    4040    CGUIColor m_TextColor;
     41
    4142    CStr m_Id;
    4243    float m_Width;
Note: See TracChangeset for help on using the changeset viewer.