tappytux: Moves image loading to Form.OnCreate to be able to show error messages

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2031 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-09-28 18:21:15 +00:00
parent b5e830223c
commit 315ab409ed
3 changed files with 16 additions and 2 deletions

View File

@ -108,8 +108,14 @@ begin
end;
procedure TformConfig.FormCreate(Sender: TObject);
var
i: Integer;
begin
TranslateUI();
// Initialize modules
for i := 0 to GetModuleCount() do
GetModule(i).InitModule();
end;
procedure TformConfig.TranslateUI;

View File

@ -23,6 +23,7 @@ type
procedure TranslateTexts(ALanguage: Integer);
procedure TranslateTextsToEnglish; virtual;
procedure TranslateTextsToPortuguese; virtual;
procedure InitModule(); virtual;
procedure StartNewGame(); virtual; abstract;
procedure EndGame(); virtual; abstract;
end;
@ -73,8 +74,6 @@ begin
imgLevel2 := TJPEGImage.Create;
imgLevel3 := TJPEGImage.Create;
LoadImages();
TranslateTexts(ID_ENGLISH);
end;
@ -119,6 +118,11 @@ begin
end;
procedure TTappyModule.InitModule;
begin
LoadImages();
end;
initialization
gTappyModules := TFPList.Create;
finalization

View File

@ -101,6 +101,10 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
<GenerateDwarf Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>