Changed players->Profile handling (no redundant entries)
This commit is contained in:
1 parent
dfc705aea4
commit
bdca0554e4
18 files changed
+232
-323
No files matched your search
@@ -484,12 +484,15 @@ namespace VocaluxeLib.Menu
|
||||
for (int i = 0; i < CBase.Profiles.GetProfiles().Length; i++)
|
||||
{
|
||||
bool visible = CBase.Profiles.GetProfiles()[i].Active == EOffOn.TR_CONFIG_ON;
|
||||
//Show profile only if active
|
||||
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
||||
if (visible)
|
||||
{
|
||||
//Don't show profile if is selected, but if selected and guest
|
||||
if (CBase.Game.GetPlayer()[p].ProfileID == i && CBase.Profiles.GetProfiles()[i].GuestProfile == EOffOn.TR_CONFIG_OFF)
|
||||
visible = false;
|
||||
//Show profile only if active
|
||||
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
||||
{
|
||||
//Don't show profile if is selected, but if selected and guest
|
||||
if (CBase.Game.GetPlayers()[p].ProfileID == i)
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
if (visible)
|
||||
_VisibleProfiles.Add(i);
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace VocaluxeLib.Menu
|
||||
for (int player = 0; player < players.Length; player++)
|
||||
{
|
||||
_Rounds[round, player].ProfileID = players[player].ProfileID;
|
||||
_Rounds[round, player].Name = players[player].Name;
|
||||
_Rounds[round, player].Difficulty = players[player].Difficulty;
|
||||
_Rounds[round, player].Points = 0f;
|
||||
_Rounds[round, player].PointsGoldenNotes = 0f;
|
||||
_Rounds[round, player].PointsLineBonus = 0f;
|
||||
@@ -86,13 +84,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
for (int p = 0; p < player.Length; p++)
|
||||
{
|
||||
player[p].Name = _Rounds[round, p].Name;
|
||||
player[p].Points = _Rounds[round, p].Points;
|
||||
player[p].PointsGoldenNotes = _Rounds[round, p].PointsGoldenNotes;
|
||||
player[p].PointsLineBonus = _Rounds[round, p].PointsLineBonus;
|
||||
player[p].SongID = _Rounds[round, p].SongID;
|
||||
player[p].LineNr = _Rounds[round, p].LineNr;
|
||||
player[p].Difficulty = _Rounds[round, p].Difficulty;
|
||||
player[p].Medley = _Rounds[round, p].Medley;
|
||||
player[p].Duet = _Rounds[round, p].Duet;
|
||||
player[p].ShortSong = _Rounds[round, p].ShortSong;
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
int GetNumPlayer();
|
||||
void SetNumPlayer(int numPlayer);
|
||||
SPlayer[] GetPlayer();
|
||||
SPlayer[] GetPlayers();
|
||||
CPoints GetPoints();
|
||||
float GetMidBeatD();
|
||||
int GetCurrentBeatD();
|
||||
@@ -233,6 +233,8 @@ namespace VocaluxeLib.Menu
|
||||
public interface IProfiles
|
||||
{
|
||||
SProfile[] GetProfiles();
|
||||
EGameDifficulty GetDifficulty(int profileID);
|
||||
string GetPlayerName(int profileID, int playerNum = 0);
|
||||
}
|
||||
|
||||
public interface ISongs
|
||||
|
||||
@@ -301,7 +301,8 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
float w = _PlayerNotes[n].Rect.W;
|
||||
float h = _PlayerNotes[n].Rect.H;
|
||||
float dh = h / CBase.Settings.GetNumNoteLines() * (2f - (int)CBase.Game.GetPlayer()[_PlayerNotes[n].PlayerNr].Difficulty) / 4f;
|
||||
int profileID = CBase.Game.GetPlayers()[_PlayerNotes[n].PlayerNr].ProfileID;
|
||||
float dh = h / CBase.Settings.GetNumNoteLines() * (2f - (int)CBase.Profiles.GetDifficulty(profileID)) / 4f;
|
||||
|
||||
float beats = line.LastNoteBeat - line.FirstNoteBeat + 1;
|
||||
|
||||
@@ -356,7 +357,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
foreach (CParticleEffect perfline in _PlayerNotes[n].PerfectLineTwinkle)
|
||||
perfline.Draw();
|
||||
|
||||
if (singLine == null || singLine.Count == 0 || CBase.Game.GetPlayer()[player].CurrentLine == -1 || singLine.Count <= CBase.Game.GetPlayer()[player].CurrentLine)
|
||||
if (singLine == null || singLine.Count == 0 || CBase.Game.GetPlayers()[player].CurrentLine == -1 || singLine.Count <= CBase.Game.GetPlayers()[player].CurrentLine)
|
||||
{
|
||||
foreach (CParticleEffect stars in _PlayerNotes[n].GoldenStars)
|
||||
{
|
||||
@@ -366,7 +367,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (CNote note in singLine[CBase.Game.GetPlayer()[player].CurrentLine].Notes)
|
||||
foreach (CNote note in singLine[CBase.Game.GetPlayers()[player].CurrentLine].Notes)
|
||||
{
|
||||
if (note.StartBeat >= line.FirstNoteBeat && note.EndBeat <= line.LastNoteBeat)
|
||||
{
|
||||
@@ -403,13 +404,13 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
}
|
||||
}
|
||||
|
||||
int currentLine = CBase.Game.GetPlayer()[player].SingLine.Count - 1;
|
||||
int currentLine = CBase.Game.GetPlayers()[player].SingLine.Count - 1;
|
||||
if (currentLine > 0)
|
||||
{
|
||||
if (CBase.Game.GetPlayer()[player].SingLine[currentLine - 1].PerfectLine)
|
||||
if (CBase.Game.GetPlayers()[player].SingLine[currentLine - 1].PerfectLine)
|
||||
{
|
||||
_AddPerfectLine(n);
|
||||
CBase.Game.GetPlayer()[player].SingLine[currentLine - 1].PerfectLine = false;
|
||||
CBase.Game.GetPlayers()[player].SingLine[currentLine - 1].PerfectLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,8 +242,6 @@ namespace VocaluxeLib.Menu
|
||||
public struct SPlayer
|
||||
{
|
||||
public int ProfileID;
|
||||
public string Name;
|
||||
public EGameDifficulty Difficulty;
|
||||
public double Points;
|
||||
public double PointsLineBonus;
|
||||
public double PointsGoldenNotes;
|
||||
|
||||
Reference in new issue
Block a user