Ignore:
Timestamp:
May 18, 2021, 10:25:20 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Colors inversion of used images if dark mode active.
  • Fixed: Back button arrow drawn as image instead of font. Left arrow was not supported under Ubuntu.
  • Modified: Allow to start new track from already connected station.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r69 r76  
    4444    procedure LoadConfig;
    4545    procedure SaveConfig;
     46    procedure LoadGraphicAssets;
     47    procedure DarkModeChange(Sender: TObject);
    4648  public
    4749    FullScreen: Boolean;
     
    5961
    6062uses
    61   UFormImages;
     63  UFormImages, UPixelPointer;
    6264
    6365{ TFormMain }
     
    114116    FullScreen := PersistentForm1.FormFullScreen;
    115117    Engine.InitMenus;
    116     Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture);
    117     Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture);
     118    Engine.OnDarkModeChange := DarkModeChange;
    118119    Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height);
    119120    Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
    120121    Engine.MainMenu;
     122    LoadGraphicAssets;
    121123  end;
    122124end;
     
    212214end;
    213215
     216procedure TFormMain.LoadGraphicAssets;
     217begin
     218  Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture);
     219  Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture);
     220  Engine.ButtonBack.Bitmap.Assign(FormImages.ImageLeftArrow.Picture.Bitmap);
     221  if Engine.DarkMode then begin
     222    BitmapInvert(Engine.ImagePassenger.Picture.Bitmap);
     223    BitmapInvert(Engine.ImageLocomotive.Picture.Bitmap);
     224    BitmapInvert(Engine.ButtonBack.Bitmap);
     225  end;
     226end;
     227
     228procedure TFormMain.DarkModeChange(Sender: TObject);
     229begin
     230  LoadGraphicAssets;
     231end;
     232
    214233
    215234end.
Note: See TracChangeset for help on using the changeset viewer.