Changeset 73 for trunk/Forms/FormMain.pas
- Timestamp:
- Mar 26, 2024, 6:13:44 PM (8 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormMain.pas
r72 r73 1 unit UFormMain;1 unit FormMain; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, LCLType, 7 Dialogs, ExtCtrls, ComCtrls, Menus, ActnList, UEngine, UPlatform, Math,7 Dialogs, ExtCtrls, ComCtrls, Menus, ActnList, Engine, Platform, Math, 8 8 DateUtils, GraphType, UPersistentForm, UApplicationInfo, UTranslator, 9 URegistry, UAboutDialog ;9 URegistry, UAboutDialog, FormNewGame, FormMap; 10 10 11 11 type … … 61 61 PersistentForm: TPersistentForm; 62 62 Engine: TEngine; 63 FormNewGame: TFormNewGame; 64 FormMap: TFormMap; 63 65 procedure EraseBackground(DC: HDC); override; 64 66 end; … … 73 75 74 76 uses 75 UCore, UFormMap, UFormNewGame;77 Core; 76 78 77 79 resourcestring … … 115 117 with TRegistryEx.Create do 116 118 try 117 CurrentContext := Core. ApplicationInfo.GetRegistryContext;119 CurrentContext := Core.Core.ApplicationInfo.GetRegistryContext; 118 120 119 121 if ValueExists('LanguageCode') then begin 120 122 LangCode := ReadStringWithDefault('LanguageCode', ''); 121 Core. Translator1.Language :=Core.Translator1.Languages.SearchByCode(LangCode);122 end else Core. Translator1.Language :=Core.Translator1.Languages.SearchByCode('');123 Core.Core.Translator1.Language := Core.Core.Translator1.Languages.SearchByCode(LangCode); 124 end else Core.Core.Translator1.Language := Core.Core.Translator1.Languages.SearchByCode(''); 123 125 Engine.LoadFromRegistry(CurrentContext); 124 126 finally … … 131 133 with TRegistryEx.Create do 132 134 try 133 CurrentContext := Core. ApplicationInfo.GetRegistryContext;134 135 if Assigned(Core. Translator1.Language) and (Core.Translator1.Language.Code <> '') then136 WriteString('LanguageCode', Core. Translator1.Language.Code)135 CurrentContext := Core.Core.ApplicationInfo.GetRegistryContext; 136 137 if Assigned(Core.Core.Translator1.Language) and (Core.Core.Translator1.Language.Code <> '') then 138 WriteString('LanguageCode', Core.Core.Translator1.Language.Code) 137 139 else DeleteValue('LanguageCode'); 138 140 Engine.SaveToRegistry(CurrentContext); … … 167 169 {$IFDEF UNIX} 168 170 // If installed in UNIX system then use installation directory for po files 169 if not DirectoryExists(Core. Translator1.POFilesFolder) and DirectoryExists(UnixLanguagesDir) then170 Core. Translator1.POFilesFolder := UnixLanguagesDir;171 if not DirectoryExists(Core.Core.Translator1.POFilesFolder) and DirectoryExists(UnixLanguagesDir) then 172 Core.Core.Translator1.POFilesFolder := UnixLanguagesDir; 171 173 {$ENDIF} 172 174 … … 175 177 176 178 PersistentForm := TPersistentForm.Create(nil); 177 PersistentForm.RegistryContext := TRegistryContext.Create(Core. ApplicationInfo.RegistryRoot,178 Core. ApplicationInfo.RegistryKey);179 PersistentForm.RegistryContext := TRegistryContext.Create(Core.Core.ApplicationInfo.RegistryRoot, 180 Core.Core.ApplicationInfo.RegistryKey); 179 181 180 182 Application.OnDeactivate := FormDeactivate; … … 265 267 procedure TFormMain.FormShow(Sender: TObject); 266 268 begin 267 PersistentForm.RegistryContext := Core. ApplicationInfo.GetRegistryContext;269 PersistentForm.RegistryContext := Core.Core.ApplicationInfo.GetRegistryContext; 268 270 PersistentForm.Load(Self, False, True); 269 271 FullScreenEnabled := PersistentForm.FormFullScreen;
Note:
See TracChangeset
for help on using the changeset viewer.