Changeset 100 for trunk/UMenu.pas


Ignore:
Timestamp:
Sep 28, 2022, 7:14:22 PM (20 months ago)
Author:
chronos
Message:
  • Added: New game mode carrier where user needs to play existing cities and gradually unlock them by reaching exprected transported number of passengers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UMenu.pas

    r95 r100  
    1414    BackgroundColor: TColor;
    1515    BackgroundSelectedColor: TColor;
     16    TextColor: TColor;
     17    TextDisabledColor: TColor;
    1618    Kind: TMenuItemKind;
    1719    Text: string;
    1820    Selected: Boolean;
    19     FontSize: Integer;
    20     FontColor: Integer;
     21    TextSize: Integer;
    2122    function GetOutputText: string; virtual;
    2223    constructor Create; override;
     
    125126begin
    126127  Enabled := True;
    127   FontSize := 40;
    128   FontColor := clWhite;
     128  TextSize := 40;
     129  TextColor := clWhite;
     130  TextDisabledColor := clSilver;
    129131end;
    130132
     
    180182    if Items[I].Bounds.Contains(Position) then begin
    181183      if (Items[I] is TMenuItemButton) then begin
    182         if Assigned(TMenuItemButton(Items[I]).OnClick) then
    183           TMenuItemButton(Items[I]).OnClick(Items[I]);
     184        TMenuItemButton(Items[I]).MouseUp(Position);
    184185      end else
    185186      if (Items[I] is TMenuItemCheckBox) then begin
     
    215216    Brush.Style := bsSolid;
    216217    for I := 0 to Items.Count - 1 do begin
    217       Font.Size := Items[I].FontSize;
     218      Font.Size := Items[I].TextSize;
    218219      if TotalWidth < TextWidth(Items[I].GetOutputText) then
    219220        TotalWidth := TextWidth(Items[I].GetOutputText);
     
    229230    Brush.Style := bsSolid;
    230231    for I := 0 to Items.Count - 1 do begin
    231       Font.Size := Items[I].FontSize;
    232       Font.Color := Items[I].FontColor;
     232      Font.Size := Items[I].TextSize;
     233      if Items[I].Enabled then Font.Color := Items[I].TextColor
     234        else Font.Color := Items[I].TextDisabledColor;
    233235      Items[I].Bounds.Left := X;
    234236      Items[I].Bounds.Top := Y;
Note: See TracChangeset for help on using the changeset viewer.