Changeset 76 for trunk/Forms/UFormMain.pas
- Timestamp:
- May 18, 2021, 10:25:20 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r69 r76 44 44 procedure LoadConfig; 45 45 procedure SaveConfig; 46 procedure LoadGraphicAssets; 47 procedure DarkModeChange(Sender: TObject); 46 48 public 47 49 FullScreen: Boolean; … … 59 61 60 62 uses 61 UFormImages ;63 UFormImages, UPixelPointer; 62 64 63 65 { TFormMain } … … 114 116 FullScreen := PersistentForm1.FormFullScreen; 115 117 Engine.InitMenus; 116 Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture); 117 Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture); 118 Engine.OnDarkModeChange := DarkModeChange; 118 119 Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height); 119 120 Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height); 120 121 Engine.MainMenu; 122 LoadGraphicAssets; 121 123 end; 122 124 end; … … 212 214 end; 213 215 216 procedure TFormMain.LoadGraphicAssets; 217 begin 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; 226 end; 227 228 procedure TFormMain.DarkModeChange(Sender: TObject); 229 begin 230 LoadGraphicAssets; 231 end; 232 214 233 215 234 end.
Note:
See TracChangeset
for help on using the changeset viewer.