aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 16:28:45 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 16:28:45 +0000
commit0d4f50f6a2ba32a0176d768646208dbec3136084 (patch)
treed8ce05435977a94d82c1cf61a5292add0af86b43
parentb8722c611ffaabde301f3134c1c8d76e64e3b02f (diff)
downloadusdx-0d4f50f6a2ba32a0176d768646208dbec3136084.tar.gz
usdx-0d4f50f6a2ba32a0176d768646208dbec3136084.tar.xz
usdx-0d4f50f6a2ba32a0176d768646208dbec3136084.zip
Fixed some Bugs in Skipto and Random Methods
Now the last Song of a Category could be the Result of Randomize when there is an odd number of Songs. Also a little bit better Random Results git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@85 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Game/Code/Screens/UScreenSong.pas18
1 files changed, 9 insertions, 9 deletions
diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas
index e873d287..7ea5d268 100644
--- a/Game/Code/Screens/UScreenSong.pas
+++ b/Game/Code/Screens/UScreenSong.pas
@@ -66,7 +66,7 @@ type
procedure SelectNext;
procedure SelectPrev;
procedure UpdateLCD;
- procedure SkipTo(Target: integer);
+ procedure SkipTo(Target: Cardinal);
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
@@ -208,7 +208,7 @@ begin
begin
if (CatSongs.Song[(I + Interaction) mod I2].Visible) AND (Length(CatSongs.Song[(I + Interaction) mod I2].Title)>0) AND (UpCase(CatSongs.Song[(I + Interaction) mod I2].Title[1]) = Letter) then
begin
- SkipTo(2 + CatSongs.VisibleIndex((I + Interaction) mod I2));
+ SkipTo(CatSongs.VisibleIndex((I + Interaction) mod I2));
Music.PlayChange;
@@ -521,7 +521,7 @@ begin
SelectNext;
//Fix: Not Existing Song selected:
- if (I+1=I2) then Inc(I2);
+ //if (I+1=I2) then Inc(I2);
//Choose Song
SkipTo(I2-I);
@@ -529,7 +529,7 @@ begin
end
else //Random in one Category
begin
- SkipTo(2+Random(CatSongs.VisibleSongs-1));
+ SkipTo(Random(CatSongs.VisibleSongs));
end;
Music.PlayChange;
@@ -1324,7 +1324,7 @@ begin
Music.Stop;
end;
-procedure TScreenSong.SkipTo(Target: integer); // 0.5.0
+procedure TScreenSong.SkipTo(Target: Cardinal); // 0.5.0
var
Skip: integer;
I: integer;
@@ -1339,7 +1339,7 @@ begin
Interaction := 0;
SongTarget := 0;
- for I := 2 to Target do
+ for I := 1 to Target+1 do
SelectNext;
FixSelected2;
@@ -1481,7 +1481,7 @@ begin
SelectNext;
//Fix: Not Existing Song selected:
- if (I+1=I2) then Inc(I2);
+ //if (I+1=I2) then Inc(I2);
//Choose Song
SkipTo(I2-I);
@@ -1495,7 +1495,7 @@ begin
SelectNext;
FixSelected;
- SkipTo(2+Random(CatSongs.VisibleSongs-1));
+ SkipTo(Random(CatSongs.VisibleSongs));
Music.PlayChange;
ChangeMusic;
SetScroll4;
@@ -1505,7 +1505,7 @@ begin
begin
PlaylistMan.SetPlayList(PlaylistMan.CurPlayList);
- SkipTo(2+Random(CatSongs.VisibleSongs-1));
+ SkipTo(Random(CatSongs.VisibleSongs));
Music.PlayChange;
ChangeMusic;
SetScroll4;