Cleanups after merge
This commit is contained in:
1 parent
f83496d66a
commit
11398dbb2f
56 files changed
+363
-369
No files matched your search
@@ -515,6 +515,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return false;
|
||||
}
|
||||
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (CSong song in visibleSongs)
|
||||
{
|
||||
foreach (EGameMode mode in song.AvailableGameModes)
|
||||
@@ -523,6 +524,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
ids.Add(song.ID);
|
||||
}
|
||||
}
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
|
||||
if (ids.Count == 0)
|
||||
{
|
||||
|
||||
@@ -382,17 +382,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
//Show profile only if active
|
||||
if (CBase.Profiles.GetProfiles()[i].Active == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
visible = true;
|
||||
|
||||
for (int p = 0; p < _Data.ScreenNames.ProfileIDs.Count; p++)
|
||||
{
|
||||
//Don't show profile if is selected
|
||||
if (_Data.ScreenNames.ProfileIDs[p] == i)
|
||||
{
|
||||
visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Don't show profile if is selected
|
||||
visible = !_Data.ScreenNames.ProfileIDs.Contains(i);
|
||||
}
|
||||
if (visible)
|
||||
_PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
|
||||
@@ -658,7 +658,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(_GameData.PlaylistID); i++)
|
||||
{
|
||||
int id = CBase.Playlist.GetPlaylistSong(_GameData.PlaylistID, i).SongID;
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (mode == gm)
|
||||
songs.Add(id);
|
||||
@@ -669,7 +671,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
case ESongSource.TR_ALLSONGS:
|
||||
for (int i = 0; i < CBase.Songs.GetNumSongs(); i++)
|
||||
{
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (mode == gm)
|
||||
songs.Add(i);
|
||||
@@ -681,7 +685,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
CBase.Songs.SetCategory(_GameData.CategoryID);
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(_GameData.CategoryID); i++)
|
||||
{
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (mode == gm)
|
||||
songs.Add(CBase.Songs.GetVisibleSong(i).ID);
|
||||
|
||||
@@ -25,8 +25,6 @@ using System.Linq;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ using System.Xml;
|
||||
using Vocaluxe.Lib.Sound;
|
||||
using Vocaluxe.Lib.Webcam;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Profile;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
@@ -843,13 +842,13 @@ namespace Vocaluxe.Base
|
||||
CGame.Players[j].ProfileID = -1;
|
||||
if (Players[j] == "" || profiles == null)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < profiles.Length; i++)
|
||||
|
||||
foreach (CProfile profile in profiles)
|
||||
{
|
||||
if (Path.GetFileName(profiles[i].FileName) == Players[j] && profiles[i].Active == EOffOn.TR_CONFIG_ON)
|
||||
if (Path.GetFileName(profile.FileName) == Players[j] && profile.Active == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
//Update Game-infos with player
|
||||
CGame.Players[j].ProfileID = profiles[i].ID;
|
||||
CGame.Players[j].ProfileID = profile.ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Vocaluxe.Base.Server;
|
||||
using Vocaluxe.Lib.Input;
|
||||
using Vocaluxe.Lib.Input.WiiMote;
|
||||
@@ -39,22 +37,18 @@ namespace Vocaluxe.Base
|
||||
_Controller = new List<IController>();
|
||||
_KeysPool = new List<SKeyEvent>();
|
||||
_MousePool = new List<SMouseEvent>();
|
||||
|
||||
|
||||
_Controller.Add(new CWiiMote());
|
||||
_Controller.Add(CVocaluxeServer.Controller);
|
||||
|
||||
foreach (IController controller in _Controller)
|
||||
{
|
||||
controller.Init();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Close()
|
||||
{
|
||||
foreach (IController controller in _Controller)
|
||||
{
|
||||
controller.Close();
|
||||
}
|
||||
|
||||
_Controller = new List<IController>();
|
||||
}
|
||||
@@ -62,17 +56,13 @@ namespace Vocaluxe.Base
|
||||
public static void Connect()
|
||||
{
|
||||
foreach (IController controller in _Controller)
|
||||
{
|
||||
controller.Connect();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Disconnect()
|
||||
{
|
||||
foreach (IController controller in _Controller)
|
||||
{
|
||||
controller.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsConnected()
|
||||
@@ -89,17 +79,12 @@ namespace Vocaluxe.Base
|
||||
|
||||
SKeyEvent ke = new SKeyEvent();
|
||||
while (controller.PollKeyEvent(ref ke))
|
||||
{
|
||||
_KeysPool.Add(ke);
|
||||
}
|
||||
|
||||
SMouseEvent me = new SMouseEvent();
|
||||
while (controller.PollMouseEvent(ref me))
|
||||
{
|
||||
_MousePool.Add(me);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static bool PollKeyEvent(ref SKeyEvent keyEvent)
|
||||
@@ -127,9 +112,7 @@ namespace Vocaluxe.Base
|
||||
public static void SetRumble(float duration)
|
||||
{
|
||||
foreach (IController controller in _Controller)
|
||||
{
|
||||
controller.SetRumble(duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ using System.Text;
|
||||
using System.Xml;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
using System;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -38,8 +38,6 @@ using Community.CsharpSqlite;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@ using VocaluxeLib;
|
||||
using VocaluxeLib.Game;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Songs;
|
||||
using VocaluxeLib.Profile;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Vocaluxe.Lib.Playlist;
|
||||
using VocaluxeLib;
|
||||
@@ -40,13 +41,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static List<string> PlaylistNames
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
for (int i = 0; i < _Playlists.Count; i++)
|
||||
names.Add(_Playlists[i].PlaylistName);
|
||||
return names;
|
||||
}
|
||||
get { return _Playlists.Select(t => t.PlaylistName).ToList(); }
|
||||
}
|
||||
|
||||
public static int NumPlaylists
|
||||
|
||||
+64
-89
@@ -20,13 +20,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Game;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
@@ -38,7 +34,7 @@ namespace Vocaluxe.Base
|
||||
Profile = 4
|
||||
}
|
||||
|
||||
public delegate void ProfileChangedCallback(EProfileChangedFlags TypeChanged);
|
||||
public delegate void ProfileChangedCallback(EProfileChangedFlags typeChanged);
|
||||
|
||||
static class CProfiles
|
||||
{
|
||||
@@ -70,12 +66,12 @@ namespace Vocaluxe.Base
|
||||
private static Dictionary<int, CAvatar> _Avatars;
|
||||
private static Queue<int> _AvatarIDs;
|
||||
|
||||
private static Queue<SChange> _Queue = new Queue<SChange>();
|
||||
private static Object _QueueMutex = new Object();
|
||||
private static readonly Queue<SChange> _Queue = new Queue<SChange>();
|
||||
private static readonly Object _QueueMutex = new Object();
|
||||
|
||||
private static List<ProfileChangedCallback> _ProfileChangedCallbacks = new List<ProfileChangedCallback>();
|
||||
private static bool _ProfilesChanged = false;
|
||||
private static bool _AvatarsChanged = false;
|
||||
private static readonly List<ProfileChangedCallback> _ProfileChangedCallbacks = new List<ProfileChangedCallback>();
|
||||
private static bool _ProfilesChanged;
|
||||
private static bool _AvatarsChanged;
|
||||
#endregion private vars
|
||||
|
||||
#region properties
|
||||
@@ -142,7 +138,7 @@ namespace Vocaluxe.Base
|
||||
if (change.Profile == null)
|
||||
break;
|
||||
|
||||
if (!ICProfileIDValid(change.Profile.ID))
|
||||
if (!IsProfileIDValid(change.Profile.ID))
|
||||
return;
|
||||
|
||||
_Profiles[change.Profile.ID] = change.Profile;
|
||||
@@ -150,7 +146,7 @@ namespace Vocaluxe.Base
|
||||
break;
|
||||
|
||||
case EAction.DeleteProfile:
|
||||
if (!ICProfileIDValid(change.ProfileID))
|
||||
if (!IsProfileIDValid(change.ProfileID))
|
||||
break;
|
||||
|
||||
_DeleteProfile(change.ProfileID);
|
||||
@@ -170,15 +166,12 @@ namespace Vocaluxe.Base
|
||||
if (change.Avatar == null)
|
||||
break;
|
||||
|
||||
if (!ICAvatarIDValid(change.Avatar.ID))
|
||||
if (!IsAvatarIDValid(change.Avatar.ID))
|
||||
return;
|
||||
|
||||
_Avatars[change.Avatar.ID] = change.Avatar;
|
||||
_AvatarsChanged = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,15 +207,14 @@ namespace Vocaluxe.Base
|
||||
_ProfilesChanged = false;
|
||||
}
|
||||
|
||||
public static void AddProfileChangedCallback(ProfileChangedCallback Notification)
|
||||
public static void AddProfileChangedCallback(ProfileChangedCallback notification)
|
||||
{
|
||||
_ProfileChangedCallbacks.Add(Notification);
|
||||
_ProfileChangedCallbacks.Add(notification);
|
||||
}
|
||||
|
||||
public static void LoadProfiles()
|
||||
{
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.LoadProfiles;
|
||||
SChange change = new SChange {Action = EAction.LoadProfiles};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -232,8 +224,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void LoadAvatars()
|
||||
{
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.LoadAvatars;
|
||||
SChange change = new SChange {Action = EAction.LoadAvatars};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -241,14 +232,12 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddProfile(CProfile NewProfile)
|
||||
public static void AddProfile(CProfile newProfile)
|
||||
{
|
||||
if (NewProfile == null)
|
||||
if (newProfile == null)
|
||||
return;
|
||||
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.AddProfile;
|
||||
change.Profile = NewProfile;
|
||||
SChange change = new SChange {Action = EAction.AddProfile, Profile = newProfile};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -256,14 +245,12 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
|
||||
public static void EditProfile(CProfile EditProfile)
|
||||
public static void EditProfile(CProfile editProfile)
|
||||
{
|
||||
if (EditProfile == null)
|
||||
if (editProfile == null)
|
||||
return;
|
||||
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.EditProfile;
|
||||
change.Profile = EditProfile;
|
||||
SChange change = new SChange {Action = EAction.EditProfile, Profile = editProfile};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -273,12 +260,10 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void DeleteProfile(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.DeleteProfile;
|
||||
change.ProfileID = profileID;
|
||||
SChange change = new SChange {Action = EAction.DeleteProfile, ProfileID = profileID};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -286,14 +271,12 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddAvatar(CAvatar NewAvatar)
|
||||
public static void AddAvatar(CAvatar newAvatar)
|
||||
{
|
||||
if (NewAvatar == null)
|
||||
if (newAvatar == null)
|
||||
return;
|
||||
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.AddAvatar;
|
||||
change.Avatar = NewAvatar;
|
||||
SChange change = new SChange {Action = EAction.AddAvatar, Avatar = newAvatar};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -301,14 +284,12 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
|
||||
public static void EditAvatar(CAvatar EditAvatar)
|
||||
public static void EditAvatar(CAvatar editAvatar)
|
||||
{
|
||||
if (EditAvatar == null)
|
||||
if (editAvatar == null)
|
||||
return;
|
||||
|
||||
SChange change = new SChange();
|
||||
change.Action = EAction.EditAvatar;
|
||||
change.Avatar = EditAvatar;
|
||||
SChange change = new SChange {Action = EAction.EditAvatar, Avatar = editAvatar};
|
||||
|
||||
lock (_QueueMutex)
|
||||
{
|
||||
@@ -318,26 +299,20 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static CProfile[] GetProfiles()
|
||||
{
|
||||
List<CProfile> list = new List<CProfile>();
|
||||
|
||||
if (_Profiles.Count == 0)
|
||||
return null;
|
||||
|
||||
CProfile[] result = new CProfile[_Profiles.Count];
|
||||
_Profiles.Values.CopyTo(result, 0);
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
list.Add(result[i]);
|
||||
List<CProfile> list = new List<CProfile>(_Profiles.Values);
|
||||
list.Sort(_CompareByPlayerName);
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
public static CAvatar[] GetAvatars()
|
||||
public static IEnumerable<CAvatar> GetAvatars()
|
||||
{
|
||||
CAvatar[] result = null;
|
||||
if (_Avatars.Count == 0)
|
||||
return null;
|
||||
|
||||
result = new CAvatar[_Avatars.Count];
|
||||
CAvatar[] result = new CAvatar[_Avatars.Count];
|
||||
_Avatars.Values.CopyTo(result, 0);
|
||||
|
||||
return result;
|
||||
@@ -377,12 +352,12 @@ namespace Vocaluxe.Base
|
||||
_Profiles[id].SaveProfile();
|
||||
}
|
||||
|
||||
public static bool ICProfileIDValid(int profileID)
|
||||
public static bool IsProfileIDValid(int profileID)
|
||||
{
|
||||
return _Profiles.ContainsKey(profileID);
|
||||
}
|
||||
|
||||
public static bool ICAvatarIDValid(int avatarID)
|
||||
public static bool IsAvatarIDValid(int avatarID)
|
||||
{
|
||||
return _Avatars.ContainsKey(avatarID);
|
||||
}
|
||||
@@ -391,7 +366,7 @@ namespace Vocaluxe.Base
|
||||
#region profile properties
|
||||
public static string GetPlayerName(int profileID, int playerNum = 0)
|
||||
{
|
||||
if (ICProfileIDValid(profileID))
|
||||
if (IsProfileIDValid(profileID))
|
||||
return _Profiles[profileID].PlayerName;
|
||||
|
||||
string playerName = CLanguage.Translate("TR_SCREENNAMES_PLAYER");
|
||||
@@ -400,17 +375,17 @@ namespace Vocaluxe.Base
|
||||
return playerName;
|
||||
}
|
||||
|
||||
public static void SetPlayerName(int profileID, string PlayerName)
|
||||
public static void SetPlayerName(int profileID, string playerName)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
_Profiles[profileID].PlayerName = PlayerName;
|
||||
_Profiles[profileID].PlayerName = playerName;
|
||||
}
|
||||
|
||||
public static string GetProfileFileName(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return String.Empty;
|
||||
|
||||
return Path.GetFileName(_Profiles[profileID].FileName);
|
||||
@@ -418,7 +393,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static string AddGetPlayerName(int profileID, char chr)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return String.Empty;
|
||||
|
||||
_Profiles[profileID].PlayerName += chr;
|
||||
@@ -427,7 +402,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static string GetDeleteCharInPlayerName(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return String.Empty;
|
||||
|
||||
CProfile profile = _Profiles[profileID];
|
||||
@@ -439,12 +414,12 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static EGameDifficulty GetDifficulty(int profileID)
|
||||
{
|
||||
return ICProfileIDValid(profileID) ? _Profiles[profileID].Difficulty : EGameDifficulty.TR_CONFIG_NORMAL;
|
||||
return IsProfileIDValid(profileID) ? _Profiles[profileID].Difficulty : EGameDifficulty.TR_CONFIG_NORMAL;
|
||||
}
|
||||
|
||||
public static void SetDifficulty(int profileID, EGameDifficulty difficulty)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
_Profiles[profileID].Difficulty = difficulty;
|
||||
@@ -452,12 +427,12 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static EOffOn GetGuestProfile(int profileID)
|
||||
{
|
||||
return ICProfileIDValid(profileID) ? _Profiles[profileID].GuestProfile : EOffOn.TR_CONFIG_OFF;
|
||||
return IsProfileIDValid(profileID) ? _Profiles[profileID].GuestProfile : EOffOn.TR_CONFIG_OFF;
|
||||
}
|
||||
|
||||
public static void SetGuestProfile(int profileID, EOffOn option)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
_Profiles[profileID].GuestProfile = option;
|
||||
@@ -465,12 +440,12 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static EOffOn GetActive(int profileID)
|
||||
{
|
||||
return ICProfileIDValid(profileID) ? _Profiles[profileID].Active : EOffOn.TR_CONFIG_OFF;
|
||||
return IsProfileIDValid(profileID) ? _Profiles[profileID].Active : EOffOn.TR_CONFIG_OFF;
|
||||
}
|
||||
|
||||
public static void SetActive(int profileID, EOffOn option)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
_Profiles[profileID].Active = option;
|
||||
@@ -478,7 +453,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static bool IsGuestProfile(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return true; // this will prevent from saving dummy profiles to highscore db
|
||||
|
||||
return _Profiles[profileID].GuestProfile == EOffOn.TR_CONFIG_ON;
|
||||
@@ -486,14 +461,14 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static bool IsActive(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return false;
|
||||
return _Profiles[profileID].Active == EOffOn.TR_CONFIG_ON;
|
||||
}
|
||||
|
||||
public static void SetAvatar(int profileID, int avatarID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID) || !ICAvatarIDValid(avatarID))
|
||||
if (!IsProfileIDValid(profileID) || !IsAvatarIDValid(avatarID))
|
||||
return;
|
||||
|
||||
_Profiles[profileID].Avatar = _Avatars[avatarID];
|
||||
@@ -501,7 +476,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static int GetAvatarID(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return -1;
|
||||
|
||||
return _Profiles[profileID].Avatar.ID;
|
||||
@@ -511,7 +486,7 @@ namespace Vocaluxe.Base
|
||||
#region avatar texture
|
||||
public static CTexture GetAvatarTexture(int avatarID)
|
||||
{
|
||||
if (!ICAvatarIDValid(avatarID))
|
||||
if (!IsAvatarIDValid(avatarID))
|
||||
return null;
|
||||
|
||||
return _Avatars[avatarID].Texture;
|
||||
@@ -519,7 +494,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static CTexture GetAvatarTextureFromProfile(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return null;
|
||||
|
||||
return _Profiles[profileID].Avatar.Texture;
|
||||
@@ -536,15 +511,15 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
int[] ids = new int[_Profiles.Keys.Count];
|
||||
_Profiles.Keys.CopyTo(ids, 0);
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
foreach (int id in ids)
|
||||
{
|
||||
if (_Profiles[ids[i]].LoadProfile())
|
||||
if (_Profiles[id].LoadProfile())
|
||||
{
|
||||
_Profiles[ids[i]].Avatar = _GetAvatar(_Profiles[ids[i]].AvatarFileName);
|
||||
knownFiles.Add(Path.GetFileName(_Profiles[ids[i]].FileName));
|
||||
_Profiles[id].Avatar = _GetAvatar(_Profiles[id].AvatarFileName);
|
||||
knownFiles.Add(Path.GetFileName(_Profiles[id].FileName));
|
||||
}
|
||||
else
|
||||
_Profiles.Remove(ids[i]);
|
||||
_Profiles.Remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,12 +553,12 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
int[] ids = new int[_Avatars.Keys.Count];
|
||||
_Avatars.Keys.CopyTo(ids, 0);
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
foreach (int id in ids)
|
||||
{
|
||||
if (_Avatars[ids[i]].Reload())
|
||||
knownFiles.Add(Path.GetFileName(_Avatars[ids[i]].FileName));
|
||||
if (_Avatars[id].Reload())
|
||||
knownFiles.Add(Path.GetFileName(_Avatars[id].FileName));
|
||||
else
|
||||
_Avatars.Remove(ids[i]);
|
||||
_Avatars.Remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,7 +585,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static void _DeleteProfile(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
if (_Profiles[profileID].FileName == "")
|
||||
@@ -651,7 +626,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static void _RemoveProfile(int profileID)
|
||||
{
|
||||
if (!ICProfileIDValid(profileID))
|
||||
if (!IsProfileIDValid(profileID))
|
||||
return;
|
||||
|
||||
_Profiles.Remove(profileID);
|
||||
@@ -665,11 +640,11 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static CAvatar _GetAvatar(string fileName)
|
||||
{
|
||||
string Name = Path.GetFileName(fileName);
|
||||
string name = Path.GetFileName(fileName);
|
||||
|
||||
foreach (int id in _Avatars.Keys)
|
||||
{
|
||||
if (Path.GetFileName(_Avatars[id].FileName) == Name)
|
||||
if (Path.GetFileName(_Avatars[id].FileName) == name)
|
||||
return _Avatars[id];
|
||||
}
|
||||
return new CAvatar(-1);
|
||||
|
||||
@@ -21,7 +21,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
|
||||
@@ -140,7 +140,9 @@ namespace Vocaluxe.Base
|
||||
sortList.Add(new CSongPointer(song.ID, ""));
|
||||
else
|
||||
{
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (String sortString in values)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
sortList.Add(new CSongPointer(song.ID, sortString));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
@@ -256,7 +254,9 @@ namespace Vocaluxe.Base
|
||||
List<CSong> songs = new List<CSong>();
|
||||
if (_IsCatIndexValid(_CatIndex))
|
||||
{
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (CSongPointer sp in Categories[_CatIndex].Songs)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (!sp.IsSung)
|
||||
songs.Add(_Songs[sp.SongID]);
|
||||
|
||||
@@ -26,7 +26,6 @@ using System.Xml;
|
||||
using Vocaluxe.Base.Fonts;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
@@ -113,7 +112,9 @@ namespace Vocaluxe.Base
|
||||
get
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (STheme th in _Themes)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (th.PartyModeID == -1)
|
||||
names.Add(th.Name);
|
||||
@@ -128,7 +129,9 @@ namespace Vocaluxe.Base
|
||||
get
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (SSkin sk in _Skins)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (sk.PartyModeID == -1)
|
||||
names.Add(sk.Name);
|
||||
|
||||
@@ -22,7 +22,6 @@ using System.Drawing;
|
||||
using Vocaluxe.Lib.Video;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ using System.Drawing;
|
||||
using Vocaluxe.Lib.Webcam;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@ using System.Drawing;
|
||||
using System.Drawing.Text;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base.Fonts
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@ using System.Drawing.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Base.Fonts
|
||||
{
|
||||
@@ -219,10 +218,16 @@ namespace Vocaluxe.Base.Fonts
|
||||
}
|
||||
|
||||
//Add some additional space. Textures need some extra pixel for resizing.
|
||||
int d = 4;
|
||||
minX = minX - d; if (minX < 0) minX = 0;
|
||||
minY = minY - d; if (minY < 0) minY = 0;
|
||||
maxX = maxX + d; if (maxX > bmp.Width) maxX = bmp.Width;
|
||||
const int d = 4;
|
||||
minX = minX - d;
|
||||
if (minX < 0)
|
||||
minX = 0;
|
||||
minY = minY - d;
|
||||
if (minY < 0)
|
||||
minY = 0;
|
||||
maxX = maxX + d;
|
||||
if (maxX > bmp.Width)
|
||||
maxX = bmp.Width;
|
||||
|
||||
return new Rectangle(minX, minY, maxX - minX, bmp.Height - minY);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Lib.Input;
|
||||
using VocaluxeLib.Menu;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
namespace Vocaluxe.Base.Server
|
||||
{
|
||||
internal class CClientHandler
|
||||
class CClientHandler
|
||||
{
|
||||
public int ConnectionID;
|
||||
public bool LoggedIn;
|
||||
|
||||
public CClientHandler(int ConnectionID)
|
||||
public CClientHandler(int connectionID)
|
||||
{
|
||||
this.ConnectionID = ConnectionID;
|
||||
ConnectionID = connectionID;
|
||||
LoggedIn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,23 @@
|
||||
using System;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
@@ -7,9 +26,7 @@ using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using ClientServerLib;
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Lib.Input;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Profile;
|
||||
@@ -22,7 +39,7 @@ namespace Vocaluxe.Base.Server
|
||||
private static CDiscover _Discover;
|
||||
private static Dictionary<int, CClientHandler> _Clients;
|
||||
|
||||
public static CControllerFramework Controller = new CControllerFramework();
|
||||
public static readonly CControllerFramework Controller = new CControllerFramework();
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
@@ -48,46 +65,46 @@ namespace Vocaluxe.Base.Server
|
||||
_Clients = new Dictionary<int, CClientHandler>();
|
||||
}
|
||||
|
||||
private static byte[] RequestHandler(int ConnectionID, byte[] Message)
|
||||
private static byte[] RequestHandler(int connectionID, byte[] message)
|
||||
{
|
||||
byte[] answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseNOK);
|
||||
|
||||
if (Message == null)
|
||||
if (message == null)
|
||||
return answer;
|
||||
|
||||
if (Message.Length < 4)
|
||||
if (message.Length < 4)
|
||||
return answer;
|
||||
|
||||
bool loggedIn = false;
|
||||
bool loggedIn;
|
||||
lock (_Clients)
|
||||
{
|
||||
if (!_Clients.ContainsKey(ConnectionID))
|
||||
if (!_Clients.ContainsKey(connectionID))
|
||||
{
|
||||
CClientHandler client = new CClientHandler(ConnectionID);
|
||||
_Clients.Add(ConnectionID, client);
|
||||
CClientHandler client = new CClientHandler(connectionID);
|
||||
_Clients.Add(connectionID, client);
|
||||
}
|
||||
|
||||
loggedIn = _Clients[ConnectionID].LoggedIn;
|
||||
loggedIn = _Clients[connectionID].LoggedIn;
|
||||
}
|
||||
|
||||
int command = BitConverter.ToInt32(Message, 0);
|
||||
int command = BitConverter.ToInt32(message, 0);
|
||||
switch (command)
|
||||
{
|
||||
case CCommands.CommandLogin:
|
||||
SLoginData data;
|
||||
|
||||
if (!CCommands.DecodeCommandLogin(Message, out data))
|
||||
if (!CCommands.DecodeCommandLogin(message, out data))
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseLoginFailed);
|
||||
else
|
||||
{
|
||||
byte[] serverPW = CCommands.SHA256.ComputeHash(Encoding.UTF8.GetBytes(CConfig.ServerPassword));
|
||||
byte[] serverPw = CCommands.SHA256.ComputeHash(Encoding.UTF8.GetBytes(CConfig.ServerPassword));
|
||||
|
||||
if (!serverPW.SequenceEqual(data.SHA256))
|
||||
if (!serverPw.SequenceEqual(data.SHA256))
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseLoginWrongPassword);
|
||||
else
|
||||
{
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseLoginOK);
|
||||
_Clients[ConnectionID].LoggedIn = true;
|
||||
_Clients[connectionID].LoggedIn = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -95,7 +112,7 @@ namespace Vocaluxe.Base.Server
|
||||
|
||||
if (!loggedIn)
|
||||
return answer;
|
||||
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case CCommands.CommandSendKeyUp:
|
||||
@@ -121,13 +138,10 @@ namespace Vocaluxe.Base.Server
|
||||
case CCommands.CommandSendAvatarPicture:
|
||||
|
||||
SAvatarPicture avatarPicture;
|
||||
if (CCommands.DecodeCommandSendAvatarPicture(Message, out avatarPicture))
|
||||
if (CCommands.DecodeCommandSendAvatarPicture(message, out avatarPicture))
|
||||
{
|
||||
Bitmap bmp = null;
|
||||
bool success = false;
|
||||
try
|
||||
using (Bitmap bmp = new Bitmap(avatarPicture.Width, avatarPicture.Height))
|
||||
{
|
||||
bmp = new Bitmap(avatarPicture.Width, avatarPicture.Height);
|
||||
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
Marshal.Copy(avatarPicture.data, 0, bmpData.Scan0, avatarPicture.data.Length);
|
||||
bmp.UnlockBits(bmpData);
|
||||
@@ -137,23 +151,16 @@ namespace Vocaluxe.Base.Server
|
||||
while (File.Exists(Path.Combine(CSettings.FolderProfiles, filename + i + ".png")))
|
||||
i++;
|
||||
bmp.Save(Path.Combine(CSettings.FolderProfiles, filename + i + ".png"), ImageFormat.Png);
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (bmp != null)
|
||||
bmp.Dispose();
|
||||
}
|
||||
|
||||
if (success)
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseOK);
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseOK);
|
||||
}
|
||||
break;
|
||||
|
||||
case CCommands.CommandSendAvatarPictureJpg:
|
||||
|
||||
SAvatarPicture avatarPictureJpg;
|
||||
if (CCommands.DecodeCommandSendAvatarPicture(Message, out avatarPictureJpg))
|
||||
if (CCommands.DecodeCommandSendAvatarPicture(message, out avatarPictureJpg))
|
||||
{
|
||||
if (_AddAvatar(avatarPictureJpg.data) != String.Empty)
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseOK);
|
||||
@@ -162,39 +169,35 @@ namespace Vocaluxe.Base.Server
|
||||
|
||||
case CCommands.CommandSendProfile:
|
||||
SProfile profile;
|
||||
if (CCommands.DecodeCommandSendProfile(Message, out profile))
|
||||
if (CCommands.DecodeCommandSendProfile(message, out profile))
|
||||
{
|
||||
try
|
||||
{
|
||||
string AvatarFilename = _AddAvatar(profile.Avatar.data);
|
||||
if (AvatarFilename != String.Empty)
|
||||
try
|
||||
{
|
||||
string avatarFilename = _AddAvatar(profile.Avatar.data);
|
||||
if (avatarFilename != String.Empty)
|
||||
{
|
||||
CProfile p = new CProfile();
|
||||
p.Active = EOffOn.TR_CONFIG_ON;
|
||||
p.AvatarFileName = AvatarFilename;
|
||||
p.Difficulty = (EGameDifficulty)profile.Difficulty;
|
||||
p.GuestProfile = EOffOn.TR_CONFIG_OFF;
|
||||
p.PlayerName = profile.PlayerName;
|
||||
CProfile p = new CProfile
|
||||
{
|
||||
Active = EOffOn.TR_CONFIG_ON,
|
||||
AvatarFileName = avatarFilename,
|
||||
Difficulty = (EGameDifficulty)profile.Difficulty,
|
||||
GuestProfile = EOffOn.TR_CONFIG_OFF,
|
||||
PlayerName = profile.PlayerName
|
||||
};
|
||||
CProfiles.AddProfile(p);
|
||||
answer = CCommands.CreateCommandWithoutParams(CCommands.ResponseOK);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception) {}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
private static string _AddAvatar(byte[] JpgData)
|
||||
private static string _AddAvatar(byte[] jpgData)
|
||||
{
|
||||
string result = String.Empty;
|
||||
try
|
||||
@@ -206,7 +209,7 @@ namespace Vocaluxe.Base.Server
|
||||
|
||||
filename = filename + i + ".jpg";
|
||||
FileStream fs = File.Create(filename);
|
||||
fs.Write(JpgData, 0, JpgData.Length);
|
||||
fs.Write(jpgData, 0, jpgData.Length);
|
||||
fs.Flush();
|
||||
fs.Close();
|
||||
|
||||
@@ -216,11 +219,10 @@ namespace Vocaluxe.Base.Server
|
||||
CProfiles.AddAvatar(avatar);
|
||||
result = filename;
|
||||
}
|
||||
|
||||
}
|
||||
catch { }
|
||||
catch {}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,6 @@ using SlimDX.Windows;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
using BeginMode = OpenTK.Graphics.OpenGL.BeginMode;
|
||||
using BlendingFactorDest = OpenTK.Graphics.OpenGL.BlendingFactorDest;
|
||||
using BlendingFactorSrc = OpenTK.Graphics.OpenGL.BlendingFactorSrc;
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
|
||||
using System.Drawing;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
|
||||
@@ -1,8 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using VocaluxeLib;
|
||||
|
||||
namespace Vocaluxe.Lib.Input
|
||||
@@ -25,17 +41,11 @@ namespace Vocaluxe.Lib.Input
|
||||
_CurrentMousePool = new List<SMouseEvent>();
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
{
|
||||
}
|
||||
public virtual void Close() {}
|
||||
|
||||
public virtual void Connect()
|
||||
{
|
||||
}
|
||||
public virtual void Connect() {}
|
||||
|
||||
public virtual void Disconnect()
|
||||
{
|
||||
}
|
||||
public virtual void Disconnect() {}
|
||||
|
||||
public virtual bool IsConnected()
|
||||
{
|
||||
@@ -81,9 +91,7 @@ namespace Vocaluxe.Lib.Input
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void SetRumble(float duration)
|
||||
{
|
||||
}
|
||||
public virtual void SetRumble(float duration) {}
|
||||
|
||||
public void AddKeyEvent(SKeyEvent keyEvent)
|
||||
{
|
||||
@@ -101,4 +109,4 @@ namespace Vocaluxe.Lib.Input
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,9 @@ namespace Vocaluxe.Lib.Playlist
|
||||
if (PlaylistFile == "")
|
||||
{
|
||||
string filename = string.Empty;
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (char chr in PlaylistName)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (char.IsLetter(chr))
|
||||
filename += chr.ToString();
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace Vocaluxe.Lib.Video
|
||||
|
||||
@@ -25,8 +25,6 @@ using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Lib.Video.Acinerella;
|
||||
using VocaluxeLib;
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace Vocaluxe.Lib.Video
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
using System;
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Lib.Video.Gstreamer;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace Vocaluxe.Lib.Video
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib;
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace Vocaluxe.Lib.Video
|
||||
@@ -45,7 +43,6 @@ namespace Vocaluxe.Lib.Video
|
||||
float GetLength(int streamID);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="streamID"></param>
|
||||
/// <param name="frame"></param>
|
||||
|
||||
@@ -24,7 +24,6 @@ using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace Vocaluxe.Lib.Webcam
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using VocaluxeLib;
|
||||
|
||||
using System.Drawing;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Base.Fonts;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
@@ -165,9 +164,7 @@ namespace Vocaluxe.Screens
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalse
|
||||
if (CSettings.VersionRevision != ERevision.Release)
|
||||
// ReSharper restore ConditionIsAlwaysTrueOrFalse
|
||||
{
|
||||
_ReleaseText.Draw();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace Vocaluxe.Screens
|
||||
private int _SelectingSwitchNr = -1;
|
||||
private int _SelectingFastPlayerNr;
|
||||
private int _SelectedPlayerNr = -1;
|
||||
private bool _AvatarsChanged = false;
|
||||
private bool _ProfilesChanged = false;
|
||||
private bool _AvatarsChanged;
|
||||
private bool _ProfilesChanged;
|
||||
|
||||
#region public methods
|
||||
public override void Init()
|
||||
@@ -106,7 +106,7 @@ namespace Vocaluxe.Screens
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic.Aspect = EAspect.Crop;
|
||||
|
||||
CProfiles.AddProfileChangedCallback(new ProfileChangedCallback(_OnProfileChanged));
|
||||
CProfiles.AddProfileChangedCallback(_OnProfileChanged);
|
||||
}
|
||||
|
||||
public override void LoadTheme(string xmlPath)
|
||||
@@ -670,12 +670,12 @@ namespace Vocaluxe.Screens
|
||||
#endregion public methods
|
||||
|
||||
#region private methods
|
||||
private void _OnProfileChanged(EProfileChangedFlags Flags)
|
||||
private void _OnProfileChanged(EProfileChangedFlags flags)
|
||||
{
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & Flags))
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & flags))
|
||||
_AvatarsChanged = true;
|
||||
|
||||
if (EProfileChangedFlags.Profile == (EProfileChangedFlags.Profile & Flags))
|
||||
if (EProfileChangedFlags.Profile == (EProfileChangedFlags.Profile & flags))
|
||||
_ProfilesChanged = true;
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
for (int i = 0; i < CSettings.MaxNumPlayer; i++)
|
||||
{
|
||||
_Statics[_StaticPlayerAvatar[i]].Texture = CProfiles.ICProfileIDValid(CGame.Players[i].ProfileID) ?
|
||||
_Statics[_StaticPlayerAvatar[i]].Texture = CProfiles.IsProfileIDValid(CGame.Players[i].ProfileID) ?
|
||||
CProfiles.GetAvatarTextureFromProfile(CGame.Players[i].ProfileID) :
|
||||
_OriginalPlayerAvatarTextures[i];
|
||||
_Texts[_TextPlayer[i]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID, i + 1);
|
||||
|
||||
@@ -24,7 +24,6 @@ using Vocaluxe.Lib.Webcam;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Screens
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@ using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace Vocaluxe.Screens
|
||||
{
|
||||
@@ -82,7 +81,7 @@ namespace Vocaluxe.Screens
|
||||
_EditMode = EEditMode.None;
|
||||
_ProfilesChanged = false;
|
||||
_AvatarsChanged = false;
|
||||
CProfiles.AddProfileChangedCallback(new ProfileChangedCallback(_OnProfileChanged));
|
||||
CProfiles.AddProfileChangedCallback(_OnProfileChanged);
|
||||
}
|
||||
|
||||
public override void LoadTheme(string xmlPath)
|
||||
@@ -302,12 +301,12 @@ namespace Vocaluxe.Screens
|
||||
_OnDiscardSnapshot();
|
||||
}
|
||||
|
||||
private void _OnProfileChanged(EProfileChangedFlags Flags)
|
||||
private void _OnProfileChanged(EProfileChangedFlags flags)
|
||||
{
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & Flags))
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & flags))
|
||||
_AvatarsChanged = true;
|
||||
|
||||
if (EProfileChangedFlags.Profile == (EProfileChangedFlags.Profile & Flags))
|
||||
if (EProfileChangedFlags.Profile == (EProfileChangedFlags.Profile & flags))
|
||||
_ProfilesChanged = true;
|
||||
}
|
||||
|
||||
@@ -399,7 +398,7 @@ namespace Vocaluxe.Screens
|
||||
_SelectSlides[_SelectSlideProfiles].Selection = selection - 1;
|
||||
}
|
||||
|
||||
private void _LoadProfiles(bool Keep)
|
||||
private void _LoadProfiles(bool keep)
|
||||
{
|
||||
string name = String.Empty;
|
||||
if (_EditMode == EEditMode.PlayerName)
|
||||
@@ -409,12 +408,12 @@ namespace Vocaluxe.Screens
|
||||
_SelectSlides[_SelectSlideProfiles].Clear();
|
||||
|
||||
CProfile[] profiles = CProfiles.GetProfiles();
|
||||
for (int i = 0; i < profiles.Length; i++)
|
||||
foreach (CProfile profile in profiles)
|
||||
{
|
||||
_SelectSlides[_SelectSlideProfiles].AddValue(
|
||||
profiles[i].PlayerName,
|
||||
profile.PlayerName,
|
||||
null,
|
||||
profiles[i].ID,
|
||||
profile.ID,
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -428,7 +427,7 @@ namespace Vocaluxe.Screens
|
||||
selectedProfileID = _SelectSlides[_SelectSlideProfiles].ValueIndex;
|
||||
}
|
||||
|
||||
if (!Keep)
|
||||
if (!keep)
|
||||
{
|
||||
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
|
||||
_SelectSlides[_SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(selectedProfileID);
|
||||
@@ -442,21 +441,21 @@ namespace Vocaluxe.Screens
|
||||
_ProfilesChanged = false;
|
||||
}
|
||||
|
||||
private void _LoadAvatars(bool Keep)
|
||||
private void _LoadAvatars(bool keep)
|
||||
{
|
||||
int selectedAvatarID = _SelectSlides[_SelectSlideAvatars].ValueIndex;
|
||||
_SelectSlides[_SelectSlideAvatars].Clear();
|
||||
CAvatar[] avatars = CProfiles.GetAvatars();
|
||||
for (int i = 0; i < avatars.Length; i++)
|
||||
IEnumerable<CAvatar> avatars = CProfiles.GetAvatars();
|
||||
foreach (CAvatar avatar in avatars)
|
||||
{
|
||||
_SelectSlides[_SelectSlideAvatars].AddValue(
|
||||
Path.GetFileName(avatars[i].FileName),
|
||||
Path.GetFileName(avatar.FileName),
|
||||
null,
|
||||
avatars[i].ID,
|
||||
avatar.ID,
|
||||
-1);
|
||||
}
|
||||
|
||||
if (Keep)
|
||||
if (keep)
|
||||
{
|
||||
_SelectSlides[_SelectSlideAvatars].SetSelectionByValueIndex(selectedAvatarID);
|
||||
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].ValueIndex, selectedAvatarID);
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace Vocaluxe.Screens
|
||||
_Statics[_StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y -
|
||||
_Statics[_StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
|
||||
}
|
||||
if (CProfiles.ICProfileIDValid(players[p].ProfileID))
|
||||
if (CProfiles.IsProfileIDValid(players[p].ProfileID))
|
||||
_Statics[_StaticAvatar[p, CGame.NumPlayer - 1]].Texture = CProfiles.GetAvatarTextureFromProfile(players[p].ProfileID);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,6 @@ using Vocaluxe.Base.Fonts;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SingNotes;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace Vocaluxe.Screens
|
||||
@@ -702,7 +700,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
bool lyricsOnTop = CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_TOP
|
||||
|| CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTH
|
||||
|| (CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_DYNAMIC && _DynamicLyricsTop);
|
||||
|| (CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_DYNAMIC && _DynamicLyricsTop);
|
||||
_Lyrics[_LyricMainTop].Visible = lyricsOnTop;
|
||||
_Lyrics[_LyricSubTop].Visible = lyricsOnTop;
|
||||
_Statics[_StaticLyricsTop].Visible = lyricsOnTop;
|
||||
@@ -712,8 +710,8 @@ namespace Vocaluxe.Screens
|
||||
private void _SetNormalLyricsVisibility()
|
||||
{
|
||||
bool visible = CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTTOM
|
||||
|| CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTH
|
||||
|| (CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_DYNAMIC && _DynamicLyricsBottom);
|
||||
|| CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTH
|
||||
|| (CConfig.LyricsPosition == ELyricsPosition.TR_CONFIG_LYRICSPOSITION_DYNAMIC && _DynamicLyricsBottom);
|
||||
_Lyrics[_LyricMain].Visible = visible;
|
||||
_Lyrics[_LyricSub].Visible = visible;
|
||||
_Statics[_StaticLyrics].Visible = visible;
|
||||
@@ -1392,7 +1390,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
for (int i = 0; i < CGame.NumPlayer; i++)
|
||||
{
|
||||
if (CProfiles.ICProfileIDValid(CGame.Players[i].ProfileID))
|
||||
if (CProfiles.IsProfileIDValid(CGame.Players[i].ProfileID))
|
||||
_Statics[_StaticAvatars[i, CGame.NumPlayer - 1]].Texture = CProfiles.GetAvatarTextureFromProfile(CGame.Players[i].ProfileID);
|
||||
else
|
||||
_Statics[_StaticAvatars[i, CGame.NumPlayer - 1]].Visible = false;
|
||||
@@ -1403,7 +1401,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
for (int i = 0; i < CGame.NumPlayer; i++)
|
||||
{
|
||||
if (CProfiles.ICProfileIDValid(CGame.Players[i].ProfileID))
|
||||
if (CProfiles.IsProfileIDValid(CGame.Players[i].ProfileID))
|
||||
_Texts[_TextNames[i, CGame.NumPlayer - 1]].Text = CProfiles.GetPlayerName(CGame.Players[i].ProfileID);
|
||||
else
|
||||
_Texts[_TextNames[i, CGame.NumPlayer - 1]].Visible = false;
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
@@ -884,9 +884,7 @@ namespace Vocaluxe.Screens
|
||||
CGame.Reset();
|
||||
CGame.ClearSongs();
|
||||
|
||||
List<int> ids = new List<int>();
|
||||
for (int i = 0; i < CSongs.VisibleSongs.Count; i++)
|
||||
ids.Add(CSongs.VisibleSongs[i].ID);
|
||||
List<int> ids = CSongs.VisibleSongs.Select(t => t.ID).ToList();
|
||||
|
||||
while (ids.Count > 0)
|
||||
{
|
||||
@@ -910,17 +908,15 @@ namespace Vocaluxe.Screens
|
||||
CGame.Reset();
|
||||
CGame.ClearSongs();
|
||||
|
||||
List<int> ids = new List<int>();
|
||||
List<int> ids;
|
||||
if (allSongs)
|
||||
{
|
||||
ids = new List<int>();
|
||||
for (int i = 0; i < CSongs.AllSongs.Count; i++)
|
||||
ids.Add(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < CSongs.VisibleSongs.Count; i++)
|
||||
ids.Add(CSongs.VisibleSongs[i].ID);
|
||||
}
|
||||
ids = CSongs.VisibleSongs.Select(t => t.ID).ToList();
|
||||
int s = 0;
|
||||
while (s < numSongs && ids.Count > 0)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib
|
||||
{
|
||||
public static class CBase
|
||||
|
||||
@@ -143,7 +143,9 @@ namespace VocaluxeLib
|
||||
|
||||
try
|
||||
{
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (FileInfo file in dir.GetFiles(cast))
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
files.Add(!fullpath ? file.Name : file.FullName);
|
||||
|
||||
if (recursive)
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
using System.Drawing;
|
||||
using VocaluxeLib.Menu;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace VocaluxeLib.Draw
|
||||
{
|
||||
@@ -13,7 +31,7 @@ namespace VocaluxeLib.Draw
|
||||
public string TexturePath = "";
|
||||
|
||||
/// <summary>
|
||||
/// Original size (e.g. of bmp)
|
||||
/// Original size (e.g. of bmp)
|
||||
/// </summary>
|
||||
public readonly Size OrigSize;
|
||||
public float OrigAspect
|
||||
@@ -22,7 +40,7 @@ namespace VocaluxeLib.Draw
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current size when drawn
|
||||
/// Current size when drawn
|
||||
/// </summary>
|
||||
public SRectF Rect;
|
||||
|
||||
@@ -31,7 +49,7 @@ namespace VocaluxeLib.Draw
|
||||
private int _W2, _H2;
|
||||
private readonly bool _UseFullTexture;
|
||||
/// <summary>
|
||||
/// Internal texture width (on device), a power of 2 if necessary
|
||||
/// Internal texture width (on device), a power of 2 if necessary
|
||||
/// </summary>
|
||||
public int W2
|
||||
{
|
||||
@@ -46,7 +64,7 @@ namespace VocaluxeLib.Draw
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Internal texture height (on device), a power of 2 if necessary
|
||||
/// Internal texture height (on device), a power of 2 if necessary
|
||||
/// </summary>
|
||||
public int H2
|
||||
{
|
||||
@@ -62,16 +80,16 @@ namespace VocaluxeLib.Draw
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal use. Specifies which part of texture memory is actually used
|
||||
/// Internal use. Specifies which part of texture memory is actually used
|
||||
/// </summary>
|
||||
public float WidthRatio { get; private set; }
|
||||
/// <summary>
|
||||
/// Internal use. Specifies which part of texture memory is actually used
|
||||
/// Internal use. Specifies which part of texture memory is actually used
|
||||
/// </summary>
|
||||
public float HeightRatio { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Actual texture space used in x direction
|
||||
/// Actual texture space used in x direction
|
||||
/// </summary>
|
||||
public int UsedWidth
|
||||
{
|
||||
@@ -79,7 +97,7 @@ namespace VocaluxeLib.Draw
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Actual texture space used in y direction
|
||||
/// Actual texture space used in y direction
|
||||
/// </summary>
|
||||
public int UsedHeight
|
||||
{
|
||||
@@ -112,7 +130,7 @@ namespace VocaluxeLib.Draw
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new texture reference
|
||||
/// Creates a new texture reference
|
||||
/// </summary>
|
||||
/// <param name="origWidth">Original width (Bitmap size)</param>
|
||||
/// <param name="origHeight">Original height (Bitmap size)</param>
|
||||
|
||||
+20
-13
@@ -1,27 +1,34 @@
|
||||
using System;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Game;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib
|
||||
{
|
||||
public interface IMenuParty
|
||||
{
|
||||
void SetPartyModeID(int partyModeID);
|
||||
int GetPartyModeID();
|
||||
|
||||
void AssingPartyMode(IPartyMode partyMode);
|
||||
void DataToScreen(Object data);
|
||||
}
|
||||
|
||||
public interface IConfig
|
||||
{
|
||||
void SetBackgroundMusicVolume(int newVolume);
|
||||
|
||||
@@ -22,7 +22,6 @@ using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
using VocaluxeLib.Profile;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
@@ -489,8 +488,7 @@ namespace VocaluxeLib.Menu
|
||||
for (int j = 0; j < _NumW; j++)
|
||||
{
|
||||
SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||
CStatic tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect);
|
||||
tileStatic.Aspect = EAspect.Crop;
|
||||
CStatic tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
||||
CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
||||
_Theme.NameFont, _Theme.NameColor, "");
|
||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||
|
||||
@@ -21,7 +21,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
|
||||
@@ -17,18 +17,6 @@
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Drawing;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Game;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
using VocaluxeLib.PartyModes;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib.Menu
|
||||
{
|
||||
public interface IMenu
|
||||
|
||||
@@ -22,7 +22,6 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes
|
||||
{
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.Profile
|
||||
{
|
||||
@@ -13,14 +27,14 @@ namespace VocaluxeLib.Profile
|
||||
public string FileName = "";
|
||||
public CTexture Texture;
|
||||
|
||||
public CAvatar(int ID)
|
||||
public CAvatar(int id)
|
||||
{
|
||||
this.ID = ID;
|
||||
ID = id;
|
||||
}
|
||||
|
||||
public bool LoadFromFile(string NewFileName)
|
||||
public bool LoadFromFile(string fileName)
|
||||
{
|
||||
FileName = NewFileName;
|
||||
FileName = fileName;
|
||||
return Reload();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
@@ -9,15 +26,15 @@ namespace VocaluxeLib.Profile
|
||||
{
|
||||
public class CProfile
|
||||
{
|
||||
private static readonly XmlWriterSettings _Settings = new XmlWriterSettings()
|
||||
{
|
||||
private static readonly XmlWriterSettings _Settings = new XmlWriterSettings
|
||||
{
|
||||
Indent = true,
|
||||
Encoding = Encoding.UTF8,
|
||||
ConformanceLevel = ConformanceLevel.Document
|
||||
};
|
||||
|
||||
public int ID;
|
||||
|
||||
|
||||
public string PlayerName;
|
||||
public string FileName;
|
||||
public string AvatarFileName;
|
||||
@@ -55,9 +72,9 @@ namespace VocaluxeLib.Profile
|
||||
return LoadProfile(FileName);
|
||||
}
|
||||
|
||||
public bool LoadProfile(string NewFileName)
|
||||
public bool LoadProfile(string fileName)
|
||||
{
|
||||
FileName = NewFileName;
|
||||
FileName = fileName;
|
||||
|
||||
CXMLReader xmlReader = CXMLReader.OpenFile(FileName);
|
||||
if (xmlReader == null)
|
||||
@@ -85,7 +102,9 @@ namespace VocaluxeLib.Profile
|
||||
if (FileName == String.Empty)
|
||||
{
|
||||
string filename = string.Empty;
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (char chr in PlayerName)
|
||||
// ReSharper restore LoopCanBeConvertedToQuery
|
||||
{
|
||||
if (char.IsLetter(chr))
|
||||
filename += chr.ToString();
|
||||
@@ -142,4 +161,4 @@ namespace VocaluxeLib.Profile
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using VocaluxeLib;
|
||||
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib.Songs
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu.SingNotes;
|
||||
|
||||
namespace VocaluxeLib.Songs
|
||||
{
|
||||
@@ -806,9 +806,7 @@ namespace VocaluxeLib.Songs
|
||||
return null;
|
||||
|
||||
// build sentences list
|
||||
List<string> sentences = new List<string>();
|
||||
foreach (CLine line in voice.Lines)
|
||||
sentences.Add(line.Points != 0 ? line.Lyrics : String.Empty);
|
||||
List<string> sentences = voice.Lines.Select(line => line.Points != 0 ? line.Lyrics : String.Empty).ToList();
|
||||
|
||||
// find equal sentences series
|
||||
List<SSeries> series = new List<SSeries>();
|
||||
|
||||
@@ -23,10 +23,6 @@ using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
using System.Windows.Forms;
|
||||
using VocaluxeLib.Draw;
|
||||
using VocaluxeLib.Menu.SingNotes;
|
||||
|
||||
namespace VocaluxeLib
|
||||
{
|
||||
|
||||
|
||||
Reference in new issue
Block a user