2011-09-10 00:58:47 +00:00
|
|
|
unit gameconfigform;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2011-09-10 02:43:40 +00:00
|
|
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
2011-09-10 21:42:25 +00:00
|
|
|
ExtCtrls,
|
2011-09-14 00:35:25 +00:00
|
|
|
tappymodules, gameplayform;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
type
|
2011-09-10 00:58:47 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
{ TformConfig }
|
2011-09-10 00:58:47 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
TformConfig = class(TForm)
|
2011-09-10 00:58:47 +00:00
|
|
|
btnLoad: TButton;
|
|
|
|
btnWordlist: TButton;
|
|
|
|
comboGameType: TComboBox;
|
|
|
|
comboSound: TComboBox;
|
|
|
|
comboMusic: TComboBox;
|
|
|
|
comboLevel: TComboBox;
|
|
|
|
lblGameType: TLabel;
|
|
|
|
listWordlist: TLabel;
|
|
|
|
lblSettings: TLabel;
|
|
|
|
lblSound: TLabel;
|
|
|
|
lblMusic: TLabel;
|
|
|
|
lblLevel: TLabel;
|
|
|
|
lblCredits: TLabel;
|
|
|
|
ltbWordlist: TListBox;
|
|
|
|
memoGameType: TMemo;
|
|
|
|
memoCredits: TMemo;
|
2011-09-14 00:35:25 +00:00
|
|
|
procedure btnLoadClick(Sender: TObject);
|
2011-09-10 02:43:40 +00:00
|
|
|
procedure comboGameTypeChange(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
procedure comboSoundChange(Sender: TObject);
|
|
|
|
procedure FormClick(Sender: TObject);
|
2011-09-10 21:42:25 +00:00
|
|
|
procedure FormCreate(Sender: TObject);
|
2011-09-07 17:58:54 +00:00
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
|
|
|
{ public declarations }
|
2011-09-10 21:42:25 +00:00
|
|
|
procedure TranslateUI();
|
2011-09-10 00:58:47 +00:00
|
|
|
end;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
var
|
2011-09-15 14:14:50 +00:00
|
|
|
formConfig: TformConfig;
|
2011-09-07 17:58:54 +00:00
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-07 17:58:54 +00:00
|
|
|
{$R *.lfm}
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
{ TformConfig }
|
2011-09-10 02:43:40 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.comboGameTypeChange(Sender: TObject);
|
2011-09-10 02:43:40 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
Case comboGameType.itemIndex of
|
|
|
|
0: begin
|
|
|
|
memoGameType.Clear;
|
|
|
|
memoGameType.Lines.Add('Description: <Descrição do TappyWords>');
|
|
|
|
memoGameType.Lines.Add('');
|
|
|
|
memoGameType.Lines.Add('Hint: <Alguma dica para TappyWords>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
1: begin
|
|
|
|
memoGameType.Clear;
|
|
|
|
memoGameType.Lines.Add('Description: <Descrição do TappyMath>');
|
|
|
|
memoGameType.Lines.Add('');
|
|
|
|
memoGameType.Lines.Add('Hint: <Alguma dica para TappyMath>');
|
|
|
|
end;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.btnLoadClick(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
begin
|
2011-09-15 14:14:50 +00:00
|
|
|
SetCurrentModule(comboGameType.ItemIndex);
|
2011-09-15 14:34:06 +00:00
|
|
|
GetCurrentModule().StartNewGame();
|
2011-09-14 00:35:25 +00:00
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
formTappyTuxGame.Show;
|
|
|
|
Hide;
|
2011-09-14 00:35:25 +00:00
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.comboSoundChange(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
{
|
|
|
|
Case comboSound.itemIndex of
|
|
|
|
0: begin
|
|
|
|
TTappyGameData.SndFX = true;
|
|
|
|
end;
|
|
|
|
|
|
|
|
1: begin
|
|
|
|
TTappyGameData.SndFX = false;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end; }
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.FormClick(Sender: TObject);
|
2011-09-14 00:35:25 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.FormCreate(Sender: TObject);
|
2011-09-28 18:21:15 +00:00
|
|
|
var
|
|
|
|
i: Integer;
|
2011-09-10 21:42:25 +00:00
|
|
|
begin
|
|
|
|
TranslateUI();
|
2011-09-28 18:21:15 +00:00
|
|
|
|
|
|
|
// Initialize modules
|
2011-09-28 19:00:29 +00:00
|
|
|
for i := 0 to GetModuleCount() -1 do
|
2011-09-28 18:21:15 +00:00
|
|
|
GetModule(i).InitModule();
|
2011-09-10 21:42:25 +00:00
|
|
|
end;
|
|
|
|
|
2011-09-15 14:14:50 +00:00
|
|
|
procedure TformConfig.TranslateUI;
|
2011-09-10 21:42:25 +00:00
|
|
|
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;
|
|
|
|
|
2011-09-07 17:58:54 +00:00
|
|
|
end.
|
|
|
|
|