aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2011-01-02 20:33:36 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2011-01-02 20:33:36 +0000
commit5f86f14e53b9f107ce030e6cb61efba9f5fc6a4b (patch)
treeea590adb575a3166a88c0cbf675e8c9b06f43e97 /Game/Code/Screens
parentbb64e99825121cfe68d1139fff855dd44a43674a (diff)
downloadusdx-5f86f14e53b9f107ce030e6cb61efba9f5fc6a4b.tar.gz
usdx-5f86f14e53b9f107ce030e6cb61efba9f5fc6a4b.tar.xz
usdx-5f86f14e53b9f107ce030e6cb61efba9f5fc6a4b.zip
- fix: crash at startup if no webcam connected
- some string updates git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2786 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens')
-rw-r--r--Game/Code/Screens/UScreenMain.pas12
-rw-r--r--Game/Code/Screens/UScreenOptionsRecord.pas47
-rw-r--r--Game/Code/Screens/UScreenSing.pas2
-rw-r--r--Game/Code/Screens/UScreenSongMenu.pas6
4 files changed, 52 insertions, 15 deletions
diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas
index bc2019b9..8c03a53f 100644
--- a/Game/Code/Screens/UScreenMain.pas
+++ b/Game/Code/Screens/UScreenMain.pas
@@ -25,7 +25,6 @@ type
procedure InteractInc; override;
procedure InteractDec; override;
procedure SetAnimationProgress(Progress: real); override;
- //function Draw: boolean; override;
end;
const
@@ -314,6 +313,9 @@ begin
end;
function TScreenMain.Draw: boolean;
+var
+ txt: string;
+
begin
Result := inherited Draw;
@@ -324,6 +326,14 @@ begin
begin
StartScreenScredits;
end;
+
+ glColor4f(1,1,1,1);
+ SetFontStyle(0);
+ SetFontItalic(False);
+ SetFontSize(6);
+ txt := Language.Translate('US_VERSION_NUMBER');
+ SetFontPos(795 - glTextWidth(PChar(txt)), 580);
+ glPrint(PChar(txt));
end;
procedure TScreenMain.InteractNext;
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas
index 3ff73cca..807e1cfb 100644
--- a/Game/Code/Screens/UScreenOptionsRecord.pas
+++ b/Game/Code/Screens/UScreenOptionsRecord.pas
@@ -146,14 +146,22 @@ begin
if (Length(IWebCamDevice)-1 < Ini.WebCamID) then
Ini.WebCamID := 0;
- IWebCamMedia := ListMediaTypes(Ini.WebCamID);
+ ListMediaTypes(Ini.WebCamID, IWebCamMedia);
- SelectSlideWebCamDevice := AddSelectSlide(Theme.OptionsRecord.SelectSlideWebCamDevice, Ini.WebCamID, IWebCamDevice);
- SelectSlideWebCamMedia := AddSelectSlide(Theme.OptionsRecord.SelectSlideWebCamMedia, Ini.WebCamMediaID, IWebCamMedia);
+ if (Length(IWebCamMedia)=0) then
+ begin
+ Ini.EnableWebCam := 0;
+ WebCamPreviewOn := false;
+ end else
+ begin
+ SelectSlideWebCamDevice := AddSelectSlide(Theme.OptionsRecord.SelectSlideWebCamDevice, Ini.WebCamID, IWebCamDevice);
+ SelectSlideWebCamMedia := AddSelectSlide(Theme.OptionsRecord.SelectSlideWebCamMedia, Ini.WebCamMediaID, IWebCamMedia);
- WebCamPreviewOn := (Ini.EnableWebCam=1);
+ WebCamPreviewOn := (Ini.EnableWebCam=1);
+ end;
end else
WebCamPreviewOn := false;
+
AddButton(Theme.OptionsRecord.ButtonExit);
if (Length(Button[0].Text)=0) then
AddButtonText(14, 20, Theme.Options.Description[7]);
@@ -174,12 +182,18 @@ begin
if (Length(IWebCamDevice)-1 < Ini.WebCamID) then
Ini.WebCamID := 0;
- IWebCamMedia := ListMediaTypes(Ini.WebCamID);
-
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideCard, SelectSlideWebCamDevice, IWebCamDevice, Ini.WebCamID);
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideInput, SelectSlideWebCamMedia, IWebCamMedia, Ini.WebCamMediaID);
+ ListMediaTypes(Ini.WebCamID, IWebCamMedia);
- WebCamPreviewOn := (Ini.EnableWebCam=1);
+ if (Length(IWebCamMedia)=0) then
+ begin
+ Ini.EnableWebCam := 0;
+ WebCamPreviewOn := false;
+ end else
+ begin
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideCard, SelectSlideWebCamDevice, IWebCamDevice, Ini.WebCamID);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideInput, SelectSlideWebCamMedia, IWebCamMedia, Ini.WebCamMediaID);
+ WebCamPreviewOn := (Ini.EnableWebCam=1);
+ end;
end else
WebCamPreviewOn := false;
@@ -237,12 +251,19 @@ begin
if (Length(IWebCamDevice)-1 < Ini.WebCamID) then
Ini.WebCamID := 0;
- IWebCamMedia := ListMediaTypes(Ini.WebCamID);
+ ListMediaTypes(Ini.WebCamID, IWebCamMedia);
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideWebCamDevice, SelectSlideWebCamDevice, IWebCamDevice, Ini.WebCamID);
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideWebCamMedia, SelectSlideWebCamMedia, IWebCamMedia, Ini.WebCamMediaID);
+ if (Length(IWebCamMedia)=0) then
+ begin
+ Ini.EnableWebCam := 0;
+ WebCamPreviewOn := false;
+ end else
+ begin
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideWebCamDevice, SelectSlideWebCamDevice, IWebCamDevice, Ini.WebCamID);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideWebCamMedia, SelectSlideWebCamMedia, IWebCamMedia, Ini.WebCamMediaID);
- WebCamPreviewOn := (Ini.EnableWebCam=1);
+ WebCamPreviewOn := (Ini.EnableWebCam=1);
+ end;
end else
WebCamPreviewOn := false;
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index daad5d86..4d1b918c 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -2013,7 +2013,7 @@ begin
if ShowFinish then
begin
if (not Music.Finished) and (not medley_end or (ScreenSong.Mode <> smMedley))
- and ((AktSong.Finish = 0) or (Music.Position + Ini.LipSync*0.01 <= AktSong.Finish)) then
+ and ((AktSong.Finish = 0) or ((Music.Position + Ini.LipSync*0.01)*1000 <= AktSong.Finish)) then
begin
//Pause Mod:
if not Paused then
diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas
index b3a77879..e209a176 100644
--- a/Game/Code/Screens/UScreenSongMenu.pas
+++ b/Game/Code/Screens/UScreenSongMenu.pas
@@ -197,7 +197,10 @@ begin
ScreenSong.ChangeMusic;
MenuShow(CurMenu);
end else if (CurMenu = SM_Playlist_Add) then
+ begin
MenuShow(CurMenu);
+ Interaction := 3;
+ end;
end;
SDLK_LEFT:
begin
@@ -223,7 +226,10 @@ begin
ScreenSong.ChangeMusic;
MenuShow(CurMenu);
end else if (CurMenu = SM_Playlist_Add) then
+ begin
MenuShow(CurMenu);
+ Interaction := 3;
+ end;
end;
SDLK_1: