From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 21 Mar 2007 19:19:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 107 +++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 Game/Code/Screens/UScreenOptionsGame.pas (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas new file mode 100644 index 00000000..6f49bd19 --- /dev/null +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -0,0 +1,107 @@ +unit UScreenOptionsGame; + +interface + +uses + UMenu, SDL, UDisplay, UMusic, UPliki, UIni, UThemes, USongs; + +type + TScreenOptionsGame = class(TMenu) + public + old_Tabs, old_Sorting: integer; + constructor Create(Back: String); override; + function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; + procedure onShow; override; + procedure RefreshSongs; + end; + +implementation + +uses UGraphic; + +function TScreenOptionsGame.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + SDLK_ESCAPE : + begin + Music.PlayBack; + RefreshSongs; + FadeTo(@ScreenOptions); + end; + SDLK_RETURN: + begin + if SelInteraction = 6 then begin + Music.PlayBack; + RefreshSongs; + FadeTo(@ScreenOptions); + end; + end; + SDLK_DOWN: + InteractNext; + SDLK_UP : + InteractPrev; + SDLK_RIGHT: + begin + if (SelInteraction >= 0) and (SelInteraction <= 5) then begin + Music.PlayOption; + InteractInc; + end; + end; + SDLK_LEFT: + begin + if (SelInteraction >= 0) and (SelInteraction <= 5) then begin + Music.PlayOption; + InteractDec; + end; + end; + end; + end; +end; + +constructor TScreenOptionsGame.Create(Back: String); +var + I: integer; +begin + inherited Create(Back); + + AddBackground(Theme.OptionsGame.Background.Tex); + + for I := 0 to High(Theme.OptionsGame.Static) do + AddStatic(Theme.OptionsGame.Static[I]); + + for I := 0 to High(Theme.OptionsGame.Text) do + AddText(Theme.OptionsGame.Text[I]); + + //Refresh Songs Patch + old_Sorting := Ini.Sorting; + old_Tabs := Ini.Tabs; + + AddSelect(Theme.OptionsGame.SelectPlayers, Ini.Players, IPlayers); + AddSelect(Theme.OptionsGame.SelectDifficulty, Ini.Difficulty, IDifficulty); + AddSelectSlide(Theme.OptionsGame.SelectLanguage, Ini.Language, ILanguage); + AddSelect(Theme.OptionsGame.SelectTabs, Ini.Tabs, ITabs); + AddSelectSlide(Theme.OptionsGame.SelectSorting, Ini.Sorting, ISorting); + AddSelect(Theme.OptionsGame.SelectDebug, Ini.Debug, IDebug); + + + AddButton(Theme.OptionsGame.ButtonExit); + AddButtonText(14, 20, 'Exit'); + +end; + +//Refresh Songs Patch +procedure TScreenOptionsGame.RefreshSongs; +begin +if (ini.Sorting <> old_Sorting) or (ini.Tabs <> old_Tabs) then + ScreenSong.Refresh; +end; + +procedure TScreenOptionsGame.onShow; +begin +// Interaction := 0; +end; + +end. -- cgit v1.2.3 From 42717e4611f758f137d86fd99e69bf9791d3a727 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 5 Apr 2007 12:50:05 +0000 Subject: Fixed: Not loading Button Texts from Ini Fixed: Exit Text in Option Screens not translated git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@57 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 6f49bd19..cc6e850b 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -88,7 +88,8 @@ begin AddButton(Theme.OptionsGame.ButtonExit); - AddButtonText(14, 20, 'Exit'); + if (Length(Button[0].Text)=0) then + AddButtonText(14, 20, Theme.Options.Description[6]); end; -- cgit v1.2.3 From 4f7bf28056fefdcd000499c583a47738ce7d9b07 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 6 Apr 2007 10:32:24 +0000 Subject: Fixed a Bug in Optionsscreen after adding OptionsAdvanced Screen Added Jump to Title HotKey (Alt + A..Z) Added Playlist Support to Party Mode, Category Only Mode is still buggy. Fixed: Team3 Players are now Hidden when only 2 Teams are Selected git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@67 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index cc6e850b..63bbec36 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -89,7 +89,7 @@ begin AddButton(Theme.OptionsGame.ButtonExit); if (Length(Button[0].Text)=0) then - AddButtonText(14, 20, Theme.Options.Description[6]); + AddButtonText(14, 20, Theme.Options.Description[7]); end; -- cgit v1.2.3 From bda4fa8e57ca63a1d591433f120b4226d6a5d327 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 29 Apr 2007 17:50:29 +0000 Subject: Added 2 new Buttons to ScreenMain: Multi and Stats Updated Language Fiels to Fit with new Buttons Some CodeClean Up in Menu Class and in Screens Some minor Bug fixes I forgot about Added ability to group Buttons within a Screen New Theme Object: ButtonCollection: Same Attributes as a Button Plus FirstChild: Defining the First Button in the Group. For Example: SingSolo is 1, SingMulti Button is 2, in ScreenMain Added Attribute to Theme Button: Parent: Number of the assigned Group, 0 for no Group Used new Abilitys in MainScreen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@149 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 63bbec36..88bb34e3 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -9,7 +9,7 @@ type TScreenOptionsGame = class(TMenu) public old_Tabs, old_Sorting: integer; - constructor Create(Back: String); override; + constructor Create; override; function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; procedure onShow; override; procedure RefreshSongs; @@ -61,19 +61,13 @@ begin end; end; -constructor TScreenOptionsGame.Create(Back: String); +constructor TScreenOptionsGame.Create; var I: integer; begin - inherited Create(Back); + inherited Create; - AddBackground(Theme.OptionsGame.Background.Tex); - - for I := 0 to High(Theme.OptionsGame.Static) do - AddStatic(Theme.OptionsGame.Static[I]); - - for I := 0 to High(Theme.OptionsGame.Text) do - AddText(Theme.OptionsGame.Text[I]); + LoadFromTheme(Theme.OptionsGame); //Refresh Songs Patch old_Sorting := Ini.Sorting; -- cgit v1.2.3 From b61e647b67ac0d449d764b89b117a3ac8b603403 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 8 May 2007 19:00:47 +0000 Subject: Readded Q Shortcut (Exit Application) on all Screens Clean up Popup Code a little bit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@180 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 88bb34e3..540931af 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -25,6 +25,10 @@ begin If (PressedDown) Then begin // Key Down case PressedKey of + SDLK_Q: + begin + Result := false; + end; SDLK_ESCAPE : begin Music.PlayBack; -- cgit v1.2.3 From 4a731514163a14bd3a9222d99707880b56772663 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 16 May 2007 19:19:35 +0000 Subject: all SongFile Loading and Saving procedures moved to UFiles. Added Some Tolerance in Song File Loading and Song Header Loading. Fix: Programm doesn't Crash anymore when a coruppted Song is loaded for Singing or Editing. Now Jump back to SongScreen and show an Error Message. Also Party Mode is not Interupted, a new Song will be selected automatically. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@197 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 540931af..8712decc 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -3,7 +3,7 @@ unit UScreenOptionsGame; interface uses - UMenu, SDL, UDisplay, UMusic, UPliki, UIni, UThemes, USongs; + UMenu, SDL, UDisplay, UMusic, UFiles, UIni, UThemes, USongs; type TScreenOptionsGame = class(TMenu) -- cgit v1.2.3 From 3043d3db91c3a541881aa951bbd4f8ccb5e3ce40 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 5 Sep 2007 12:35:19 +0000 Subject: modified ParseInput so Backspace will perform same function as ESC in most screens ( Except where text input is required, and backspace is used for text input ) This has been done, so that when used with Windows Media Center IR Remotes ( needs SDL 1.2 dll at runtime ) users can navigate throug the game without sitting in front of the PC keyboard. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@370 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 8712decc..0f69f326 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -29,7 +29,9 @@ begin begin Result := false; end; - SDLK_ESCAPE : + + SDLK_ESCAPE, + SDLK_BACKSPACE : begin Music.PlayBack; RefreshSongs; -- cgit v1.2.3 From 44554c7908f7e2405a249331f00a35703f5939c2 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 11 Oct 2007 12:02:20 +0000 Subject: Added IAudioPlayback Interface and implementation for BASS. Created "AudioPlayback" Global Singleton, which removed the need for the "Music" Global variable. This was done because global singleton objects are a recognized better "design pattern" achieving the same thing as global variables, but in a nicer way. I will be working to a) separate IAudioPlayback in to separate "Playback" and "Input" Interfaces b) build a FFMpeg class that implements IAudioPlayback git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@504 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 0f69f326..1d94ffa6 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -33,14 +33,14 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE : begin - Music.PlayBack; + AudioPlayback.PlayBack; RefreshSongs; FadeTo(@ScreenOptions); end; SDLK_RETURN: begin if SelInteraction = 6 then begin - Music.PlayBack; + AudioPlayback.PlayBack; RefreshSongs; FadeTo(@ScreenOptions); end; @@ -51,15 +51,17 @@ begin InteractPrev; SDLK_RIGHT: begin - if (SelInteraction >= 0) and (SelInteraction <= 5) then begin - Music.PlayOption; + if (SelInteraction >= 0) and (SelInteraction <= 5) then + begin + AudioPlayback.PlayOption; InteractInc; end; end; SDLK_LEFT: begin - if (SelInteraction >= 0) and (SelInteraction <= 5) then begin - Music.PlayOption; + if (SelInteraction >= 0) and (SelInteraction <= 5) then + begin + AudioPlayback.PlayOption; InteractDec; end; end; -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 1d94ffa6..6cd0a20c 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -2,6 +2,8 @@ unit UScreenOptionsGame; interface +{$I switches.inc} + uses UMenu, SDL, UDisplay, UMusic, UFiles, UIni, UThemes, USongs; -- cgit v1.2.3 From dee94f5dae9e6b5ae6c7b54a12a567745abc8dc3 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 20:36:19 +0000 Subject: General: - cleanup and adaption of SingDrawOscilloscope Portaudio/SDL audio output: - stuttering in portaudio output has been fixed (SDL_MixBuffers cannot be used without initializing the SDL audio stuff first, so it is not usable with portaudio. Now SDL is used for audio-output instead of portaudio (although the file-name is UAudioPlayback_Portaudio.pas at the moment). - cleaner file closing - volume adjustment UMusic: - cleanup of the audio-interfaces - introduced TNoteType = (ntFreestyle, ntNormal, ntGolden) - some bug-fixes - introduced TSoundLibrary. This is library for all in-game sounds used by USDX. Instead of calling AudioPlayer.PlaySwoosh you should call AudioPlayer.PlaySound(SoundLib.Swoosh) now. You might call SoundLib.Swoosh.Play too, but this is not recommended at the moment because SoundLib.Swoosh could be nil if the file was not found. The SoundLibrary approach is much cleaner than the previous one. The AudioPlayer does not have to specify a Play... and Stop... method for every available sound anymore. In addition it is not an AudioPlayers responsibility to init the in-game sounds. URecord: - polish to english translation of some variables - CaptureSoundLeft/Right is CaptureChannel[0/1] now - TSoundCardInput -> TAudioInputDeviceSource - TGenericSoundCard.Input -> TGenericSoundCard.Source - autocorrelation algorithm more readable now - Clean-up of the audio-input interface - moved cloned code of the input-classes to one base class (TAudioInputBase) - Cleaner finalization - Start-/StopCapture will not crash anymore in the recording-options menu - Fixed several bugs in the autocorrelation stuff (e.g. wrong usage of $10000) - SzczytJest (now ToneValid) was not used correctly. ToneValid is set to true if a valid tone was found (= the sound was louder than the threshold -> no background noise). If i remember correctly the sound was accepted although the tone was invalid. So the old data was used although noone was singing. This resulted in some sort of ghost-singer effect. UIni: - moved TIni.Card to TScreenOptionsRecord.Card because it is not stored in the ini-file and will not be in the future. - TIni.CardList ist now TIni.InputDeviceConfig. The name cardlist was misleading because it just specifies input- but no output-devices. In addition a soundcard can have multiple input-devices (at least in linux). - bugfix on InputDeviceConfig (formerly CardList) usage. USDX expected that the indices of the corresponding elements in TIni.InputDeviceConfig[] and TAudioInputProcessor.Device[] were the same. This is wrong. If device 2 was defined at first place in the ini and device 1 at the second, the indices of the two arrays didn't match (they were swapped) erroneously. To fix this and to support the item listed below the index to TIni.InputDeviceConfig[] is now stored in TAudioInputDevice.CfgIndex. NOTE: InputDeviceConfig[] contains configurations of non-available (unplugged) devices. Iterate over TAudioInputProcessor.Device[] for available devices. - configurations of external devices that are not plugged in will not be deleted anymore. - multiple definitions of one device in the ini-file will not crash USDX anymore - CardList[I].ChannelL/R now are InputDeviceConfig[I].ChannelToPlayerMap[0/1]. I think the new name is more intuitive because it maps a channel to a player number. Now the both vars are joint to one array. Now it is possible to use loops to process them and we might support more than two input channels on one device in the future (if such devices exist) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@827 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenOptionsGame.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenOptionsGame.pas') diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index 6cd0a20c..15b538a5 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -35,14 +35,14 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE : begin - AudioPlayback.PlayBack; + AudioPlayback.PlaySound(SoundLib.Back); RefreshSongs; FadeTo(@ScreenOptions); end; SDLK_RETURN: begin if SelInteraction = 6 then begin - AudioPlayback.PlayBack; + AudioPlayback.PlaySound(SoundLib.Back); RefreshSongs; FadeTo(@ScreenOptions); end; @@ -55,7 +55,7 @@ begin begin if (SelInteraction >= 0) and (SelInteraction <= 5) then begin - AudioPlayback.PlayOption; + AudioPlayback.PlaySound(SoundLib.Option); InteractInc; end; end; @@ -63,7 +63,7 @@ begin begin if (SelInteraction >= 0) and (SelInteraction <= 5) then begin - AudioPlayback.PlayOption; + AudioPlayback.PlaySound(SoundLib.Option); InteractDec; end; end; -- cgit v1.2.3