aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbasisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c>2015-09-14 00:11:19 +0000
committerbasisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c>2015-09-14 00:11:19 +0000
commit5a01e129266afda8614b766147606e3d318fc89c (patch)
tree47bed9c239720b44aeced53bdac3f23003be4e58 /src
parent8ace847c2b8bbe70c7225540ae8ded1366196e11 (diff)
downloadusdx-5a01e129266afda8614b766147606e3d318fc89c.tar.gz
usdx-5a01e129266afda8614b766147606e3d318fc89c.tar.xz
usdx-5a01e129266afda8614b766147606e3d318fc89c.zip
* added texts and English+German translation for JukeBox
* write to log if a skin-texture can't be found / loaded * implemented search-feature in jukebox-mode similar to the search feature in normal mode * fixed bunch of bugs in jukebox mode that existed in usdx wp * jukebox mode: start playing full playlist when user presses enter after doing a search without results instead of crashing * repeat playlist by default in jukebox mode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3137 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/base/UPath.pas3
-rw-r--r--src/base/USkins.pas2
-rw-r--r--src/screens/UScreenJukebox.pas157
3 files changed, 64 insertions, 98 deletions
diff --git a/src/base/UPath.pas b/src/base/UPath.pas
index 77ccd65d..6708262f 100644
--- a/src/base/UPath.pas
+++ b/src/base/UPath.pas
@@ -36,6 +36,7 @@ interface
uses
SysUtils,
Classes,
+ TntSysUtils,
IniFiles,
{$IFDEF MSWINDOWS}
TntClasses,
@@ -667,7 +668,7 @@ begin
if (IsNativeUTF8()) then
Result := fName
else
- Result := Utf8ToAnsi(fName);
+ Result := Utf8ToAnsi(fName); //basisbit hackyhack - rteverted already
end;
function TPathImpl.GetDrive(): IPath;
diff --git a/src/base/USkins.pas b/src/base/USkins.pas
index a909b081..6d8c2ebf 100644
--- a/src/base/USkins.pas
+++ b/src/base/USkins.pas
@@ -187,7 +187,7 @@ begin
if (TextureName <> '') and (Result.IsSet) then
begin
//Log.LogError('', '-----------------------------------------');
- //Log.LogError(TextureName+' - '+ Result, 'TSkin.GetTextureFileName');
+ Log.LogError('Was not able to retrieve Texture for ' + TextureName + ' - ' + Result.ToNative, 'TSkin.GetTextureFileName');
end;
end;
diff --git a/src/screens/UScreenJukebox.pas b/src/screens/UScreenJukebox.pas
index d282d979..ae0eacad 100644
--- a/src/screens/UScreenJukebox.pas
+++ b/src/screens/UScreenJukebox.pas
@@ -614,19 +614,19 @@ begin
// allow search for songs
Ord('J'):
begin
- LastTick := SDL_GetTicks();
- FindSongList := not FindSongList;
- if (Filter = '') then
+ if (SongListVisible) then
begin
- if (FindSongList) then
- Button[JukeboxFindSong].Text[0].Text := '';
+ LastTick := SDL_GetTicks();
+ FindSongList := not FindSongList;
+ if (Filter = '') and (FindSongList) then
+ Button[JukeboxFindSong].Text[0].Text := '';
+ Button[JukeboxFindSong].SetSelect(FindSongList);
+ if FindSongList then
+ FilterSongList(Filter)
+ else
+ FilterSongList('');
+ Exit;
end;
- Button[JukeboxFindSong].SetSelect(FindSongList);
- if FindSongList then
- FilterSongList(Filter)
- else
- FilterSongList('');
- Exit;
end;
//Randomixe Playlist
@@ -758,7 +758,14 @@ begin
SDLK_ESCAPE:
begin
if (SongListVisible) then
- SongListVisible := false
+ begin
+ SongListVisible := false;
+ FindSongList := false;
+ Button[JukeboxFindSong].SetSelect(FindSongList);
+ Filter:= '';
+ FilterSongList('');
+ Button[JukeboxFindSong].Text[0].Text := '';
+ end
else
ScreenPopupCheck.ShowPopup('MSG_END_JUKEBOX', OnEscapeJukebox, nil, false)
end;
@@ -769,6 +776,12 @@ begin
if (FindSongList) and (SongListVisible) then
begin
LastTick := SDL_GetTicks();
+ if (Filter = '') then
+ begin
+ FindSongList:=false;
+ Button[JukeboxFindSong].SetSelect(FindSongList);
+ Exit;
+ end;
Button[JukeboxFindSong].Text[0].DeleteLastLetter();
Filter := Button[JukeboxFindSong].Text[0].Text;
FilterSongList(Filter);
@@ -795,20 +808,24 @@ begin
if (SongListVisible) then
begin
LastTick := SDL_GetTicks();
+ if (FindSongList) then
+ begin
+ FindSongList:=false;
+ Button[JukeboxFindSong].SetSelect(FindSongList);
+ end;
+ if (High(JukeboxVisibleSongs) < 0) then
+ begin
+ FilterSongList('');
+ end;
CurrentSongList := ActualInteraction - 1;
Finish;
PlayMusic(CurrentSongList);
end;
+
end;
SDLK_LEFT:
begin
- {if not (SongListVisible) and (CurrentSongList > 0) then
- begin
- CurrentSongList := CurrentSongList - 2;
- PlayMusic(CurrentSongList);
- end;
- }
if (SDL_ModState = KMOD_LSHIFT) then
begin
fCurrentVideo.GetScreenPosition(X, Y, Z);
@@ -823,21 +840,12 @@ begin
SDLK_RIGHT:
begin
- {
- if not (SongListVisible) and (CurrentSongList < High(JukeboxVisibleSongs)) then
- begin
- CurrentSongList := CurrentSongList + 1;
- PlayMusic(CurrentSongList);
- end;
- }
-
if (SDL_ModState = KMOD_LSHIFT) then
begin
fCurrentVideo.GetScreenPosition(X, Y, Z);
fCurrentVideo.SetScreenPosition(X - 2, Y, Z);
fCurrentVideo.SetWidth(fCurrentVideo.GetWidth + 4);
end;
-
end;
SDLK_DELETE:
@@ -848,51 +856,6 @@ begin
end;
end;
- SDLK_PAGEDOWN:
- begin
- {if (SongListVisible) and ((ActualInteraction + 10) < High(JukeboxVisibleSongs)) then
- begin
-
- LastTick := SDL_GetTicks();
-
- // TODO: BUG AT END
- if (ListMin + 10 < High(JukeboxVisibleSongs) - 9 + Interaction) then
- begin
- ListMin := ListMin + 10;
- ActualInteraction := ActualInteraction + 10;
- end
- else
- begin
- ListMin := High(JukeboxVisibleSongs) - 9 + Interaction;
- ActualInteraction := High(JukeboxVisibleSongs) - 9 + Interaction;
- end;
-
- end;}
- end;
-
- SDLK_PAGEUP:
- begin
- {
- if (SongListVisible) and (ActualInteraction - 9 > 0) then
- begin
- if (ListMin > 10) then
- ListMin := ListMin - 10
- else
- ListMin := 0;
-
- ActualInteraction := ActualInteraction - 10;
-
- if (ActualInteraction < 10) then
- Interaction := ActualInteraction;
-
- LastTick := SDL_GetTicks();
- end;}
- end;
-
- // up and down could be done at the same time,
- // but i don't want to declare variables inside
- // functions like this one, called so many times
-
SDLK_DOWN:
begin
if (SongListVisible) then
@@ -1107,9 +1070,10 @@ begin
JukeboxSongListOrder := AddButton(Theme.Jukebox.SongListOrder);
JukeboxRandomSongList := AddButton(Theme.Jukebox.RandomSongList);
JukeboxLyric := AddButton(Theme.Jukebox.Lyric);
+ RepeatSongList := true;
Button[JukeboxFindSong].Selectable := false;
- Button[JukeboxRepeatSongList].Selectable := false;
+ Button[JukeboxRepeatSongList].Selectable := true;
Button[JukeboxSongListOrder].Selectable := false;
Button[JukeboxRandomSongList].Selectable := false;
Button[JukeboxLyric].Selectable := false;
@@ -1405,7 +1369,7 @@ begin
begin
if (RepeatSongList) then
begin
- // resyart playlist
+ // restart playlist
CurrentSongList := 0;
CatSongs.Selected := JukeboxVisibleSongs[CurrentSongList];
PlayMusic(CurrentSongList);
@@ -1705,8 +1669,8 @@ begin
Lyrics.AddLine(@Lines[0].Line[Lyrics.LineCounter]);
end;
- Text[JukeboxTextSongText].Visible := true;
- Text[JukeboxTextSongText].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title;
+ //Text[JukeboxTextSongText].Visible := true;
+ //Text[JukeboxTextSongText].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title;
Max := 9;
@@ -1769,31 +1733,32 @@ begin
Button[JukeboxRepeatSongList].Draw;
Button[JukeboxRandomSongList].Draw;
Button[JukeboxLyric].Draw;
+ try
+ for I := 0 to Max do
+ begin
+ Button[SongDescription[I]].Visible := true;
+ Button[SongDescription[I]].Selectable := true;
- for I := 0 to Max do
- begin
- Button[SongDescription[I]].Visible := true;
- Button[SongDescription[I]].Selectable := true;
+ SongDesc := CatSongs.Song[JukeboxVisibleSongs[I + ListMin]].Artist + ' - ' + CatSongs.Song[JukeboxVisibleSongs[I + ListMin]].Title;
- SongDesc := CatSongs.Song[JukeboxVisibleSongs[I + ListMin]].Artist + ' - ' + CatSongs.Song[JukeboxVisibleSongs[I + ListMin]].Title;
+ if (JukeboxVisibleSongs[I + ListMin] = CurrentSongID) and (I + ListMin <> ActualInteraction) then
+ begin
+ Button[SongDescription[I]].Text[0].ColR := SelectColR;
+ Button[SongDescription[I]].Text[0].ColG := SelectColG;
+ Button[SongDescription[I]].Text[0].ColB := SelectColB;
+ end
+ else
+ begin
+ Button[SongDescription[I]].Text[0].ColR := 1;
+ Button[SongDescription[I]].Text[0].ColG := 1;
+ Button[SongDescription[I]].Text[0].ColB := 1;
+ end;
- if (JukeboxVisibleSongs[I + ListMin] = CurrentSongID) and (I + ListMin <> ActualInteraction) then
- begin
- Button[SongDescription[I]].Text[0].ColR := SelectColR;
- Button[SongDescription[I]].Text[0].ColG := SelectColG;
- Button[SongDescription[I]].Text[0].ColB := SelectColB;
- end
- else
- begin
- Button[SongDescription[I]].Text[0].ColR := 1;
- Button[SongDescription[I]].Text[0].ColG := 1;
- Button[SongDescription[I]].Text[0].ColB := 1;
+ Button[SongDescription[I]].Text[0].Text := SongDesc;
+ Button[SongDescription[I]].Draw;
end;
-
- Button[SongDescription[I]].Text[0].Text := SongDesc;
- Button[SongDescription[I]].Draw;
+ finally
end;
-
end;
end.