aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens/UScreenOptionsRecord.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
commit51ed8fe6f2ea9892e905e81cf5bad3960537eb40 (patch)
treea4dcb099343762dcb7bd7988f73de68c1959d3a5 /Game/Code/Screens/UScreenOptionsRecord.pas
downloadusdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.gz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.xz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.zip
Challenge MOD r7 alpha based on Ultrastar Deluxe v1.0.1a
for changes read Changelog.txt in folder Game git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2107 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens/UScreenOptionsRecord.pas')
-rw-r--r--Game/Code/Screens/UScreenOptionsRecord.pas142
1 files changed, 142 insertions, 0 deletions
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas
new file mode 100644
index 00000000..9f75f78a
--- /dev/null
+++ b/Game/Code/Screens/UScreenOptionsRecord.pas
@@ -0,0 +1,142 @@
+unit UScreenOptionsRecord;
+
+interface
+
+uses
+ UMenu, SDL, UDisplay, UMusic, UFiles, UIni, UThemes;
+
+type
+ TScreenOptionsRecord = class(TMenu)
+ const
+ ID='ID_011'; //for help system
+
+ 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, UHelp, ULog;
+
+function TScreenOptionsRecord.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
+begin
+ Result := true;
+ If (PressedDown) Then
+ begin // Key Down
+ case PressedKey of
+ SDLK_TAB:
+ begin
+ ScreenPopupHelp.ShowPopup();
+ end;
+
+ SDLK_Q:
+ begin
+ Result := false;
+ end;
+ 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
+ inherited Create;
+
+ LoadFromTheme(Theme.OptionsRecord);
+
+ 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);
+ if (Length(Button[0].Text)=0) then
+ AddButtonText(14, 20, Theme.Options.Description[7]);
+
+ Interaction := 0;
+end;
+
+procedure TScreenOptionsRecord.onShow;
+begin
+ Interaction := 0;
+ if not Help.SetHelpID(ID) then
+ Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsRecord)');
+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