Bugfix for CProfiles
This commit is contained in:
1 parent
ff58f76dc0
commit
1d628fc09c
3 files changed
+16
-24
No files matched your search
+15
-21
@@ -136,7 +136,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static string AddGetPlayerName(int profileID, char chr)
|
public static string AddGetPlayerName(int profileID, char chr)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
|
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
@@ -148,7 +148,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static string GetDeleteCharInPlayerName(int profileID)
|
public static string GetDeleteCharInPlayerName(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
|
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
@@ -161,17 +161,17 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static bool IsProfileIDValid(int profileID)
|
public static bool IsProfileIDValid(int profileID)
|
||||||
{
|
{
|
||||||
return profileID < 0 || profileID >= _Profiles.Count;
|
return profileID >= 0 && profileID < _Profiles.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EGameDifficulty GetDifficulty(int profileID)
|
public static EGameDifficulty GetDifficulty(int profileID)
|
||||||
{
|
{
|
||||||
return IsProfileIDValid(profileID) ? EGameDifficulty.TR_CONFIG_NORMAL : _Profiles[profileID].Difficulty;
|
return IsProfileIDValid(profileID) ? _Profiles[profileID].Difficulty : EGameDifficulty.TR_CONFIG_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetDifficulty(int profileID, EGameDifficulty difficulty)
|
public static void SetDifficulty(int profileID, EGameDifficulty difficulty)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
@@ -181,23 +181,17 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static EOffOn GetGuestProfile(int profileID)
|
public static EOffOn GetGuestProfile(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
return IsProfileIDValid(profileID) ? _Profiles[profileID].GuestProfile : EOffOn.TR_CONFIG_OFF;
|
||||||
return EOffOn.TR_CONFIG_OFF;
|
|
||||||
|
|
||||||
return _Profiles[profileID].GuestProfile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EOffOn GetActive(int profileID)
|
public static EOffOn GetActive(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
return IsProfileIDValid(profileID) ? _Profiles[profileID].Active : EOffOn.TR_CONFIG_OFF;
|
||||||
return EOffOn.TR_CONFIG_OFF;
|
|
||||||
|
|
||||||
return _Profiles[profileID].Active;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetGuestProfile(int profileID, EOffOn option)
|
public static void SetGuestProfile(int profileID, EOffOn option)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
@@ -207,7 +201,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void SetActive(int profileID, EOffOn option)
|
public static void SetActive(int profileID, EOffOn option)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
profile.Active = option;
|
profile.Active = option;
|
||||||
@@ -216,7 +210,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static bool IsGuestProfile(int profileID)
|
public static bool IsGuestProfile(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return true; // this will prevent from saving dummy profiles to highscore db
|
return true; // this will prevent from saving dummy profiles to highscore db
|
||||||
|
|
||||||
return _Profiles[profileID].GuestProfile == EOffOn.TR_CONFIG_ON;
|
return _Profiles[profileID].GuestProfile == EOffOn.TR_CONFIG_ON;
|
||||||
@@ -224,14 +218,14 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static bool IsActive(int profileID)
|
public static bool IsActive(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return false;
|
return false;
|
||||||
return _Profiles[profileID].Active == EOffOn.TR_CONFIG_ON;
|
return _Profiles[profileID].Active == EOffOn.TR_CONFIG_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetAvatar(int profileID, int avatarNr)
|
public static void SetAvatar(int profileID, int avatarNr)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID) || avatarNr < 0 || avatarNr >= _Avatars.Count)
|
if (!IsProfileIDValid(profileID) || avatarNr < 0 || avatarNr >= _Avatars.Count)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SProfile profile = _Profiles[profileID];
|
SProfile profile = _Profiles[profileID];
|
||||||
@@ -241,7 +235,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static int GetAvatarNr(int profileID)
|
public static int GetAvatarNr(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (int i = 0; i < _Avatars.Count; i++)
|
for (int i = 0; i < _Avatars.Count; i++)
|
||||||
@@ -255,7 +249,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void DeleteProfile(int profileID)
|
public static void DeleteProfile(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
if (_Profiles[profileID].ProfileFile == "")
|
if (_Profiles[profileID].ProfileFile == "")
|
||||||
return;
|
return;
|
||||||
@@ -293,7 +287,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
private static void _SaveProfile(int profileID)
|
private static void _SaveProfile(int profileID)
|
||||||
{
|
{
|
||||||
if (IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_Profiles[profileID].ProfileFile == "")
|
if (_Profiles[profileID].ProfileFile == "")
|
||||||
|
|||||||
@@ -490,8 +490,6 @@ namespace Vocaluxe.Screens
|
|||||||
_ChooseAvatarStatic.Visible = false;
|
_ChooseAvatarStatic.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent)) {}
|
|
||||||
|
|
||||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||||
{
|
{
|
||||||
if (_Buttons[_ButtonBack].Selected)
|
if (_Buttons[_ButtonBack].Selected)
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ namespace VocaluxeLib.Menu
|
|||||||
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
||||||
{
|
{
|
||||||
//Don't show profile if is selected, but if selected and guest
|
//Don't show profile if is selected, but if selected and guest
|
||||||
if (CBase.Game.GetPlayers()[p].ProfileID == i)
|
if (CBase.Game.GetPlayers()[p].ProfileID == i && CBase.Profiles.GetProfiles()[i].GuestProfile==EOffOn.TR_CONFIG_OFF)
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user