IMPORTANT: Format of all files with Resharper
NO functional changes. If you have problems merging your changes, merge/rebase on previous commit then merge this. Conflicts can easily be resolved (take yours if in doubt) After that merge next commits
This commit is contained in:
1 parent
3a110804d8
commit
149026ec32
57 files changed
+1242
-1099
No files matched your search
@@ -138,9 +138,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
writer.WriteComment("<SlideShow%>: Texture name for slide-show");
|
||||
for (int i = 0; i < _Theme.SlideShowTextures.Count; i++)
|
||||
{
|
||||
writer.WriteElementString("SlideShow" + (i + 1), _Theme.SlideShowTextures[i]);
|
||||
}
|
||||
|
||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
@@ -193,9 +191,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
|
||||
if (_Theme.Type == EBackgroundTypes.SlideShow && _Theme.SlideShowTextures.Count > 0)
|
||||
{
|
||||
ok = _DrawSlideShow();
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
@@ -209,7 +205,10 @@ namespace VocaluxeLib.Menu
|
||||
return true;
|
||||
}
|
||||
|
||||
public void UnloadTextures() { _SlideShowTextures.Clear(); }
|
||||
public void UnloadTextures()
|
||||
{
|
||||
_SlideShowTextures.Clear();
|
||||
}
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
@@ -226,7 +225,7 @@ namespace VocaluxeLib.Menu
|
||||
if (!String.IsNullOrEmpty(image))
|
||||
{
|
||||
CTexture texture = CBase.Drawing.AddTexture(image);
|
||||
if(texture != null)
|
||||
if (texture != null)
|
||||
_SlideShowTextures.Add(texture);
|
||||
}
|
||||
}
|
||||
@@ -273,7 +272,7 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
private bool _DrawSlideShow()
|
||||
{
|
||||
if (_SlideShowTextures.Count > 0)
|
||||
if (_SlideShowTextures.Count > 0)
|
||||
{
|
||||
if (!_SlideShowTimer.IsRunning)
|
||||
{
|
||||
@@ -314,10 +313,10 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
float alpha = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
|
||||
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1,1,1, alpha));
|
||||
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1, 1, 1, alpha));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace VocaluxeLib.Menu
|
||||
private bool _ThemeLoaded;
|
||||
|
||||
/// <summary>
|
||||
/// Holds a reference to Songline. DO NOT MODIFY
|
||||
/// Holds a reference to Songline. DO NOT MODIFY
|
||||
/// </summary>
|
||||
private CSongLine _Line;
|
||||
private CText _Text;
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace VocaluxeLib.Menu
|
||||
public int[] NumPlayerTeams;
|
||||
public List<int>[] TeamList;
|
||||
}
|
||||
|
||||
public abstract class CMenuPartyNameSelection : CMenuParty
|
||||
{
|
||||
private bool _Teams;
|
||||
@@ -40,7 +41,7 @@ namespace VocaluxeLib.Menu
|
||||
protected bool _AllowChangeTeamNum = true;
|
||||
protected bool _ChangePlayerNumDynamic = true;
|
||||
protected bool _ChangeTeamNumDynamic = true;
|
||||
private int _CurrentTeam = 0;
|
||||
private int _CurrentTeam;
|
||||
|
||||
private bool _AvatarsChanged;
|
||||
private bool _ProfilesChanged;
|
||||
@@ -70,9 +71,9 @@ namespace VocaluxeLib.Menu
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
_ThemeButtons = new string[] { _ButtonBack, _ButtonNext, _ButtonRandom, _ButtonIncreaseTeams, _ButtonDecreaseTeams, _ButtonIncreasePlayer, _ButtonDecreasePlayer };
|
||||
_ThemeSelectSlides = new string[] { _SelectSlideTeams, _SelectSlidePlayer };
|
||||
_ThemeNameSelections = new string[] { _NameSelection };
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonRandom, _ButtonIncreaseTeams, _ButtonDecreaseTeams, _ButtonIncreasePlayer, _ButtonDecreasePlayer};
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideTeams, _SelectSlidePlayer};
|
||||
_ThemeNameSelections = new string[] {_NameSelection};
|
||||
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
@@ -83,11 +84,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void SetPartyModeData(int numPlayer)
|
||||
{
|
||||
SetPartyModeData(1, numPlayer, new int[] { numPlayer });
|
||||
SetPartyModeData(1, numPlayer, new int[] {numPlayer});
|
||||
_CurrentTeam = 0;
|
||||
}
|
||||
|
||||
public void SetPartyModeData(int numTeams, int numPlayer, int[] numPlayerTeams)
|
||||
public void SetPartyModeData(int numTeams, int numPlayer, int[] numPlayerTeams)
|
||||
{
|
||||
_NumTeams = numTeams;
|
||||
_NumPlayer = numPlayer;
|
||||
@@ -141,13 +142,14 @@ namespace VocaluxeLib.Menu
|
||||
_AddPlayer(_CurrentTeam, _SelectedProfileID);
|
||||
}
|
||||
//Started selecting with 'P'
|
||||
if (_SelectingFast) {
|
||||
if (_SelectingFast)
|
||||
{
|
||||
if (!_ChangePlayerNumDynamic && _TeamList[_CurrentTeam].Count == _NumPlayerTeams[_CurrentTeam])
|
||||
resetSelection = true;
|
||||
else if (_TeamList[_CurrentTeam].Count == _PartyMode.GetMaxPlayerPerTeam())
|
||||
resetSelection = true;
|
||||
}
|
||||
else if(!_SelectingFast)
|
||||
else if (!_SelectingFast)
|
||||
resetSelection = true;
|
||||
break;
|
||||
|
||||
@@ -292,14 +294,15 @@ namespace VocaluxeLib.Menu
|
||||
else if (_SelectSlides[_SelectSlidePlayer].Selected)
|
||||
IncreasePlayerNum(_CurrentTeam);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (numPressed > 0)
|
||||
{
|
||||
if (_ChangeTeamNumDynamic && numPressed < _PartyMode.GetMaxTeams() && numPressed > _SelectSlides[_SelectSlideTeams].NumValues)
|
||||
{
|
||||
while (numPressed < _PartyMode.GetMaxTeams())
|
||||
IncreaseTeamNum();
|
||||
}
|
||||
if (numPressed <= _SelectSlides[_SelectSlideTeams].NumValues)
|
||||
_SelectSlides[_SelectSlideTeams].SetSelectionByValueIndex(numPressed - 1);
|
||||
}
|
||||
@@ -353,7 +356,7 @@ namespace VocaluxeLib.Menu
|
||||
_OldMouseX = mouseEvent.X;
|
||||
_OldMouseY = mouseEvent.Y;
|
||||
}
|
||||
// LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
|
||||
// LeftButton isn't hold anymore, but Select-Mode is still active -> "Drop" of Avatar
|
||||
else if (_SelectedProfileID >= 0 && !_SelectingFast)
|
||||
{
|
||||
//Check if mouse is in drop-area
|
||||
@@ -439,7 +442,7 @@ namespace VocaluxeLib.Menu
|
||||
else if (mouseEvent.RB)
|
||||
{
|
||||
bool exit = true;
|
||||
if (_SelectSlides[_SelectSlidePlayer].Selected && _TeamList[_CurrentTeam].Count > 0 )
|
||||
if (_SelectSlides[_SelectSlidePlayer].Selected && _TeamList[_CurrentTeam].Count > 0)
|
||||
{
|
||||
int currentSelection = _SelectSlides[_SelectSlidePlayer].Selection;
|
||||
int id = _TeamList[_CurrentTeam][currentSelection];
|
||||
@@ -447,7 +450,7 @@ namespace VocaluxeLib.Menu
|
||||
_UpdatePlayerSlide();
|
||||
exit = false;
|
||||
}
|
||||
|
||||
|
||||
if (exit)
|
||||
Back();
|
||||
}
|
||||
@@ -568,9 +571,7 @@ namespace VocaluxeLib.Menu
|
||||
return;
|
||||
|
||||
if (_NumTeams - 1 >= _PartyMode.GetMinTeams())
|
||||
{
|
||||
_NumTeams--;
|
||||
}
|
||||
_UpdateButtonState();
|
||||
}
|
||||
|
||||
@@ -601,9 +602,8 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
_UpdateButtonState();
|
||||
}
|
||||
|
||||
#region private methods
|
||||
|
||||
#region private methods
|
||||
private void _OnProfileChanged(EProfileChangedFlags flags)
|
||||
{
|
||||
if (EProfileChangedFlags.Avatar == (EProfileChangedFlags.Avatar & flags))
|
||||
@@ -650,9 +650,7 @@ namespace VocaluxeLib.Menu
|
||||
_SelectSlides[_SelectSlidePlayer].AddValue(name, avatar);
|
||||
}
|
||||
for (int i = _TeamList[_CurrentTeam].Count; i < _NumPlayerTeams[_CurrentTeam]; i++)
|
||||
{
|
||||
_SelectSlides[_SelectSlidePlayer].AddValue("", _NameSelections[_NameSelection].TextureEmptyTile);
|
||||
}
|
||||
if (selection >= _TeamList[_CurrentTeam].Count)
|
||||
selection = _TeamList[_CurrentTeam].Count - 1;
|
||||
_SelectSlides[_SelectSlidePlayer].SetSelectionByValueIndex(selection);
|
||||
@@ -664,13 +662,12 @@ namespace VocaluxeLib.Menu
|
||||
_SelectSlides[_SelectSlideTeams].Clear();
|
||||
for (int i = 1; i <= _NumTeams; i++)
|
||||
_SelectSlides[_SelectSlideTeams].AddValue("Team " + i);
|
||||
|
||||
}
|
||||
|
||||
private void _UpdateButtonVisibility()
|
||||
{
|
||||
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.GetMinTeams() != _PartyMode.GetMaxTeams();
|
||||
_Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum;
|
||||
_Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum;
|
||||
}
|
||||
@@ -711,9 +708,7 @@ namespace VocaluxeLib.Menu
|
||||
List<int> ids = new List<int>();
|
||||
ids.AddRange(_TeamList[t]);
|
||||
for (int p = 0; p < ids.Count; p++)
|
||||
{
|
||||
_RemovePlayer(t, ids[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,7 +740,6 @@ namespace VocaluxeLib.Menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ namespace VocaluxeLib.Menu
|
||||
_Player = player;
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
}
|
||||
//Normal activation
|
||||
//Normal activation
|
||||
else if (active)
|
||||
{
|
||||
Selection = 0;
|
||||
@@ -385,7 +385,7 @@ namespace VocaluxeLib.Menu
|
||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||
_PlayerSelector.Visible = true;
|
||||
}
|
||||
//Deactivate
|
||||
//Deactivate
|
||||
else
|
||||
{
|
||||
Selection = -1;
|
||||
@@ -415,7 +415,8 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_Tiles[i].Avatar.Texture = CBase.Profiles.GetAvatar(_VisibleProfiles[i + offset * _Tiles.Count]);
|
||||
_Tiles[i].Avatar.Color = new SColorF(1, 1, 1, 1);
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetPlayerName(_VisibleProfiles[i + offset * _Tiles.Count]); ;
|
||||
_Tiles[i].Name.Text = CBase.Profiles.GetPlayerName(_VisibleProfiles[i + offset * _Tiles.Count]);
|
||||
;
|
||||
_Tiles[i].ProfileID = _VisibleProfiles[i + offset * _Tiles.Count];
|
||||
}
|
||||
else
|
||||
@@ -462,7 +463,7 @@ namespace VocaluxeLib.Menu
|
||||
return new CStatic(_PartyModeID);
|
||||
}
|
||||
|
||||
public void UnloadTextures() { }
|
||||
public void UnloadTextures() {}
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
@@ -486,12 +487,14 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void UseProfile(int id)
|
||||
{
|
||||
if(id > -1)
|
||||
if (id > -1)
|
||||
{
|
||||
if (!_UsedProfiles.Contains(id) && CBase.Profiles.IsProfileIDValid(id) && !CBase.Profiles.IsGuest(id))
|
||||
{
|
||||
_UsedProfiles.Add(id);
|
||||
UpdateList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveUsedProfile(int id)
|
||||
@@ -513,7 +516,7 @@ namespace VocaluxeLib.Menu
|
||||
if (_VisibleProfiles.Count == _UsedProfiles.Count)
|
||||
return id;
|
||||
|
||||
while(id == -1)
|
||||
while (id == -1)
|
||||
{
|
||||
int rand = CBase.Game.GetRandom(_VisibleProfiles.Count);
|
||||
if (_UsedProfiles.Contains(_VisibleProfiles[rand]))
|
||||
@@ -532,7 +535,7 @@ namespace VocaluxeLib.Menu
|
||||
for (int j = 0; j < _NumW; j++)
|
||||
{
|
||||
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) { Aspect = EAspect.Crop };
|
||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
||||
var 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));
|
||||
|
||||
@@ -71,10 +71,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
base._PreviewIdInternal = value;
|
||||
_UpdatePreview();
|
||||
}
|
||||
get
|
||||
{
|
||||
return base._PreviewIdInternal;
|
||||
}
|
||||
get { return base._PreviewIdInternal; }
|
||||
}
|
||||
|
||||
public override int GetActualSelection()
|
||||
@@ -375,7 +372,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
if (!keyEvent.Handled)
|
||||
{
|
||||
{
|
||||
_ActualSelection = _Locked;
|
||||
if (_PreviewId != _Locked)
|
||||
_PreviewId = _Locked;
|
||||
|
||||
Reference in new issue
Block a user