Ignore:
Timestamp:
Oct 4, 2014, 9:19:27 PM (10 years ago)
Author:
chronos
Message:
  • Added: Show player color in player list.
  • Added: Confirmation dialog for game restart action.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.pas

    r70 r74  
    5656    procedure FormDestroy(Sender: TObject);
    5757    procedure FormShow(Sender: TObject);
     58    procedure ListView1CustomDrawSubItem(Sender: TCustomListView;
     59      Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     60      var DefaultDraw: Boolean);
    5861    procedure ListView1Data(Sender: TObject; Item: TListItem);
    5962    procedure ListView1DblClick(Sender: TObject);
     
    111114    Item.Data := Players[Item.Index];
    112115    Item.SubItems.Add(PlayerModeText[Mode]);
    113     Item.SubItems.Add(IntToStr(Color));
     116    Item.SubItems.Add(''); // Do not show color text
    114117    Item.SubItems.Add(IntToStr(StartUnits));
    115118  end;
     
    212215begin
    213216  ReloadView;
     217end;
     218
     219procedure TFormNew.ListView1CustomDrawSubItem(Sender: TCustomListView;
     220  Item: TListItem; SubItem: Integer; State: TCustomDrawState;
     221  var DefaultDraw: Boolean);
     222begin
     223  if SubItem = 2 then
     224  with ListView1.Canvas do begin
     225    Brush.Color := TPlayer(Item.Data).Color;
     226    Brush.Style := bsSolid;
     227    FillRect(Item.DisplayRectSubItem(2, drBounds));
     228  end;
    214229end;
    215230
Note: See TracChangeset for help on using the changeset viewer.