diff options
author | basisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2015-09-07 00:11:32 +0000 |
---|---|---|
committer | basisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2015-09-07 00:11:32 +0000 |
commit | 3eb83d6110761ac8c8efae4baaa231be3bfa64e4 (patch) | |
tree | f221afe626f5b5d399e9fc5449c6021350b35e4d /src | |
parent | a1cc9838fa20ec350c06534ce34b493fdc9fbb6d (diff) | |
download | usdx-3eb83d6110761ac8c8efae4baaa231be3bfa64e4.tar.gz usdx-3eb83d6110761ac8c8efae4baaa231be3bfa64e4.tar.xz usdx-3eb83d6110761ac8c8efae4baaa231be3bfa64e4.zip |
* show CallStack on unhandled application error
* do not show Top 5 Screen when there are no scores to show
* first UThemes changes for duett and fixes for jukebox
* first step of standardizing the function-keys in JukeBox: press r to randomize/mix the playlist or press j and start typing for song search
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3131 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/base/UThemes.pas | 81 | ||||
-rw-r--r-- | src/screens/UScreenJukebox.pas | 123 | ||||
-rw-r--r-- | src/screens/UScreenTop5.pas | 2 | ||||
-rw-r--r-- | src/ultrastardx.dpr | 16 |
4 files changed, 152 insertions, 70 deletions
diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas index 7bf4a4e5..b9ec8bb0 100644 --- a/src/base/UThemes.pas +++ b/src/base/UThemes.pas @@ -106,7 +106,7 @@ type Y: integer; W: integer; Z: real; - Color: string; + Color: string; DColor: string; ColR: real; ColG: real; @@ -228,6 +228,13 @@ type ButtonCollection: AThemeButtonCollection; end; + TThemeBox = record + X: integer; + Y: integer; + W: integer; + H: integer; + end; + TThemeLoading = class(TThemeBasic) StaticAnimation: TThemeStatic; TextLoading: TThemeText; @@ -269,7 +276,10 @@ type MedleyIcon: TThemeStatic; CalculatedMedleyIcon: TThemeStatic; - //Show Cat in TopLeft Mod + //Duet Icon + DuetIcon: TThemeStatic; + + //Show Cat in TopLeft Mod TextCat: TThemeText; StaticCat: TThemeStatic; @@ -295,6 +305,17 @@ type StaticNonParty: AThemeStatic; TextNonParty: AThemeText; + //Screen Song Scores + TextScore: TThemeText; + TextMaxScore: TThemeText; + TextMediaScore: TThemeText; + TextMaxScore2: TThemeText; + TextMediaScore2: TThemeText; + TextScoreUser: TThemeText; + TextMaxScoreLocal: TThemeText; + TextMediaScoreLocal: TThemeText; + TextScoreUserLocal: TThemeText; + //Party Mode StaticTeam1Joker1: TThemeStatic; StaticTeam1Joker2: TThemeStatic; @@ -313,6 +334,10 @@ type StaticTeam3Joker5: TThemeStatic; + StaticDuetSingerP1: TThemeStatic; + StaticDuetSingerP2: TThemeStatic; + TextDuetSingerP1: TThemeText; + TextDuetSingerP2: TThemeText; end; TThemeSing = class(TThemeBasic) @@ -371,7 +396,12 @@ type LineBonusText: array [0..8] of UTF8String; //Pause Popup - PausePopUp: TThemeStatic; + PausePopUp: TThemeStatic; + + InfoMessageText: TThemeText; + InfoMessageBG: TThemeStatic; + + StaticDuet: AThemeStatic; end; TThemeJukebox = class(TThemeBasic) @@ -407,6 +437,11 @@ type LowerX, LowerW, LowerY, LowerH : integer; end; + TThemeLyricBarDuet = record + IndicatorYOffset, UpperX, UpperW, UpperY, UpperH, + LowerX, LowerW, LowerY, LowerH : integer; + end; + TThemeLyricBarJukebox = record IndicatorYOffset, UpperX, UpperW, UpperY, UpperH, LowerX, LowerW, LowerY, LowerH : integer; @@ -473,7 +508,7 @@ type ButtonExit: TThemeButton; TextDescription: TThemeText; - Description: array[0..7] of UTF8String; + Description: array[0..9] of UTF8String; end; TThemeOptionsGame = class(TThemeBasic) @@ -571,6 +606,7 @@ type Button2: TThemeButton; Button3: TThemeButton; Button4: TThemeButton; + Button5: TThemeButton; SelectSlide3: TThemeSelectSlide; @@ -795,6 +831,7 @@ type Song: TThemeSong; Sing: TThemeSing; LyricBar: TThemeLyricBar; + LyricBarDuet: TThemeLyricBarDuet; LyricBarJukebox: TThemeLyricBarJukebox; Jukebox: TThemeJukebox; Score: TThemeScore; @@ -880,6 +917,7 @@ var //Skin: TSkin; Theme: TTheme; Color: array of TColor; + LastC: integer; implementation @@ -1037,7 +1075,7 @@ end; function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; var - I: integer; + I, J: integer; begin Result := false; @@ -1140,6 +1178,9 @@ begin ThemeLoadStatic(Song.MedleyIcon, 'SongMedleyIcon'); ThemeLoadStatic(Song.CalculatedMedleyIcon, 'SongCalculatedMedleyIcon'); + //Duet Icon + ThemeLoadStatic(Song.DuetIcon, 'SongDuetIcon'); + //Show Cat in TopLeft Mod ThemeLoadStatic(Song.StaticCat, 'SongStaticCat'); ThemeLoadText(Song.TextCat, 'SongTextCat'); @@ -1162,6 +1203,12 @@ begin ThemeLoadStatics (Song.StaticNonParty, 'SongStaticNonParty'); ThemeLoadTexts (Song.TextNonParty, 'SongTextNonParty'); + // Duet Singers + ThemeLoadStatic (Song.StaticDuetSingerP1, 'SongStaticDuetSingerP1'); + ThemeLoadStatic (Song.StaticDuetSingerP2, 'SongStaticDuetSingerP2'); + ThemeLoadText (Song.TextDuetSingerP1, 'SongTextDuetSingerP1'); + ThemeLoadText (Song.TextDuetSingerP2, 'SongTextDuetSingerP2'); + //Party Mode ThemeLoadStatic(Song.StaticTeam1Joker1, 'SongStaticTeam1Joker1'); ThemeLoadStatic(Song.StaticTeam1Joker2, 'SongStaticTeam1Joker2'); @@ -1193,6 +1240,17 @@ begin LyricBar.LowerY := ThemeIni.ReadInteger('SingLyricsLowerBar', 'Y', 0); LyricBar.LowerH := ThemeIni.ReadInteger('SingLyricsLowerBar', 'H', 0); + //LyricBarDuet + LyricBarDuet.UpperX := ThemeIni.ReadInteger('SingLyricsDuetUpperBar', 'X', 0); + LyricBarDuet.UpperW := ThemeIni.ReadInteger('SingLyricsDuetUpperBar', 'W', 0); + LyricBarDuet.UpperY := ThemeIni.ReadInteger('SingLyricsDuetUpperBar', 'Y', 0); + LyricBarDuet.UpperH := ThemeIni.ReadInteger('SingLyricsDuetUpperBar', 'H', 0); + LyricBarDuet.IndicatorYOffset := ThemeIni.ReadInteger('SingLyricsDuetUpperBar', 'IndicatorYOffset', 0); + LyricBarDuet.LowerX := ThemeIni.ReadInteger('SingLyricsDuetLowerBar', 'X', 0); + LyricBarDuet.LowerW := ThemeIni.ReadInteger('SingLyricsDuetLowerBar', 'W', 0); + LyricBarDuet.LowerY := ThemeIni.ReadInteger('SingLyricsDuetLowerBar', 'Y', 0); + LyricBarDuet.LowerH := ThemeIni.ReadInteger('SingLyricsDuetLowerBar', 'H', 0); + // Lyric Jukebox LyricBarJukebox.UpperX := ThemeIni.ReadInteger('JukeboxLyricsUpperBar', 'X', 0); LyricBarJukebox.UpperW := ThemeIni.ReadInteger('JukeboxLyricsUpperBar', 'W', 0); @@ -1233,6 +1291,9 @@ begin // Sing ThemeLoadBasic(Sing, 'Sing'); + + ThemeLoadStatics (Sing.StaticDuet, 'SingStaticDuet'); + //TimeBar mod ThemeLoadStatic(Sing.StaticTimeProgress, 'SingTimeProgress'); ThemeLoadText(Sing.TextTimeText, 'SingTimeText'); @@ -1771,6 +1832,7 @@ begin ThemeText.Text := Language.Translate(ThemeIni.ReadString(Name, 'Text', '')); ThemeText.Color := ThemeIni.ReadString(Name, 'Color', ''); + ThemeText.DColor := ThemeIni.ReadString(Name, 'DColor', ''); //Reflection ThemeText.Reflection := (ThemeIni.ReadInteger(Name, 'Reflection', 0)) = 1; @@ -1783,6 +1845,15 @@ begin ThemeText.ColG := Color[C].RGB.G; ThemeText.ColB := Color[C].RGB.B; end; + + C := ColorExists(ThemeText.DColor); + if C >= 0 then + begin + ThemeText.DColR := Color[C].RGB.R; + ThemeText.DColG := Color[C].RGB.G; + ThemeText.DColB := Color[C].RGB.B; + end; + end; procedure TTheme.ThemeLoadTexts(var ThemeText: AThemeText; const Name: string); diff --git a/src/screens/UScreenJukebox.pas b/src/screens/UScreenJukebox.pas index 8e4b7712..d282d979 100644 --- a/src/screens/UScreenJukebox.pas +++ b/src/screens/UScreenJukebox.pas @@ -116,7 +116,7 @@ type JukeboxTextTimeText: integer;
JukeboxTextTimeDesc: integer;
- //JukeboxTextSongText: integer;
+ JukeboxTextSongText: integer; //Button of Songtitle
SongFinish: boolean;
@@ -489,14 +489,14 @@ begin OrderMode := false;
Button[JukeboxSongListOrder].SetSelect(false);
try
- //Button[JukeboxSongListOrder].Text[0].Text := Language.Translate('OPTION_VALUE_ARTIST'); /hackyhack
+ Button[JukeboxSongListOrder].Text[0].Text := Language.Translate('OPTION_VALUE_ARTIST');
finally
end;
end;
end;
- //Button[JukeboxFindSong].Text[0].Text := ''; /hackyhack
+ Button[JukeboxFindSong].Text[0].Text := '';
Button[JukeboxLyric].SetSelect(true);
Button[JukeboxRandomSongList].SetSelect(false);
@@ -610,6 +610,57 @@ begin Inc(fTimebarMode);
Exit;
end;
+
+ // allow search for songs
+ Ord('J'):
+ begin
+ LastTick := SDL_GetTicks();
+ FindSongList := not FindSongList;
+ if (Filter = '') then
+ begin
+ if (FindSongList) then
+ Button[JukeboxFindSong].Text[0].Text := '';
+ end;
+ Button[JukeboxFindSong].SetSelect(FindSongList);
+ if FindSongList then
+ FilterSongList(Filter)
+ else
+ FilterSongList('');
+ Exit;
+ end;
+
+ //Randomixe Playlist
+ Ord('R'):
+ begin
+ if (SongListVisible) then
+ begin
+ LastTick := SDL_GetTicks();
+
+ Button[JukeboxRandomSongList].SetSelect(true);
+ Button[JukeboxSongListOrder].SetSelect(false);
+
+ RandomMode := true;
+ OrderMode := false;
+
+ for I := 0 to High(JukeboxVisibleSongs) * 2 do
+ begin
+ RValueI := RandomRange(0, High(JukeboxVisibleSongs) + 1);
+ RValueE := RandomRange(0, High(JukeboxVisibleSongs) + 1);
+
+ tmp := JukeboxVisibleSongs[RValueI];
+ JukeboxVisibleSongs[RValueI] := JukeboxVisibleSongs[RValueE];
+ JukeboxVisibleSongs[RValueE] := tmp;
+
+ if (RValueI = CurrentSongList) then
+ CurrentSongList := RValueE
+ else
+ begin
+ if (RValueE = CurrentSongList) then
+ CurrentSongList := RValueI;
+ end;
+ end;
+ end;
+ end;
end;
end;
@@ -704,65 +755,6 @@ begin end;
end;
- SDLK_F:
- begin
-
- if (SongListVisible) and (SDL_ModState = KMOD_LCTRL) then
- begin
- LastTick := SDL_GetTicks();
-
- FindSongList := not FindSongList;
-
- if (Filter = '') then
- begin
- if (FindSongList) then
- Button[JukeboxFindSong].Text[0].Text := ''
- end;
-
- Button[JukeboxFindSong].SetSelect(FindSongList);
-
- if not (FindSongList) then
- FilterSongList('')
- else
- FilterSongList(Filter);
-
- Exit;
- end;
- end;
-
- SDLK_R:
- begin
-
- if (SongListVisible) and (SDL_ModState = KMOD_LCTRL) then
- begin
- LastTick := SDL_GetTicks();
-
- Button[JukeboxRandomSongList].SetSelect(true);
- Button[JukeboxSongListOrder].SetSelect(false);
-
- RandomMode := true;
- OrderMode := false;
-
- for I := 0 to High(JukeboxVisibleSongs) * 2 do
- begin
- RValueI := RandomRange(0, High(JukeboxVisibleSongs) + 1);
- RValueE := RandomRange(0, High(JukeboxVisibleSongs) + 1);
-
- tmp := JukeboxVisibleSongs[RValueI];
- JukeboxVisibleSongs[RValueI] := JukeboxVisibleSongs[RValueE];
- JukeboxVisibleSongs[RValueE] := tmp;
-
- if (RValueI = CurrentSongList) then
- CurrentSongList := RValueE
- else
- begin
- if (RValueE = CurrentSongList) then
- CurrentSongList := RValueI;
- end;
- end;
- end;
- end;
-
SDLK_ESCAPE:
begin
if (SongListVisible) then
@@ -1097,7 +1089,7 @@ begin JukeboxTextTimeText := AddText(Theme.Jukebox.TextTimeText);
JukeboxTextTimeDesc := AddText(Theme.Jukebox.TextTimeDesc);
-// JukeboxTextSongText := AddText(Theme.Jukebox.TextSongText);
+ JukeboxTextSongText := AddText(Theme.Jukebox.TextSongText);
PosY := Theme.Jukebox.SongDescription.Y;
for I := 0 to 9 do
@@ -1531,7 +1523,7 @@ begin Text[JukeboxTextTimeText].Draw;
Text[JukeboxTextTimeDesc].Draw;
- // Text[JukeboxTextSongText].Draw;
+ Text[JukeboxTextSongText].Draw;
// options desc
Text[JukeboxTextOptionsSongPosition].Draw;
@@ -1713,6 +1705,9 @@ begin Lyrics.AddLine(@Lines[0].Line[Lyrics.LineCounter]);
end;
+ Text[JukeboxTextSongText].Visible := true;
+ Text[JukeboxTextSongText].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title;
+
Max := 9;
if (High(JukeboxVisibleSongs) < 9) then
diff --git a/src/screens/UScreenTop5.pas b/src/screens/UScreenTop5.pas index 75b9f160..97ad7ea7 100644 --- a/src/screens/UScreenTop5.pas +++ b/src/screens/UScreenTop5.pas @@ -214,6 +214,8 @@ begin Text[TextDate[I]].Text := CurrentSong.Score[Ini.Difficulty, I-1].Date; end; + If Length(CurrentSong.Score[Ini.Difficulty])=0 then + FadeTo(@ScreenSong); //if there are no scores to show, go to next screen for I := Length(CurrentSong.Score[Ini.Difficulty]) + 1 to 5 do begin Statics[StaticNumber[I]].Visible := false; diff --git a/src/ultrastardx.dpr b/src/ultrastardx.dpr index d798d632..d5cf85e6 100644 --- a/src/ultrastardx.dpr +++ b/src/ultrastardx.dpr @@ -354,13 +354,27 @@ uses const sLineBreak = {$IFDEF LINUX} AnsiChar(#10) {$ENDIF} {$IFDEF MSWINDOWS} AnsiString(#13#10) {$ENDIF}; +var + I: Integer; + Report: string; + begin try Main; except on E : Exception do begin - ShowMessage('Exception class name = '+E.ClassName+sLineBreak+'Exception message = '+E.Message); + Report := 'Sorry, an error ocurred! Please report this error to the game-developers. Also check the Error.log file in the game folder.' + LineEnding + + 'Stacktrace:' + LineEnding; + if E <> nil then begin + Report := Report + 'Exception class: ' + E.ClassName + LineEnding + + 'Message: ' + E.Message + LineEnding; + end; + Report := Report + BackTraceStrFunc(ExceptAddr); + for I := 0 to ExceptFrameCount - 1 do + Report := Report + LineEnding + BackTraceStrFunc(ExceptFrames[I]); + ShowMessage(Report); + Halt; end; end; end. |