Grid overview for profile screen (#858)
* Add Profile Grid * Add Profile Grid * Add Profile Grid * Add Profile Grid * Version 4 * Add Profile Grid * Add Profile Grid * Add Profile Grid * Fix Out of Bounds Index & Player Selector Cursor * Add Profile Grid * Fix Out of Bounds Index & Player Selector Cursor
This commit is contained in:
1 parent
9dac6d9b19
commit
76d26239bd
4 files changed
+283
-128
No files matched your search
@@ -1,4 +1,8 @@
|
||||
ScreenProfiles
|
||||
++++++++++
|
||||
Version 4:
|
||||
Add: <NameSelection>
|
||||
|
||||
++++++++++
|
||||
Version 3:
|
||||
Rename: <SelectSlideGuestProfile> to <SelectSlideUserRole>
|
||||
@@ -7,4 +11,4 @@ Rename: <SelectSlideGuestProfile> to <SelectSlideUserRole>
|
||||
Version 2:
|
||||
|
||||
Add: <ButtonDiscardSnapshot>, <ButtonSaveSnapshot>, <ButtonWebcam>, <ButtonTakeSnapshot>
|
||||
++++++++++
|
||||
++++++++++
|
||||
@@ -2,7 +2,7 @@
|
||||
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Informations>
|
||||
<ScreenName>ScreenProfiles</ScreenName>
|
||||
<ScreenVersion>3</ScreenVersion>
|
||||
<ScreenVersion>4</ScreenVersion>
|
||||
</Informations>
|
||||
<Backgrounds>
|
||||
<Background Name="Background1">
|
||||
@@ -29,7 +29,7 @@
|
||||
<Skin />
|
||||
<Color Name="Visible" />
|
||||
<Rect>
|
||||
<X>1147.5</X>
|
||||
<X>1340</X>
|
||||
<Y>150</Y>
|
||||
<W>240</W>
|
||||
<H>240</H>
|
||||
@@ -53,11 +53,11 @@
|
||||
<Text>TR_SCREENPROFILES_PROFILES</Text>
|
||||
</Text>
|
||||
<Text Name="TextPlayerName">
|
||||
<X>112.5</X>
|
||||
<Y>430.5</Y>
|
||||
<X>730</X>
|
||||
<Y>435.5</Y>
|
||||
<Z>0</Z>
|
||||
<H>40.5</H>
|
||||
<MaxW>0</MaxW>
|
||||
<MaxW>295</MaxW>
|
||||
<Color Name="TextColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Left</Align>
|
||||
@@ -67,11 +67,11 @@
|
||||
<Text>TR_SCREENPROFILES_PLAYERNAME</Text>
|
||||
</Text>
|
||||
<Text Name="TextGameDifficulty">
|
||||
<X>112.5</X>
|
||||
<Y>520.5</Y>
|
||||
<X>730</X>
|
||||
<Y>525.5</Y>
|
||||
<Z>0</Z>
|
||||
<H>40.5</H>
|
||||
<MaxW>0</MaxW>
|
||||
<MaxW>295</MaxW>
|
||||
<Color Name="TextColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Left</Align>
|
||||
@@ -81,11 +81,11 @@
|
||||
<Text>TR_SCREENPROFILES_GAMEDIFFICULTY</Text>
|
||||
</Text>
|
||||
<Text Name="TextAvatar">
|
||||
<X>112.5</X>
|
||||
<Y>610.5</Y>
|
||||
<X>730</X>
|
||||
<Y>615.5</Y>
|
||||
<Z>0</Z>
|
||||
<H>40.5</H>
|
||||
<MaxW>0</MaxW>
|
||||
<MaxW>295</MaxW>
|
||||
<Color Name="TextColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Left</Align>
|
||||
@@ -95,11 +95,11 @@
|
||||
<Text>TR_SCREENPROFILES_AVATAR</Text>
|
||||
</Text>
|
||||
<Text Name="TextUserrole">
|
||||
<X>112.5</X>
|
||||
<Y>700.5</Y>
|
||||
<X>730</X>
|
||||
<Y>705.5</Y>
|
||||
<Z>0</Z>
|
||||
<H>40.5</H>
|
||||
<MaxW>0</MaxW>
|
||||
<MaxW>295</MaxW>
|
||||
<Color Name="TextColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Left</Align>
|
||||
@@ -109,11 +109,11 @@
|
||||
<Text>TR_SCREENPROFILES_USERROLE</Text>
|
||||
</Text>
|
||||
<Text Name="TextActive">
|
||||
<X>112.5</X>
|
||||
<Y>790.5</Y>
|
||||
<X>730</X>
|
||||
<Y>795.5</Y>
|
||||
<Z>0</Z>
|
||||
<H>40.5</H>
|
||||
<MaxW>0</MaxW>
|
||||
<MaxW>295</MaxW>
|
||||
<Color Name="TextColor" />
|
||||
<SelColor Name="TextSelColor" />
|
||||
<Align>Left</Align>
|
||||
@@ -128,20 +128,20 @@
|
||||
<Skin />
|
||||
<SkinSelected>SelectSlide</SkinSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>420</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>75</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<Color Name="SelectSlideColor" />
|
||||
<SelColor Name="SelectSlideSelColor" />
|
||||
<Text Name="Text">
|
||||
<X>532.5</X>
|
||||
<Y>15</Y>
|
||||
<X>420</X>
|
||||
<Y>5</Y>
|
||||
<Z>0</Z>
|
||||
<H>60</H>
|
||||
<MaxW>1053</MaxW>
|
||||
<MaxW>800</MaxW>
|
||||
<Color Name="ButtonTextSelColor" />
|
||||
<SelColor Name="ButtonTextSelColor" />
|
||||
<Align>Center</Align>
|
||||
@@ -155,7 +155,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>112.5</X>
|
||||
<X>50</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -190,7 +190,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>682.5</X>
|
||||
<X>1050</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -225,7 +225,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>997.5</X>
|
||||
<X>1347.5</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -260,7 +260,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>1312.5</X>
|
||||
<X>1645</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -295,7 +295,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>1627.5</X>
|
||||
<X>752.5</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -330,7 +330,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>1147.5</X>
|
||||
<X>1340</X>
|
||||
<Y>270</Y>
|
||||
<W>240</W>
|
||||
<H>75</H>
|
||||
@@ -357,7 +357,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>1147.5</X>
|
||||
<X>1340</X>
|
||||
<Y>195</Y>
|
||||
<W>240</W>
|
||||
<H>75</H>
|
||||
@@ -384,7 +384,7 @@
|
||||
<Skin>Button</Skin>
|
||||
<SkinSelected>Button</SkinSelected>
|
||||
<Rect>
|
||||
<X>1627.5</X>
|
||||
<X>752.5</X>
|
||||
<Y>900</Y>
|
||||
<W>225</W>
|
||||
<H>75</H>
|
||||
@@ -427,21 +427,21 @@
|
||||
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>217.5</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>120</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<RectArrowLeft>
|
||||
<X>757.5</X>
|
||||
<X>1050</X>
|
||||
<Y>247.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
<Z>0</Z>
|
||||
</RectArrowLeft>
|
||||
<RectArrowRight>
|
||||
<X>1755</X>
|
||||
<X>1810</X>
|
||||
<Y>247.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
@@ -454,9 +454,9 @@
|
||||
<TextColor Name="TextColorAlpha" />
|
||||
<TextSelColor Name="TextSelColor" />
|
||||
<TextH>40.5</TextH>
|
||||
<TextRelativeX>75</TextRelativeX>
|
||||
<TextRelativeX>65</TextRelativeX>
|
||||
<TextRelativeY>0</TextRelativeY>
|
||||
<TextMaxW>328.8</TextMaxW>
|
||||
<TextMaxW>630</TextMaxW>
|
||||
<TextFont>Outline</TextFont>
|
||||
<TextStyle>Bold</TextStyle>
|
||||
<NumVisible>0</NumVisible>
|
||||
@@ -469,21 +469,21 @@
|
||||
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>510</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>75</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<RectArrowLeft>
|
||||
<X>757.5</X>
|
||||
<X>1050</X>
|
||||
<Y>517.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
<Z>0</Z>
|
||||
</RectArrowLeft>
|
||||
<RectArrowRight>
|
||||
<X>1755</X>
|
||||
<X>1810</X>
|
||||
<Y>517.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
@@ -496,9 +496,9 @@
|
||||
<TextColor Name="TextColorAlpha" />
|
||||
<TextSelColor Name="TextSelColor" />
|
||||
<TextH>40.5</TextH>
|
||||
<TextRelativeX>75</TextRelativeX>
|
||||
<TextRelativeX>65</TextRelativeX>
|
||||
<TextRelativeY>0</TextRelativeY>
|
||||
<TextMaxW>313.01</TextMaxW>
|
||||
<TextMaxW>630</TextMaxW>
|
||||
<TextFont>Outline</TextFont>
|
||||
<TextStyle>Bold</TextStyle>
|
||||
<NumVisible>1</NumVisible>
|
||||
@@ -511,21 +511,21 @@
|
||||
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>600</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>75</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<RectArrowLeft>
|
||||
<X>757.5</X>
|
||||
<X>1050</X>
|
||||
<Y>607.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
<Z>0</Z>
|
||||
</RectArrowLeft>
|
||||
<RectArrowRight>
|
||||
<X>1755</X>
|
||||
<X>1810</X>
|
||||
<Y>607.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
@@ -538,9 +538,9 @@
|
||||
<TextColor Name="TextColorAlpha" />
|
||||
<TextSelColor Name="TextSelColor" />
|
||||
<TextH>40.5</TextH>
|
||||
<TextRelativeX>75</TextRelativeX>
|
||||
<TextRelativeX>65</TextRelativeX>
|
||||
<TextRelativeY>0</TextRelativeY>
|
||||
<TextMaxW>313.01</TextMaxW>
|
||||
<TextMaxW>630</TextMaxW>
|
||||
<TextFont>Outline</TextFont>
|
||||
<TextStyle>Bold</TextStyle>
|
||||
<NumVisible>1</NumVisible>
|
||||
@@ -553,21 +553,21 @@
|
||||
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>690</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>75</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<RectArrowLeft>
|
||||
<X>757.5</X>
|
||||
<X>1050</X>
|
||||
<Y>697.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
<Z>0</Z>
|
||||
</RectArrowLeft>
|
||||
<RectArrowRight>
|
||||
<X>1755</X>
|
||||
<X>1810</X>
|
||||
<Y>697.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
@@ -580,9 +580,9 @@
|
||||
<TextColor Name="TextColorAlpha" />
|
||||
<TextSelColor Name="TextSelColor" />
|
||||
<TextH>40.5</TextH>
|
||||
<TextRelativeX>75</TextRelativeX>
|
||||
<TextRelativeX>65</TextRelativeX>
|
||||
<TextRelativeY>0</TextRelativeY>
|
||||
<TextMaxW>469.5</TextMaxW>
|
||||
<TextMaxW>630</TextMaxW>
|
||||
<TextFont>Outline</TextFont>
|
||||
<TextStyle>Bold</TextStyle>
|
||||
<NumVisible>1</NumVisible>
|
||||
@@ -595,21 +595,21 @@
|
||||
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||
<Rect>
|
||||
<X>750</X>
|
||||
<X>1040</X>
|
||||
<Y>780</Y>
|
||||
<W>1072.5</W>
|
||||
<W>840</W>
|
||||
<H>75</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<RectArrowLeft>
|
||||
<X>757.5</X>
|
||||
<X>1050</X>
|
||||
<Y>787.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
<Z>0</Z>
|
||||
</RectArrowLeft>
|
||||
<RectArrowRight>
|
||||
<X>1755</X>
|
||||
<X>1810</X>
|
||||
<Y>787.5</Y>
|
||||
<W>60</W>
|
||||
<H>60</H>
|
||||
@@ -622,16 +622,44 @@
|
||||
<TextColor Name="TextColorAlpha" />
|
||||
<TextSelColor Name="TextSelColor" />
|
||||
<TextH>40.5</TextH>
|
||||
<TextRelativeX>75</TextRelativeX>
|
||||
<TextRelativeX>65</TextRelativeX>
|
||||
<TextRelativeY>0</TextRelativeY>
|
||||
<TextMaxW>469.5</TextMaxW>
|
||||
<TextMaxW>630</TextMaxW>
|
||||
<TextFont>Outline</TextFont>
|
||||
<TextStyle>Bold</TextStyle>
|
||||
<NumVisible>1</NumVisible>
|
||||
</SelectSlide>
|
||||
</SelectSlides>
|
||||
<SingNotes />
|
||||
<NameSelections />
|
||||
<NameSelections>
|
||||
<NameSelection Name="NameSelection">
|
||||
<Rect>
|
||||
<X>50</X>
|
||||
<Y>195</Y>
|
||||
<W>1230</W>
|
||||
<H>540</H>
|
||||
<Z>0</Z>
|
||||
</Rect>
|
||||
<SkinEmptyTile>PlayerTile</SkinEmptyTile>
|
||||
<ColorEmptyTile Name="EmptyTileColor" />
|
||||
<SkinTileSelected>PlayerSelector</SkinTileSelected>
|
||||
<Tiles>
|
||||
<W>150</W>
|
||||
<H>150</H>
|
||||
<NumW>4</NumW>
|
||||
<NumH>4</NumH>
|
||||
<SpaceW>10</SpaceW>
|
||||
<SpaceH>10</SpaceH>
|
||||
<Name>
|
||||
<Space>-20</Space>
|
||||
<H>25.5</H>
|
||||
<Font>Outline</Font>
|
||||
<Style>Bold</Style>
|
||||
<Color Name="TextColor" />
|
||||
</Name>
|
||||
</Tiles>
|
||||
</NameSelection>
|
||||
</NameSelections>
|
||||
<Equalizers />
|
||||
<Playlists />
|
||||
<ParticleEffects />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#region license
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
@@ -41,7 +41,7 @@ namespace Vocaluxe.Screens
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
{
|
||||
get { return 3; }
|
||||
get { return 4; }
|
||||
}
|
||||
|
||||
private const string _SelectSlideProfiles = "SelectSlideProfiles";
|
||||
@@ -58,10 +58,11 @@ namespace Vocaluxe.Screens
|
||||
private const string _ButtonSaveSnapshot = "ButtonSaveSnapshot";
|
||||
private const string _ButtonDiscardSnapshot = "ButtonDiscardSnapshot";
|
||||
private const string _ButtonTakeSnapshot = "ButtonTakeSnapshot";
|
||||
|
||||
private const string _NameSelection = "NameSelection";
|
||||
private const string _StaticAvatar = "StaticAvatar";
|
||||
private bool _ProfilesChanged;
|
||||
private bool _AvatarsChanged;
|
||||
private bool _SelectingKeyboardActive;
|
||||
|
||||
private Dictionary<int, Guid> _SelectSlideGuids = new Dictionary<int, Guid>();
|
||||
|
||||
@@ -78,10 +79,12 @@ namespace Vocaluxe.Screens
|
||||
{_ButtonPlayerName, _ButtonExit, _ButtonSave, _ButtonNew, _ButtonDelete, _ButtonWebcam, _ButtonSaveSnapshot, _ButtonDiscardSnapshot, _ButtonTakeSnapshot};
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideProfiles, _SelectSlideDifficulty, _SelectSlideAvatars, _SelectSlideUserRole, _SelectSlideActive};
|
||||
_ThemeStatics = new string[] {_StaticAvatar};
|
||||
_ThemeNameSelections = new string[] { _NameSelection };
|
||||
|
||||
_EditMode = EEditMode.None;
|
||||
_ProfilesChanged = false;
|
||||
_AvatarsChanged = false;
|
||||
_SelectingKeyboardActive = false;
|
||||
CProfiles.AddProfileChangedCallback(_OnProfileChanged);
|
||||
}
|
||||
|
||||
@@ -101,6 +104,46 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
if (_SelectingKeyboardActive)
|
||||
{
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.Left:
|
||||
case Keys.Right:
|
||||
case Keys.Up:
|
||||
case Keys.Down:
|
||||
_NameSelections[_NameSelection].HandleInput(keyEvent);
|
||||
return true;
|
||||
|
||||
case Keys.Enter:
|
||||
if (_NameSelections[_NameSelection].SelectedID != Guid.Empty)
|
||||
_SelectProfileById(_NameSelections[_NameSelection].SelectedID);
|
||||
|
||||
_NameSelections[_NameSelection].FastSelection(false, -1);
|
||||
_SelectingKeyboardActive = false;
|
||||
_SelectElement(_Buttons[_ButtonPlayerName]);
|
||||
return true;
|
||||
|
||||
case Keys.Escape:
|
||||
case Keys.Back:
|
||||
_NameSelections[_NameSelection].FastSelection(false, -1);
|
||||
_SelectingKeyboardActive = false;
|
||||
_SelectElement(_Buttons[_ButtonExit]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_EditMode == EEditMode.None && keyEvent.Key == Keys.Up && _Buttons[_ButtonExit].Selected)
|
||||
{
|
||||
if (CProfiles.NumProfiles <= 0)
|
||||
return true;
|
||||
|
||||
_SelectingKeyboardActive = true;
|
||||
_NameSelections[_NameSelection].Init();
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
_NameSelections[_NameSelection].FastSelection(true, 1);
|
||||
}
|
||||
|
||||
if (_EditMode == EEditMode.None)
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -199,6 +242,15 @@ namespace Vocaluxe.Screens
|
||||
if (_EditMode == EEditMode.None)
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
_NameSelections[_NameSelection].HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && _NameSelections[_NameSelection].IsOverTile(mouseEvent))
|
||||
{
|
||||
Guid profileId = _NameSelections[_NameSelection].TilePlayerID(mouseEvent);
|
||||
_SelectProfileById(profileId);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
||||
{
|
||||
if (_Buttons[_ButtonExit].Selected)
|
||||
@@ -250,16 +302,29 @@ namespace Vocaluxe.Screens
|
||||
|
||||
if (mouseEvent.RB)
|
||||
CGraphics.FadeTo(EScreen.Main);
|
||||
|
||||
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_NameSelections[_NameSelection].Rect, mouseEvent))
|
||||
{
|
||||
int offset = _NameSelections[_NameSelection].Offset + mouseEvent.Wheel;
|
||||
_NameSelections[_NameSelection].UpdateList(offset);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
if (_AvatarsChanged)
|
||||
{
|
||||
_LoadAvatars(true);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
}
|
||||
|
||||
if (_ProfilesChanged)
|
||||
{
|
||||
_LoadProfiles(true);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
}
|
||||
|
||||
if (_SelectSlides[_SelectSlideProfiles].Selection > -1)
|
||||
{
|
||||
@@ -291,6 +356,7 @@ namespace Vocaluxe.Screens
|
||||
public override void OnShow()
|
||||
{
|
||||
base.OnShow();
|
||||
_NameSelections[_NameSelection].Init();
|
||||
_LoadAvatars(false);
|
||||
_LoadProfiles(false);
|
||||
UpdateGame();
|
||||
@@ -300,6 +366,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
base.OnClose();
|
||||
_EditMode = EEditMode.None;
|
||||
_SelectingKeyboardActive = false;
|
||||
_OnDiscardSnapshot();
|
||||
}
|
||||
|
||||
@@ -368,6 +435,7 @@ namespace Vocaluxe.Screens
|
||||
int id = CProfiles.NewAvatar(file);
|
||||
CProfiles.SetAvatar(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag), id);
|
||||
_LoadAvatars(false);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
|
||||
_SelectElement(_Buttons[_ButtonSave]);
|
||||
}
|
||||
@@ -400,6 +468,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
CProfiles.SetAvatar(id, _SelectSlides[_SelectSlideAvatars].SelectedTag);
|
||||
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
_SelectElement(_Buttons[_ButtonPlayerName]);
|
||||
_EditMode = EEditMode.PlayerName;
|
||||
}
|
||||
@@ -408,6 +477,8 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
_EditMode = EEditMode.None;
|
||||
CProfiles.SaveProfiles();
|
||||
_LoadProfiles(true);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
}
|
||||
|
||||
private void _DeleteProfile()
|
||||
@@ -416,6 +487,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
CProfiles.DeleteProfile(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag));
|
||||
_SelectSlideGuids.Remove(_SelectSlides[_SelectSlideProfiles].SelectedTag);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
|
||||
int selection = _SelectSlides[_SelectSlideProfiles].Selection;
|
||||
if (_SelectSlides[_SelectSlideProfiles].NumValues - 1 > selection)
|
||||
@@ -462,7 +534,10 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
|
||||
if (_EditMode == EEditMode.PlayerName)
|
||||
{
|
||||
CProfiles.SetPlayerName(_GetIdFromTag(_SelectSlides[_SelectSlideProfiles].SelectedTag), name);
|
||||
_NameSelections[_NameSelection].UpdateList();
|
||||
}
|
||||
}
|
||||
_ProfilesChanged = false;
|
||||
}
|
||||
@@ -489,6 +564,16 @@ namespace Vocaluxe.Screens
|
||||
_AvatarsChanged = false;
|
||||
}
|
||||
|
||||
private void _SelectProfileById(Guid profileId)
|
||||
{
|
||||
if (profileId == Guid.Empty)
|
||||
return;
|
||||
|
||||
KeyValuePair<int, Guid> entry = _SelectSlideGuids.FirstOrDefault(x => x.Value.Equals(profileId));
|
||||
if (_SelectSlideGuids.ContainsKey(entry.Key))
|
||||
_SelectSlides[_SelectSlideProfiles].SelectedTag = entry.Key;
|
||||
}
|
||||
|
||||
private Guid _GetIdFromTag(int tag)
|
||||
{
|
||||
if (tag == -1 || !_SelectSlideGuids.ContainsKey(tag))
|
||||
@@ -497,4 +582,4 @@ namespace Vocaluxe.Screens
|
||||
return _SelectSlideGuids[tag];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,14 +142,17 @@ namespace VocaluxeLib.Menu
|
||||
{
|
||||
_UsedProfiles.Clear();
|
||||
_PrepareTiles();
|
||||
|
||||
_PlayerSelector = new CStatic(_PartyModeID, _TextureTileSelected, new SColorF(), new SRectF(0, 0, _Theme.Tiles.W + 6, _Theme.Tiles.H + 6, Rect.Z - 0.5f))
|
||||
{
|
||||
Visible = false
|
||||
};
|
||||
|
||||
_PlayerSelector = new CStatic(_PartyModeID, _TextureTileSelected, new SColorF(), new SRectF(0, 0, _Theme.Tiles.W + 10, _Theme.Tiles.H + 10, Rect.Z - 0.5f))
|
||||
{
|
||||
Visible = true
|
||||
};
|
||||
|
||||
_UpdateVisibleProfiles();
|
||||
UpdateList(0);
|
||||
|
||||
_ActualSelection = _Tiles.FindIndex(t => t.ProfileID != Guid.Empty);
|
||||
SelectedID = _ActualSelection >= 0 ? _Tiles[_ActualSelection].ProfileID : Guid.Empty;
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
@@ -181,69 +184,104 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
public void HandleInput(SKeyEvent kevent)
|
||||
{
|
||||
switch (kevent.Key)
|
||||
{
|
||||
case Keys.Right:
|
||||
if (_ActualSelection + 1 < _Tiles.Count)
|
||||
{
|
||||
if (_Tiles[_ActualSelection + 1].ProfileID != Guid.Empty)
|
||||
_ActualSelection++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int offset = Offset;
|
||||
UpdateList(Offset + 1);
|
||||
if (offset != Offset)
|
||||
_ActualSelection -= _Theme.Tiles.NumW - 1;
|
||||
}
|
||||
break;
|
||||
if (_Tiles.Count == 0 || _VisibleProfiles.Count == 0)
|
||||
{
|
||||
_ActualSelection = -1;
|
||||
SelectedID = Guid.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
case Keys.Left:
|
||||
if (_ActualSelection - 1 > -1)
|
||||
_ActualSelection--;
|
||||
else if (Offset > 0)
|
||||
if (_ActualSelection < 0 || _ActualSelection >= _Tiles.Count || _Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
{
|
||||
_ActualSelection = _Tiles.FindIndex(t => t.ProfileID != Guid.Empty);
|
||||
if (_ActualSelection < 0)
|
||||
{
|
||||
UpdateList(Offset - 1);
|
||||
_ActualSelection += _Theme.Tiles.NumW - 1;
|
||||
SelectedID = Guid.Empty;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (kevent.Key)
|
||||
{
|
||||
case Keys.Right:
|
||||
if (_ActualSelection + 1 < _Tiles.Count)
|
||||
{
|
||||
if (_Tiles[_ActualSelection + 1].ProfileID != Guid.Empty)
|
||||
_ActualSelection++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int oldOffset = Offset;
|
||||
UpdateList(Offset + 1);
|
||||
if (oldOffset != Offset)
|
||||
_ActualSelection = Math.Max(0, _ActualSelection - (_Theme.Tiles.NumW - 1));
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Up:
|
||||
if (_ActualSelection - _Theme.Tiles.NumW > -1)
|
||||
_ActualSelection -= _Theme.Tiles.NumW;
|
||||
else if (Offset > 0)
|
||||
{
|
||||
UpdateList(Offset - 1);
|
||||
}
|
||||
break;
|
||||
case Keys.Left:
|
||||
if (_ActualSelection - 1 >= 0)
|
||||
{
|
||||
_ActualSelection--;
|
||||
}
|
||||
else if (Offset > 0)
|
||||
{
|
||||
UpdateList(Offset - 1);
|
||||
_ActualSelection = Math.Min(_Tiles.Count - 1, _ActualSelection + (_Theme.Tiles.NumW - 1));
|
||||
while (_ActualSelection >= 0 && _Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
_ActualSelection--;
|
||||
}
|
||||
break;
|
||||
|
||||
case Keys.Down:
|
||||
if (_ActualSelection + _Theme.Tiles.NumW < _Tiles.Count)
|
||||
{
|
||||
if (_Tiles[_ActualSelection + _Theme.Tiles.NumW].ProfileID != Guid.Empty)
|
||||
_ActualSelection += _Theme.Tiles.NumW;
|
||||
}
|
||||
else
|
||||
{
|
||||
int offset = Offset;
|
||||
UpdateList(Offset + 1);
|
||||
}
|
||||
if (_Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
{
|
||||
_ActualSelection = _Tiles.Count - _Theme.Tiles.NumW;
|
||||
while(_Tiles[_ActualSelection + 1].ProfileID != Guid.Empty)
|
||||
{
|
||||
_ActualSelection++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Keys.Up:
|
||||
if (_ActualSelection - _Theme.Tiles.NumW >= 0)
|
||||
{
|
||||
_ActualSelection -= _Theme.Tiles.NumW;
|
||||
}
|
||||
else if (Offset > 0)
|
||||
{
|
||||
int currentColumn = _ActualSelection % _Theme.Tiles.NumW;
|
||||
UpdateList(Offset - 1);
|
||||
_ActualSelection = currentColumn;
|
||||
if (_ActualSelection >= _Tiles.Count)
|
||||
_ActualSelection = _Tiles.Count - 1;
|
||||
while (_ActualSelection >= 0 && _Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
_ActualSelection--;
|
||||
}
|
||||
break;
|
||||
|
||||
if (Offset * _Theme.Tiles.NumW + _ActualSelection < _VisibleProfiles.Count)
|
||||
SelectedID = _VisibleProfiles.ElementAt(Offset * _Theme.Tiles.NumW + _ActualSelection);
|
||||
else
|
||||
SelectedID = Guid.Empty;
|
||||
}
|
||||
case Keys.Down:
|
||||
if (_ActualSelection + _Theme.Tiles.NumW < _Tiles.Count &&
|
||||
_Tiles[_ActualSelection + _Theme.Tiles.NumW].ProfileID != Guid.Empty)
|
||||
{
|
||||
_ActualSelection += _Theme.Tiles.NumW;
|
||||
}
|
||||
else
|
||||
{
|
||||
int oldOffset = Offset;
|
||||
int currentColumn = _ActualSelection % _Theme.Tiles.NumW;
|
||||
UpdateList(Offset + 1);
|
||||
|
||||
if (oldOffset != Offset)
|
||||
{
|
||||
_ActualSelection = currentColumn;
|
||||
while (_ActualSelection < _Tiles.Count && _Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
_ActualSelection++;
|
||||
if (_ActualSelection >= _Tiles.Count || _Tiles[_ActualSelection].ProfileID == Guid.Empty)
|
||||
_ActualSelection = _Tiles.FindLastIndex(t => t.ProfileID != Guid.Empty);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (_ActualSelection >= 0 && _ActualSelection < _Tiles.Count && _Tiles[_ActualSelection].ProfileID != Guid.Empty)
|
||||
{
|
||||
SelectedID = _Tiles[_ActualSelection].ProfileID;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedID = Guid.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleMouse(SMouseEvent mevent)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user