Changeset 64 for trunk/Forms
- Timestamp:
- Nov 26, 2020, 4:58:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r63 r64 65 65 procedure TFormMain.FormCreate(Sender: TObject); 66 66 begin 67 Engine := TEngine.Create; 67 68 LoadConfig; 68 Engine := TEngine.Create;69 69 //PaintBox1.ControlStyle := [csOpaque]; 70 70 Randomize; … … 85 85 procedure TFormMain.FormDestroy(Sender: TObject); 86 86 begin 87 SaveConfig; 87 88 Engine.Free; 88 SaveConfig;89 89 end; 90 90 … … 103 103 begin 104 104 if Key = KeyF11 then begin 105 FormMain.FullScreen := not FormMain.FullScreen; 106 FormMain.PersistentForm1.SetFullScreen(FormMain.FullScreen); 107 end; 105 FullScreen := not FullScreen; 106 PersistentForm1.SetFullScreen(FormMain.FullScreen); 107 end else 108 Engine.KeyUp(Key); 108 109 end; 109 110 … … 112 113 PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext; 113 114 PersistentForm1.Load(Self, False, True); 115 FullScreen := PersistentForm1.FormFullScreen; 114 116 Randomize; 117 Engine.InitMenus; 115 118 Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture); 116 119 Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture); … … 185 188 Translator1.Language := Translator1.Languages.SearchByCode(LangCode); 186 189 end else Translator1.Language := Translator1.Languages.SearchByCode(''); 187 //ThemeManager1.Theme := ThemeManager1.Themes.FindByName(ReadStringWithDefault('Theme', 'System'));190 Engine.DarkMode := ReadBoolWithDefault('DarkMode', False); 188 191 finally 189 192 Free; … … 200 203 WriteString('LanguageCode', Translator1.Language.Code) 201 204 else DeleteValue('LanguageCode'); 202 //WriteString('Theme', ThemeManager1.Theme.Name);205 WriteBool('DarkMode', Engine.DarkMode); 203 206 finally 204 207 Free;
Note:
See TracChangeset
for help on using the changeset viewer.