diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-03-21 19:19:04 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-03-21 19:19:04 +0000 |
commit | 5ed6620bad808381fce94f2cd67ee911b4d45bff (patch) | |
tree | bfe0fe2041260620f88f8161922ee90c034d7d73 /Game/Code/Screens/UScreenOptionsRecord.pas | |
download | usdx-5ed6620bad808381fce94f2cd67ee911b4d45bff.tar.gz usdx-5ed6620bad808381fce94f2cd67ee911b4d45bff.tar.xz usdx-5ed6620bad808381fce94f2cd67ee911b4d45bff.zip |
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens/UScreenOptionsRecord.pas')
-rw-r--r-- | Game/Code/Screens/UScreenOptionsRecord.pas | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas new file mode 100644 index 00000000..c27ec02a --- /dev/null +++ b/Game/Code/Screens/UScreenOptionsRecord.pas @@ -0,0 +1,136 @@ +unit UScreenOptionsRecord;
+
+interface
+
+uses
+ UMenu, SDL, UDisplay, UMusic, UPliki, UIni, UThemes;
+
+type
+ TScreenOptionsRecord = class(TMenu)
+ private
+ SelectSlideInput: integer;
+ SelectSlideChannelL: integer;
+ SelectSlideChannelR: integer;
+ public
+ constructor Create; override;
+ function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
+ procedure onShow; override;
+ procedure UpdateCard;
+ end;
+
+implementation
+
+uses SysUtils, UGraphic, URecord, ULog;
+
+function TScreenOptionsRecord.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
+begin
+ Result := true;
+ If (PressedDown) Then
+ begin // Key Down
+ case PressedKey of
+ SDLK_ESCAPE, SDLK_BACKSPACE:
+ begin
+ Ini.Save;
+ Music.PlayBack;
+ FadeTo(@ScreenOptions);
+ end;
+ SDLK_RETURN:
+ begin
+ if SelInteraction = 4 then begin
+ Ini.Save;
+ Music.PlayBack;
+ FadeTo(@ScreenOptions);
+ end;
+ end;
+ SDLK_DOWN:
+ InteractNext;
+ SDLK_UP :
+ InteractPrev;
+ SDLK_RIGHT:
+ begin
+ if (SelInteraction >= 0) and (SelInteraction <= 3) then begin
+ Music.PlayOption;
+ InteractInc;
+ end;
+ if SelInteraction = 0 then UpdateCard;
+ end;
+ SDLK_LEFT:
+ begin
+ if (SelInteraction >= 0) and (SelInteraction <= 3) then begin
+ Music.PlayOption;
+ InteractDec;
+ end;
+ if SelInteraction = 0 then UpdateCard;
+ end;
+ end;
+ end;
+end;
+
+constructor TScreenOptionsRecord.Create;
+var
+ I: integer;
+ SC: integer;
+ SCI: integer;
+begin
+ AddBackground(Theme.OptionsRecord.Background.Tex);
+ for I := 0 to High(Theme.OptionsRecord.Static) do
+ AddStatic(Theme.OptionsRecord.Static[I]);
+
+ for I := 0 to High(Theme.OptionsRecord.Text) do
+ AddText(Theme.OptionsRecord.Text[I]);
+
+// SetLength(ICard, 0);
+// ICard[0] := 'karta';
+
+// SetLength(IInput, 0);
+// IInput[0] := 'wejscie';
+
+// if Length(Recording.SoundCard) > 0 then begin
+ SetLength(ICard, Length(Recording.SoundCard));
+ for SC := 0 to High(Recording.SoundCard) do
+ ICard[SC] := Recording.SoundCard[SC].Description;
+// end;
+
+// if Length(Recording.SoundCard[Ini.Card].Input) > 0 then begin
+ SetLength(IInput, Length(Recording.SoundCard[Ini.Card].Input));
+ for SCI := 0 to High(Recording.SoundCard[Ini.Card].Input) do
+ IInput[SCI] := Recording.SoundCard[Ini.Card].Input[SCI].Name;
+// end;
+
+
+ AddSelectSlide(Theme.OptionsRecord.SelectSlideCard, Ini.Card, ICard);
+ SelectSlideInput := AddSelectSlide(Theme.OptionsRecord.SelectSlideInput, Ini.CardList[0].Input, IInput);
+ SelectSlideChannelL := AddSelectSlide(Theme.OptionsRecord.SelectSlideChannelL, Ini.CardList[0].ChannelL, IChannel);
+ SelectSlideChannelR := AddSelectSlide(Theme.OptionsRecord.SelectSlideChannelR, Ini.CardList[0].ChannelR, IChannel);
+
+ AddButton(Theme.OptionsRecord.ButtonExit);
+ AddButtonText(14, 20, 'Exit');
+
+ Interaction := 0;
+end;
+
+procedure TScreenOptionsRecord.onShow;
+begin
+ Interaction := 0;
+end;
+
+procedure TScreenOptionsRecord.UpdateCard;
+var
+ SC: integer;
+ SCI: integer;
+begin
+ SC := Ini.Card;
+// if SC = 1 then beep;
+
+ SetLength(IInput, Length(Recording.SoundCard[SC].Input));
+ for SCI := 0 to High(Recording.SoundCard[SC].Input) do begin
+ IInput[SCI] := Recording.SoundCard[SC].Input[SCI].Name;
+// Log.LogError(IInput[SCI]);
+ end;
+
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideInput, SelectSlideInput, IInput, Ini.CardList[SC].Input);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelL, SelectSlideChannelL, IChannel, Ini.CardList[SC].ChannelL);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelR, SelectSlideChannelR, IChannel, Ini.CardList[SC].ChannelR);
+end;
+
+end.
\ No newline at end of file |