Improvements to Tic Tac Toe game mode

- Player selection screen, I added a help line at the bottom and added a text label below the team selector.
- Tic Tac Toe main screen, changed the player name area, including a mic equalizer below the player name.
This commit is contained in:
Stefan authored and GitHub committed 2022-10-29 17:09:41 +02:00
commit dbc1738da1
8 files changed
+179 -21

No files matched your search

@@ -19,9 +19,11 @@
<string name="TR_SCREENCONFIG_NUMFIELDS">Number of fields</string>
<string name="TR_SCREENCONFIG_REFILLJOKERS">Refill jokers every round</string>
<string name="TR_SCREENNAMES_TITLE">Tic-Tac-Toe: Choose Player</string>
<string name="TR_SCREENNAMES_SELPLAYERSTITLE">Selected players for this team:</string>
<string name="TR_SCREENNAMES_TEAM1">Team 1</string>
<string name="TR_SCREENNAMES_TEAM2">Team 2</string>
<string name="TR_SCREENNAMES_BUTTON_RANDOM">Select random</string>
<string name="TR_SCREENNAMES_HELPMESSAGE">Add at least one player to both teams! / Drag player avatars to add them to the selected players list! / Right click avatar of selected players to remove them!</string>
<string name="TR_SCREENMAIN_TITLE">Tic-Tac-Toe</string>
<string name="TR_SCREENMAIN_TEAM_CHOOSE">Choose a field.</string>
<string name="TR_SCREENMAIN_NEXT_PLAYER">Next player</string>
@@ -19,9 +19,11 @@
<string name="TR_SCREENCONFIG_NUMFIELDS">Anzahl der Felder</string>
<string name="TR_SCREENCONFIG_REFILLJOKERS">Joker nach jeder Runde auffüllen</string>
<string name="TR_SCREENNAMES_TITLE">Tic-Tac-Toe: Spielerwahl</string>
<string name="TR_SCREENNAMES_SELPLAYERSTITLE">Ausgewählte Spieler für dieses Team:</string>
<string name="TR_SCREENNAMES_TEAM1">Team 1</string>
<string name="TR_SCREENNAMES_TEAM2">Team 2</string>
<string name="TR_SCREENNAMES_BUTTON_RANDOM">Zufällig auswählen</string>
<string name="TR_SCREENNAMES_HELPMESSAGE">Füge mindestens einen Spieler zu beiden Teams hinzu! / Zum Hinzufügen den Spieleravatar auf die Liste der ausgewählten Spieler ziehen! / Zum Entfernen den Spieleravatar mit rechter Maustaste anklicken!</string>
<string name="TR_SCREENMAIN_TITLE">Tic-Tac-Toe</string>
<string name="TR_SCREENMAIN_TEAM_CHOOSE">Wählt ein Feld aus.</string>
<string name="TR_SCREENMAIN_NEXT_PLAYER">Nächster Spieler</string>
@@ -2,7 +2,7 @@
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Informations>
<ScreenName>PartyScreenTicTacToeMain</ScreenName>
<ScreenVersion>1</ScreenVersion>
<ScreenVersion>2</ScreenVersion>
</Informations>
<Backgrounds>
<Background Name="Background1">
@@ -44,7 +44,7 @@
<Y>200</Y>
<W>100</W>
<H>100</H>
<Z>-1</Z>
<Z>-3</Z>
</Rect>
</Static>
<Static Name="StaticAvatarT2">
@@ -55,7 +55,29 @@
<Y>200</Y>
<W>100</W>
<H>100</H>
<Z>-1</Z>
<Z>-3</Z>
</Rect>
</Static>
<Static Name="StaticTeam1">
<Skin>PlayerSelBG</Skin>
<Color Name="Player1" />
<Rect>
<X>5</X>
<Y>195</Y>
<W>325</W>
<H>110</H>
<Z>-2</Z>
</Rect>
</Static>
<Static Name="StaticTeam2">
<Skin>PlayerSelBG</Skin>
<Color Name="Player2" />
<Rect>
<X>950</X>
<Y>195</Y>
<W>325</W>
<H>110</H>
<Z>-2</Z>
</Rect>
</Static>
</Statics>
@@ -146,7 +168,7 @@
</Text>
<Text Name="TextNextPlayerNameT1">
<X>120</X>
<Y>230</Y>
<Y>200</Y>
<Z>0</Z>
<H>35</H>
<MaxW>0</MaxW>
@@ -160,7 +182,7 @@
</Text>
<Text Name="TextNextPlayerNameT2">
<X>1160</X>
<Y>230</Y>
<Y>200</Y>
<Z>0</Z>
<H>40</H>
<MaxW>0</MaxW>
@@ -490,7 +512,48 @@
<SelectSlides />
<SingNotes />
<NameSelections />
<Equalizers />
<Equalizers>
<Equalizer Name="EqualizerTeam1">
<Skin/>
<Rect>
<X>120</X>
<Y>250</Y>
<W>205</W>
<H>37</H>
<Z>-3</Z>
</Rect>
<NumBars>16</NumBars>
<Space>2</Space>
<Style>Columns</Style>
<DrawNegative>TR_CONFIG_OFF</DrawNegative>
<Color Name="Player1">
<A>0.2</A>
</Color>
<MaxColor Name="Player1">
<A>0.4</A>
</MaxColor>
</Equalizer>
<Equalizer Name="EqualizerTeam2">
<Skin/>
<Rect>
<X>955</X>
<Y>250</Y>
<W>205</W>
<H>37</H>
<Z>-3</Z>
</Rect>
<NumBars>16</NumBars>
<Space>2</Space>
<Style>Columns</Style>
<DrawNegative>TR_CONFIG_OFF</DrawNegative>
<Color Name="Player2">
<A>0.2</A>
</Color>
<MaxColor Name="Player2">
<A>0.4</A>
</MaxColor>
</Equalizer>
</Equalizers>
<Playlists />
<ParticleEffects />
<ScreenSettings />
@@ -2,7 +2,7 @@
<Screen xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Informations>
<ScreenName>PartyScreenTicTacToeNames</ScreenName>
<ScreenVersion>1</ScreenVersion>
<ScreenVersion>2</ScreenVersion>
</Informations>
<Backgrounds>
<Background Name="Background1">
@@ -41,6 +41,34 @@
<Font>Outline</Font>
<Text>TR_SCREENNAMES_TITLE</Text>
</Text>
<Text Name="TextSelPlayersTitle">
<X>640</X>
<Y>155</Y>
<Z>0</Z>
<H>20</H>
<MaxW>0</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Bold</Style>
<Font>Outline</Font>
<Text>TR_SCREENNAMES_SELPLAYERSTITLE</Text>
</Text>
<Text Name="TextHelpBar">
<X>640</X>
<Y>703</Y>
<Z>0</Z>
<H>16</H>
<MaxW>1200</MaxW>
<Color Name="TextColor" />
<SelColor Name="TextSelColor" />
<Align>Center</Align>
<ResizeAlign>Center</ResizeAlign>
<Style>Normal</Style>
<Font>Outline</Font>
<Text>TR_SCREENNAMES_HELPMESSAGE</Text>
</Text>
</Texts>
<Buttons>
<Button Name="ButtonBack">
@@ -48,7 +76,7 @@
<SkinSelected>Button</SkinSelected>
<Rect>
<X>145</X>
<Y>625</Y>
<Y>618</Y>
<W>150</W>
<H>50</H>
<Z>0</Z>
@@ -83,7 +111,7 @@
<SkinSelected>Button</SkinSelected>
<Rect>
<X>985</X>
<Y>625</Y>
<Y>618</Y>
<W>150</W>
<H>50</H>
<Z>0</Z>
@@ -118,7 +146,7 @@
<SkinSelected>Button</SkinSelected>
<Rect>
<X>565</X>
<Y>625</Y>
<Y>618</Y>
<W>150</W>
<H>50</H>
<Z>0</Z>
@@ -207,7 +235,7 @@
<SkinSelected>Plus</SkinSelected>
<Rect>
<X>1180</X>
<Y>210</Y>
<Y>230</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
@@ -234,7 +262,7 @@
<SkinSelected>Minus</SkinSelected>
<Rect>
<X>1130</X>
<Y>210</Y>
<Y>230</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
@@ -311,21 +339,21 @@
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<Rect>
<X>40</X>
<Y>160</Y>
<Y>180</Y>
<W>1055</W>
<H>150</H>
<Z>0</Z>
</Rect>
<RectArrowLeft>
<X>45</X>
<Y>210</Y>
<Y>230</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
</RectArrowLeft>
<RectArrowRight>
<X>1050</X>
<Y>210</Y>
<Y>230</Y>
<W>40</W>
<H>40</H>
<Z>0</Z>
@@ -379,4 +407,4 @@
<Playlists />
<ParticleEffects />
<ScreenSettings />
</Screen>
</Screen>
@@ -38,7 +38,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
get { return 1; }
get { return 2; }
}
private const string _TextPopupReallyExit = "TextPopupReallyExit";
@@ -64,6 +64,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe
private const string _StaticPopupBG = "StaticPopupBG";
private const string _StaticAvatarT1 = "StaticAvatarT1";
private const string _StaticAvatarT2 = "StaticAvatarT2";
private const string _StaticTeam1 = "StaticTeam1";
private const string _StaticTeam2 = "StaticTeam2";
private readonly string[] _EqualizerTeam = new string[]
{"EqualizerTeam1", "EqualizerTeam2"};
private bool _ExitPopupVisible;
@@ -89,7 +94,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe
_ButtonNextRound, _ButtonBack, _ButtonExit, _ButtonPopupYes, _ButtonPopupNo, _ButtonField, _ButtonJokerRandomT1, _ButtonJokerRandomT2, _ButtonJokerRetryT1,
_ButtonJokerRetryT2
};
_ThemeStatics = new string[] {_StaticPopupBG, _StaticAvatarT1, _StaticAvatarT2};
_ThemeStatics = new string[] {_StaticPopupBG, _StaticAvatarT1, _StaticAvatarT2, _StaticTeam1, _StaticTeam2};
var texts = new List<string>();
texts.AddRange(_EqualizerTeam);
_ThemeEqualizers = texts.ToArray();
}
public override void LoadTheme(string xmlPath)
@@ -265,9 +274,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
return true;
}
public override void OnClose()
{
base.OnClose();
CBase.Record.Stop();
}
public override void OnShow()
{
base.OnShow();
CBase.Record.Start();
if (_PartyMode.GameData.CurrentRoundNr == 1)
{
@@ -299,6 +315,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
_Texts[_TextNextPlayerNameT2].Visible = false;
_Statics[_StaticAvatarT1].Visible = false;
_Statics[_StaticAvatarT2].Visible = false;
_Statics[_StaticTeam1].Visible = false;
_Statics[_StaticTeam2].Visible = false;
_Equalizers[_EqualizerTeam[0]].Visible = false;
_Equalizers[_EqualizerTeam[1]].Visible = false;
_Buttons[_ButtonJokerRandomT1].Visible = false;
_Buttons[_ButtonJokerRandomT2].Visible = false;
_Buttons[_ButtonJokerRetryT1].Visible = false;
@@ -331,6 +351,15 @@ namespace VocaluxeLib.PartyModes.TicTacToe
public override bool UpdateGame()
{
if (!_Equalizers[_EqualizerTeam[0]].Visible)
return true;
for (int i = 0; i < 2; i++)
{
CBase.Record.AnalyzeBuffer(i);
_Equalizers["EqualizerTeam" + (i+1)].Update(CBase.Record.ToneWeigth(i), CBase.Record.GetMaxVolume(i));
}
return true;
}
@@ -504,6 +533,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
_Statics[_StaticAvatarT2].Visible = true;
_Statics[_StaticAvatarT1].Texture = CBase.Profiles.GetAvatar(_PartyMode.GameData.ProfileIDsTeam1[_PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam1]);
_Statics[_StaticAvatarT2].Texture = CBase.Profiles.GetAvatar(_PartyMode.GameData.ProfileIDsTeam2[_PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2]);
_Statics[_StaticTeam1].Visible = true;
_Statics[_StaticTeam2].Visible = true;
_Equalizers[_EqualizerTeam[0]].Visible = true;
_Equalizers[_EqualizerTeam[1]].Visible = true;
}
private void _UseJoker(int teamNr, int jokerNum)
@@ -641,4 +674,4 @@ namespace VocaluxeLib.PartyModes.TicTacToe
return 0;
}
}
}
}
@@ -28,7 +28,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
get { return 1; }
get { return 2; }
}
private new CPartyModeTicTacToe _PartyMode;
@@ -84,4 +84,4 @@ namespace VocaluxeLib.PartyModes.TicTacToe
_PartyMode.Next();
}
}
}
}
+25
View File
@@ -686,6 +686,31 @@ namespace Vocaluxe.Base
{
return CRecord.GetToneAbs(player);
}
public void AnalyzeBuffer(int player)
{
CRecord.AnalyzeBuffer(player);
}
public bool Start()
{
return CRecord.Start();
}
public bool Stop()
{
return CRecord.Stop();
}
public float GetMaxVolume(int player)
{
return CRecord.GetMaxVolume(player);
}
public float[] ToneWeigth(int player)
{
return CRecord.ToneWeigth(player);
}
}
class CBsongs : ISongs
+5
View File
@@ -208,6 +208,11 @@ namespace VocaluxeLib
public interface IRecording
{
int GetToneAbs(int player);
void AnalyzeBuffer(int player);
float GetMaxVolume(int player);
float[] ToneWeigth(int player);
bool Start();
bool Stop();
}
public interface IProfiles