Changeset 76 for trunk/Forms


Ignore:
Timestamp:
May 18, 2021, 10:25:20 PM (4 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.
Location:
trunk/Forms
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImages.lfm

    r41 r76  
    11object FormImages: TFormImages
    22  Left = 1198
    3   Height = 349
     3  Height = 524
    44  Top = 264
    5   Width = 702
     5  Width = 1053
    66  Caption = 'FormImages'
    7   ClientHeight = 349
    8   ClientWidth = 702
    9   LCLVersion = '1.6.2.0'
     7  ClientHeight = 524
     8  ClientWidth = 1053
     9  DesignTimePPI = 144
     10  LCLVersion = '2.0.12.0'
    1011  object ImageLocomotive: TImage
    11     Left = 32
    12     Height = 34
    13     Top = 32
    14     Width = 32
     12    Left = 48
     13    Height = 51
     14    Top = 48
     15    Width = 48
    1516    Picture.Data = {
    1617      1754506F727461626C654E6574776F726B477261706869634E04000089504E47
     
    5354  end
    5455  object ImagePassenger: TImage
    55     Left = 33
    56     Height = 32
    57     Top = 64
    58     Width = 32
     56    Left = 50
     57    Height = 48
     58    Top = 96
     59    Width = 48
    5960    Picture.Data = {
    6061      1754506F727461626C654E6574776F726B477261706869638C02000089504E47
     
    8384  end
    8485  object ImageTunnel: TImage
    85     Left = 32
    86     Height = 51
    87     Top = 104
    88     Width = 56
     86    Left = 48
     87    Height = 76
     88    Top = 156
     89    Width = 84
    8990    Picture.Data = {
    9091      1754506F727461626C654E6574776F726B47726170686963E40E000089504E47
     
    211212  end
    212213  object ImageScreenshot: TImage
    213     Left = 33
    214     Height = 32
    215     Top = 168
    216     Width = 34
     214    Left = 50
     215    Height = 48
     216    Top = 252
     217    Width = 51
    217218    Picture.Data = {
    218219      1754506F727461626C654E6574776F726B477261706869631C0E000089504E47
     
    332333    }
    333334  end
     335  object ImageLeftArrow: TImage
     336    Left = 163
     337    Height = 79
     338    Top = 57
     339    Width = 85
     340    Picture.Data = {
     341      1754506F727461626C654E6574776F726B477261706869630602000089504E47
     342      0D0A1A0A0000000D49484452000001000000010008030000006BAC5854000000
     343      21504C5445000000000000000000000000000000000000000000000000000000
     344      0000000000006DD148C10000000A74524E530010304050809FBFCFEFF438B8CF
     345      0000018A49444154789CEDDC8B718200144451893141FB2F386901F2165C724E
     346      05EC1D67547EB71B000000000000000000000000F007CB63B3FBD9C73C69595F
     347      5BADCBD9073DC87EFBEDB7DF7EFBEDB7DF7EFBEDB7DF7EFBEDB7DF7EFBEDB7DF
     348      7EFBEDB7DF7EFBEDBF0EFBEDB7DF7EFBEDB7DF7EFBEDB7DF7EFBEDB7DF7EFBED
     349      B7DF7EFBEDB7DF7EFBEDB7FF3A76EC7FADDF07FB78AFFDC7CB3D72DBB13F17A0
     350      647F2C40CBFE54809AFDA1003DFB33018AF6470234ED4F04A8DA1F08D0B57F3E
     351      40D9FEF1006DFBA703D4ED1F0ED0B77F3640E1FED1008DFB270354EE9F0CF075
     352      F6965D7C02E6027416F02D3019A0B1805F82B301FA0AF837381DA0AD803342F3
     353      01BA0A382B9C08D054C095A14C809E02AE0EA702B41408BE93BCA340F2A5EC15
     354      05A26FA5DF51E0F9793F56F6AEB4FF7E9F9C020A28A080020A28A080020A28A0
     355      80020A28A080020A28A080020A28A080020A28A080020A28A080020A28A08002
     356      0A28A080020A28A080020A28A080020A28A080020A28F05BE0B159F409500000
     357      00000000000000000000E0627E009B74DE3A9610647B0000000049454E44AE42
     358      6082
     359    }
     360    Proportional = True
     361    Stretch = True
     362  end
    334363end
  • trunk/Forms/UFormImages.pas

    r41 r76  
    1313
    1414  TFormImages = class(TForm)
     15    ImageLeftArrow: TImage;
    1516    ImageLocomotive: TImage;
    1617    ImagePassenger: TImage;
  • trunk/Forms/UFormMain.lfm

    r71 r76  
    1515  OnKeyUp = FormKeyUp
    1616  OnShow = FormShow
    17   LCLVersion = '2.0.10.0'
     17  LCLVersion = '2.0.12.0'
    1818  object PaintBox1: TPaintBox
    1919    Left = 0
  • 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.