From 052ee11accb94fe2f4048156dc1e1beadb34acfd Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 6 Jan 2016 10:31:37 +0000 Subject: add About screen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3192 b956fd51-792f-4845-bead-9b4dfca2ff2c --- game/languages/English.ini | 7 +- game/languages/German.ini | 5 ++ game/themes/Deluxe.ini | 180 ++++++++++++++++++++++++++++++++++++++++++ game/themes/Verdure.ini | 182 +++++++++++++++++++++++++++++++++++++++++++ src/base/UGraphic.pas | 6 ++ src/screens/UScreenAbout.pas | 168 +++++++++++++++++++++++++++++++++++++++ src/screens/UScreenMain.pas | 2 +- src/ultrastardx.dpr | 2 + 8 files changed, 550 insertions(+), 2 deletions(-) create mode 100644 src/screens/UScreenAbout.pas diff --git a/game/languages/English.ini b/game/languages/English.ini index a747fe2d..0dd14942 100644 --- a/game/languages/English.ini +++ b/game/languages/English.ini @@ -9,7 +9,7 @@ OPTION_VALUE_ENGLISH=English OPTION_VALUE_EUSKARA=Euskara OPTION_VALUE_FINNISH=Finnish OPTION_VALUE_FRENCH=French - OPTION_VALUE_GAELIC=Gaelic +OPTION_VALUE_GAELIC=Gaelic OPTION_VALUE_GERMAN=German OPTION_VALUE_GREEK=Greek OPTION_VALUE_HUNGARIAN=Hungarian @@ -464,3 +464,8 @@ SING_JUKEBOX_DESC=Listen to my collection of songs SING_ABOUT=About SING_ABOUT_DESC=About Ultrastar Deluxe +ABOUT_MAIN=About... +ABOUT_MAIN_DESC=Ultrastar Deluxe +ABOUT_MAIN_WHEREAMI=About... +ABOUT_USDX_CREDITS=Credits +ABOUT_OVERVIEW=UltraStar Deluxe is a free OpenSource karaoke game for your PC. The gameplay experience is similar to that of the commercial product SingStar™ by Sony Computer Entertainment, which is exclusively available for the Playstation®. Unlike SingStar™, however, UltraStar Deluxe allows users to create their own songs and sing them on their PC.\nBy publishing the sourcecode, we’ve enabled you to customize the game completly to your heart’s content, desires and particular needs.\nEspecially you are allowed to modify the product as you wish.\n\nCreate your own themes or download content from the community, such as plugins, free songs or code patches for extended features.\nIn party mode it allows up to twelve players to sing along to your favorite music in order to score points, depending on the pitch of the voice and the rhythm of singing. diff --git a/game/languages/German.ini b/game/languages/German.ini index 36010b4f..c81e0521 100644 --- a/game/languages/German.ini +++ b/game/languages/German.ini @@ -464,3 +464,8 @@ SING_JUKEBOX_DESC=Höre meine Liedersammlung SING_ABOUT=Über SING_ABOUT_DESC=Über Ultrastar Deluxe +ABOUT_MAIN=Über... +ABOUT_MAIN_DESC=Ultrastar Deluxe +ABOUT_MAIN_WHEREAMI=Über... +ABOUT_USDX_CREDITS=Credits +ABOUT_OVERVIEW=UltraStar Deluxe ist ein freies OpenSource Karaoke Spiel für ihren PC. Das spielt orientiert sich am kommerziellen Spiel Singstar™ von Sony Computer Entertainment, das aber nur für die Playstation® erhältlich ist. Im Gegensatz zu Singstar™ kann man mit UltraStar Deluxe aber auch eigene Lieder erstellen und am eigenen PC singen. \nDer Quellcode von UltraStar Deluxe ist öffentlich, so dass sie das Spiel nach Herzenslust oder ihren Ansprüchen anpassen können. \nEs ist ihnen ausdrücklich erlaubt, das Spiel zu modifizieren. \n\nErstellen sie ihr eigenes Theme oder laden sie Inhalte, wie Plugins, Lieder oder auch Programmschnipsel aus Foren und erweitern sie UltraStar Deluxe. \nIm Party-Mode können, zum Beispiel, bis zu 12 Spieler zu ihrer Lieblingsmusik singen und Punkte sammeln, wenn Tonhöhe und Rhythmus stimmen. diff --git a/game/themes/Deluxe.ini b/game/themes/Deluxe.ini index f2f0b376..e7faedd5 100644 --- a/game/themes/Deluxe.ini +++ b/game/themes/Deluxe.ini @@ -9228,3 +9228,183 @@ Align = 1 Color = White Text = Anastacia +[AboutMain] +Texts = 0 +Statics = 0 + +[AboutMainBackground] +Tex = MainBG + +[AboutMainButtonCredits] +X = 589 +Y = 415 +W = 190 +H = 50 +Tex = Button +DColor = ColorDark +Color = ColorLight +Type = Transparent +Texts = 1 +Reflection = 0 + +[AboutMainButtonCreditsText1] +X = 95 +Y = 10 +Font = 0 +Size = 30 +Align = 1 +Text = ABOUT_USDX_CREDITS +Color = White + +[AboutMainButtonExit] +X = 589 +Y = 480 +W = 190 +H = 50 +Tex = Button +DColor = ColorDark +Color = ColorLight +Type = Transparent +Texts = 1 +Reflection = 0 + +[AboutMainButtonExitText1] +X = 95 +Y = 10 +Font = 0 +Size = 30 +Align = 1 +Text = SING_OPTIONS_EXIT +Color = White + +[AboutMainTextOverview] +X = 45 +Y = 125 +W = 510 +Color = White +Font = 0 +Size = 24 +Align = 0 +Text = + +[AboutMainStatic1] +X = 40 +Y = 22 +W = 27 +H = 27 +Color = White +Tex = MainIcon +Type = Colorized + +[AboutMainStatic2] +X = 0 +Y = 545 +W = 250 +H = 30 +Tex = Leiste1 +Color = ColorLight +Type = Colorized +Reflection = 1 +ReflectionSpacing = 2 + +[AboutMainStatic3] +X = 250 +Y = 545 +W = 550 +H = 30 +Tex = Leiste2 +Color = White +Type = Transparent +Reflection = 1 +ReflectionSpacing = 2 + +[AboutMainStatic4] +X = 260 +Y = 552 +W = 24 +H = 23 +Tex = ButtonNavi +Color = White +Type = Transparent + +[AboutMainStatic5] +X = 388 +Y = 552 +W = 32 +H = 23 +Tex = ButtonEsc +Color = White +Type = Transparent + +[AboutMainStatic6] +X = 40 +Y = 100 +W = 520 +H = 20 +Tex = StatMainBG1 +Color = ColorLight +Type = Colorized + +[AboutMainStatic7] +X = 40 +Y = 120 +W = 520 +H = 370 +Tex = StatMainBG2 +Color = ColorDark +Type = Colorized + +[AboutMainStatic8] +X = 40 +Y = 490 +W = 520 +H = 20 +Tex = StatMainBG3 +Color = ColorLight +Type = Colorized + +[AboutMainText1] +X = 70 +Y = 6 +Color = White +Font = 0 +Size = 60 +Text = ABOUT_MAIN +Align = 0 + +[AboutMainText2] +X = 238 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 2 +Text = ABOUT_MAIN_WHEREAMI + +[AboutMainText3] +X = 70 +Y = 53 +Color = White +Font = 0 +Size = 30 +Align = 0 +Text = ABOUT_MAIN_DESC + +[AboutMainText4] +X = 294 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 0 +Text = SING_LEGEND_NAVIGATE + +[AboutMainText5] +X = 418 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 0 +Text = SING_LEGEND_ESC + diff --git a/game/themes/Verdure.ini b/game/themes/Verdure.ini index 2e45e906..27f60351 100644 --- a/game/themes/Verdure.ini +++ b/game/themes/Verdure.ini @@ -178,6 +178,7 @@ Text = SING_LEGEND_NAVIGATE Reflection = 1 ReflectionSpacing = 13 +; Enter button [MainStatic5] X = 515 Y = 545 @@ -190,6 +191,7 @@ Type = Transparent Reflection = 1 ReflectionSpacing = 2 +; Enter text [MainText3] X = 555 Y = 548 @@ -9449,3 +9451,183 @@ Align = 1 Color = White Text = Anastacia +[AboutMain] +Texts = 0 +Statics = 0 + +[AboutMainBackground] +Tex = MainBG + +[AboutMainButtonCredits] +X = 589 +Y = 415 +W = 190 +H = 50 +Tex = Button +DColor = ColorDark +Color = ColorLight +Type = Transparent +Texts = 1 +Reflection = 0 + +[AboutMainButtonCreditsText1] +X = 95 +Y = 10 +Font = 0 +Size = 30 +Align = 1 +Text = ABOUT_USDX_CREDITS +Color = White + +[AboutMainButtonExit] +X = 589 +Y = 480 +W = 190 +H = 50 +Tex = Button +DColor = ColorDark +Color = ColorLight +Type = Transparent +Texts = 1 +Reflection = 0 + +[AboutMainButtonExitText1] +X = 95 +Y = 10 +Font = 0 +Size = 30 +Align = 1 +Text = SING_OPTIONS_EXIT +Color = White + +[AboutMainTextOverview] +X = 45 +Y = 125 +W = 510 +Color = White +Font = 0 +Size = 24 +Align = 0 +Text = + +[AboutMainStatic1] +X = 40 +Y = 22 +W = 27 +H = 27 +Color = White +Tex = MainIcon +Type = Colorized + +[AboutMainStatic2] +X = 0 +Y = 545 +W = 250 +H = 30 +Tex = Leiste1 +Color = ColorLight +Type = Colorized +Reflection = 1 +ReflectionSpacing = 2 + +[AboutMainStatic3] +X = 250 +Y = 545 +W = 550 +H = 30 +Tex = Leiste2 +Color = White +Type = Transparent +Reflection = 1 +ReflectionSpacing = 2 + +[AboutMainStatic4] +X = 260 +Y = 552 +W = 24 +H = 23 +Tex = ButtonNavi +Color = White +Type = Transparent + +[AboutMainStatic5] +X = 388 +Y = 552 +W = 32 +H = 23 +Tex = ButtonEsc +Color = White +Type = Transparent + +[AboutMainStatic6] +X = 40 +Y = 100 +W = 520 +H = 20 +Tex = StatMainBG1 +Color = ColorLight +Type = Colorized + +[AboutMainStatic7] +X = 40 +Y = 120 +W = 520 +H = 370 +Tex = StatMainBG2 +Color = ColorDark +Type = Colorized + +[AboutMainStatic8] +X = 40 +Y = 490 +W = 520 +H = 20 +Tex = StatMainBG3 +Color = ColorLight +Type = Colorized + +[AboutMainText1] +X = 70 +Y = 6 +Color = White +Font = 0 +Size = 60 +Text = ABOUT_MAIN +Align = 0 + +[AboutMainText2] +X = 238 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 2 +Text = ABOUT_MAIN_WHEREAMI + +[AboutMainText3] +X = 70 +Y = 53 +Color = White +Font = 0 +Size = 30 +Align = 0 +Text = ABOUT_MAIN_DESC + +[AboutMainText4] +X = 294 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 0 +Text = SING_LEGEND_NAVIGATE + +[AboutMainText5] +X = 418 +Y = 552 +Color = Black +Font = 0 +Size = 21 +Align = 0 +Text = SING_LEGEND_ESC + diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas index f0b60b95..6df125ca 100644 --- a/src/base/UGraphic.pas +++ b/src/base/UGraphic.pas @@ -67,6 +67,7 @@ uses UScreenEditConvert, UScreenEditHeader, UScreenOpen, + UScreenAbout, UThemes, USkins, UScreenSongMenu, @@ -129,6 +130,7 @@ var ScreenEditConvert: TScreenEditConvert; ScreenEditHeader: TScreenEditHeader; ScreenOpen: TScreenOpen; + ScreenAbout: TScreenAbout; ScreenSongMenu: TScreenSongMenu; ScreenSongJumpto: TScreenSongJumpto; @@ -761,6 +763,9 @@ begin SDL_WM_SetCaption(PChar(Title + ' - Loading ScreenEditConvert & ScreenOpen'), nil); ScreenEditConvert := TScreenEditConvert.Create; ScreenOpen := TScreenOpen.Create; + SDL_WM_SetCaption(PChar(Title + ' - Loading ScreenAbout'), nil); + ScreenAbout := TScreenAbout.Create; + Log.BenchmarkEnd(3); Log.LogBenchmark('====> Screen About', 3); Log.BenchmarkStart(3); SDL_WM_SetCaption(PChar(Title + ' - Loading ScreenSongMenu & ScreenSongJumpto'), nil); ScreenSongMenu := TScreenSongMenu.Create; ScreenSongJumpto := TScreenSongJumpto.Create; @@ -813,6 +818,7 @@ begin ScreenEdit.Free; ScreenEditConvert.Free; ScreenOpen.Free; + ScreenAbout.Free; //ScreenSingModi.Free; ScreenSongMenu.Free; ScreenSongJumpto.Free; diff --git a/src/screens/UScreenAbout.pas b/src/screens/UScreenAbout.pas new file mode 100644 index 00000000..08c19747 --- /dev/null +++ b/src/screens/UScreenAbout.pas @@ -0,0 +1,168 @@ +{* 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 UScreenAbout; + +interface + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +{$I switches.inc} + +uses + SysUtils, + SDL, + UDisplay, + UIni, + UMusic, + UMenu, + UThemes; + +type + TScreenAbout = class(TMenu) + public + TextOverview: integer; + constructor Create; override; + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; + procedure OnShow; override; + procedure SetAnimationProgress(Progress: real); override; + + procedure SetOverview; + end; + +implementation + +uses + Classes, + UCommon, + UDataBase, + UGraphic, + ULanguage, + ULog, + USong, + USongs, + UUnicodeUtils; + +function TScreenAbout.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; +begin + Result := true; + if (PressedDown) then + begin // Key Down + // check normal keys + case UCS4UpperCase(CharCode) of + Ord('Q'): + begin + Result := false; + Exit; + end; + end; + + // check special keys + case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + Ini.Save; + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenMain); + end; + SDLK_RETURN: + begin + //Exit Button Pressed + if Interaction = 1 then + begin + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenMain); + end; + + // ultrastar deluxe team credits + if Interaction = 0 then + begin + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenCredits); + end; + end; + SDLK_LEFT: + begin + InteractPrev; + end; + SDLK_RIGHT: + begin + InteractNext; + end; + SDLK_UP: + begin + InteractPrev; + end; + SDLK_DOWN: + begin + InteractNext; + end; + end; + end; +end; + +constructor TScreenAbout.Create; +begin + inherited Create; + + TextOverview := AddText(Theme.AboutMain.TextOverview); + + LoadFromTheme(Theme.AboutMain); + + AddButton(Theme.AboutMain.ButtonCredits); + AddButton(Theme.AboutMain.ButtonExit); + + Interaction := 0; +end; + +procedure TScreenAbout.OnShow; +begin + inherited; + + //Set Overview Text: + SetOverview; +end; + +procedure TScreenAbout.SetOverview; +var + Overview: UTF8String; +begin + // Format overview + Overview := Language.Translate('ABOUT_OVERVIEW'); + Text[0].Text := Overview; +end; + +procedure TScreenAbout.SetAnimationProgress(Progress: real); +var + I: integer; +begin + for I := 0 to high(Button) do + Button[I].Texture.ScaleW := Progress; +end; + +end. diff --git a/src/screens/UScreenMain.pas b/src/screens/UScreenMain.pas index 1d6992f9..65708bc5 100644 --- a/src/screens/UScreenMain.pas +++ b/src/screens/UScreenMain.pas @@ -231,7 +231,7 @@ begin //About if Interaction = 6 then begin -// disable for now FadeTo(@ScreenAbout, SoundLib.Start); + FadeTo(@ScreenAbout, SoundLib.Start); end; //Exit diff --git a/src/ultrastardx.dpr b/src/ultrastardx.dpr index 0e02bdc4..d5f675a5 100644 --- a/src/ultrastardx.dpr +++ b/src/ultrastardx.dpr @@ -351,6 +351,8 @@ uses UScreenPartyRounds in 'screens\UScreenPartyRounds.pas', UScreenPartyWin in 'screens\UScreenPartyWin.pas', + UScreenAbout in 'screens\UScreenAbout.pas', + SysUtils; const -- cgit v1.2.3