From 873f177f08dc7c4fe2d7e50bbe7709df98e238d3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 14:58:32 +0000 Subject: rename Screen part2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1306 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 133 ++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 src/screens/UScreenOptionsSound.pas (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas new file mode 100644 index 00000000..9c602788 --- /dev/null +++ b/src/screens/UScreenOptionsSound.pas @@ -0,0 +1,133 @@ +unit UScreenOptionsSound; + +interface + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +{$I switches.inc} + +uses + UMenu, SDL, UDisplay, UMusic, UFiles, UIni, UThemes; + +type + TScreenOptionsSound = class(TMenu) + public + constructor Create; override; + function ParseInput(PressedKey: cardinal; CharCode: widechar; + PressedDown: boolean): boolean; override; + procedure onShow; override; + end; + +implementation + +uses UGraphic, SysUtils; + +function TScreenOptionsSound.ParseInput(PressedKey: cardinal; + CharCode: widechar; PressedDown: boolean): boolean; +begin + Result := True; + if (PressedDown) then + begin // Key Down + // check normal keys + case WideCharUpperCase(CharCode)[1] of + 'Q': + begin + Result := False; + Exit; + end; + end; + + // check special keys + case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE: + begin + // Escape -> save nothing - just leave this screen + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenOptions); + end; + SDLK_RETURN: + begin + if SelInteraction = 8 then + begin + Ini.Save; + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenOptions); + end; + end; + SDLK_DOWN: + InteractNext; + SDLK_UP: + InteractPrev; + SDLK_RIGHT: + begin + if (SelInteraction >= 0) and (SelInteraction < 8) then + begin + AudioPlayback.PlaySound(SoundLib.Option); + InteractInc; + end; + end; + SDLK_LEFT: + begin + if (SelInteraction >= 0) and (SelInteraction < 8) then + begin + AudioPlayback.PlaySound(SoundLib.Option); + InteractDec; + end; + end; + end; + end; + +{** + * Actually this one isn't pretty - but it does the trick of + * turning the background music on/off in "real time" + * bgm = background music + * TODO: - Fetching the SelectInteraction via something more descriptive + * - Obtaining the current value of a select is imho ugly + *} + if (SelInteraction = 1) then + begin + if TBackgroundMusicOption(SelectsS[1].SelectedOption) = bmoOn then + SoundLib.StartBgMusic + else + SoundLib.PauseBgMusic; + end; + +end; + +constructor TScreenOptionsSound.Create; +begin + inherited Create; + + LoadFromTheme(Theme.OptionsSound); + + AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, + Ini.VoicePassthrough, IVoicePassthrough); + AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, + Ini.BackgroundMusicOption, IBackgroundMusic); + AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost); + // TODO: - MicBoost needs to be moved to ScreenOptionsRecord + AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist); + AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick); + AddSelectSlide(Theme.OptionsSound.SelectThreshold, Ini.ThresholdIndex, IThreshold); + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, + Ini.PreviewVolume, IPreviewVolume); + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, + Ini.PreviewFading, IPreviewFading); + + AddButton(Theme.OptionsSound.ButtonExit); + if (Length(Button[0].Text) = 0) then + AddButtonText(14, 20, Theme.Options.Description[7]); + + Interaction := 0; +end; + +procedure TScreenOptionsSound.onShow; +begin + inherited; + Interaction := 0; +end; + +end. -- cgit v1.2.3 From f16756422a5dbb24ce1b751bb9e2bb1de4f19713 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 23 Sep 2008 21:17:50 +0000 Subject: added file headers git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1404 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index 9c602788..80210f63 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -1,3 +1,28 @@ +{* UltraStar Deluxe - Karaoke Game + * + * UltraStar Deluxe is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + *} + unit UScreenOptionsSound; interface -- cgit v1.2.3 From c7f5d683c1eae49e30ee42a76557661f57311b9e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 25 Apr 2009 10:09:59 +0000 Subject: Cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1694 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index 80210f63..99ecb599 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -34,7 +34,13 @@ interface {$I switches.inc} uses - UMenu, SDL, UDisplay, UMusic, UFiles, UIni, UThemes; + UMenu, + SDL, + UDisplay, + UMusic, + UFiles, + UIni, + UThemes; type TScreenOptionsSound = class(TMenu) @@ -47,19 +53,21 @@ type implementation -uses UGraphic, SysUtils; +uses + UGraphic, + SysUtils; function TScreenOptionsSound.ParseInput(PressedKey: cardinal; CharCode: widechar; PressedDown: boolean): boolean; begin - Result := True; + Result := true; if (PressedDown) then begin // Key Down // check normal keys case WideCharUpperCase(CharCode)[1] of 'Q': begin - Result := False; + Result := false; Exit; end; end; -- cgit v1.2.3 From bee4da886058f54ec7e1901951b5c1bf05f8ea34 Mon Sep 17 00:00:00 2001 From: mogguh Date: Wed, 27 May 2009 22:09:26 +0000 Subject: All options do have one option visible now FIXED: SelectSlides with only two options did not show arrows on reelection ENHANCEMENT: Beautified some portions of UMenuSelectSlide.pas code git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1784 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 40 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index 99ecb599..f10c1cb9 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -136,19 +136,39 @@ begin LoadFromTheme(Theme.OptionsSound); - AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, - Ini.VoicePassthrough, IVoicePassthrough); - AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, - Ini.BackgroundMusicOption, IBackgroundMusic); - AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost); + Theme.OptionsSound.SelectSlideVoicePassthrough.showArrows := true; + Theme.OptionsSound.SelectSlideVoicePassthrough.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, Ini.VoicePassthrough, IVoicePassthrough); + + Theme.OptionsSound.SelectBackgroundMusic.showArrows := true; + Theme.OptionsSound.SelectBackgroundMusic.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, Ini.BackgroundMusicOption, IBackgroundMusic); + // TODO: - MicBoost needs to be moved to ScreenOptionsRecord + Theme.OptionsSound.SelectMicBoost.showArrows := true; + Theme.OptionsSound.SelectMicBoost.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost); + + + Theme.OptionsSound.SelectClickAssist.showArrows := true; + Theme.OptionsSound.SelectClickAssist.oneItemOnly := true; AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist); - AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick); + + Theme.OptionsSound.SelectThreshold.showArrows := true; + Theme.OptionsSound.SelectThreshold.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectThreshold, Ini.BeatClick, IBeatClick); + + Theme.OptionsSound.SelectThreshold.showArrows := true; + Theme.OptionsSound.SelectThreshold.oneItemOnly := true; AddSelectSlide(Theme.OptionsSound.SelectThreshold, Ini.ThresholdIndex, IThreshold); - AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, - Ini.PreviewVolume, IPreviewVolume); - AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, - Ini.PreviewFading, IPreviewFading); + + Theme.OptionsSound.SelectSlidePreviewVolume.showArrows := true; + Theme.OptionsSound.SelectSlidePreviewVolume.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolume); + + Theme.OptionsSound.SelectSlidePreviewFading.showArrows := true; + Theme.OptionsSound.SelectSlidePreviewFading.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFading); AddButton(Theme.OptionsSound.ButtonExit); if (Length(Button[0].Text) = 0) then -- cgit v1.2.3 From 6f3d675698f54c5cace969befaeaa6f38ca001ad Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Mon, 1 Jun 2009 09:30:11 +0000 Subject: fix display of beatclick select in ScreenOptionSound git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1793 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index f10c1cb9..78b09c97 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -154,9 +154,9 @@ begin Theme.OptionsSound.SelectClickAssist.oneItemOnly := true; AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist); - Theme.OptionsSound.SelectThreshold.showArrows := true; - Theme.OptionsSound.SelectThreshold.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectThreshold, Ini.BeatClick, IBeatClick); + Theme.OptionsSound.SelectBeatClick.showArrows := true; + Theme.OptionsSound.SelectBeatClick.oneItemOnly := true; + AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick); Theme.OptionsSound.SelectThreshold.showArrows := true; Theme.OptionsSound.SelectThreshold.oneItemOnly := true; -- cgit v1.2.3 From 036ad16426b7003cf872ce49d8854648217eba8b Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 27 Jun 2009 20:01:11 +0000 Subject: Translation of option values. part 2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1829 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index 78b09c97..aa87ceb4 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -138,25 +138,25 @@ begin Theme.OptionsSound.SelectSlideVoicePassthrough.showArrows := true; Theme.OptionsSound.SelectSlideVoicePassthrough.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, Ini.VoicePassthrough, IVoicePassthrough); + AddSelectSlide(Theme.OptionsSound.SelectSlideVoicePassthrough, Ini.VoicePassthrough, IVoicePassthroughTranslated); Theme.OptionsSound.SelectBackgroundMusic.showArrows := true; Theme.OptionsSound.SelectBackgroundMusic.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, Ini.BackgroundMusicOption, IBackgroundMusic); + AddSelectSlide(Theme.OptionsSound.SelectBackgroundMusic, Ini.BackgroundMusicOption, IBackgroundMusicTranslated); // TODO: - MicBoost needs to be moved to ScreenOptionsRecord Theme.OptionsSound.SelectMicBoost.showArrows := true; Theme.OptionsSound.SelectMicBoost.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost); + AddSelectSlide(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoostTranslated); Theme.OptionsSound.SelectClickAssist.showArrows := true; Theme.OptionsSound.SelectClickAssist.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist); + AddSelectSlide(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssistTranslated); Theme.OptionsSound.SelectBeatClick.showArrows := true; Theme.OptionsSound.SelectBeatClick.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick); + AddSelectSlide(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClickTranslated); Theme.OptionsSound.SelectThreshold.showArrows := true; Theme.OptionsSound.SelectThreshold.oneItemOnly := true; @@ -164,11 +164,11 @@ begin Theme.OptionsSound.SelectSlidePreviewVolume.showArrows := true; Theme.OptionsSound.SelectSlidePreviewVolume.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolume); + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolumeTranslated); Theme.OptionsSound.SelectSlidePreviewFading.showArrows := true; Theme.OptionsSound.SelectSlidePreviewFading.oneItemOnly := true; - AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFading); + AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFadingTranslated); AddButton(Theme.OptionsSound.ButtonExit); if (Length(Button[0].Text) = 0) then -- cgit v1.2.3 From 917901e8e33438c425aef50a0a7417f32d77b760 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Mon, 9 Nov 2009 00:27:55 +0000 Subject: merged unicode branch (r1931) into trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1939 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index aa87ceb4..7556dceb 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -34,8 +34,8 @@ interface {$I switches.inc} uses - UMenu, SDL, + UMenu, UDisplay, UMusic, UFiles, @@ -46,26 +46,27 @@ type TScreenOptionsSound = class(TMenu) public constructor Create; override; - function ParseInput(PressedKey: cardinal; CharCode: widechar; + function ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; - procedure onShow; override; + procedure OnShow; override; end; implementation uses UGraphic, + UUnicodeUtils, SysUtils; function TScreenOptionsSound.ParseInput(PressedKey: cardinal; - CharCode: widechar; PressedDown: boolean): boolean; + CharCode: UCS4Char; PressedDown: boolean): boolean; begin Result := true; if (PressedDown) then begin // Key Down // check normal keys - case WideCharUpperCase(CharCode)[1] of - 'Q': + case UCS4UpperCase(CharCode) of + Ord('Q'): begin Result := false; Exit; @@ -177,7 +178,7 @@ begin Interaction := 0; end; -procedure TScreenOptionsSound.onShow; +procedure TScreenOptionsSound.OnShow; begin inherited; Interaction := 0; -- cgit v1.2.3 From ffd76ba736eb429e7b79891f288b35fdde472e53 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Tue, 16 Mar 2010 19:25:13 +0000 Subject: some theme edits (option menu) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2203 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index 7556dceb..cf4b5de4 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -173,7 +173,7 @@ begin AddButton(Theme.OptionsSound.ButtonExit); if (Length(Button[0].Text) = 0) then - AddButtonText(14, 20, Theme.Options.Description[7]); + AddButtonText(20, 5, Theme.Options.Description[7]); Interaction := 0; end; -- cgit v1.2.3 From 6470ff97f46c3681546ff2a04bbe85b9cdb4bda2 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 3 May 2010 21:53:12 +0000 Subject: ESC saves again. revert 1183. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2336 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenOptionsSound.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/screens/UScreenOptionsSound.pas') diff --git a/src/screens/UScreenOptionsSound.pas b/src/screens/UScreenOptionsSound.pas index cf4b5de4..c0efa4d8 100644 --- a/src/screens/UScreenOptionsSound.pas +++ b/src/screens/UScreenOptionsSound.pas @@ -78,7 +78,7 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE: begin - // Escape -> save nothing - just leave this screen + Ini.Save; AudioPlayback.PlaySound(SoundLib.Back); FadeTo(@ScreenOptions); end; -- cgit v1.2.3