Changeset 90


Ignore:
Timestamp:
Sep 22, 2022, 9:54:56 PM (2 years ago)
Author:
chronos
Message:
  • Modified: TColors class moved into separate unit.
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BigMetro.lpi

    r89 r90  
    8989      </Item2>
    9090    </RequiredPackages>
    91     <Units Count="8">
     91    <Units Count="9">
    9292      <Unit0>
    9393        <Filename Value="BigMetro.lpr"/>
     
    128128        <IsPartOfProject Value="True"/>
    129129      </Unit7>
     130      <Unit8>
     131        <Filename Value="UColors.pas"/>
     132        <IsPartOfProject Value="True"/>
     133      </Unit8>
    130134    </Units>
    131135  </ProjectOptions>
  • trunk/BigMetro.lpr

    r89 r90  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, SysUtils, UFormMain, UFormImages, Common, UMenu, UControls,
    11 UMetroPassenger;
     11UMetroPassenger, UColors;
    1212
    1313{$R *.res}
  • trunk/UEngine.pas

    r89 r90  
    99  Classes, SysUtils, Graphics, Controls, ExtCtrls, Math, DateUtils,
    1010  UMetaCanvas, Generics.Collections, Generics.Defaults, UMenu, UControls,
    11   UMetroPassenger;
     11  UMetroPassenger, UColors;
    1212
    1313type
     
    2323  TTrackLink = class;
    2424  TTrackLinks = class;
    25 
    26   TColors = record
    27     Background: TColor;
    28     Text: TColor;
    29     ShapeBackground: TColor;
    30     MenuItemText: TColor;
    31     MenuItemBackground: TColor;
    32     MenuItemBackgroundSelected: TColor;
    33   end;
    3425
    3526  { TMapStation }
     
    310301      UpdatedShape: TStationShape; Distance: Integer);
    311302    procedure SetDarkMode(AValue: Boolean);
    312     procedure InitColors;
    313303    procedure SetState(AValue: TGameState);
    314304    procedure TrainMovement;
     
    16861676  if FDarkMode = AValue then Exit;
    16871677  FDarkMode := AValue;
    1688   InitColors;
     1678  Colors.Init(FDarkMode);
    16891679  if Assigned(FOnDarkModeChange) then FOnDarkModeChange(Self);
    1690 end;
    1691 
    1692 procedure TEngine.InitColors;
    1693 begin
    1694   with Colors do
    1695   if FDarkMode then begin
    1696     Background := $2f3020;
    1697     Text := clWhite;
    1698     ShapeBackground := clBlack;
    1699     MenuItemText := $cccccc;
    1700     MenuItemBackground := $b75C01;
    1701     MenuItemBackgroundSelected := $070C81;
    1702   end else begin
    1703     Background := $eff0e0;
    1704     Text := clBlack;
    1705     ShapeBackground := clWhite;
    1706     MenuItemText := clWhite;
    1707     MenuItemBackground := $e78C31;
    1708     MenuItemBackgroundSelected := $f7bC61;
    1709   end;
    17101680end;
    17111681
     
    29242894  //  ImageLocomotive.Picture.LoadFromFile(ImageLocomotiveName);
    29252895  MetaCanvas := TMetaCanvas.Create;
    2926   InitColors;
     2896  Colors.Init(FDarkMode);
    29272897end;
    29282898
Note: See TracChangeset for help on using the changeset viewer.