tappytux: Adds descriptions and translations to modules

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1933 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-09-10 21:42:25 +00:00
parent f743387f69
commit 1c94c886bd
8 changed files with 227 additions and 100 deletions

View File

@ -6,17 +6,14 @@ object Form1: TForm1
Caption = 'TappyTux Loader'
ClientHeight = 436
ClientWidth = 582
OnCreate = FormCreate
LCLVersion = '0.9.31'
object comboGameType: TComboBox
Left = 17
Height = 23
Height = 21
Top = 38
Width = 100
ItemHeight = 15
Items.Strings = (
'Tappy Words'
'Tappy Math'
)
ItemHeight = 0
OnChange = comboGameTypeChange
TabOrder = 0
Text = 'GameType'
@ -31,9 +28,9 @@ object Form1: TForm1
end
object listWordlist: TLabel
Left = 208
Height = 16
Height = 17
Top = 16
Width = 79
Width = 93
Caption = 'Select Wordlist'
ParentColor = False
end
@ -54,17 +51,17 @@ object Form1: TForm1
end
object lblSettings: TLabel
Left = 400
Height = 16
Height = 17
Top = 16
Width = 43
Width = 52
Caption = 'Settings'
ParentColor = False
end
object lblSound: TLabel
Left = 408
Height = 16
Height = 17
Top = 47
Width = 53
Width = 63
Caption = 'Sound FX'
Font.Style = [fsBold]
ParentColor = False
@ -72,9 +69,9 @@ object Form1: TForm1
end
object lblMusic: TLabel
Left = 408
Height = 16
Height = 17
Top = 79
Width = 33
Width = 40
Caption = 'Music'
Font.Style = [fsBold]
ParentColor = False
@ -82,9 +79,9 @@ object Form1: TForm1
end
object lblLevel: TLabel
Left = 408
Height = 16
Height = 17
Top = 111
Width = 79
Width = 93
Caption = 'Starting Level'
Font.Style = [fsBold]
ParentColor = False
@ -92,10 +89,10 @@ object Form1: TForm1
end
object comboSound: TComboBox
Left = 493
Height = 23
Height = 21
Top = 40
Width = 68
ItemHeight = 15
ItemHeight = 0
Items.Strings = (
'ON'
'OFF'
@ -105,10 +102,10 @@ object Form1: TForm1
end
object comboMusic: TComboBox
Left = 493
Height = 23
Height = 21
Top = 72
Width = 68
ItemHeight = 15
ItemHeight = 0
Items.Strings = (
'ON'
'OFF'
@ -118,10 +115,10 @@ object Form1: TForm1
end
object comboLevel: TComboBox
Left = 493
Height = 23
Height = 21
Top = 104
Width = 68
ItemHeight = 15
ItemHeight = 0
Items.Strings = (
'1'
'2'
@ -139,9 +136,9 @@ object Form1: TForm1
end
object lblCredits: TLabel
Left = 400
Height = 16
Height = 17
Top = 168
Width = 38
Width = 46
Caption = 'Credits'
ParentColor = False
end
@ -188,9 +185,9 @@ object Form1: TForm1
end
object lblGameType: TLabel
Left = 16
Height = 16
Height = 17
Top = 16
Width = 58
Width = 67
Caption = 'GameType'
ParentColor = False
end

View File

@ -6,7 +6,8 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls;
ExtCtrls,
tappymodules;
type
@ -30,10 +31,12 @@ type
memoGameType: TMemo;
memoCredits: TMemo;
procedure comboGameTypeChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
procedure TranslateUI();
end;
var
@ -67,5 +70,24 @@ begin
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TranslateUI();
end;
procedure TForm1.TranslateUI;
var
i: Integer;
lModule: TTappyModule;
begin
comboGameType.Items.Clear;
for i := 0 to GetModuleCount() - 1 do
begin
lModule := GetModule(i);
comboGameType.Items.Add(lModule.ShortDescription);
end;
comboGameType.ItemIndex := 0;
end;
end.

View File

@ -0,0 +1,44 @@
unit mod_tappymath;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
tappymodules;
type
{ TTappyMath }
TTappyMath = class(TTappyModule)
public
constructor Create; override;
procedure TranslateTextsToEnglish; override;
procedure TranslateTextsToPortuguese; override;
end;
implementation
{ TTappyWords }
constructor TTappyMath.Create;
begin
inherited Create;
end;
procedure TTappyMath.TranslateTextsToEnglish;
begin
ShortDescription := 'TappyMath - A game to learn arithmetics';
end;
procedure TTappyMath.TranslateTextsToPortuguese;
begin
ShortDescription := 'TappyMath - Um jogo para aprender aritmética';
end;
initialization
AddModule(TTappyMath.Create);
end.

View File

@ -9,11 +9,36 @@ uses
tappymodules;
type
{ TTappyWords }
TTappyWords = class(TTappyModule)
public
constructor Create; override;
procedure TranslateTextsToEnglish; override;
procedure TranslateTextsToPortuguese; override;
end;
implementation
{ TTappyWords }
constructor TTappyWords.Create;
begin
inherited Create;
end;
procedure TTappyWords.TranslateTextsToEnglish;
begin
ShortDescription := 'TappyWords - A game to learn typing and ortography';
end;
procedure TTappyWords.TranslateTextsToPortuguese;
begin
ShortDescription := 'TappyWords - Um jogo para aprender a digitar e ortografia';
end;
initialization
AddModule(TTappyWords.Create);
end.

View File

@ -20,6 +20,9 @@ type
const
STR_LINUX_RESOURCES_FOLDER = '/usr/share/tappytux/';
ID_ENGLISH = 0;
ID_PORTUGUESE = 1;
var
vTappyTuxConfig: TTappyTuxConfig;

View File

@ -5,7 +5,8 @@ unit tappymodules;
interface
uses
Classes, SysUtils, Graphics;
Classes, SysUtils, Graphics,
tappyconfig;
type
@ -14,9 +15,13 @@ type
TTappyModule = class
public
imgBackground: TPortableNetworkGraphic;
ShortDescription, LongDescription: string;
constructor Create; virtual;
destructor Destroy; override;
procedure LoadImages; virtual;
procedure TranslateTexts(ALanguage: Integer);
procedure TranslateTextsToEnglish; virtual;
procedure TranslateTextsToPortuguese; virtual;
end;
procedure AddModule(AModule: TTappyModule);
@ -61,6 +66,8 @@ end;
constructor TTappyModule.Create;
begin
inherited Create;
TranslateTexts(ID_ENGLISH);
end;
destructor TTappyModule.Destroy;
@ -91,6 +98,24 @@ begin
end;
procedure TTappyModule.TranslateTexts(ALanguage: Integer);
begin
case ALanguage of
ID_ENGLISH: TranslateTextsToEnglish();
ID_PORTUGUESE: TranslateTextsToEnglish();
end;
end;
procedure TTappyModule.TranslateTextsToEnglish;
begin
end;
procedure TTappyModule.TranslateTextsToPortuguese;
begin
end;
initialization
gTappyModules := TFPList.Create;
finalization

View File

@ -34,7 +34,7 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="8">
<Units Count="9">
<Unit0>
<Filename Value="tappytux.lpr"/>
<IsPartOfProject Value="True"/>
@ -49,9 +49,9 @@
<UnitName Value="gameconfigform"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<FoldState Value=" T8W211?"/>
<TopLine Value="67"/>
<CursorPos X="17" Y="75"/>
<FoldState Value=" T8Y21,"/>
<UsageCount Value="27"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -62,7 +62,7 @@
<ComponentName Value="Form2"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="gameplayform"/>
<EditorIndex Value="1"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="19"/>
@ -74,10 +74,10 @@
<Filename Value="tappyconfig.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="tappyconfig"/>
<EditorIndex Value="3"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="3"/>
<CursorPos X="1" Y="16"/>
<TopLine Value="16"/>
<CursorPos X="21" Y="24"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit3>
@ -85,8 +85,7 @@
<Filename Value="tappydrawer.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="tappydrawer"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="4"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="272"/>
<CursorPos X="70" Y="291"/>
@ -97,10 +96,10 @@
<Filename Value="tappygamedata.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="tappygamedata"/>
<EditorIndex Value="2"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="14"/>
<CursorPos X="5" Y="21"/>
<CursorPos X="24" Y="23"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit5>
@ -108,10 +107,10 @@
<Filename Value="mod_tappywords.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="mod_tappywords"/>
<EditorIndex Value="5"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="15" Y="9"/>
<TopLine Value="6"/>
<CursorPos X="1" Y="20"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit6>
@ -119,134 +118,146 @@
<Filename Value="tappymodules.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="tappymodules"/>
<EditorIndex Value="6"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="68"/>
<CursorPos X="47" Y="76"/>
<TopLine Value="66"/>
<CursorPos X="30" Y="70"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="mod_tappymath.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="mod_tappymath"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="19"/>
<CursorPos X="3" Y="38"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit8>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="gameconfigform.pas"/>
<Caret Line="12" Column="40" TopLine="2"/>
<Filename Value="tappyconfig.pas"/>
<Caret Line="8" Column="37" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="gameconfigform.pas"/>
<Caret Line="63" Column="62" TopLine="43"/>
<Filename Value="tappydrawer.pas"/>
<Caret Line="33" Column="3" TopLine="27"/>
</Position2>
<Position3>
<Filename Value="gameconfigform.pas"/>
<Caret Line="65" Column="62" TopLine="45"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="17" Column="11" TopLine="5"/>
</Position3>
<Position4>
<Filename Value="gameconfigform.pas"/>
<Caret Line="64" Column="62" TopLine="44"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="18" Column="36" TopLine="14"/>
</Position4>
<Position5>
<Filename Value="tappygamedata.pas"/>
<Caret Line="11" Column="1" TopLine="1"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="19" Column="34" TopLine="5"/>
</Position5>
<Position6>
<Filename Value="tappygamedata.pas"/>
<Caret Line="276" Column="1" TopLine="251"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="20" Column="41" TopLine="6"/>
</Position6>
<Position7>
<Filename Value="tappydrawer.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
<Caret Line="165" Column="46" TopLine="152"/>
</Position7>
<Position8>
<Filename Value="tappydrawer.pas"/>
<Caret Line="44" Column="7" TopLine="32"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="50" Column="33" TopLine="33"/>
</Position8>
<Position9>
<Filename Value="tappydrawer.pas"/>
<Caret Line="68" Column="5" TopLine="55"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="8" Column="30" TopLine="1"/>
</Position9>
<Position10>
<Filename Value="tappydrawer.pas"/>
<Caret Line="89" Column="5" TopLine="76"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="38" Column="50" TopLine="16"/>
</Position10>
<Position11>
<Filename Value="tappydrawer.pas"/>
<Caret Line="54" Column="15" TopLine="40"/>
<Caret Line="10" Column="43" TopLine="1"/>
</Position11>
<Position12>
<Filename Value="tappydrawer.pas"/>
<Caret Line="40" Column="15" TopLine="27"/>
<Caret Line="187" Column="5" TopLine="172"/>
</Position12>
<Position13>
<Filename Value="tappymodules.pas"/>
<Caret Line="15" Column="45" TopLine="1"/>
<Caret Line="17" Column="31" TopLine="1"/>
</Position13>
<Position14>
<Filename Value="tappyconfig.pas"/>
<Caret Line="8" Column="37" TopLine="1"/>
<Filename Value="tappymodules.pas"/>
<Caret Line="19" Column="35" TopLine="4"/>
</Position14>
<Position15>
<Filename Value="tappydrawer.pas"/>
<Caret Line="33" Column="3" TopLine="27"/>
<Caret Line="45" Column="1" TopLine="34"/>
</Position15>
<Position16>
<Filename Value="tappymodules.pas"/>
<Caret Line="17" Column="11" TopLine="5"/>
<Filename Value="tappydrawer.pas"/>
<Caret Line="291" Column="1" TopLine="272"/>
</Position16>
<Position17>
<Filename Value="tappymodules.pas"/>
<Caret Line="18" Column="36" TopLine="14"/>
<Filename Value="tappydrawer.pas"/>
<Caret Line="51" Column="57" TopLine="51"/>
</Position17>
<Position18>
<Filename Value="tappymodules.pas"/>
<Caret Line="19" Column="34" TopLine="5"/>
<Filename Value="mod_tappywords.pas"/>
<Caret Line="12" Column="24" TopLine="1"/>
</Position18>
<Position19>
<Filename Value="tappymodules.pas"/>
<Caret Line="20" Column="41" TopLine="6"/>
<Filename Value="mod_tappywords.pas"/>
<Caret Line="17" Column="11" TopLine="1"/>
</Position19>
<Position20>
<Filename Value="tappydrawer.pas"/>
<Caret Line="165" Column="46" TopLine="152"/>
<Filename Value="mod_tappymath.pas"/>
<Caret Line="16" Column="3" TopLine="1"/>
</Position20>
<Position21>
<Filename Value="tappymodules.pas"/>
<Caret Line="50" Column="33" TopLine="33"/>
<Filename Value="mod_tappymath.pas"/>
<Caret Line="15" Column="25" TopLine="9"/>
</Position21>
<Position22>
<Filename Value="tappymodules.pas"/>
<Caret Line="8" Column="30" TopLine="1"/>
<Caret Line="21" Column="28" TopLine="8"/>
</Position22>
<Position23>
<Filename Value="tappymodules.pas"/>
<Caret Line="38" Column="50" TopLine="16"/>
<Caret Line="98" Column="40" TopLine="93"/>
</Position23>
<Position24>
<Filename Value="tappydrawer.pas"/>
<Caret Line="10" Column="43" TopLine="1"/>
<Filename Value="mod_tappywords.pas"/>
<Caret Line="18" Column="24" TopLine="8"/>
</Position24>
<Position25>
<Filename Value="tappydrawer.pas"/>
<Caret Line="187" Column="5" TopLine="172"/>
<Filename Value="mod_tappymath.pas"/>
<Caret Line="18" Column="49" TopLine="9"/>
</Position25>
<Position26>
<Filename Value="tappymodules.pas"/>
<Caret Line="17" Column="31" TopLine="1"/>
<Filename Value="gameconfigform.pas"/>
<Caret Line="37" Column="29" TopLine="19"/>
</Position26>
<Position27>
<Filename Value="tappymodules.pas"/>
<Caret Line="19" Column="35" TopLine="4"/>
<Filename Value="gameconfigform.pas"/>
<Caret Line="76" Column="8" TopLine="55"/>
</Position27>
<Position28>
<Filename Value="tappydrawer.pas"/>
<Caret Line="45" Column="1" TopLine="34"/>
<Filename Value="gameconfigform.pas"/>
<Caret Line="79" Column="53" TopLine="58"/>
</Position28>
<Position29>
<Filename Value="tappydrawer.pas"/>
<Caret Line="291" Column="1" TopLine="272"/>
<Filename Value="gameconfigform.pas"/>
<Caret Line="10" Column="15" TopLine="1"/>
</Position29>
<Position30>
<Filename Value="tappydrawer.pas"/>
<Caret Line="51" Column="57" TopLine="51"/>
<Filename Value="gameconfigform.pas"/>
<Caret Line="78" Column="29" TopLine="61"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, gameconfigform, gameplayform, tappyconfig, tappydrawer,
tappygamedata, mod_tappywords, tappymodules
tappygamedata, mod_tappywords, tappymodules, mod_tappymath
{ you can add units after this };
{$R *.res}