diff options
author | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-28 19:54:31 +0000 |
---|---|---|
committer | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-28 19:54:31 +0000 |
commit | 60e6d3f9904a8114e985fccd14454b9b604ea275 (patch) | |
tree | c3dc298e5c81272f3df8e80171ae0f60d8774f2e /Game/Code/Screens | |
parent | 58a47541955f5010269d72a06e307bbb945211ea (diff) | |
download | usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.gz usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.xz usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.zip |
- new SDL.dll (with a quick and dirty workaround for the hanging-mouse problem)
- changing of sorting and folder-option (on/off) does not need any restart now
- a lot of code clean up
- some bugfixes... i hope... dont't know which...
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2316 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens')
31 files changed, 427 insertions, 334 deletions
diff --git a/Game/Code/Screens/UScreenCredits.pas b/Game/Code/Screens/UScreenCredits.pas index 96eb1642..f20a0797 100644 --- a/Game/Code/Screens/UScreenCredits.pas +++ b/Game/Code/Screens/UScreenCredits.pas @@ -3,7 +3,7 @@ unit UScreenCredits; interface
uses
- UMenu, SDL, UDisplay, UTexture, gl, UMusic, UFiles, SysUtils, UThemes, ULCD, ULight, UGraphicClasses;
+ UMenu, SDL, UDisplay, UTexture, gl, UMusic, UFiles, SysUtils, UThemes, UGraphicClasses;
type
TCreditsStages=(InitialDelay,Intro,MainPart,Outro);
@@ -159,6 +159,7 @@ end; function TScreenCredits.Draw: boolean;
begin
DrawCredits;
+ Result := true;
end;
procedure TScreenCredits.onShow;
@@ -180,7 +181,7 @@ end; Procedure TScreenCredits.Draw_FunkyText;
var
- S,I, Len: Integer;
+ S{,I, Len}: Integer;
X,Y,A: Real;
visibleText: PChar;
begin
@@ -479,7 +480,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -532,7 +533,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -590,7 +591,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -643,7 +644,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -699,7 +700,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -758,7 +759,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -814,7 +815,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -872,7 +873,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -898,7 +899,7 @@ Data := Music.GetFFTData; end;
if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin
j:=CTime-(STime+Delay-10);
- f:=j*10.0;
+ //f:=j*10.0;
gltranslatef(0,-223,0);
glrotatef(j*-9,0,0,1);
gltranslatef(0,223,0);
@@ -931,7 +932,7 @@ Data := Music.GetFFTData; if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha);
if ESC_Alpha >20 then ESC_Alpha:=20;
if ((CTime-STime)<20) then ESC_Alpha:=20;
- k:=CTime-STime;
+ //k:=CTime-STime;
if CTime <=STime+10 then j:=CTime-STime else j:=10;
if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0;
glColor4f(1, 1, 1, ESC_Alpha/20*j/10);
@@ -1107,4 +1108,4 @@ Data := Music.GetFFTData; // Draw_FunkyText;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenEditConvert.pas b/Game/Code/Screens/UScreenEditConvert.pas index d19d95e3..4fbd73a2 100644 --- a/Game/Code/Screens/UScreenEditConvert.pas +++ b/Game/Code/Screens/UScreenEditConvert.pas @@ -71,8 +71,8 @@ implementation uses UGraphic, SysUtils, UDrawTexture, TextGL, UFiles, UMain, UIni, gl, USkins;
function TScreenEditConvert.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
-var
- T: integer;
+{var
+ T: integer;}
begin
Result := true;
If (PressedDown) Then
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index a0c89637..5570e965 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -2,7 +2,7 @@ unit UScreenEditSub; interface
-uses UMenu, UVideo, TextGL, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, UMenuText,
+uses UMenu, UVideo, TextGL, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, UMenuText,
ULyrics, Math, gl, UThemes, MidiOut, UHelp;
type
@@ -1136,7 +1136,7 @@ end; function TScreenEditSub.ParseInputEditBPM(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
var
- SDL_ModState: Word;
+ //SDL_ModState: Word;
strBPM: string;
temp: real;
@@ -1144,8 +1144,8 @@ begin // used when in Text Edit Mode
Result := true;
- SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
- + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT {+ KMOD_CAPS});
+ //SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
+ // + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT {+ KMOD_CAPS});
// check normal keys
if (ScanCode in [48..57, 44]) then
@@ -1339,7 +1339,7 @@ end; procedure TScreenEditSub.LyricsCapitalize;
var
C: integer;
- N: integer; // temporary
+ //N: integer; // temporary
S: string;
begin
// temporary
@@ -1936,9 +1936,9 @@ end; function TScreenEditSub.Draw: boolean;
var
- Min: integer;
- Sec: integer;
- Tekst: string;
+ //Min: integer;
+ //Sec: integer;
+ //Tekst: string;
Pet: integer;
PlayClick: boolean;
line, note: integer;
@@ -2387,14 +2387,14 @@ end; procedure TScreenEditSub.DrawInfoBar(x, y, w, h: integer);
var
- start, end_: integer;
- ww: integer;
+ start, end_: integer;
+ ww: integer;
- pos: real;
- br: real;
+ pos: real;
+ br: real;
- line, note: integer;
- numLines, numNotes: integer;
+ line: integer;
+ numLines: integer;
begin
numLines := Length(Czesci[0].Czesc);
@@ -2564,4 +2564,4 @@ begin Result := 0;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenLevel.pas b/Game/Code/Screens/UScreenLevel.pas index 856e0cf1..145a3b2a 100644 --- a/Game/Code/Screens/UScreenLevel.pas +++ b/Game/Code/Screens/UScreenLevel.pas @@ -22,12 +22,12 @@ implementation uses UGraphic, UMain, UIni, UTexture, ULog;
function TScreenLevel.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
-var
- SDL_ModState: Word;
+{var
+ SDL_ModState: Word; }
begin
Result := true;
- SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
- + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT {+ KMOD_CAPS});
+ //SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
+ // + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT {+ KMOD_CAPS});
If (PressedDown) Then
begin // Key Down
@@ -71,8 +71,6 @@ begin end;
constructor TScreenLevel.Create;
-var
- I: integer;
begin
inherited Create;
@@ -101,4 +99,4 @@ begin Button[2].Texture.ScaleW := Progress;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenLoading.pas b/Game/Code/Screens/UScreenLoading.pas index 82dfdab2..49dc961b 100644 --- a/Game/Code/Screens/UScreenLoading.pas +++ b/Game/Code/Screens/UScreenLoading.pas @@ -17,7 +17,7 @@ type implementation
-uses UGraphic, UTime;
+uses UGraphic, UTime, UDisplay;
function TScreenLoading.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
begin
diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas index 91a9e620..b21a4778 100644 --- a/Game/Code/Screens/UScreenMain.pas +++ b/Game/Code/Screens/UScreenMain.pas @@ -3,7 +3,7 @@ unit UScreenMain; interface
uses
- UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes, ULCD, ULight, UHelp;
+ UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes, UHelp;
type
TScreenMain = class(TMenu)
@@ -20,7 +20,6 @@ type procedure InteractPrev; override;
procedure InteractInc; override;
procedure InteractDec; override;
- procedure UpdateLCD;
procedure SetAnimationProgress(Progress: real); override;
//function Draw: boolean; override;
end;
@@ -35,8 +34,8 @@ uses Windows, UPlaylist, UGraphic, UMain, UIni, UTexture, USongs, Textgl, opengl function TScreenMain.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
var
-I: Integer;
SDL_ModState: Word;
+
begin
Result := true;
@@ -235,8 +234,6 @@ begin end;
constructor TScreenMain.Create;
-var
- I: integer;
begin
inherited Create;
@@ -269,8 +266,6 @@ end; procedure TScreenMain.onShow;
begin
- LCD.WriteText(1, ' Choose mode: ');
- UpdateLCD;
ScreenSong.Mode := smNormal;
ScreenSong.SongIndex := -1;
PlaylistMan.Mode := 0;
@@ -289,8 +284,6 @@ begin inherited InteractNext;
Text[TextDescription].Text := Theme.Main.Description[Interaction];
Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
- UpdateLCD;
- Light.LightOne(1, 200);
end;
procedure TScreenMain.InteractPrev;
@@ -298,8 +291,6 @@ begin inherited InteractPrev;
Text[TextDescription].Text := Theme.Main.Description[Interaction];
Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
- UpdateLCD;
- Light.LightOne(0, 200);
end;
procedure TScreenMain.InteractDec;
@@ -307,8 +298,6 @@ begin inherited InteractDec;
Text[TextDescription].Text := Theme.Main.Description[Interaction];
Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
- UpdateLCD;
- Light.LightOne(0, 200);
end;
procedure TScreenMain.InteractInc;
@@ -316,18 +305,6 @@ begin inherited InteractInc;
Text[TextDescription].Text := Theme.Main.Description[Interaction];
Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
- UpdateLCD;
- Light.LightOne(1, 200);
-end;
-
-procedure TScreenMain.UpdateLCD;
-begin
- case Interaction of
- 0: LCD.WriteText(2, ' sing ');
- 1: LCD.WriteText(2, ' multi ');
- 2: LCD.WriteText(2, ' options ');
- 3: LCD.WriteText(2, ' exit ');
- end
end;
procedure TScreenMain.SetAnimationProgress(Progress: real);
@@ -335,4 +312,4 @@ begin Static[0].Texture.ScaleW := Progress;
Static[0].Texture.ScaleH := Progress;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOpen.pas b/Game/Code/Screens/UScreenOpen.pas index 6b80354c..97252b2b 100644 --- a/Game/Code/Screens/UScreenOpen.pas +++ b/Game/Code/Screens/UScreenOpen.pas @@ -2,13 +2,13 @@ unit UScreenOpen; interface
-uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, UMenuText,
+uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, UMenuText,
ULyrics, Math, gl, UThemes;
type
TScreenOpen = class(TMenu)
private
- TextF: array[0..1] of integer;
+ //TextF: array[0..1] of integer;
TextN: integer;
public
Tex_Background: TTexture;
@@ -162,4 +162,3 @@ begin end;*)
end.
-
diff --git a/Game/Code/Screens/UScreenOptions.pas b/Game/Code/Screens/UScreenOptions.pas index ee4c2cba..3e9a4ff7 100644 --- a/Game/Code/Screens/UScreenOptions.pas +++ b/Game/Code/Screens/UScreenOptions.pas @@ -102,8 +102,6 @@ begin end;
constructor TScreenOptions.Create;
-var
- I: integer;
begin
inherited Create;
@@ -177,4 +175,4 @@ begin Button[7].Texture.ScaleW := Progress;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOptionsAdvanced.pas b/Game/Code/Screens/UScreenOptionsAdvanced.pas index c364ca20..7c89ed34 100644 --- a/Game/Code/Screens/UScreenOptionsAdvanced.pas +++ b/Game/Code/Screens/UScreenOptionsAdvanced.pas @@ -79,8 +79,8 @@ begin end;
constructor TScreenOptionsAdvanced.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index c9268931..a77ce5b3 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -75,17 +75,11 @@ begin end;
constructor TScreenOptionsGame.Create;
-var
- I: integer;
begin
inherited Create;
LoadFromTheme(Theme.OptionsGame);
- //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);
@@ -104,8 +98,12 @@ end; //Refresh Songs Patch
procedure TScreenOptionsGame.RefreshSongs;
begin
-if (ini.Sorting <> old_Sorting) or (ini.Tabs <> old_Tabs) then
- ScreenSong.Refresh;
+ if (ini.Sorting <> old_Sorting) or (ini.Tabs <> old_Tabs) then
+ begin
+ //Tabs at Startup fix
+ Ini.Tabs_at_startup := Ini.Tabs;
+ ScreenSong.Refresh(false);
+ end;
end;
procedure TScreenOptionsGame.onShow;
@@ -113,6 +111,10 @@ begin // Interaction := 0;
if not Help.SetHelpID(ID) then
Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsGame)');
+
+ //Refresh Songs Patch
+ old_Sorting := Ini.Sorting;
+ old_Tabs := Ini.Tabs;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOptionsGraphics.pas b/Game/Code/Screens/UScreenOptionsGraphics.pas index 58e40c23..ee6e96f9 100644 --- a/Game/Code/Screens/UScreenOptionsGraphics.pas +++ b/Game/Code/Screens/UScreenOptionsGraphics.pas @@ -76,8 +76,6 @@ begin end;
constructor TScreenOptionsGraphics.Create;
-var
- I: integer;
begin
inherited Create;
@@ -104,4 +102,4 @@ begin Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsGraphics)');
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOptionsLyrics.pas b/Game/Code/Screens/UScreenOptionsLyrics.pas index aeeb01a4..a6ee2464 100644 --- a/Game/Code/Screens/UScreenOptionsLyrics.pas +++ b/Game/Code/Screens/UScreenOptionsLyrics.pas @@ -73,8 +73,6 @@ begin end;
constructor TScreenOptionsLyrics.Create;
-var
- I: integer;
begin
inherited Create;
@@ -98,4 +96,4 @@ begin Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsLyrics)');
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas index 8dda4a6f..c4c43674 100644 --- a/Game/Code/Screens/UScreenOptionsRecord.pas +++ b/Game/Code/Screens/UScreenOptionsRecord.pas @@ -81,7 +81,7 @@ end; constructor TScreenOptionsRecord.Create;
var
- I: integer;
+ //I: integer;
SC: integer;
SCI: integer;
begin
diff --git a/Game/Code/Screens/UScreenOptionsSound.pas b/Game/Code/Screens/UScreenOptionsSound.pas index f2b94e73..6735abea 100644 --- a/Game/Code/Screens/UScreenOptionsSound.pas +++ b/Game/Code/Screens/UScreenOptionsSound.pas @@ -73,8 +73,6 @@ begin end;
constructor TScreenOptionsSound.Create;
-var
- I: integer;
begin
inherited Create;
@@ -104,4 +102,4 @@ begin Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsSound)');
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenOptionsThemes.pas b/Game/Code/Screens/UScreenOptionsThemes.pas index 320baa83..9a65aae0 100644 --- a/Game/Code/Screens/UScreenOptionsThemes.pas +++ b/Game/Code/Screens/UScreenOptionsThemes.pas @@ -9,8 +9,10 @@ type TScreenOptionsThemes = class(TMenu)
private
procedure ReloadTheme;
+
public
- SkinSelect: Integer;
+ AktualTheme: Integer;
+ SkinSelect: Integer;
constructor Create; override;
function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
procedure onShow; override;
@@ -46,10 +48,12 @@ begin Ini.Save;
// Reload all screens, after Theme changed
- // Todo : JB - Check if theme was actually changed
- UGraphic.UnLoadScreens();
- UGraphic.LoadScreens( false );
-
+ if(AktualTheme<>Ini.Theme) then
+ begin
+ UGraphic.UnLoadScreens();
+ UGraphic.LoadScreens( true );
+ ScreenSong.Refresh(true);
+ end;
Music.PlayBack;
FadeTo(@ScreenOptions);
end;
@@ -60,10 +64,12 @@ begin Ini.Save;
// Reload all screens, after Theme changed
- // Todo : JB - Check if theme was actually changed
- UGraphic.UnLoadScreens();
- UGraphic.LoadScreens( false );
-
+ if(AktualTheme<>Ini.Theme) then
+ begin
+ UGraphic.UnLoadScreens();
+ UGraphic.LoadScreens( true );
+ ScreenSong.Refresh(true);
+ end;
Music.PlayBack;
FadeTo(@ScreenOptions);
end;
@@ -119,8 +125,8 @@ begin end;
constructor TScreenOptionsThemes.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
@@ -143,6 +149,8 @@ begin Interaction := 0;
if not Help.SetHelpID(ID) then
Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsThemes)');
+
+ AktualTheme := Ini.Theme;
end;
procedure TScreenOptionsThemes.ReloadTheme;
@@ -160,6 +168,8 @@ begin Display.Draw;
SwapBuffers;
+ ScreenOptionsThemes.AktualTheme := self.AktualTheme;
+
freeandnil( self );
end;
diff --git a/Game/Code/Screens/UScreenPartyNewRound.pas b/Game/Code/Screens/UScreenPartyNewRound.pas index 91ae0e64..7c043b7e 100644 --- a/Game/Code/Screens/UScreenPartyNewRound.pas +++ b/Game/Code/Screens/UScreenPartyNewRound.pas @@ -112,8 +112,8 @@ begin end;
constructor TScreenPartyNewRound.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
@@ -171,8 +171,8 @@ begin end;
procedure TScreenPartyNewRound.onShow;
-var
- I: Integer;
+//var
+ //I: Integer;
function GetTeamPlayers(const Num: Byte): String;
var
Players: Array of String;
@@ -322,7 +322,7 @@ var T: Integer;
NumRounds: Integer;
begin
- N:=0;
+ //N:=0;
//current round-number
R:=PartySession.CurRound;
diff --git a/Game/Code/Screens/UScreenPartyNewRoundM2.pas b/Game/Code/Screens/UScreenPartyNewRoundM2.pas index ee5c8a90..7fe94ac2 100644 --- a/Game/Code/Screens/UScreenPartyNewRoundM2.pas +++ b/Game/Code/Screens/UScreenPartyNewRoundM2.pas @@ -237,7 +237,6 @@ var T: Integer;
NumRounds: Integer;
begin
- N:=0;
//current round-number
R:=PartySessionM2.CurRound;
@@ -310,4 +309,4 @@ begin Button[2].Texture.ScaleW := Progress; }
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenPartyOptions.pas b/Game/Code/Screens/UScreenPartyOptions.pas index d6c2d71a..8576b596 100644 --- a/Game/Code/Screens/UScreenPartyOptions.pas +++ b/Game/Code/Screens/UScreenPartyOptions.pas @@ -437,8 +437,8 @@ begin end;
constructor TScreenPartyOptions.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
//Fill IPlaylist
diff --git a/Game/Code/Screens/UScreenPartyOptionsM2.pas b/Game/Code/Screens/UScreenPartyOptionsM2.pas index 472b2c16..7a8f5f2b 100644 --- a/Game/Code/Screens/UScreenPartyOptionsM2.pas +++ b/Game/Code/Screens/UScreenPartyOptionsM2.pas @@ -802,6 +802,8 @@ begin if MenuPluginOpen then
Draw_MenuPlugin;
+
+ Result := true;
end;
procedure TScreenPartyOptionsM2.SetAnimationProgress(Progress: real);
diff --git a/Game/Code/Screens/UScreenPartyPlayerM2.pas b/Game/Code/Screens/UScreenPartyPlayerM2.pas index 6ee9d1df..da96bf30 100644 --- a/Game/Code/Screens/UScreenPartyPlayerM2.pas +++ b/Game/Code/Screens/UScreenPartyPlayerM2.pas @@ -23,7 +23,7 @@ uses UGraphic, UMain, UIni, UTexture, UPartyM2, UHelp, ULog; function TScreenPartyPlayerM2.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
var
- I, J: integer;
+ {I,} J: integer;
SDL_ModState: Word;
procedure IntNext;
begin
@@ -40,11 +40,11 @@ var begin
Result := true;
If (PressedDown) Then
-
+ begin // Key Down
SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT
+ KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT);
- begin // Key Down
+
case PressedKey of
SDLK_TAB:
begin
@@ -204,8 +204,8 @@ begin end;
constructor TScreenPartyPlayerM2.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
diff --git a/Game/Code/Screens/UScreenPartyScore.pas b/Game/Code/Screens/UScreenPartyScore.pas index faed2964..9dc824fb 100644 --- a/Game/Code/Screens/UScreenPartyScore.pas +++ b/Game/Code/Screens/UScreenPartyScore.pas @@ -88,7 +88,7 @@ end; constructor TScreenPartyScore.Create;
var
- I: integer;
+ //I: integer;
Tex: TTexture;
R, G, B: Real;
Color: Integer;
diff --git a/Game/Code/Screens/UScreenPartyWin.pas b/Game/Code/Screens/UScreenPartyWin.pas index d7c26d30..057c1f8a 100644 --- a/Game/Code/Screens/UScreenPartyWin.pas +++ b/Game/Code/Screens/UScreenPartyWin.pas @@ -71,8 +71,8 @@ begin end;
constructor TScreenPartyWin.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
diff --git a/Game/Code/Screens/UScreenPopup.pas b/Game/Code/Screens/UScreenPopup.pas index 417f59bb..24aec1b4 100644 --- a/Game/Code/Screens/UScreenPopup.pas +++ b/Game/Code/Screens/UScreenPopup.pas @@ -18,8 +18,8 @@ type end;
TScreenPopupError = class(TMenu)
- private
- CurMenu: Byte; //Num of the cur. Shown Menu
+ {private
+ CurMenu: Byte; //Num of the cur. Shown Menu}
public
Visible: Boolean; //Whether the Menu should be Drawn
@@ -356,7 +356,7 @@ begin glColor4f(0.2, 0.2, 0.2, 0.8); glVertex2f(Rect.left-5, Rect.bottom+5); glEnd;
glDisable(GL_BLEND);
- //glScissor(Rect.left-1, ScreenH-Rect.bottom-1, Rect.right-Rect.left+2, Rect.bottom-Rect.top+2);
+ glScissor(Rect.left-1, ScreenH-Rect.bottom-1, Rect.right-Rect.left+2, Rect.bottom-Rect.top+2);
glScissor(round((Rect.left-1)*(ScreenW/Screens)/RenderW+(ScreenW/Screens)*(ScreenAct-1)),
round((RenderH-Rect.bottom-1)*ScreenH/RenderH),
round((Rect.right-Rect.left+2)*(ScreenW/Screens)/RenderW),
@@ -787,35 +787,28 @@ end; procedure TScreenPopupHelp.DrawLine(line, index, Y: integer);
begin
- //glEnable(GL_BLEND);
glColor4f(1, 1, 1, 1);
glLineWidth(2);
glBegin(GL_LINES);
glVertex2f(TextsGFX[line].lines[index].fX, TextsGFX[line].lines[index].fY - Y);
glVertex2f(TextsGFX[line].lines[index].tX, TextsGFX[line].lines[index].tY - Y);
glEnd;
- //glDisable(GL_BLEND);
end;
procedure TScreenPopupHelp.DrawText(line, index, Y: integer);
-var
- text: PChar;
-
begin
glColor4f(1, 1, 1, 1);
SetFontStyle(TextsGFX[line].texts[index].Style); SetFontItalic(TextsGFX[line].texts[index].Italic); SetFontSize(TextsGFX[line].texts[index].Size); SetFontPos (TextsGFX[line].texts[index].X, TextsGFX[line].texts[index].Y - Y); - text := Addr(TextsGFX[line].texts[index].text[1]); - glPrint(text);
+ glPrint(PChar(TextsGFX[line].texts[index].text));
end;
procedure TScreenPopupHelp.DrawScroll(X, Y, W, H: integer; pos, len: double);
var
fY, tY: double;
begin
- //glEnable(GL_BLEND);
glColor4f(1, 1, 1, 1);
glLineWidth(1);
@@ -837,7 +830,6 @@ begin glVertex2f(X+W, tY);
glVertex2f(X, tY);
glEnd;
- //glDisable(GL_BLEND);
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas index ca2ec78b..4101aef9 100644 --- a/Game/Code/Screens/UScreenScore.pas +++ b/Game/Code/Screens/UScreenScore.pas @@ -3,7 +3,7 @@ unit UScreenScore; interface
uses
- UMenu, SDL, SysUtils, UDisplay, UMusic, USongs, UThemes, ULCD, gl;
+ UMenu, SDL, SysUtils, UDisplay, UMusic, USongs, UThemes, gl;
type
THandler = record
@@ -368,11 +368,6 @@ begin RefreshTexts;
- LCD.HideCursor;
- LCD.Clear;
- LCD.WriteText(1, Ini.Name[0]);
- LCD.WriteText(2, 'Score: ' + Text[TextTotalScore[1]].Text);
-
MP3VolumeHandler.changed := false;
if not (Ini.SavePlayback=1) then
StartPreview
@@ -642,4 +637,4 @@ begin end;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 43ad1dde..c6d83fd0 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -3,7 +3,7 @@ unit UScreenSing; interface
uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics,
- TextGL, gl, BASS, UThemes, ULCD, UGraphicClasses, UVideo;
+ TextGL, gl, BASS, UThemes, UGraphicClasses, UVideo;
type
THandler = record
@@ -93,7 +93,6 @@ type function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
function Draw: boolean; override;
procedure Finish; virtual;
- procedure UpdateLCD;
procedure Pause; //Pause Mod(Toggles Pause)
//OnSentenceEnd for LineBonus + Singbar
@@ -249,17 +248,11 @@ end; //Pause Mod End
constructor TScreenSing.Create;
-var
- I: integer;
- P: integer;
begin
inherited Create;
LoadFromTheme(Theme.Sing);
- // time
- //TextTime := AddText(75, 14, 1, 8, 0.25, 0.25, 0.25, '00:00');
-
//TimeBar mod
StaticTimeProgress := AddStatic(Theme.Sing.StaticTimeProgress);
TextTimeText := AddText(Theme.Sing.TextTimeText);
@@ -323,7 +316,6 @@ end; procedure TScreenSing.onShow;
var
- P: integer;
V1: boolean;
V1TwoP: boolean; //added for ps3 skin
V1ThreeP: boolean; //added for ps3 skin
@@ -405,7 +397,14 @@ begin V2M := true;
V3R := true;
end;
-
+ else begin //should not happen
+ V1 := true;
+ V1TwoP := false;
+ V1ThreeP := false;
+ V2R := false;
+ V2M := false;
+ V3R := false;
+ end;
end;
//Added for ps3 skin
@@ -761,7 +760,7 @@ end; procedure TScreenSing.SongError;
var
- I, K, len: integer;
+ I, len: integer;
begin
if (not ScreenSong.PartyMedley) and (ScreenSong.Mode <> smMedley) then
@@ -815,7 +814,7 @@ end; procedure TScreenSing.LoadNextSong;
var
P, I: integer;
- numNotes: integer;
+
begin
// load notes
ResetSingTemp;
@@ -844,7 +843,6 @@ begin end;
AktSong.Path := CatSongs.Song[CatSongs.Selected].Path;
- // AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed
if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
begin
@@ -863,7 +861,6 @@ begin if MedleyStart<0 then
MedleyStart := 0;
- //that one is better:
MedleyEnd := GetTimeFromBeat(AktSong.Medley.EndBeat) + AktSong.Medley.FadeOut_time;
end;
@@ -895,8 +892,6 @@ begin Tex_Background.TexNum := -1;
// play music+timer (I)
- Music.CaptureStart;
-
if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then
begin
Music.MoveTo(MedleyStart);
@@ -924,14 +919,12 @@ begin LyricSub.AddCzesc(1);
LyricSub.Selected := -1;
- UpdateLCD;
-
//Deactivate Pause
Paused := False;
//Kill all Stars not Killed yet
//GoldenStarsTwinkle Mod
- GoldenRec.SentenceChange;
+ GoldenRec.SentenceChange;
//GoldenStarsTwinkle Mod End
//Set Num of Empty Sentences for Phrasen Bonus
@@ -952,6 +945,8 @@ begin Text[SongNameText].Visible := false;
end;
+ Music.CaptureStart;
+
if ((ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley)
and (PlaylistMedley.CurrentMedleySong>1) then
onShowFinish;
@@ -1367,13 +1362,37 @@ begin DrawVolumeBar(10, 475, 782, 12, MP3Volume);
end else
MP3VolumeHandler.changed := false;
+
+
+ if (Ini.Debug=1) then
+ begin
+ glEnable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
+ glColor4f(1, 1, 1, 0.6);
+ glBegin(GL_QUADS);
+ glVertex2f(0, 180);
+ glVertex2f(0, 210);
+ glVertex2f(400, 210);
+ glVertex2f(400, 180);
+ glEnd;
+ glDisable(GL_BLEND);
+
+ SetFontStyle(1);
+ SetFontItalic(false);
+ SetFontSize(8);
+ glColor4f(0, 0, 0, 1);
+
+ SetFontPos (5, 184);
+ glPrint(PChar('lt: ' + FormatFloat('#0.00', Czas.Teraz) +
+ ' mt: ' + FormatFloat('#0.00', Music.Position) +
+ ' dt: ' + FormatFloat('#0.000', Czas.Teraz-Music.Position)));
+ end;
end;
procedure TScreenSing.UpdateMedleyStats(medley_end: boolean);
var
len, num, I : integer;
- lastline: boolean;
- vol: real;
+
begin
len := Length(PlaylistMedley.Stats);
num := PlaylistMedley.NumPlayer;
@@ -1498,7 +1517,7 @@ begin PlaylistMedley.Stats[len].Player[I].ScoreLine / len);
PlaylistMedley.Stats[len].Player[I].ScoreGolden := round(
- PlaylistMedley.Stats[J].Player[I].ScoreGolden / len);
+ PlaylistMedley.Stats[len].Player[I].ScoreGolden / len);
PlaylistMedley.Stats[len].Player[I].ScoreI := round(
PlaylistMedley.Stats[len].Player[I].ScoreI / len);
@@ -1551,22 +1570,6 @@ begin end;
end;
-procedure TScreenSing.UpdateLCD;
-var
- T: string;
-begin
- LCD.HideCursor;
- LCD.Clear;
-
- T := LyricMain.Text;
- if Copy(T, Length(T), 1) <> ' ' then T := T + ' ';
- LCD.AddTextBR(T);
-
- T := LyricSub.Text;
- if Copy(T, Length(T), 1) <> ' ' then T := T + ' ';
- LCD.AddTextBR(T);
-end;
-
procedure TScreenSing.onSentenceEnd(S: Cardinal);
var
I: Integer;
@@ -1686,28 +1689,27 @@ end; procedure TScreenSing.DrawMedleyCountdown();
var
- txt: PChar;
w, h: real;
timeDiff: real;
t: real;
+
begin
if (Czas.Teraz < GetTimeFromBeat(AktSong.Medley.StartBeat)) then
begin
timeDiff := GetTimeFromBeat(AktSong.Medley.StartBeat)-Czas.Teraz+1;
t := frac(timeDiff);
- CountDownText := IntToStr(round(timeDiff-t));
+
glColor4f(0.15, 0.30, 0.6, t);
- h := 130*t*ScreenH/RenderH;
+ h := 100*t*ScreenH/RenderH;
SetFontStyle(1); SetFontItalic(false); SetFontSize(h); w := glTextWidth(PChar(CountDownText)); SetFontPos (RenderW/2-w/2, RenderH/2-h/2*3); - txt := Addr(CountDownText[1]); - glPrint(txt);
+ glPrint(PChar(IntToStr(round(timeDiff-t))));
end;
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas index f1ab96e5..6010aed8 100644 --- a/Game/Code/Screens/UScreenSingModi.pas +++ b/Game/Code/Screens/UScreenSingModi.pas @@ -3,7 +3,7 @@ unit UScreenSingModi; interface
uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics,
- TextGL, gl, BASS, UThemes, ULCD, UScreenSing, ModiSDK, UVideo;
+ TextGL, gl, BASS, UThemes, UScreenSing, ModiSDK, UVideo;
type
TScreenSingModi = class(TScreenSing)
@@ -528,7 +528,7 @@ end; //ShowScore if DLLMan.Selected.LoadSong then
begin
// update static menu with time ...
- CurTime := Czas.Razem - Czas.Teraz;
+ //CurTime := Czas.Razem - Czas.Teraz;
// update static menu with time ...
if ScreenSong.PartyMedley then
@@ -775,4 +775,4 @@ begin Music.PlayCustomSound(Index);
end;
-end.
+end.
\ No newline at end of file diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 8516c012..0777e68d 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -3,8 +3,22 @@ unit UScreenSong; interface
uses
- UMenu, TextGL, SDL, UMusic, UDraw, UFiles, UTime, UDisplay, USongs, SysUtils, ULog, UThemes, UTexture, ULanguage,
- ULCD, ULight, UIni, UVideo;
+ UMenu,
+ TextGL,
+ SDL,
+ UMusic,
+ UDraw,
+ UFiles,
+ UTime,
+ UDisplay,
+ USongs,
+ SysUtils,
+ ULog,
+ UThemes,
+ UTexture,
+ ULanguage,
+ UIni,
+ UVideo;
type
TVisArr = array of integer;
@@ -137,16 +151,15 @@ type procedure onHide; override;
procedure SelectNext;
procedure SelectPrev;
- procedure UpdateLCD;
procedure SkipTo(Target: Cardinal);
procedure RandomSongChallenge();
- procedure SkipTo2(Target: Cardinal); //skipt exactly to the target song nr.
+ procedure SkipTo2(Target: Integer); //skipt exactly to the target song nr.
procedure FixSelected; //Show Wrong Song when Tabs on Fix
procedure FixSelected2; //Show Wrong Song when Tabs on Fix
procedure ShowCatTL(Cat: Integer);// Show Cat in Top left
procedure ShowCatTLCustom(Caption: String);// Show Custom Text in Top left
procedure HideCatTL;// Show Cat in Tob left
- procedure Refresh; //Refresh Song Sorting
+ procedure Refresh(GiveStats: boolean); //Refresh Song Sorting
procedure DrawEqualizer;
procedure ChangeMusic;
procedure LoadTop;
@@ -337,7 +350,6 @@ function TScreenSong.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDow var
I: integer;
I2: integer;
- HS: integer;
SDL_ModState: Word;
Letter: Char;
VisArr: array of integer;
@@ -359,7 +371,8 @@ begin If (PressedDown) Then
begin // Key Down
- if (WaitHandler.active) and not (PressedKey = SDLK_RETURN) then
+ if (WaitHandler.active) and not (PressedKey IN [SDLK_RETURN, SDLK_TAB, SDLK_F,
+ SDLK_A, SDLK_E, SDLK_K, SDLK_M, SDLK_P, SDLK_S, SDLK_V]) then
begin
if (Ini.Tabs_at_startup=1) then
begin
@@ -392,7 +405,8 @@ begin if (WaitHandler.active) then
begin
WaitHandler.active := false;
- if (PressedKey<>SDLK_RETURN) then
+ if (not PressedKey IN [SDLK_RETURN, SDLK_TAB, SDLK_F,
+ SDLK_A, SDLK_E, SDLK_K, SDLK_M, SDLK_P, SDLK_S, SDLK_V]) then
Exit;
end;
end;
@@ -421,7 +435,6 @@ begin ChangeMusic;
SetScroll4;
- UpdateLCD;
//Break and Exit
Exit;
end;
@@ -440,7 +453,6 @@ begin ChangeMusic;
SetScroll4;
- UpdateLCD;
//Break and Exit
Exit;
@@ -547,6 +559,7 @@ begin SDLK_F:
begin
+ WaitHandler.change_time := 0;
if (Mode = smNormal) and (SDL_ModState = KMOD_LSHIFT) and MakeMedley then
begin
if Length(PlaylistMedley.Song)>0 then
@@ -567,6 +580,7 @@ begin SDLK_ESCAPE,
SDLK_BACKSPACE :
begin
+ WaitHandler.change_time := 0;
if (Mode = smNormal) or ((Mode = smChallenge) and not PartyMedley and not FoundCAT) then
begin
//On Escape goto Cat-List Hack
@@ -683,6 +697,8 @@ begin end;
end else
begin
+ WaitHandler.changed := false;
+ CatSongs.Selected := Interaction;
//Do the Action that is specified in Ini
case Ini.OnSongClick of
0: StartSong;
@@ -723,6 +739,8 @@ begin begin
if (Length(Songs.Song) > 0) and (Mode <> smChallenge) then begin //not in M2-Mode
if (Mode = smNormal) then begin
+ WaitHandler.changed := false;
+ CatSongs.Selected := Interaction;
if not CatSongs.Song[Interaction].Main then begin // clicked on Song
if CatSongs.CatNumShow = -3 then
ScreenSongMenu.MenuShow(SM_Playlist)
@@ -740,8 +758,11 @@ begin SDLK_P: //Show Playlist Menu
begin
- if (Length(Songs.Song) > 0) AND (Mode = smNormal) then begin //not in party-modes
- ScreenSongMenu.MenuShow(SM_Playlist_Load);
+ if (Length(Songs.Song) > 0) AND (Mode = smNormal) then
+ begin //not in party-modes
+ WaitHandler.changed := false;
+ CatSongs.Selected := Interaction;
+ ScreenSongMenu.MenuShow(SM_Playlist_Load);
end;
end;
@@ -750,6 +771,8 @@ begin if (Length(Songs.Song) > 0) AND (Mode = smNormal) then //not in party-modes
begin
VidVis := windowed;
+ WaitHandler.changed := false;
+ CatSongs.Selected := Interaction;
ScreenSongJumpto.Visible := True;
end else if (Mode=smChallenge) and not PartyMedley then //M2-MOD-mode
DoJokerM2
@@ -849,8 +872,6 @@ begin SelectNext;
ChangeMusic;
SetScroll4;
- UpdateLCD;
- Light.LightOne(1, 200);
end;
end;
@@ -863,15 +884,16 @@ begin SelectPrev;
ChangeMusic;
SetScroll4;
- UpdateLCD;
- Light.LightOne(0, 200);
end;
end;
SDLK_E:
begin
if (Mode = smNormal) then
+ begin
+ WaitHandler.changed := false;
OpenEditor;
+ end;
end;
SDLK_R:
@@ -1117,7 +1139,7 @@ constructor TScreenSong.Create; var
Pet: integer;
I: integer;
-Label CreateSongButtons;
+
begin
inherited Create;
@@ -1203,88 +1225,19 @@ begin // Song List
// Songs.LoadSongList; // moved to the UltraStar unit
- CatSongs.Refresh;
-
- if (length(CatSongs.Song) > 0) then
- begin
- //Set Length of Button Array one Time Instead of one time for every Song
- SetButtonLength(Length(CatSongs.Song));
-
- I := 0;
- CreateSongButtons:
-
- try
- for Pet := I to High(CatSongs.Song) do begin // creating all buttons
- // new
- Texture.Limit := 512;// 256 0.4.2 value, 512 in 0.5.0
-
- if not FileExists(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover) then
- CatSongs.Song[Pet].Cover := ''; // 0.5.0: if cover not found then show 'no cover'
-
- if CatSongs.Song[Pet].Cover = '' then
- AddButton(300 + Pet*250, 140, 200, 200, Skin.GetTextureFileName('SongCover'), 'JPG', 'Plain', Theme.Song.Cover.Reflections)
- else begin
- // cache texture if there is a need to this
- if not Covers.CoverExists(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover) then begin
- Texture.CreateCacheMipmap := true;
- Texture.GetTexture(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, 'Plain', true); // preloads textures and creates cache mipmap
- Texture.CreateCacheMipmap := false;
-
- // puts this texture to the cache file
- Covers.AddCover(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover);
-
- // unload full size texture
- Texture.UnloadTexture(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, false);
-
- // we should also add mipmap texture by calling createtexture and use mipmap cache as data source
- end;
-
- // and now load it from cache file (small place for the optimization by eliminating reading it from file, but not here)
- AddButton(300 + Pet*250, 140, 200, 200, CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, 'JPG', 'Plain', Theme.Song.Cover.Reflections);
- end;
- Texture.Limit := 1024*1024;
- I := -1;
- end;
- except
- //When Error is reported the First time for this Song
- if (I <> Pet) then
- begin
- //Some Error reporting:
- Log.LogError('Could not load Cover: ' + CatSongs.Song[Pet].Cover);
-
- //Change Cover to NoCover and Continue Loading
- CatSongs.Song[Pet].Cover := '';
- I := Pet;
- end
- else //when Error occurs Multiple Times(NoSong Cover is damaged), then start loading next Song
- begin
- Log.LogError('NoCover Cover is damaged!');
- try
- AddButton(300 + Pet*250, 140, 200, 200, '', 'JPG', 'Plain', Theme.Song.Cover.Reflections);
- except
- Messagebox(0, PChar('No Cover Image is damage. Could not Workaround Song Loading, Ultrastar will exit now.'), PChar(Language.Translate('US_VERSION')), MB_ICONERROR or MB_OK);
- Halt;
- end;
- I := Pet + 1;
- end;
- end;
-
- if (I <> -1) then
- GoTo CreateSongButtons;
+
+ //Refresh;
- end;
// Randomize Patch
Randomize;
//Equalizer
SetLength(EqualizerBands, Theme.Song.Equalizer.Bands);
+
//ClearArray
For I := low(EqualizerBands) to high(EqualizerBands) do
EqualizerBands[I] := 3;
- if (Length(CatSongs.Song) > 0) then
- Interaction := 0;
-
MP3Volume := Ini.PreviewVolume * 10;
end;
@@ -1494,8 +1447,8 @@ end; procedure TScreenSong.SetScroll1;
var
B: integer; // button
- BMin: integer; // button min
- BMax: integer; // button max
+ //BMin: integer; // button min
+ //BMax: integer; // button max
Src: integer;
// Dst: integer;
Count: integer; // Dst is not used. Count is used.
@@ -1630,8 +1583,8 @@ end; procedure TScreenSong.SetScroll2;
var
B: integer;
- Wsp: integer; // wspolczynnik przesuniecia wzgledem srodka ekranu
- Wsp2: real;
+ //Wsp: integer; // wspolczynnik przesuniecia wzgledem srodka ekranu
+ //Wsp2: real;
begin
// liniowe
for B := 0 to High(Button) do
@@ -1657,8 +1610,8 @@ end; procedure TScreenSong.SetScroll3; // with slide
var
B: integer;
- Wsp: integer; // wspolczynnik przesuniecia wzgledem srodka ekranu
- Wsp2: real;
+ //Wsp: integer; // wspolczynnik przesuniecia wzgledem srodka ekranu
+ //Wsp2: real;
begin
SongTarget := Interaction;
@@ -1720,7 +1673,7 @@ begin end;
end;
end;
-
+{ old version
procedure TScreenSong.SetScroll5; // rotate
var
B: integer;
@@ -1731,14 +1684,6 @@ var X: Real;
begin
VS := CatSongs.VisibleSongs; // cache Visible Songs
- {Vars
- Theme.Song.CoverW: Radius des Kreises
- Theme.Song.CoverX: X Pos Linke Kante des gewählten Covers
- Theme.Song.CoverX: Y Pos Obere Kante des gewählten Covers
- Theme.Song.CoverH: Höhe der Cover
-
- (CatSongs.VisibleIndex(B) - SongCurrent)/VS = Abstand zum MIttleren Cover in %
- }
//Change Pos of all Buttons
for B := low(Button) to high(Button) do
@@ -1752,7 +1697,7 @@ begin else if (Pos > VS/2) then
Pos := Pos - VS;
- if (Abs(Pos) < 2.5) then {fixed Positions}
+ if (Abs(Pos) < 2.5) then //fixed Positions
begin
Angle := Pi * (Pos / 5);
//Button[B].Visible := False;
@@ -1764,7 +1709,8 @@ begin Button[B].Z := 0.95 - Abs(Pos) * 0.01;
- Button[B].Y := (Theme.Song.Cover.Y + (Theme.Song.Cover.H - Abs(Theme.Song.Cover.H * cos(Angle))) * 0.5);
+ Button[B].Y := (Theme.Song.Cover.Y +
+ (Theme.Song.Cover.H - Abs(Theme.Song.Cover.H * cos(Angle))) * 0.5);
Button[B].W := Button[B].H;
@@ -1777,7 +1723,7 @@ begin end
else
- begin {Behind the Front Covers}
+ begin //Behind the Front Covers
// Button[B].Visible := False;
// if VS/2-abs(Pos)>VS*0.4 then Button[B].Visible := False;
@@ -1799,7 +1745,7 @@ begin // Button[B].Reflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
Button[B].DeSelectReflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
- Diff := (Button[B].H - Theme.Song.Cover.H)/2;
+ //Diff := (Button[B].H - Theme.Song.Cover.H)/2;
Button[B].X := Theme.Song.Cover.X+Theme.Song.Cover.H/2-Button[b].H/2 + (Theme.Song.Cover.H)*sin(Angle/2)*1.52;
@@ -1810,8 +1756,95 @@ begin end;
end;
+end; }
+
+//new version from 1.1 (copy)
+procedure TScreenSong.SetScroll5;
+var
+ B: integer;
+ Angle: real;
+ Pos: real;
+ VS: integer;
+ Padding: real;
+ X: real;
+ {
+ Theme.Song.CoverW: circle radius
+ Theme.Song.CoverX: x-pos. of the left edge of the selected cover
+ Theme.Song.CoverY: y-pos. of the upper edge of the selected cover
+ Theme.Song.CoverH: cover height
+ }
+begin
+ VS := CatSongs.VisibleSongs();
+
+ // Update positions of all buttons
+ for B := 0 to High(Button) do
+ begin
+ Button[B].Visible := CatSongs.Song[B].Visible; // adjust visibility
+ if Button[B].Visible then // Only change pos for visible buttons
+ begin
+ // Pos is the distance to the centered cover in the range [-VS/2..+VS/2]
+ Pos := (CatSongs.VisibleIndex(B) - SongCurrent);
+ if (Pos < -VS/2) then
+ Pos := Pos + VS
+ else if (Pos > VS/2) then
+ Pos := Pos - VS;
+
+ // Avoid overlapping of the front covers.
+ // Use an alternate position for the five front covers.
+ if (Abs(Pos) < 2.5) then
+ begin
+ Angle := Pi * (Pos / 5); // Range: (-1/4*Pi .. +1/4*Pi)
+
+ Button[B].H := Abs(Theme.Song.Cover.H * cos(Angle*0.8));
+ Button[B].W := Button[B].H;
+
+ //Button[B].Reflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
+ Button[B].DeSelectReflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
+
+ Padding := (Button[B].H - Theme.Song.Cover.H)/2;
+ X := Sin(Angle*1.3) * 0.9;
+
+ Button[B].X := Theme.Song.Cover.X + Theme.Song.Cover.W * X - Padding;
+ Button[B].Y := (Theme.Song.Cover.Y + (Theme.Song.Cover.H - Abs(Theme.Song.Cover.H * cos(Angle))) * 0.5);
+ Button[B].Z := 0.95 - Abs(Pos) * 0.01;
+ end
+ { only draw 3 visible covers in the background
+ (the 3 that are on the opposite of the front covers}
+ else if (Abs(Pos) > floor(VS/2) - 1.5) then
+ begin
+ // Transform Pos to range [-1..-3/4, +3/4..+1]
+ { the 3 covers at the back will show up in the gap between the
+ front cover and its neighbors
+ one cover will be hiddenbehind the front cover,
+ but this will not be a lack of performance ;) }
+ if Pos < 0 then
+ Pos := (Pos - 2 + ceil(VS/2))/8 - 0.75
+ else
+ Pos := (Pos + 2 - floor(VS/2))/8 + 0.75;
+
+ // angle in radians [-2Pi..-Pi, +Pi..+2Pi]
+ Angle := 2*Pi * Pos;
+
+ Button[B].H := 0.6*(Theme.Song.Cover.H-Abs(Theme.Song.Cover.H * cos(Angle/2)*0.8));
+ Button[B].W := Button[B].H;
+
+ Padding := (Button[B].H - Theme.Song.Cover.H)/2;
+
+ Button[B].X := Theme.Song.Cover.X+Theme.Song.Cover.H/2-Button[b].H/2+Theme.Song.Cover.W/320*((Theme.Song.Cover.H)*sin(Angle/2)*1.52);
+ Button[B].Y := Theme.Song.Cover.Y - (Button[B].H - Theme.Song.Cover.H)*0.75;
+ Button[B].Z := (0.4 - Abs(Pos/4)) -0.00001; //z < 0.49999 is behind the cover 1 is in front of the covers
+
+ //Button[B].Reflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
+ Button[B].DeSelectReflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H;
+ end
+ { all other covers are not visible }
+ else
+ Button[B].Visible := false;
+ end;
+ end;
end;
+
procedure TScreenSong.onShow;
var
I: Integer;
@@ -2381,7 +2414,6 @@ end; procedure TScreenSong.DrawAspect();
var
- txt: PChar;
w, h: real;
str: string;
@@ -2408,21 +2440,20 @@ begin glColor4f(1, 1, 1, 1);
- h := 11*ScreenH/RenderH;
+ h := 12;
SetFontStyle(1); SetFontItalic(false); SetFontSize(h); w := glTextWidth(PChar(str)); - SetFontPos (RenderW/2-w/2, 20); - txt := Addr(str[1]); - glPrint(txt);
+ SetFontPos (RenderW/2-w/2, 21); + glPrint(PChar(str));
end;
procedure TScreenSong.SelectNext;
var
Skip, Skip2: integer;
- I: integer;
+ //I: integer;
VS: Integer;
begin
VS := CatSongs.VisibleSongs;
@@ -2524,18 +2555,8 @@ begin end;
end;
-procedure TScreenSong.UpdateLCD;
-begin{
- LCD.HideCursor;
- LCD.Clear;
- LCD.WriteText(1, Text[TextArtist].Text);
- LCD.WriteText(2, Text[TextTitle].Text); }
-end;
-
//Procedure Change current played Preview
procedure TScreenSong.ChangeMusic;
-var
- I: integer;
begin
//When Music Preview is avtivated -> then Change Music
if (Ini.PreviewVolume <> 0) then
@@ -2543,6 +2564,7 @@ begin if (NOT CatSongs.Song[Interaction].Main) AND(CatSongs.VisibleSongs > 0) then
begin
Music.Close;
+ acClose;
if Music.Open(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Mp3) then
begin
if (CatSongs.Song[Interaction].PreviewStart>0) then
@@ -2671,7 +2693,7 @@ begin FixSelected2;
end;
-procedure TScreenSong.SkipTo2(Target: Cardinal); //new
+procedure TScreenSong.SkipTo2(Target: Integer); //new
begin
UnLoadDetailedCover;
@@ -3002,7 +3024,6 @@ begin Music.PlayChange;
ChangeMusic;
SetScroll;
- UpdateLCD;
end;
//do Joker in M2-MOD mode
@@ -3033,9 +3054,6 @@ begin end;
procedure TScreenSong.SetJoker;
-var
- h, x, y: real;
- ptxt: pchar;
begin
//If Party Mode
if Mode = smParty then //Show Joker that are available
@@ -3363,14 +3381,94 @@ begin Texture.UnloadTexture(Button[Interaction].Texture.Name, false);
end;
-procedure TScreenSong.Refresh;
-begin {
-CatSongs.Refresh;
-CatSongs.ShowCategoryList;
-Interaction := 0;
-SelectNext;
-FixSelected; }
+procedure TScreenSong.Refresh(GiveStats: boolean);
+var
+ Pet: integer;
+ I: integer;
+Label CreateSongButtons;
+
+begin
+ ClearButtons();
+ CatSongs.Refresh;
+
+ if (length(CatSongs.Song) > 0) then
+ begin
+ //Set Length of Button Array one Time Instead of one time for every Song
+ SetButtonLength(Length(CatSongs.Song));
+
+ I := 0;
+ Pet := 0;
+ CreateSongButtons:
+
+ try
+ for Pet := I to High(CatSongs.Song) do
+ begin // creating all buttons
+ // new
+ Texture.Limit := 512;// 256 0.4.2 value, 512 in 0.5.0
+
+ if not FileExists(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover) then
+ CatSongs.Song[Pet].Cover := ''; // 0.5.0: if cover not found then show 'no cover'
+
+ if CatSongs.Song[Pet].Cover = '' then
+ AddButton(300 + Pet*250, 140, 200, 200, Skin.GetTextureFileName('SongCover'), 'JPG', 'Plain', Theme.Song.Cover.Reflections)
+ else begin
+ // cache texture if there is a need to this
+ if not Covers.CoverExists(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover) then begin
+ Texture.CreateCacheMipmap := true;
+ Texture.GetTexture(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, 'Plain', true); // preloads textures and creates cache mipmap
+ Texture.CreateCacheMipmap := false;
+
+ // puts this texture to the cache file
+ Covers.AddCover(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover);
+
+ // unload full size texture
+ Texture.UnloadTexture(CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, false);
+
+ // we should also add mipmap texture by calling createtexture and use mipmap cache as data source
+ end;
+
+ // and now load it from cache file (small place for the optimization by eliminating reading it from file, but not here)
+ AddButton(300 + Pet*250, 140, 200, 200, CatSongs.Song[Pet].Path + CatSongs.Song[Pet].Cover, 'JPG', 'Plain', Theme.Song.Cover.Reflections);
+ end;
+ Texture.Limit := 1024*1024;
+ I := -1;
+ if GiveStats then
+ begin
+ if (Pet mod 10 = 0) then
+ UpdateScreenLoading('Songs: '+IntToStr(Pet));
+ end;
+
+ end;
+ except
+ //When Error is reported the First time for this Song
+ if (I <> Pet) then
+ begin
+ //Some Error reporting:
+ Log.LogError('Could not load Cover: ' + CatSongs.Song[Pet].Cover);
+
+ //Change Cover to NoCover and Continue Loading
+ CatSongs.Song[Pet].Cover := '';
+ I := Pet;
+ end
+ else //when Error occurs Multiple Times(NoSong Cover is damaged), then start loading next Song
+ begin
+ Log.LogError('NoCover Cover is damaged!');
+ try
+ AddButton(300 + Pet*250, 140, 200, 200, '', 'JPG', 'Plain', Theme.Song.Cover.Reflections);
+ except
+ Messagebox(0, PChar('No Cover Image is damage. Could not Workaround Song Loading, Ultrastar will exit now.'), PChar(Language.Translate('US_VERSION')), MB_ICONERROR or MB_OK);
+ Halt;
+ end;
+ I := Pet + 1;
+ end;
+ end;
+
+ if (I <> -1) then
+ GoTo CreateSongButtons;
+
+ end;
+ FixSelected;
end;
function TScreenSong.getVisibleMedleyArr(MinS: TMedleySource): TVisArr;
diff --git a/Game/Code/Screens/UScreenSongJumpto.pas b/Game/Code/Screens/UScreenSongJumpto.pas index e1a24ddf..ed86757b 100644 --- a/Game/Code/Screens/UScreenSongJumpto.pas +++ b/Game/Code/Screens/UScreenSongJumpto.pas @@ -104,6 +104,11 @@ begin CatSongs.SetFilter('', 0);
SetTextFound(0);
end;
+ if(ScreenSong.Mode = smNormal) and not ScreenSong.MakeMedley then
+ begin
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
+ end;
end;
// Up and Down could be done at the same time,
@@ -142,8 +147,8 @@ begin end;
constructor TScreenSongJumpto.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index ccf14978..ccd9d07c 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -134,6 +134,12 @@ begin begin
Music.PlayBack;
Visible := False;
+ if(ScreenSong.Mode = smNormal) and not ScreenSong.MakeMedley then
+ begin
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
+ end;
+ CatSongs.Selected := Interaction;
end;
SDLK_RETURN:
@@ -192,8 +198,8 @@ begin end;
constructor TScreenSongMenu.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
@@ -540,6 +546,8 @@ begin 4: //Button 4
begin
PlaylistMan.AddItem(ScreenSong.Interaction, SelectValue);
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
end;
@@ -559,6 +567,8 @@ begin PlaylistMan.AddItem(
ScreenSong.Interaction,
PlaylistMan.AddPlaylist(Button[0].Text[0].Text));
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
@@ -570,6 +580,8 @@ begin 4: //Button 4
begin
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
end;
@@ -583,6 +595,8 @@ begin begin
//Delete
PlayListMan.DelItem(PlayListMan.GetIndexbySongID(ScreenSong.Interaction));
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
@@ -604,6 +618,8 @@ begin begin
//Load Playlist
PlaylistMan.SetPlayList(SelectValue);
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
end;
@@ -617,6 +633,8 @@ begin begin
//Delete
PlayListMan.DelPlaylist(PlaylistMan.CurPlayList);
+ ScreenSong.WaitHandler.changed := true;
+ ScreenSong.WaitHandler.change_time := 0;
Visible := False;
end;
diff --git a/Game/Code/Screens/UScreenStatMain.pas b/Game/Code/Screens/UScreenStatMain.pas index b82e655c..68eac441 100644 --- a/Game/Code/Screens/UScreenStatMain.pas +++ b/Game/Code/Screens/UScreenStatMain.pas @@ -84,8 +84,8 @@ begin end;
constructor TScreenStatMain.Create;
-var
- I: integer;
+{var
+ I: integer;}
begin
inherited Create;
@@ -114,16 +114,19 @@ begin AddButtonText(14, 20, Theme.Options.Description[4]);
Interaction := 0;
+end;
+procedure TScreenStatMain.onShow;
+var
+ I: Integer;
+
+begin
//Set Songs with Vid
SongswithVid := 0;
For I := 0 to high(Songs.Song) do
if (Songs.Song[I].Video <> '') then
Inc(SongswithVid);
-end;
-procedure TScreenStatMain.onShow;
-begin
//Set Overview Text:
SetOverview;
if not Help.SetHelpID(ID) then
@@ -133,7 +136,7 @@ end; procedure TScreenStatMain.SetOverview;
var
Overview, Formatstr: String;
- I: Integer;
+ //I: Integer;
//Some Vars to Save Attributes to
A1, A2, A3: Integer;
A4, A5: String;
diff --git a/Game/Code/Screens/UScreenTop.pas b/Game/Code/Screens/UScreenTop.pas index 57005d95..e2e36d64 100644 --- a/Game/Code/Screens/UScreenTop.pas +++ b/Game/Code/Screens/UScreenTop.pas @@ -3,7 +3,7 @@ unit UScreenTop; interface
uses
- UMenu, SDL, SysUtils, UDisplay, UMusic, USongs, UThemes, ULCD, ModiSDK;
+ UMenu, SDL, SysUtils, UDisplay, UMusic, USongs, UThemes, ModiSDK;
type
THandler = record
@@ -250,4 +250,4 @@ begin MP3VolumeHandler.changed := false;
end;
-end.
+end.
\ No newline at end of file |