From cd7c11ce381ea3a5a6c885b55294950ba1d64ba1 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 16 Dec 2012 12:09:40 +0100 Subject: [PATCH] Change challenge-names-screen (first step) --- .../Screens/PartyScreenChallengeNames.xml | 408 +----------------- .../PartyScreenChallengeNames.cs | 86 +++- 2 files changed, 77 insertions(+), 417 deletions(-) diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml index 8f3ea66b..9f3b5636 100644 --- a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml +++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml @@ -172,14 +172,14 @@ 26 - + CoverTile CoverTile - 900 - 105 + 0 + 0 0,00 100 100 @@ -220,15 +220,15 @@ - - + + CoverTile CoverTile - 1015 - 105 + 0 + 0 0,00 100 100 @@ -269,399 +269,7 @@ - - - - CoverTile - - CoverTile - - 1130 - 105 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 900 - 230 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 1015 - 230 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 1130 - 230 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 952 - 345 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 1077 - 345 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 952 - 460 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - - - - CoverTile - - CoverTile - - 1077 - 460 - 0,00 - 100 - 100 - - - ButtonColor - - - ButtonSColor - - - 50 - 102 - - 20 - - 98 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - Center - - - - Outline - - - - - - - - - - + 52 diff --git a/PartyModeChallenge/PartyScreenChallengeNames.cs b/PartyModeChallenge/PartyScreenChallengeNames.cs index 39cedd9b..454fee54 100644 --- a/PartyModeChallenge/PartyScreenChallengeNames.cs +++ b/PartyModeChallenge/PartyScreenChallengeNames.cs @@ -14,10 +14,27 @@ namespace Vocaluxe.PartyModes const string ButtonNext = "ButtonNext"; const string ButtonBack = "ButtonBack"; + const string ButtonPlayerDestination = "ButtonPlayerDestination"; const string NameSelection = "NameSelection"; + private List PlayerChooseButtons; + private List PlayerDestinationButtons; + //PlayerDestinationButtons-Option + private const int PlayerDestinationButtonsNumH = 3; + private const int PlayerDestinationButtonsNumW = 4; + private const int PlayerDestinationButtonsFirstX = 900; + private const int PlayerDestinationButtonsFirstY = 105; + private const int PlayerDestinationButtonsSpaceH = 15; + private const int PlayerDestinationButtonsSpaceW = 25; + //PlayerChooseButtons-Option + private const int PlayerChooseButtonsNumH = 3; + private const int PlayerChooseButtonsNumW = 4; + private const int PlayerChooseButtonsFirstX = 900; + private const int PlayerChooseButtonsFirstY = 105; + private const int PlayerChooseButtonsSpaceH = 15; + private const int PlayerChooseButtonsSpaceW = 25; + private CStatic chooseAvatarStatic; - private List PlayerButtons; private bool SelectingMouseActive = false; private bool SelectingKeyboardActive = false; private bool SelectingKeyboardUnendless = false; @@ -44,18 +61,11 @@ namespace Vocaluxe.PartyModes chooseAvatarStatic = GetNewStatic(); chooseAvatarStatic.Visible = false; - PlayerButtons = new List(); - for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) - { - PlayerButtons.Add("ButtonPlayer" + i); - } + PlayerChooseButtons = new List(); _ThemeName = "PartyScreenChallengeNames"; List buttons = new List(); - buttons.Add(ButtonNext); - buttons.Add(ButtonBack); - buttons.AddRange(PlayerButtons); - _ThemeButtons = buttons.ToArray(); + _ThemeButtons = new string[] { ButtonBack, ButtonNext, ButtonPlayerDestination }; _ThemeNameSelections = new string[] { NameSelection }; _ScreenVersion = ScreenVersion; @@ -72,6 +82,48 @@ namespace Vocaluxe.PartyModes base.LoadTheme(XmlPath); } + private void AddButtonPlayerDestination() + { + PlayerDestinationButtons = new List(); + int row = 1; + int column = 1; + for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) + { + CButton b = GetNewButton(); + b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH); + b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); + PlayerDestinationButtons.Add(b); + column++; + if (column > PlayerDestinationButtonsNumH) + { + row++; + column = 1; + } + AddButton(b); + } + } + + private void AddButtonPlayerChoose() + { + PlayerChooseButtons = new List(); + int row = 1; + int column = 1; + for (int i = 1; i <= PlayerChooseButtonsNumH*PlayerChooseButtonsNumW; i++) + { + CButton b = GetNewButton(); + b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH); + b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); + PlayerChooseButtons.Add(b); + column++; + if (column > PlayerChooseButtonsNumH) + { + row++; + column = 1; + } + AddButton(b); + } + } + public override bool HandleInput(KeyEvent KeyEvent) { base.HandleInput(KeyEvent); @@ -151,9 +203,9 @@ namespace Vocaluxe.PartyModes if (Buttons[htButtons(ButtonNext)].Selected) Next(); - for (int i = 0; i < PlayerButtons.Count; i++) + for (int i = 0; i < PlayerDestinationButtons.Count; i++) { - if (Buttons[htButtons(PlayerButtons[i])].Selected) + if (PlayerDestinationButtons[i].Selected) { //KeyboardSelectPlayerNr = i; //selectingKeyboardActive = true; @@ -233,13 +285,13 @@ namespace Vocaluxe.PartyModes if (SelectedPlayerNr != -1) { //Foreach Drop-Area - for (int i = 0; i < PlayerButtons.Count; i++) + for (int i = 0; i < PlayerDestinationButtons.Count; i++) { //Check first, if area is "active" - if (Buttons[htButtons(PlayerButtons[i])].Visible == true) + if (PlayerDestinationButtons[i].Visible == true) { //Check if Mouse is in area - if (CHelper.IsInBounds(Buttons[htButtons(PlayerButtons[i])].Rect, MouseEvent)) + if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent)) { //Add Player-ID to list. ProfileIDs[i] = SelectedPlayerNr; @@ -248,7 +300,7 @@ namespace Vocaluxe.PartyModes //Buttons[htButtons(PlayerButtons[i])]. = chooseAvatarStatic.Texture; //Buttons[htButtons(PlayerButtons[i])].Text.Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; //TODO: Just for testing, remove. - Buttons[htButtons(PlayerButtons[i])].Text.Text = "Gesetzt"; + PlayerDestinationButtons[i].Text.Text = "Gesetzt"; //Update Tiles-List NameSelections[htNameSelections(NameSelection)].UpdateList(); } @@ -286,7 +338,7 @@ namespace Vocaluxe.PartyModes for (int i = 0; i < ProfileIDs.Length; i++ ) ProfileIDs[i] = -1; - for (int i = 1; i <= PlayerButtons.Count; i++) + for (int i = 1; i <= PlayerDestinationButtons.Count; i++) { Buttons[htButtons("ButtonPlayer" + i)].Text.Text = "Player " + i; if (i <= NumPlayers)