diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml
index 98c84333..c58a0c02 100644
--- a/Output/Languages/Deutsch.xml
+++ b/Output/Languages/Deutsch.xml
@@ -103,8 +103,20 @@
Hauptmenü
Singen
+ Party
Optionen
Profile
+
+ Party-Modus Auswahl
+ Party-Modus
+ Beschreibung
+ Autor
+ Version
+ Dieser Party-Modus konnte nicht geladen werden.
+ Zielgruppe
+ Keine Teams
+ Anzahl der Teams
+ Anzahl der Spieler
Spielerauswahl
Spieler
diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml
index c07c4636..c84f1331 100644
--- a/Output/Languages/English.xml
+++ b/Output/Languages/English.xml
@@ -103,8 +103,20 @@
Main Menu
Sing
+ Party
Options
Profiles
+
+ Party Mode Selection
+ Party Mode
+ Description
+ Author
+ Version
+ Can't load this party-mode.
+ Target audience
+ No teams
+ Number of teams
+ Number of players
Player Selection
Player
diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml
index c4a7f455..ff41874d 100644
--- a/Output/Languages/French.xml
+++ b/Output/Languages/French.xml
@@ -103,8 +103,20 @@
Menu Principal
Chanter
+ TODO: Party
Options
Profils
+
+ TODO: Party Mode Selection
+ TODO: Party Mode
+ TODO: Description
+ TODO: Author
+ TODO: Version
+ TODO: Can't load this party-mode.
+ TODO: Target audience
+ TODO: No Teams
+ TODO: Number of teams
+ TODO: Number of players
Sélection des joueurs
Joueur
diff --git a/Output/Languages/Spanish.xml b/Output/Languages/Spanish.xml
index 12adb00e..20ad318c 100644
--- a/Output/Languages/Spanish.xml
+++ b/Output/Languages/Spanish.xml
@@ -97,8 +97,20 @@
Menú Principal
Cantar
+ TODO: Party
Opciones
Perfiles
+
+ TODO: Party Mode Selection
+ TODO: Party Mode
+ TODO: Description
+ TODO: Author
+ TODO: Version
+ TODO: Can't load this party-mode.
+ TODO: Target audience
+ TODO: No Teams
+ TODO: Number of teams
+ TODO: Number of players
Selección de Jugadores
Jugador
diff --git a/Output/PartyModes/Challenge.xml b/Output/PartyModes/Challenge.xml
new file mode 100644
index 00000000..c5fe5c94
--- /dev/null
+++ b/Output/PartyModes/Challenge.xml
@@ -0,0 +1,19 @@
+
+
+ 1
+
+ TR_PARTYMODE_NAME
+ brunzel
+ TR_PARTYMODE_DESCRIPTION
+ Challenge
+ PartyModeChallenge
+ 0
+ 1
+ TR_PARTYMODE_AUDIENCE
+
+
+ PartyScreenChallengeMain
+ PartyScreenChallengeConfig
+ PartyScreenChallengeNames
+
+
\ No newline at end of file
diff --git a/Output/PartyModes/Challenge/Languages/Deutsch.xml b/Output/PartyModes/Challenge/Languages/Deutsch.xml
new file mode 100644
index 00000000..74d61366
--- /dev/null
+++ b/Output/PartyModes/Challenge/Languages/Deutsch.xml
@@ -0,0 +1,32 @@
+
+
+
+ Deutsch
+
+
+
+ Challenge Modus
+ Spiele mit bis zu X Spielern einen Wettkampfmodus
+ Für alle, die Spaß am Wettkampf haben.
+ Weiter
+ Zurück
+ Start
+ Nächste Runde
+
+ Challenge Modus: Einstellungen
+ Anzahl der Spieler
+ Anzahl der Mikrofone
+ Anzahl der Runden
+
+ Challenge Modus: Spielerwahl
+
+ Challenge Modus: Übersicht
+ Pos
+ Name
+ S
+ U
+ N
+ Sing-Punkte
+ Punkte
+
+
diff --git a/Output/PartyModes/Challenge/Languages/English.xml b/Output/PartyModes/Challenge/Languages/English.xml
new file mode 100644
index 00000000..403f4843
--- /dev/null
+++ b/Output/PartyModes/Challenge/Languages/English.xml
@@ -0,0 +1,32 @@
+
+
+
+ English
+
+
+
+ Challenge Mode
+ Challenge with up to X Players
+ For all who are interested in duel fights.
+ Next
+ Back
+ Start
+ Next Round
+
+ Challenge Mode: Configuration
+ Number of players
+ Number of mics
+ Number of rounds
+
+ Challenge Mode: Choose Player
+
+ Challenge Mode: Overview
+ Pos
+ Name
+ W
+ D
+ L
+ Sing Points
+ Score
+
+
diff --git a/Output/PartyModes/Challenge/Languages/French.xml b/Output/PartyModes/Challenge/Languages/French.xml
new file mode 100644
index 00000000..af8f9136
--- /dev/null
+++ b/Output/PartyModes/Challenge/Languages/French.xml
@@ -0,0 +1,32 @@
+
+
+
+ Français
+
+
+
+ TODO: Challenge Mode
+ TODO: Challenge with up to X Players
+ TODO: For all who are interested in duel fights.
+ TODO: Next
+ Retour
+ Démarrer
+ TODO: Next Round
+
+ TODO: Challenge Mode: Configuration
+ TODO: Number of players
+ TODO: Number of mics
+ TODO: Number of rounds
+
+ TODO: Challenge Mode: Choose Player
+
+ TODO: Challenge Mode: Overview
+ TODO: Pos
+ TODO: Name
+ TODO: W
+ TODO: D
+ TODO: L
+ TODO: Sing Points
+ TODO: Score
+
+
diff --git a/Output/PartyModes/Challenge/Languages/Spanish.xml b/Output/PartyModes/Challenge/Languages/Spanish.xml
new file mode 100644
index 00000000..f16f9a61
--- /dev/null
+++ b/Output/PartyModes/Challenge/Languages/Spanish.xml
@@ -0,0 +1,31 @@
+
+
+
+ Español
+
+
+
+ TODO: Challenge Mode
+ TODO: Challenge with up to X Players
+ TODO: For all who are interested in duel fights.
+ TODO: Next
+ Volver
+ Comenzar
+ TODO: Next Round
+
+ TODO: Challenge Mode: Configuration
+ TODO: Number of players
+ TODO: Number of mics
+ TODO: Number of rounds
+
+ TODO: Challenge Mode: Choose Player
+
+ TODO: Challenge Mode: Overview
+ TODO: Name
+ TODO: W
+ TODO: D
+ TODO: L
+ TODO: Sing Points
+ TODO: Score
+
+
diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeConfig.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeConfig.xml
new file mode 100644
index 00000000..6581aa77
--- /dev/null
+++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeConfig.xml
@@ -0,0 +1,458 @@
+
+
+
+ 1
+
+
+ Video
+
+
+
+ BG_Default
+
+
+ BackgroundColor
+
+
+
+ Menu
+
+ 40
+ 40
+ 0,00
+ 1200
+ 50
+
+
+ StaticColor
+
+
+
+
+
+
+ 640
+ 48
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENCONFIG_TITLE
+
+
+
+
+
+
+ 75
+ 105
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENCONFIG_NUMPLAYERS
+
+
+
+
+
+
+ 75
+ 165
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENCONFIG_NUMMICS
+
+
+
+
+
+
+ 75
+ 225
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENCONFIG_NUMROUNDS
+
+
+
+
+
+
+ Button
+
+ Button
+
+ 985
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_NEXT
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+ Button
+
+ Button
+
+ 145
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_BACK
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+ Invisible
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ 500
+ 100
+ 0,00
+ 700
+ 50
+
+ 505
+ 105
+ 0,00
+ 40
+ 40
+
+ 1170
+ 105
+ 0,00
+ 40
+ 40
+
+
+ SelectSlideColor
+
+
+ SelectSlideSColor
+
+
+ SelectSlideHColor
+
+
+ ArrowColor
+
+
+ ArrowSColor
+
+
+ TextColor
+
+
+ TextSColor
+
+ 32,00
+
+ 205,33
+
+ Outline
+
+ Bold
+
+ 9
+
+
+
+ Invisible
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ 500
+ 160
+ 0,00
+ 700
+ 50
+
+ 505
+ 165
+ 0,00
+ 40
+ 40
+
+ 1170
+ 165
+ 0,00
+ 40
+ 40
+
+
+ SelectSlideColor
+
+
+ SelectSlideSColor
+
+
+ SelectSlideHColor
+
+
+ ArrowColor
+
+
+ ArrowSColor
+
+
+ TextColor
+
+
+ TextSColor
+
+ 32,00
+
+ 205,33
+
+ Outline
+
+ Bold
+
+ 2
+
+
+
+ Invisible
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ 500
+ 220
+ 0,00
+ 700
+ 50
+
+ 505
+ 225
+ 0,00
+ 40
+ 40
+
+ 1170
+ 225
+ 0,00
+ 40
+ 40
+
+
+ SelectSlideColor
+
+
+ SelectSlideSColor
+
+
+ SelectSlideHColor
+
+
+ ArrowColor
+
+
+ ArrowSColor
+
+
+ TextColor
+
+
+ TextSColor
+
+ 32,00
+
+ 205,33
+
+ Outline
+
+ Bold
+
+ 10
+
+
+
diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml
new file mode 100644
index 00000000..eccf108c
--- /dev/null
+++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml
@@ -0,0 +1,322 @@
+
+
+
+ 1
+
+
+ Video
+
+
+
+ BG_Default
+
+
+ BackgroundColor
+
+
+
+ Menu
+
+ 40
+ 40
+ 0,00
+ 1200
+ 50
+
+
+ StaticColor
+
+
+
+
+
+
+ 640
+ 48
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TITLE
+
+
+
+
+
+
+ 100
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_POS
+
+
+
+
+
+
+ 110
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_PLAYERNAME
+
+
+
+
+
+
+ 400
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_WON
+
+
+
+
+
+
+ 475
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_DRAWN
+
+
+
+
+
+
+ 550
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_LOST
+
+
+
+
+
+
+ 750
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_SINGPOINTS
+
+
+
+
+
+
+ 850
+ 100
+
+ 0,00
+
+ 37
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Right
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_TABLE_GAMEPOINTS
+
+
+
+
+
+
+ Button
+
+ Button
+
+ 985
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_NEXT_ROUND
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
\ No newline at end of file
diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml
new file mode 100644
index 00000000..9d033c03
--- /dev/null
+++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml
@@ -0,0 +1,274 @@
+
+
+
+ 1
+
+
+ Video
+
+
+
+ BG_Default
+
+
+ BackgroundColor
+
+
+
+ Menu
+
+ 40
+ 40
+ 0,00
+ 1200
+ 50
+
+
+ StaticColor
+
+
+
+
+
+
+ 640
+ 48
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENNAMES_TITLE
+
+
+
+
+
+
+ Button
+
+ Button
+
+ 985
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_NEXT
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+ Button
+
+ Button
+
+ 145
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_BACK
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+ CoverTile
+
+ CoverTile
+
+ 0
+ 0
+ 0,00
+ 100
+ 100
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 50
+ 102
+
+ 20
+
+ 98
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ CoverTile
+
+ CoverTile
+
+ 0
+ 0
+ 0,00
+ 100
+ 100
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 50
+ 102
+
+ 20
+
+ 98
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Output/Themes/Ambient/Random.png b/Output/Themes/Ambient/Random.png
new file mode 100644
index 00000000..f19c9dc3
Binary files /dev/null and b/Output/Themes/Ambient/Random.png differ
diff --git a/Output/Themes/Ambient/Screens/ScreenMain.xml b/Output/Themes/Ambient/Screens/ScreenMain.xml
index 71116b93..cff309a2 100644
--- a/Output/Themes/Ambient/Screens/ScreenMain.xml
+++ b/Output/Themes/Ambient/Screens/ScreenMain.xml
@@ -86,6 +86,63 @@
26
+
+
+ Button
+
+ Button
+
+ 355
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENMAIN_BUTTON_PARTY
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
Button
diff --git a/Output/Themes/Ambient/Screens/ScreenParty.xml b/Output/Themes/Ambient/Screens/ScreenParty.xml
new file mode 100644
index 00000000..6361977d
--- /dev/null
+++ b/Output/Themes/Ambient/Screens/ScreenParty.xml
@@ -0,0 +1,654 @@
+
+
+
+ 1
+
+
+ Video
+
+
+
+ BG_Default
+
+
+ BackgroundColor
+
+
+
+ Menu
+
+ 40
+ 40
+ 0,00
+ 1200
+ 50
+
+
+ StaticColor
+
+
+
+
+
+
+ 640
+ 48
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_TITLE
+
+
+
+
+
+
+ 75
+ 105
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_MODES
+
+
+
+
+
+
+ 75
+ 165
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_DESCRIPTION
+
+
+
+
+
+
+ 75
+ 225
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_TARGETAUDIENCE
+
+
+
+
+
+
+ 75
+ 285
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_NUMTEAMS
+
+
+
+
+
+
+ 75
+ 345
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_NUMPLAYERS
+
+
+
+
+
+
+ 75
+ 405
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_AUTHOR
+
+
+
+
+
+
+ 75
+ 465
+
+ 0,00
+
+ 32
+
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_VERSION
+
+
+
+
+
+
+ 850
+ 165
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 225
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 285
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 345
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 405
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 465
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ StaticColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 850
+ 525
+
+ 0,00
+
+ 32
+
+ 600
+
+
+ TextWarningColor
+
+
+ TextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_SCREENPARTY_ERROR
+
+
+
+
+
+
+ Invisible
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ SelectSlideArrowLeft
+
+ SelectSlideArrowRight
+
+ SelectSlide
+
+ 500
+ 100
+ 0,00
+ 700
+ 50
+
+ 505
+ 105
+ 0,00
+ 40
+ 40
+
+ 1170
+ 105
+ 0,00
+ 40
+ 40
+
+
+ SelectSlideColor
+
+
+ SelectSlideSColor
+
+
+ SelectSlideHColor
+
+
+ ArrowColor
+
+
+ ArrowSColor
+
+
+ TextColor
+
+
+ TextSColor
+
+ 32,00
+
+ 600
+
+ Outline
+
+ Bold
+
+ 1
+
+
+
+ Button
+
+ Button
+
+ 985
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_START
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+ Button
+
+ Button
+
+ 145
+ 600
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_EXIT
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
+
+
diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml
index 7cc7cfd0..6e94ebeb 100644
--- a/Output/Themes/Ambient/Screens/ScreenSong.xml
+++ b/Output/Themes/Ambient/Screens/ScreenSong.xml
@@ -228,6 +228,186 @@
+
+
+ 1070
+ 65
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player1
+
+
+ Player1
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 1070
+ 135
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player2
+
+
+ Player2
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 1070
+ 205
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player3
+
+
+ Player3
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 1070
+ 275
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player4
+
+
+ Player4
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 1070
+ 345
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player5
+
+
+ Player5
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+ 1070
+ 415
+
+ -2,11
+
+ 50
+
+ 350
+
+
+ Player6
+
+
+ Player6
+
+ Left
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
Button
@@ -669,6 +849,357 @@
+
+
+ Random
+
+ Random
+
+ 980
+ 50
+ -1,01
+ 80
+ 80
+
+
+ Player1Dim
+
+
+ Player1
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Random
+
+ Random
+
+ 980
+ 120
+ -1,01
+ 80
+ 80
+
+
+ Player2Dim
+
+
+ Player2
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Random
+
+ Random
+
+ 980
+ 190
+ -1,01
+ 80
+ 80
+
+
+ Player3Dim
+
+
+ Player3
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Random
+
+ Random
+
+ 980
+ 260
+ -1,01
+ 80
+ 80
+
+
+ Player4Dim
+
+
+ Player4
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Random
+
+ Random
+
+ 980
+ 330
+ -1,01
+ 80
+ 80
+
+
+ Player5Dim
+
+
+ Player5
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Random
+
+ Random
+
+ 980
+ 400
+ -1,01
+ 80
+ 80
+
+
+ Player6Dim
+
+
+ Player6
+
+
+ 40
+ 20
+
+ 40
+
+ 60
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+
+
+
+ Button
+
+ Button
+
+ 985
+ 500
+ 0,00
+ 150
+ 50
+
+
+ ButtonColor
+
+
+ ButtonSColor
+
+
+ 75
+ 10
+
+ 32
+
+ 142
+
+
+ ButtonTextColor
+
+
+ ButtonTextSColor
+
+ Center
+
+ Center
+
+
+
+ Outline
+
+ TR_BUTTON_START
+
+
+
+
+
+ 10
+ 26
+
+
+
+
+
+ 10
+ 26
+
+
Button
diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml
index f4549af2..eb483724 100644
--- a/Output/Themes/Ambient/Skin Blue.xml
+++ b/Output/Themes/Ambient/Skin Blue.xml
@@ -335,6 +335,7 @@
Sing.png
Minus.png
Plus.png
+ Random.png
[Blue]BG_Video.mp4
diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml
index 994705cd..a1865f81 100644
--- a/Output/Themes/Ambient/Skin Green.xml
+++ b/Output/Themes/Ambient/Skin Green.xml
@@ -329,6 +329,7 @@
Sing.png
Minus.png
Plus.png
+ Random.png
[Green]BG_Video.mp4
diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml
index b669bfd0..cdbaebd4 100644
--- a/Output/Themes/Ambient/Skin Red.xml
+++ b/Output/Themes/Ambient/Skin Red.xml
@@ -329,6 +329,7 @@
Sing.png
Minus.png
Plus.png
+ Random.png
[Red]BG_Video.mp4
diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml
index 6e3d562e..22bb6061 100644
--- a/Output/Themes/Ambient/Skin Yellow.xml
+++ b/Output/Themes/Ambient/Skin Yellow.xml
@@ -329,6 +329,7 @@
Sing.png
Minus.png
Plus.png
+ Random.png
[Yellow]BG_Video.mp4
diff --git a/PartyModeChallenge/ChallengeRounds.cs b/PartyModeChallenge/ChallengeRounds.cs
new file mode 100644
index 00000000..e9412be6
--- /dev/null
+++ b/PartyModeChallenge/ChallengeRounds.cs
@@ -0,0 +1,251 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.PartyModes
+{
+ public class ChallengeRounds
+ {
+ private Random _Rand;
+ private int _NumPlayer;
+
+ public List Rounds;
+
+ public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
+ {
+ Rounds = new List();
+ _Rand = new Random(System.DateTime.Now.Millisecond);
+
+ if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
+ _NumPlayer = 0;
+ else
+ {
+ _NumPlayer = NumPlayer;
+ BuildRounds(NumRounds, NumPlayerAtOnce, _Rand);
+ }
+ }
+
+ public Combination GetRound(int RoundNr)
+ {
+ if (RoundNr >= Rounds.Count || _NumPlayer == 0 || Rounds.Count == 0)
+ return null;
+
+ return Rounds[RoundNr];
+ }
+
+ private void BuildRounds(int NumRounds, int NumPlayerAtOnce, Random Rand)
+ {
+ Combinations Combinations = new Combinations(_NumPlayer, NumPlayerAtOnce, Rand);
+ Rounds.Add(Combinations.GetNextCombination(null));
+
+ for (int i = 1; i < NumRounds; i++)
+ {
+
+ Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(i)));
+ }
+ }
+
+ private List GetPlayerDemand(int RoundIndex)
+ {
+ List NumPlayed = new List(_NumPlayer);
+ for (int i = 0; i < _NumPlayer; i++)
+ {
+ NumPlayed.Add(0);
+ }
+
+ for (int i = 0; i < RoundIndex; i++)
+ {
+ foreach (int PlayerIndex in Rounds[i].Player)
+ {
+ NumPlayed[PlayerIndex]++;
+ }
+ }
+
+ int max = 0;
+ foreach (int p in NumPlayed)
+ {
+ if (p > max)
+ max = p;
+ }
+
+ int num = Rounds[0].Player.Count;
+ List result = new List();
+ List other = new List();
+ List last = new List();
+
+ for (int i = 0; i < NumPlayed.Count; i++)
+ {
+ if (NumPlayed[i] == 0 || NumPlayed[i] < max)
+ result.Add(i);
+ else
+ {
+ if (RoundIndex > 0)
+ {
+ if (!Rounds[RoundIndex - 1].IsAvailable(i))
+ other.Add(i);
+ else
+ last.Add(i);
+ }
+ else
+ last.Add(i);
+
+ }
+ }
+
+ while (result.Count < num && other.Count > 0)
+ {
+ int n = other.Count;
+ int r = _Rand.Next(n);
+ result.Add(other[r]);
+ other.RemoveAt(r);
+ }
+
+ while (result.Count < num)
+ {
+ int n = last.Count;
+ int r = _Rand.Next(n);
+ result.Add(last[r]);
+ last.RemoveAt(r);
+ }
+
+
+ result.Sort();
+ return result;
+ }
+ }
+
+ class Combinations
+ {
+ private List _Combs;
+ private Random _Rand;
+ private int _NumPlayer;
+ private int _NumMics;
+
+ public Combinations(int NumPlayer, int NumMics, Random Rand)
+ {
+ _Combs = new List();
+ _NumMics = NumMics;
+ _NumPlayer = NumPlayer;
+ _Rand = Rand;
+ }
+
+ public Combination GetNextCombination(List PlayerNrDemand)
+ {
+ if (_Combs.Count == 0)
+ Create();
+
+ Combination combs = new Combination();
+
+ if (_NumPlayer == _NumMics)
+ {
+ return _Combs[0];
+ }
+
+ //filter against PlayerNrDemand
+ List combsFiltered = new List();
+ if (PlayerNrDemand != null)
+ {
+ for (int i = 0; i < _Combs.Count; i++)
+ {
+ if (_Combs[i].IsAvailableAll(PlayerNrDemand))
+ combsFiltered.Add(_Combs[i]);
+ }
+ }
+
+ //1st fallback
+ if (PlayerNrDemand != null && combsFiltered.Count == 0)
+ {
+ for (int i = 0; i < _Combs.Count; i++)
+ {
+ if (_Combs[i].IsAvailableSomeone(PlayerNrDemand))
+ combsFiltered.Add(_Combs[i]);
+ }
+ }
+
+ //2nd fallback
+ if (combsFiltered.Count == 0)
+ {
+ for (int i = 0; i < _Combs.Count; i++)
+ {
+ combsFiltered.Add(_Combs[i]);
+ }
+ }
+
+ int num = combsFiltered.Count;
+ int rand = _Rand.Next(num);
+ Combination c = new Combination();
+ for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
+ {
+ c.Player.Add(combsFiltered[rand].Player[i]);
+ }
+ _Combs.Remove(combsFiltered[rand]);
+
+ return combsFiltered[rand];
+ }
+
+ private void Create()
+ {
+ _Combs.Clear();
+
+ int num = (int)Math.Pow(2, _NumPlayer);
+
+ for (int i = 1; i <= num; i++)
+ {
+ Combination c = new Combination();
+
+ for (int j = 0; j < _NumPlayer; j++)
+ {
+ if ((i & (1 << j)) > 0)
+ {
+ c.Player.Add(j);
+ }
+ }
+
+ if (c.Player.Count == _NumMics)
+ _Combs.Add(c);
+ }
+ }
+ }
+
+ public class Combination
+ {
+ public List Player;
+
+ public Combination()
+ {
+ Player = new List();
+ }
+
+ public bool IsAvailable(int PlayerIndex)
+ {
+ foreach (int p in Player)
+ {
+ if (p == PlayerIndex)
+ return true;
+ }
+ return false;
+ }
+
+ public bool IsAvailableAll(List PlayerIndices)
+ {
+ bool result = true;
+ foreach (int p in PlayerIndices)
+ {
+ result &= IsAvailable(p);
+ }
+ return result;
+ }
+
+ public bool IsAvailableSomeone(List PlayerIndices)
+ {
+ bool result = false;
+ foreach (int p in PlayerIndices)
+ {
+ result |= IsAvailable(p);
+ }
+ return result;
+ }
+ }
+}
diff --git a/PartyModeChallenge/PartyModeChallenge.cs b/PartyModeChallenge/PartyModeChallenge.cs
new file mode 100644
index 00000000..bda02000
--- /dev/null
+++ b/PartyModeChallenge/PartyModeChallenge.cs
@@ -0,0 +1,612 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.PartyModes
+{
+ #region Communication
+ #region ToScreen
+ public struct DataToScreenConfig
+ {
+ public int NumPlayer;
+ public int NumPlayerAtOnce;
+ public int NumRounds;
+ }
+
+ public struct DataToScreenNames
+ {
+ public int NumPlayer;
+ public List ProfileIDs;
+ }
+
+ public struct DataToScreenMain
+ {
+ public int CurrentRoundNr;
+ public int NumPlayerAtOnce;
+ public List Combs;
+ public List ResultTable;
+ }
+
+ public class ResultTableRow : IComparable
+ {
+ public int PlayerID;
+ public int NumPlayed;
+ public int NumWon;
+ public int NumDrawn;
+ public int NumLost;
+ public int SumSingPoints;
+ public int NumGamePoints;
+
+ public int CompareTo(object obj)
+ {
+ if (obj is ResultTableRow)
+ {
+ ResultTableRow row = (ResultTableRow)obj;
+
+ int res = row.NumGamePoints.CompareTo(NumGamePoints);
+ if (res == 0)
+ {
+ res = row.SumSingPoints.CompareTo(SumSingPoints);
+ if (res == 0)
+ {
+ res = row.NumWon.CompareTo(NumWon);
+ }
+ }
+ return res;
+ }
+
+ throw new ArgumentException("object is not a ResultTableRow");
+ }
+ }
+
+ #endregion ToScreen
+
+ #region FromScreen
+ public struct DataFromScreen
+ {
+ public FromScreenConfig ScreenConfig;
+ public FromScreenNames ScreenNames;
+ public FromScreenMain ScreenMain;
+ }
+
+ public struct FromScreenConfig
+ {
+ public int NumPlayer;
+ public int NumPlayerAtOnce;
+ public int NumRounds;
+ }
+
+ public struct FromScreenNames
+ {
+ public bool FadeToConfig;
+ public bool FadeToMain;
+ public List ProfileIDs;
+ }
+
+ public struct FromScreenMain
+ {
+ public bool FadeToSongSelection;
+ }
+ #endregion FromScreen
+ #endregion Communication
+
+ public sealed class PartyModeChallenge : CPartyMode
+ {
+ private const int MaxPlayer = 12;
+ private const int MinPlayer = 1;
+ private const int MaxTeams = 0;
+ private const int MinTeams = 0;
+ private const int MaxNumRounds = 100;
+
+ enum EStage
+ {
+ NotStarted,
+ Config,
+ Names,
+ Main,
+ Singing
+ }
+
+ struct Data
+ {
+ public int NumPlayer;
+ public int NumPlayerAtOnce;
+ public int NumRounds;
+ public List ProfileIDs;
+
+ public ChallengeRounds Rounds;
+ public List ResultTable;
+
+ public int CurrentRoundNr;
+ }
+
+ struct Stats
+ {
+ public int ProfileID;
+ public int SingPoints;
+ public int GamePoints;
+ public int Won;
+ public int Drawn;
+ public int Lost;
+ }
+
+ private DataToScreenConfig ToScreenConfig;
+ private DataToScreenNames ToScreenNames;
+ private DataToScreenMain ToScreenMain;
+
+ private Data GameData;
+ private EStage _Stage;
+
+ public PartyModeChallenge()
+ {
+ _ScreenSongOptions.Selection.RandomOnly = false;
+ _ScreenSongOptions.Selection.PartyMode = true;
+ _ScreenSongOptions.Selection.CategoryChangeAllowed = true;
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
+ _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
+
+ _ScreenSongOptions.Sorting.SearchString = String.Empty;
+ _ScreenSongOptions.Sorting.SearchStringVisible = false;
+ _ScreenSongOptions.Sorting.ShowDuetSongs = false;
+
+ _Stage = EStage.NotStarted;
+
+ ToScreenConfig = new DataToScreenConfig();
+ ToScreenNames = new DataToScreenNames();
+ ToScreenMain = new DataToScreenMain();
+
+ GameData = new Data();
+ GameData.NumPlayer = 4;
+ GameData.NumPlayerAtOnce = 2;
+ GameData.NumRounds = 2;
+ GameData.CurrentRoundNr = 1;
+ GameData.ProfileIDs = new List();
+ }
+
+ public override bool Init()
+ {
+ _Stage = EStage.NotStarted;
+
+ _ScreenSongOptions.Sorting.IgnoreArticles = _Base.Config.GetIgnoreArticles();
+ _ScreenSongOptions.Sorting.SongSorting = ESongSorting.TR_CONFIG_FOLDER;
+ _ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
+
+ ToScreenMain.ResultTable = new List();
+ GameData.ResultTable = new List();
+
+ return true;
+ }
+
+ public override void DataFromScreen(string ScreenName, Object Data)
+ {
+ DataFromScreen data = new DataFromScreen();
+ switch (ScreenName)
+ {
+ case "PartyScreenChallengeConfig":
+
+ try
+ {
+ data = (DataFromScreen)Data;
+ GameData.NumPlayer = data.ScreenConfig.NumPlayer;
+ GameData.NumPlayerAtOnce = data.ScreenConfig.NumPlayerAtOnce;
+ GameData.NumRounds = data.ScreenConfig.NumRounds;
+
+ _Stage = EStage.Config;
+ _Base.Graphics.FadeTo(EScreens.ScreenPartyDummy);
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
+ }
+ break;
+
+ case "PartyScreenChallengeNames":
+ try
+ {
+ data = (DataFromScreen)Data;
+ if (data.ScreenNames.FadeToConfig)
+ _Stage = EStage.NotStarted;
+ else
+ {
+ GameData.ProfileIDs = data.ScreenNames.ProfileIDs;
+ _Stage = EStage.Names;
+ }
+
+ _Base.Graphics.FadeTo(EScreens.ScreenPartyDummy);
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
+ }
+ break;
+
+ case "PartyScreenChallengeMain":
+ try
+ {
+ data = (DataFromScreen)Data;
+ if (data.ScreenMain.FadeToSongSelection)
+ _Stage = EStage.Singing;
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
+ }
+
+
+ if (_Stage == EStage.Singing)
+ StartNextRound();
+ break;
+
+ default:
+ _Base.Log.LogError("Error in party mode challenge. Wrong screen is sending: " + ScreenName);
+ break;
+ }
+ }
+
+ public override void UpdateGame()
+ {
+ if (_Base.Songs.GetCurrentCategoryIndex() != -1)
+ _ScreenSongOptions.Selection.RandomOnly = true;
+ else
+ _ScreenSongOptions.Selection.RandomOnly = false;
+ }
+
+ public override CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen)
+ {
+ CMenuParty Screen = null;
+ AlternativeScreen = EScreens.ScreenSong;
+
+ switch (_Stage)
+ {
+ case EStage.NotStarted:
+ _Screens.TryGetValue("PartyScreenChallengeConfig", out Screen);
+ if (_Screens != null)
+ {
+ ToScreenConfig.NumPlayer = GameData.NumPlayer;
+ ToScreenConfig.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
+ ToScreenConfig.NumRounds = GameData.NumRounds;
+ Screen.DataToScreen(ToScreenConfig);
+ }
+ break;
+ case EStage.Config:
+ _Screens.TryGetValue("PartyScreenChallengeNames", out Screen);
+ if (_Screens != null)
+ {
+ ToScreenNames.NumPlayer = GameData.NumPlayer;
+ ToScreenNames.ProfileIDs = GameData.ProfileIDs;
+ Screen.DataToScreen(ToScreenNames);
+ }
+ break;
+ case EStage.Names:
+ _Screens.TryGetValue("PartyScreenChallengeMain", out Screen);
+ if (_Screens != null)
+ {
+ _Base.Songs.ResetPartySongSung();
+ GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce);
+ GameData.CurrentRoundNr = 1;
+ ToScreenMain.CurrentRoundNr = 1;
+ ToScreenMain.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
+ ToScreenMain.Combs = GameData.Rounds.Rounds;
+ UpdateScores();
+ ToScreenMain.ResultTable = GameData.ResultTable;
+ Screen.DataToScreen(ToScreenMain);
+ }
+ break;
+ case EStage.Main:
+ //nothing to do
+ break;
+ case EStage.Singing:
+ _Screens.TryGetValue("PartyScreenChallengeMain", out Screen);
+ if (_Screens != null)
+ {
+ UpdateScores();
+ ToScreenMain.CurrentRoundNr = GameData.CurrentRoundNr;
+ ToScreenMain.Combs = GameData.Rounds.Rounds;
+
+ Screen.DataToScreen(ToScreenMain);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return Screen;
+ }
+
+ public override EScreens GetStartScreen()
+ {
+ return EScreens.ScreenPartyDummy;
+ }
+
+ public override EScreens GetMainScreen()
+ {
+ return EScreens.ScreenPartyDummy;
+ }
+
+ public override ScreenSongOptions GetScreenSongOptions()
+ {
+ _ScreenSongOptions.Sorting.SongSorting = _Base.Config.GetSongSorting();
+ _ScreenSongOptions.Sorting.Tabs = _Base.Config.GetTabs();
+ _ScreenSongOptions.Sorting.IgnoreArticles = _Base.Config.GetIgnoreArticles();
+
+ return _ScreenSongOptions;
+ }
+
+ public override void SetSearchString(string SearchString, bool Visible)
+ {
+ _ScreenSongOptions.Sorting.SearchString = SearchString;
+ _ScreenSongOptions.Sorting.SearchStringVisible = Visible;
+ }
+
+ public override int GetMaxPlayer()
+ {
+ return MaxPlayer;
+ }
+
+ public override int GetMinPlayer()
+ {
+ return MinPlayer;
+ }
+
+ public override int GetMaxTeams()
+ {
+ return MaxTeams;
+ }
+
+ public override int GetMinTeams()
+ {
+ return MinTeams;
+ }
+
+ public override int GetMaxNumRounds()
+ {
+ return MaxNumRounds;
+ }
+
+ public override void JokerUsed(int TeamNr)
+ {
+ if (_ScreenSongOptions.Selection.NumJokers == null)
+ return;
+
+ if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
+ return;
+
+ if (!_ScreenSongOptions.Selection.CategoryChangeAllowed)
+ _ScreenSongOptions.Selection.NumJokers[TeamNr]--;
+
+ _ScreenSongOptions.Selection.RandomOnly = true;
+ _ScreenSongOptions.Selection.CategoryChangeAllowed = false;
+ }
+
+ public override void SongSelected(int SongID)
+ {
+
+ EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
+
+ _Base.Game.Reset();
+ _Base.Game.ClearSongs();
+ _Base.Game.AddSong(SongID, gm);
+ _Base.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
+
+ SPlayer[] player = _Base.Game.GetPlayer();
+ if (player == null)
+ return;
+
+ if (player.Length < GameData.NumPlayerAtOnce)
+ return;
+
+ SProfile[] profiles = _Base.Profiles.GetProfiles();
+ Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
+
+ for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
+ {
+ //default values
+ player[i].Name = "foobar";
+ player[i].Difficulty = EGameDifficulty.TR_CONFIG_EASY;
+ player[i].ProfileID = -1;
+
+ //try to fill with the right data
+ if (c != null)
+ {
+ if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
+ {
+ player[i].Name = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
+ player[i].Difficulty = profiles[GameData.ProfileIDs[c.Player[i]]].Difficulty;
+ player[i].ProfileID = GameData.ProfileIDs[c.Player[i]];
+ }
+ }
+ }
+
+ _Base.Songs.AddPartySongSung(SongID);
+ _Base.Graphics.FadeTo(EScreens.ScreenSing);
+ }
+
+ public override void LeavingHighscore()
+ {
+ //TODO:
+ _Base.Graphics.FadeTo(EScreens.ScreenPartyDummy);
+ }
+
+ private void StartNextRound()
+ {
+ _ScreenSongOptions.Selection.RandomOnly = false;
+ _ScreenSongOptions.Selection.CategoryChangeAllowed = true;
+ GameData.CurrentRoundNr++;
+ SetNumJokers();
+ SetTeamNames();
+ _Base.Graphics.FadeTo(EScreens.ScreenSong);
+ }
+
+ private void SetNumJokers()
+ {
+ switch (GameData.NumPlayerAtOnce)
+ {
+ case 1:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 10 };
+ break;
+
+ case 2:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
+ break;
+
+ case 3:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 4, 4, 4 };
+ break;
+
+ case 4:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 3, 3, 3, 3 };
+ break;
+
+ case 5:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2 };
+ break;
+
+ case 6:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2, 2 };
+ break;
+ default:
+ _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
+ break;
+ }
+ }
+
+ private void SetTeamNames()
+ {
+ SProfile[] profiles = _Base.Profiles.GetProfiles();
+
+ if (profiles == null)
+ {
+ _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
+ return;
+ }
+
+ if (GameData.NumPlayerAtOnce < 1 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce)
+ {
+ _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
+ return;
+ }
+
+ _ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
+ Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
+
+ for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
+ {
+ if (c != null)
+ {
+ if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
+ _ScreenSongOptions.Selection.TeamNames[i] = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
+ else
+ _ScreenSongOptions.Selection.TeamNames[i] = "foobar";
+ }
+ else
+ _ScreenSongOptions.Selection.TeamNames[i] = "foobar";
+ }
+ }
+
+ private void UpdateScores()
+ {
+ if (GameData.ResultTable.Count == 0)
+ {
+ for (int i = 0; i < GameData.NumPlayer; i++)
+ {
+ ResultTableRow row = new ResultTableRow();
+ row.PlayerID = GameData.ProfileIDs[i];
+ row.NumPlayed = 0;
+ row.NumWon = 0;
+ row.NumDrawn = 0;
+ row.NumLost = 0;
+ row.SumSingPoints = 0;
+ row.NumGamePoints = 0;
+ GameData.ResultTable.Add(row);
+ }
+ }
+ else
+ {
+ SPlayer[] results = _Base.Game.GetPlayer();
+ if (results == null)
+ return;
+
+ if (results.Length < GameData.NumPlayerAtOnce)
+ return;
+
+ List points = GetPointsForPlayer(results);
+
+ for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
+ {
+ int index = -1;
+ for (int j = 0; j < GameData.ResultTable.Count; j++)
+ {
+ if (points[i].ProfileID == GameData.ResultTable[j].PlayerID)
+ {
+ index = j;
+ break;
+ }
+ }
+
+ if (index != -1)
+ {
+ ResultTableRow row = GameData.ResultTable[index];
+
+ row.NumPlayed++;
+ row.NumWon += points[i].Won;
+ row.NumDrawn += points[i].Drawn;
+ row.NumLost += points[i].Lost;
+ row.SumSingPoints += points[i].SingPoints;
+ row.NumGamePoints += points[i].GamePoints;
+
+ GameData.ResultTable[index] = row;
+ }
+ }
+ }
+
+ GameData.ResultTable.Sort();
+ }
+
+ private List GetPointsForPlayer(SPlayer[] Results)
+ {
+ List result = new List();
+ for(int i = 0; i < GameData.NumPlayerAtOnce; i++)
+ {
+ Stats stat = new Stats();
+ stat.ProfileID = Results[i].ProfileID;
+ stat.SingPoints = (int)Results[i].Points;
+ stat.Won = 0;
+ stat.Drawn = 0;
+ stat.Lost = 0;
+ stat.GamePoints = 0;
+ result.Add(stat);
+ }
+
+ result.Sort(delegate(Stats s1, Stats s2) { return s1.SingPoints.CompareTo(s2.SingPoints); });
+
+ int current = result[result.Count - 1].SingPoints;
+ int points = result.Count;
+
+ for (int i = result.Count - 1; i >= 0; i--)
+ {
+ Stats res = result[i];
+
+ if (i < result.Count - 1)
+ {
+ if (current > res.SingPoints)
+ {
+ res.GamePoints = i * 2;
+ }
+ else
+ res.GamePoints = points;
+ }
+ else
+ res.GamePoints = i * 2;
+
+ current = res.SingPoints;
+ points = res.GamePoints;
+
+ result[i] = res;
+ }
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/PartyModeChallenge/PartyModeChallenge.csproj b/PartyModeChallenge/PartyModeChallenge.csproj
new file mode 100644
index 00000000..3155de6c
--- /dev/null
+++ b/PartyModeChallenge/PartyModeChallenge.csproj
@@ -0,0 +1,148 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}
+ Library
+ Properties
+ PartyModeChallenge
+ PartyModeChallenge
+ v2.0
+
+
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\Output\PartyModes\Challenge\Code
+ TRACE;DEBUG;WIN
+ prompt
+ 4
+ Off
+
+
+ AnyCPU
+ none
+ true
+ ..\Output\PartyModes\Challenge\Code
+ prompt
+ 4
+ false
+ WIN
+ Off
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\Output\PartyModes\Challenge\Code
+ TRACE;DEBUG;WIN
+ prompt
+ 4
+ Off
+
+
+ AnyCPU
+ none
+ true
+ ..\Output\PartyModes\Challenge\Code
+ prompt
+ 4
+ false
+ WIN
+ Off
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\Output\PartyModes\Challenge\Code
+ TRACE;DEBUG;LINUX
+ prompt
+ 4
+ Off
+
+
+ AnyCPU
+ none
+ true
+ ..\Output\PartyModes\Challenge\Code
+ prompt
+ 4
+ false
+ LINUX
+ Off
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\Output\PartyModes\Challenge\Code
+ TRACE;DEBUG;LINUX
+ prompt
+ 4
+ Off
+
+
+ AnyCPU
+ none
+ true
+ ..\Output\PartyModes\Challenge\Code
+ prompt
+ 4
+ false
+ LINUX
+ Off
+
+
+
+
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+
+
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}
+ VocaluxeLib
+ False
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PartyModeChallenge/PartyScreenChallengeConfig.cs b/PartyModeChallenge/PartyScreenChallengeConfig.cs
new file mode 100644
index 00000000..f16799fd
--- /dev/null
+++ b/PartyModeChallenge/PartyScreenChallengeConfig.cs
@@ -0,0 +1,257 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.PartyModes
+{
+ public class PartyScreenChallengeConfig : CMenuParty
+ {
+ // Version number for theme files. Increment it, if you've changed something on the theme files!
+ const int ScreenVersion = 1;
+
+ const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
+ const string SelectSlideNumMics = "SelectSlideNumMics";
+ const string SelectSlideNumRounds = "SelectSlideNumRounds";
+ const string ButtonNext = "ButtonNext";
+ const string ButtonBack = "ButtonBack";
+
+ private int _MaxNumMics = 2;
+ private int _MaxNumRounds = 100;
+ private int _RoundSteps = 1;
+
+ DataFromScreen Data;
+
+ public PartyScreenChallengeConfig()
+ {
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+
+ _ThemeName = "PartyScreenChallengeConfig";
+ _ThemeSelectSlides = new string[] { SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds };
+ _ThemeButtons = new string[] { ButtonNext, ButtonBack };
+ _ScreenVersion = ScreenVersion;
+
+ Data = new DataFromScreen();
+ FromScreenConfig config = new FromScreenConfig();
+ config.NumPlayer = 4;
+ config.NumPlayerAtOnce = 2;
+ config.NumRounds = 12;
+ Data.ScreenConfig = config;
+ }
+
+ public override void LoadTheme(string XmlPath)
+ {
+ base.LoadTheme(XmlPath);
+ }
+
+ public override void DataToScreen(object ReceivedData)
+ {
+ DataToScreenConfig config = new DataToScreenConfig();
+
+ try
+ {
+ config = (DataToScreenConfig)ReceivedData;
+ Data.ScreenConfig.NumPlayer = config.NumPlayer;
+ Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
+ Data.ScreenConfig.NumRounds = config.NumRounds;
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + _ThemeName + ". " + e.Message);;
+ }
+
+ }
+
+ public override bool HandleInput(KeyEvent KeyEvent)
+ {
+ base.HandleInput(KeyEvent);
+
+ if (KeyEvent.KeyPressed)
+ {
+
+ }
+ else
+ {
+ switch (KeyEvent.Key)
+ {
+ case Keys.Back:
+ case Keys.Escape:
+ Back();
+ break;
+
+ case Keys.Enter:
+ UpdateSlides();
+
+ if (Buttons[htButtons(ButtonBack)].Selected)
+ Back();
+
+ if (Buttons[htButtons(ButtonNext)].Selected)
+ Next();
+ break;
+
+ case Keys.Left:
+ UpdateSlides();
+ break;
+
+ case Keys.Right:
+ UpdateSlides();
+ break;
+ }
+ }
+ return true;
+ }
+
+ public override bool HandleMouse(MouseEvent MouseEvent)
+ {
+ base.HandleMouse(MouseEvent);
+
+ if (MouseEvent.LB && IsMouseOver(MouseEvent))
+ {
+ UpdateSlides();
+ if (Buttons[htButtons(ButtonBack)].Selected)
+ Back();
+
+ if (Buttons[htButtons(ButtonNext)].Selected)
+ Next();
+ }
+
+ if (MouseEvent.RB)
+ {
+ Back();
+ }
+
+ return true;
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+
+ _MaxNumMics = _Base.Config.GetMaxNumMics();
+ if (_MaxNumMics > 6)
+ _MaxNumMics = 6;
+
+ _MaxNumRounds = _PartyMode.GetMaxNumRounds();
+
+ RebuildSlides();
+ }
+
+ public override bool UpdateGame()
+ {
+ return true;
+ }
+
+ public override bool Draw()
+ {
+ base.Draw();
+ return true;
+ }
+
+ public override void OnClose()
+ {
+ base.OnClose();
+ }
+
+ private void RebuildSlides()
+ {
+ // build num player slide (min player ... max player);
+ SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Clear();
+ for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
+ {
+ SelectSlides[htSelectSlides(SelectSlideNumPlayers)].AddValue(i.ToString());
+ }
+ SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
+
+ UpdateMicsAtOnce();
+ SetRoundSteps();
+ UpdateSlideRounds();
+ }
+
+ private void UpdateSlides()
+ {
+ int player = Data.ScreenConfig.NumPlayer;
+ int mics = Data.ScreenConfig.NumPlayerAtOnce;
+ Data.ScreenConfig.NumPlayer = SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection + _PartyMode.GetMinPlayer();
+ Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection + _PartyMode.GetMinPlayer();
+ Data.ScreenConfig.NumRounds = (SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection + 1) * _RoundSteps;
+
+ UpdateMicsAtOnce();
+ SetRoundSteps();
+
+ if (player != Data.ScreenConfig.NumPlayer || mics != Data.ScreenConfig.NumPlayerAtOnce)
+ {
+ int num = CHelper.nCk(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
+ while (num > _MaxNumRounds)
+ {
+ num -= _RoundSteps;
+ }
+ Data.ScreenConfig.NumRounds = num;
+ }
+
+ UpdateSlideRounds();
+ }
+
+ private void UpdateMicsAtOnce()
+ {
+ //Data.ScreenConfig.NumPlayerAtOnce
+ int MaxNum = _MaxNumMics;
+ if (Data.ScreenConfig.NumPlayer < _MaxNumMics)
+ MaxNum = Data.ScreenConfig.NumPlayer;
+
+ if (Data.ScreenConfig.NumPlayerAtOnce > MaxNum)
+ Data.ScreenConfig.NumPlayerAtOnce = MaxNum;
+
+ // build mics at once slide
+ SelectSlides[htSelectSlides(SelectSlideNumMics)].Clear();
+ for (int i = 1; i <= MaxNum; i++)
+ {
+ SelectSlides[htSelectSlides(SelectSlideNumMics)].AddValue(i.ToString());
+ }
+ SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
+ }
+
+ private void UpdateSlideRounds()
+ {
+ // build num rounds slide
+ SelectSlides[htSelectSlides(SelectSlideNumRounds)].Clear();
+ for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
+ {
+ SelectSlides[htSelectSlides(SelectSlideNumRounds)].AddValue(i.ToString());
+ }
+ SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
+ }
+
+ private void SetRoundSteps()
+ {
+ if (Data.ScreenConfig.NumPlayerAtOnce < 1 || Data.ScreenConfig.NumPlayer < 1 || Data.ScreenConfig.NumPlayerAtOnce > Data.ScreenConfig.NumPlayer)
+ {
+ _RoundSteps = 1;
+ return;
+ }
+
+ int res = Data.ScreenConfig.NumPlayer / Data.ScreenConfig.NumPlayerAtOnce;
+ int mod = Data.ScreenConfig.NumPlayer % Data.ScreenConfig.NumPlayerAtOnce;
+
+ if (mod == 0)
+ _RoundSteps = res;
+ else
+ _RoundSteps = Data.ScreenConfig.NumPlayer;
+ }
+
+ private void Back()
+ {
+ FadeTo(EScreens.ScreenParty);
+ }
+
+ private void Next()
+ {
+ _PartyMode.DataFromScreen(_ThemeName, Data);
+ }
+ }
+}
diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs
new file mode 100644
index 00000000..282b0b20
--- /dev/null
+++ b/PartyModeChallenge/PartyScreenChallengeMain.cs
@@ -0,0 +1,235 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.PartyModes
+{
+ struct TableRow
+ {
+ public CText Pos;
+ public CText Name;
+ public CText Won;
+ public CText Drawn;
+ public CText Lost;
+ public CText SingPoints;
+ public CText GamePoints;
+ }
+
+
+ public class PartyScreenChallengeMain : CMenuParty
+ {
+ // Version number for theme files. Increment it, if you've changed something on the theme files!
+ const int ScreenVersion = 1;
+
+ const string TextPosition = "TextPosition";
+ const string TextPlayerName = "TextPlayerName";
+ const string TextWon = "TextWon";
+ const string TextDrawn = "TextDrawn";
+ const string TextLost = "TextLost";
+ const string TextSingPoints = "TextSingPoints";
+ const string TextGamePoints = "TextGamePoints";
+
+ const string ButtonNextRound = "ButtonNextRound";
+
+
+ private DataFromScreen Data;
+ private DataToScreenMain GameState;
+ private List Table;
+
+ public PartyScreenChallengeMain()
+ {
+ Data = new DataFromScreen();
+ Data.ScreenMain = new FromScreenMain();
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+
+ _ThemeName = "PartyScreenChallengeMain";
+ _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextWon, TextDrawn, TextLost, TextSingPoints, TextGamePoints };
+ _ThemeButtons = new string[] { "ButtonNextRound" };
+ _ScreenVersion = ScreenVersion;
+ }
+
+ public override void LoadTheme(string XmlPath)
+ {
+ base.LoadTheme(XmlPath);
+
+ GameState = new DataToScreenMain();
+ BuildTable();
+ }
+
+ public override void DataToScreen(object ReceivedData)
+ {
+ DataToScreenMain data = new DataToScreenMain();
+
+ try
+ {
+ data = (DataToScreenMain)ReceivedData;
+ GameState = data;
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
+ }
+
+ }
+
+ public override bool HandleInput(KeyEvent KeyEvent)
+ {
+ base.HandleInput(KeyEvent);
+
+ if (KeyEvent.KeyPressed)
+ {
+
+ }
+ else
+ {
+ switch (KeyEvent.Key)
+ {
+ case Keys.Back:
+ case Keys.Escape:
+ EndParty();
+ break;
+
+ case Keys.Enter:
+ if (Buttons[htButtons(ButtonNextRound)].Selected)
+ NextRound();
+ break;
+ }
+ }
+ return true;
+ }
+
+ public override bool HandleMouse(MouseEvent MouseEvent)
+ {
+ base.HandleMouse(MouseEvent);
+
+ if (MouseEvent.LB && IsMouseOver(MouseEvent))
+ {
+ if (Buttons[htButtons(ButtonNextRound)].Selected)
+ NextRound();
+ }
+
+ if (MouseEvent.RB)
+ {
+ EndParty();
+ }
+
+ return true;
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+
+ Updatetable();
+ }
+
+ public override bool UpdateGame()
+ {
+ return true;
+ }
+
+ public override bool Draw()
+ {
+ base.Draw();
+ return true;
+ }
+
+ public override void OnClose()
+ {
+ base.OnClose();
+ }
+
+ private void NextRound()
+ {
+ Data.ScreenMain.FadeToSongSelection = true;
+ _PartyMode.DataFromScreen(_ThemeName, Data);
+ }
+
+ private void EndParty()
+ {
+ //TODO
+ }
+
+ private void BuildTable()
+ {
+ Table = new List();
+ float delta = Texts[htTexts(TextPosition)].Height * 1.2f;
+
+ for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++)
+ {
+ TableRow row = new TableRow();
+
+ row.Pos = GetNewText(Texts[htTexts(TextPosition)]);
+ row.Name = GetNewText(Texts[htTexts(TextPlayerName)]);
+ row.Won = GetNewText(Texts[htTexts(TextWon)]);
+ row.Drawn = GetNewText(Texts[htTexts(TextDrawn)]);
+ row.Lost = GetNewText(Texts[htTexts(TextLost)]);
+ row.SingPoints = GetNewText(Texts[htTexts(TextSingPoints)]);
+ row.GamePoints = GetNewText(Texts[htTexts(TextGamePoints)]);
+
+ row.Pos.Y += delta * (i + 1);
+ row.Name.Y += delta * (i + 1);
+ row.Won.Y += delta * (i + 1);
+ row.Drawn.Y += delta * (i + 1);
+ row.Lost.Y += delta * (i + 1);
+ row.SingPoints.Y += delta * (i + 1);
+ row.GamePoints.Y += delta * (i + 1);
+
+ row.Pos.Text = (i + 1).ToString() + ")";
+
+ row.Pos.Visible = false;
+ row.Name.Visible = false;
+ row.Won.Visible = false;
+ row.Drawn.Visible = false;
+ row.Lost.Visible = false;
+ row.SingPoints.Visible = false;
+ row.GamePoints.Visible = false;
+
+ AddText(row.Pos);
+ AddText(row.Name);
+ AddText(row.Won);
+ AddText(row.Drawn);
+ AddText(row.Lost);
+ AddText(row.SingPoints);
+ AddText(row.GamePoints);
+
+ Table.Add(row);
+ }
+ }
+
+ private void Updatetable()
+ {
+ SProfile[] profiles = _Base.Profiles.GetProfiles();
+
+ for (int i = 0; i < Table.Count; i++)
+ {
+ if (i < GameState.ResultTable.Count)
+ {
+ TableRow row = Table[i];
+
+ row.Pos.Visible = true;
+ row.Name.Visible = true;
+ row.Won.Visible = true;
+ row.Drawn.Visible = true;
+ row.Lost.Visible = true;
+ row.SingPoints.Visible = true;
+ row.GamePoints.Visible = true;
+
+ row.Name.Text = profiles[GameState.ResultTable[i].PlayerID].PlayerName;
+ row.Won.Text = GameState.ResultTable[i].NumWon.ToString();
+ row.Drawn.Text = GameState.ResultTable[i].NumDrawn.ToString();
+ row.Lost.Text = GameState.ResultTable[i].NumLost.ToString();
+ row.SingPoints.Text = GameState.ResultTable[i].SumSingPoints.ToString();
+ row.GamePoints.Text = GameState.ResultTable[i].NumGamePoints.ToString();
+ }
+ }
+ }
+ }
+}
diff --git a/PartyModeChallenge/PartyScreenChallengeNames.cs b/PartyModeChallenge/PartyScreenChallengeNames.cs
new file mode 100644
index 00000000..6603f766
--- /dev/null
+++ b/PartyModeChallenge/PartyScreenChallengeNames.cs
@@ -0,0 +1,531 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.PartyModes
+{
+ public class PartyScreenChallengeNames : CMenuParty
+ {
+ // Version number for theme files. Increment it, if you've changed something on the theme files!
+ const int ScreenVersion = 1;
+
+ const string ButtonNext = "ButtonNext";
+ const string ButtonBack = "ButtonBack";
+ const string ButtonPlayerDestination = "ButtonPlayerDestination";
+ const string ButtonPlayerChoose = "ButtonPlayerChoose";
+
+ 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 List PlayerChooseButtonsVisibleProfiles;
+ private const int PlayerChooseButtonsNumH = 7;
+ private const int PlayerChooseButtonsNumW = 4;
+ private const int PlayerChooseButtonsFirstX = 52;
+ private const int PlayerChooseButtonsFirstY = 105;
+ private const int PlayerChooseButtonsSpaceH = 15;
+ private const int PlayerChooseButtonsSpaceW = 25;
+ private int PlayerChooseButtonsOffset = 0;
+
+ private CStatic chooseAvatarStatic;
+ private bool SelectingMouseActive = false;
+ private int OldMouseX = 0;
+ private int OldMouseY = 0;
+ private int SelectedPlayerNr = -1;
+ private bool ButtonsAdded = false;
+
+ private int NumPlayer = 4;
+
+ private DataFromScreen Data;
+
+ private class CPlayerChooseButton
+ {
+ public CButton Button;
+ public int ProfileID;
+ }
+
+ public PartyScreenChallengeNames()
+ {
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+
+ chooseAvatarStatic = GetNewStatic();
+ chooseAvatarStatic.Visible = false;
+
+ PlayerChooseButtonsVisibleProfiles = new List();
+
+ Data.ScreenNames.ProfileIDs = new List();
+
+ _ThemeName = "PartyScreenChallengeNames";
+ List buttons = new List();
+ _ThemeButtons = new string[] { ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose };
+ _ScreenVersion = ScreenVersion;
+
+ Data = new DataFromScreen();
+ FromScreenNames names = new FromScreenNames();
+ names.FadeToConfig = false;
+ names.FadeToMain = false;
+ names.ProfileIDs = new List();
+ Data.ScreenNames = names;
+ }
+
+ public override void LoadTheme(string XmlPath)
+ {
+ base.LoadTheme(XmlPath);
+ }
+
+ public override void DataToScreen(object ReceivedData)
+ {
+ DataToScreenNames config = new DataToScreenNames();
+
+ try
+ {
+ config = (DataToScreenNames)ReceivedData;
+ Data.ScreenNames.ProfileIDs = config.ProfileIDs;
+ if (Data.ScreenNames.ProfileIDs == null)
+ Data.ScreenNames.ProfileIDs = new List();
+
+ NumPlayer = config.NumPlayer;
+
+ while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
+ {
+ Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
+ }
+
+
+ }
+ catch (Exception e)
+ {
+ _Base.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + _ThemeName + ". " + e.Message); ;
+ }
+
+ }
+
+ public override bool HandleInput(KeyEvent KeyEvent)
+ {
+ base.HandleInput(KeyEvent);
+
+ if (KeyEvent.KeyPressed)
+ {
+
+ }
+ else
+ {
+ switch (KeyEvent.Key)
+ {
+ case Keys.Back:
+ case Keys.Escape:
+ Back();
+ break;
+
+ case Keys.Enter:
+ if (Buttons[htButtons(ButtonBack)].Selected)
+ Back();
+
+ if (Buttons[htButtons(ButtonNext)].Selected)
+ Next();
+
+ if (!OnAdd())
+ OnRemove();
+ break;
+
+ case Keys.Delete:
+ OnRemove();
+ break;
+ }
+ }
+ return true;
+ }
+
+ public override bool HandleMouse(MouseEvent MouseEvent)
+ {
+ base.HandleMouse(MouseEvent);
+
+ /*
+ //Check if LeftButton is hold and Select-Mode inactive
+ if (MouseEvent.LBH && !SelectingMouseActive)
+ {
+ //Save mouse-coords
+ OldMouseX = MouseEvent.X;
+ OldMouseY = MouseEvent.Y;
+ //Check if mouse if over tile
+ for (int i = 0; i < PlayerChooseButtons.Count; i++)
+ {
+ if (PlayerChooseButtons[i].Button.Selected)
+ {
+ SelectedPlayerNr = PlayerChooseButtons[i].ProfileID;
+ if (SelectedPlayerNr != -1)
+ {
+ //Activate mouse-selecting
+ SelectingMouseActive = true;
+ //Update of Drag/Drop-Texture
+ chooseAvatarStatic.Visible = true;
+ chooseAvatarStatic.Rect = PlayerChooseButtons[i].Button.Rect;
+ chooseAvatarStatic.Rect.Z = -100;
+ chooseAvatarStatic.Color = new SColorF(1, 1, 1, 1);
+ chooseAvatarStatic.Texture = _Base.Profiles.GetProfiles()[SelectedPlayerNr].Avatar.Texture;
+ }
+ }
+ }
+ }*/
+
+ //Check if LeftButton is hold and Select-Mode active
+ if (MouseEvent.LBH && SelectingMouseActive)
+ {
+ //Update coords for Drag/Drop-Texture
+ chooseAvatarStatic.Rect.X += (MouseEvent.X - OldMouseX);
+ chooseAvatarStatic.Rect.Y += (MouseEvent.Y - OldMouseY);
+ OldMouseX = MouseEvent.X;
+ OldMouseY = MouseEvent.Y;
+ }
+ // LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
+ else if (SelectingMouseActive)
+ {
+ //Check if really a player was selected
+ if (SelectedPlayerNr != -1)
+ {
+ //Foreach Drop-Area
+ for (int i = 0; i < PlayerDestinationButtons.Count; i++)
+ {
+ //Check first, if area is "active"
+ if (PlayerDestinationButtons[i].Visible == true)
+ {
+ //Check if Mouse is in area
+ if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
+ {
+ int added = -1;
+ //Add Player-ID to list.
+ if (Data.ScreenNames.ProfileIDs.Count < (i + 1))
+ {
+ Data.ScreenNames.ProfileIDs.Add(SelectedPlayerNr);
+ added = Data.ScreenNames.ProfileIDs.Count - 1;
+ }
+ else if (Data.ScreenNames.ProfileIDs.Count >= (i + 1))
+ {
+ Data.ScreenNames.ProfileIDs[i] = SelectedPlayerNr;
+ added = i;
+ }
+ UpdateButtonNext();
+ //Update texture and name
+ PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
+ PlayerDestinationButtons[added].SColor = new SColorF(1, 1, 1, 1);
+ PlayerDestinationButtons[added].Texture = chooseAvatarStatic.Texture;
+ PlayerDestinationButtons[added].STexture = chooseAvatarStatic.Texture;
+ PlayerDestinationButtons[added].Text.Text = _Base.Profiles.GetProfiles()[SelectedPlayerNr].PlayerName;
+ //Update Tiles-List
+ UpdateButtonPlayerChoose();
+ }
+ }
+ }
+ SelectedPlayerNr = -1;
+ }
+ //Reset variables
+ SelectingMouseActive = false;
+ chooseAvatarStatic.Visible = false;
+ }
+
+ if (MouseEvent.LB && IsMouseOver(MouseEvent))
+ {
+ if (Buttons[htButtons(ButtonBack)].Selected)
+ Back();
+
+ if (Buttons[htButtons(ButtonNext)].Selected)
+ Next();
+
+ if (!OnAdd())
+ OnRemove();
+ }
+
+ if (MouseEvent.RB)
+ {
+ Back();
+ }
+
+ return true;
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+
+ if (!ButtonsAdded)
+ {
+ AddButtonPlayerDestination();
+ AddButtonPlayerChoose();
+ ButtonsAdded = true;
+ }
+
+ UpdateButtonPlayerDestination();
+ UpdateButtonPlayerChoose();
+
+ UpdateButtonNext();
+ }
+
+ public override bool UpdateGame()
+ {
+ return true;
+ }
+
+ public override bool Draw()
+ {
+ base.Draw();
+ if (chooseAvatarStatic.Visible)
+ chooseAvatarStatic.Draw();
+ return true;
+ }
+
+ public override void OnClose()
+ {
+ base.OnClose();
+ }
+
+ private void AddButtonPlayerDestination()
+ {
+ Buttons[htButtons(ButtonPlayerDestination)].Visible = false;
+ PlayerDestinationButtons = new List();
+ int row = 0;
+ int column = 0;
+ for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++)
+ {
+ CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]);
+ 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 = 0;
+ }
+ b.Visible = true;
+ b.Enabled = false;
+ AddButton(b);
+ }
+ }
+
+ private void AddButtonPlayerChoose()
+ {
+ Buttons[htButtons(ButtonPlayerChoose)].Visible = false;
+ PlayerChooseButtons = new List();
+ int row = 0;
+ int column = 0;
+ for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++)
+ {
+ CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]);
+ b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
+ b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
+ CPlayerChooseButton pcb = new CPlayerChooseButton();
+ pcb.Button = b;
+ pcb.ProfileID = -1;
+ PlayerChooseButtons.Add(pcb);
+ column++;
+ if (column >= PlayerChooseButtonsNumH)
+ {
+ row++;
+ column = 0;
+ }
+ b.Visible = true;
+ b.Enabled = false;
+ AddButton(b);
+ }
+ }
+
+ private void UpdateButtonPlayerChoose()
+ {
+ UpdateVisibleProfiles();
+ if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >= (PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
+ {
+ UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
+ }
+ else
+ {
+ UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
+ }
+ }
+
+ private void UpdateButtonPlayerChoose(int Offset)
+ {
+ int NumButtonPlayerChoose = PlayerChooseButtonsNumW * PlayerChooseButtonsNumH;
+ if (Offset < 0)
+ Offset = 0;
+
+ if (NumButtonPlayerChoose * (Offset + 1) - PlayerChooseButtonsVisibleProfiles.Count <= NumButtonPlayerChoose)
+ {
+ for (int i = 0; i < NumButtonPlayerChoose; i++)
+ {
+ if ((i + Offset * NumButtonPlayerChoose) < PlayerChooseButtonsVisibleProfiles.Count)
+ {
+ PlayerChooseButtons[i].ProfileID = PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose];
+ PlayerChooseButtons[i].Button.Text.Text = _Base.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].PlayerName;
+ PlayerChooseButtons[i].Button.Texture = _Base.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].Avatar.Texture;
+ PlayerChooseButtons[i].Button.STexture = _Base.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].Avatar.Texture;
+ PlayerChooseButtons[i].Button.Color = new SColorF(1, 1, 1, 0.6f);
+ PlayerChooseButtons[i].Button.SColor = new SColorF(1, 1, 1, 1);
+ PlayerChooseButtons[i].Button.Enabled = true;
+ }
+ else
+ {
+ PlayerChooseButtons[i].ProfileID = -1;
+ PlayerChooseButtons[i].Button.Text.Text = String.Empty;
+ PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture;
+ PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture;
+ PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color;
+ PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor;
+ PlayerChooseButtons[i].Button.Enabled = false;
+ }
+ }
+ }
+ }
+
+ private void UpdateVisibleProfiles()
+ {
+ PlayerChooseButtonsVisibleProfiles.Clear();
+ for (int i = 0; i < _Base.Profiles.GetProfiles().Length; i++)
+ {
+ bool visible = false;
+ //Show profile only if active
+ if (_Base.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, but if selected and guest
+ if (Data.ScreenNames.ProfileIDs[p] == i && _Base.Profiles.GetProfiles()[i].GuestProfile == EOffOn.TR_CONFIG_OFF)
+ {
+ visible = false;
+ break;
+ }
+ }
+ }
+ if (visible)
+ {
+ PlayerChooseButtonsVisibleProfiles.Add(i);
+ }
+ }
+ }
+
+ private void UpdateButtonPlayerDestination()
+ {
+ for (int i = 0; i < PlayerDestinationButtons.Count; i++)
+ {
+ if (NumPlayer > i)
+ {
+ PlayerDestinationButtons[i].Visible = true;
+ PlayerDestinationButtons[i].Enabled = true;
+ }
+ else
+ {
+ PlayerDestinationButtons[i].Visible = false;
+ PlayerDestinationButtons[i].Enabled = false;
+ }
+ }
+ for (int i = 0; i < NumPlayer; i++)
+ {
+ if (i < Data.ScreenNames.ProfileIDs.Count)
+ {
+ if (Data.ScreenNames.ProfileIDs[i] != -1)
+ {
+ PlayerDestinationButtons[i].Color = new SColorF(1, 1, 1, 0.6f);
+ PlayerDestinationButtons[i].SColor = new SColorF(1, 1, 1, 1);
+ PlayerDestinationButtons[i].Texture = _Base.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
+ PlayerDestinationButtons[i].STexture = _Base.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
+ PlayerDestinationButtons[i].Text.Text = _Base.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[i]].PlayerName;
+ PlayerDestinationButtons[i].Enabled = true;
+ }
+ }
+ else
+ {
+ PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color;
+ PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor;
+ PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture;
+ PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture;
+ PlayerDestinationButtons[i].Text.Text = String.Empty;
+ PlayerDestinationButtons[i].Enabled = false;
+ }
+ }
+ }
+
+ private void UpdateButtonNext()
+ {
+ if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
+ Buttons[htButtons(ButtonNext)].Visible = true;
+ else
+ Buttons[htButtons(ButtonNext)].Visible = false;
+ }
+
+ private bool OnAdd()
+ {
+ for (int i = 0; i < PlayerChooseButtons.Count; i++)
+ {
+ if (PlayerChooseButtons[i].Button.Selected && PlayerChooseButtons[i].ProfileID != -1)
+ {
+ if (Data.ScreenNames.ProfileIDs.Count < NumPlayer)
+ {
+ Data.ScreenNames.ProfileIDs.Add(PlayerChooseButtons[i].ProfileID);
+ int added = Data.ScreenNames.ProfileIDs.Count - 1;
+ UpdateButtonNext();
+ //Update texture and name
+ PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
+ PlayerDestinationButtons[added].SColor = new SColorF(1, 1, 1, 1);
+ PlayerDestinationButtons[added].Texture = _Base.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
+ PlayerDestinationButtons[added].STexture = _Base.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
+ PlayerDestinationButtons[added].Text.Text = _Base.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].PlayerName;
+ PlayerDestinationButtons[added].Enabled = true;
+ //Update Tiles-List
+ UpdateButtonPlayerChoose();
+ CheckInteraction();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private bool OnRemove()
+ {
+ for (int i = 0; i < PlayerDestinationButtons.Count; i++)
+ {
+ if (PlayerDestinationButtons[i].Selected)
+ {
+ if ((i + 1) <= Data.ScreenNames.ProfileIDs.Count)
+ {
+ Data.ScreenNames.ProfileIDs.RemoveAt(i);
+ UpdateButtonNext();
+ UpdateButtonPlayerDestination();
+ UpdateButtonPlayerChoose();
+ CheckInteraction();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private void Back()
+ {
+ Data.ScreenNames.FadeToConfig = true;
+ Data.ScreenNames.FadeToMain = false;
+ _PartyMode.DataFromScreen(_ThemeName, Data);
+ }
+
+ private void Next()
+ {
+ Data.ScreenNames.FadeToConfig = false;
+ Data.ScreenNames.FadeToMain = true;
+ _PartyMode.DataFromScreen(_ThemeName, Data);
+ }
+ }
+}
diff --git a/Vocaluxe.sln b/Vocaluxe.sln
index 7c14c341..3f653674 100644
--- a/Vocaluxe.sln
+++ b/Vocaluxe.sln
@@ -2,36 +2,61 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocaluxe.csproj", "{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6F3E1874-F28A-40E9-AFBD-31934D593679} = {6F3E1874-F28A-40E9-AFBD-31934D593679}
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC} = {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VocaluxeLib", "VocaluxeLib\VocaluxeLib.csproj", "{D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PartyModeChallenge", "PartyModeChallenge\PartyModeChallenge.csproj", "{6F3E1874-F28A-40E9-AFBD-31934D593679}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- DebugWin|x64 = DebugWin|x64
- DebugWin|x86 = DebugWin|x86
- ReleaseWin|x64 = ReleaseWin|x64
- ReleaseWin|x86 = ReleaseWin|x86
DebugLinux|x64 = DebugLinux|x64
DebugLinux|x86 = DebugLinux|x86
+ DebugWin|x64 = DebugWin|x64
+ DebugWin|x86 = DebugWin|x86
ReleaseLinux|x64 = ReleaseLinux|x64
ReleaseLinux|x86 = ReleaseLinux|x86
+ ReleaseWin|x64 = ReleaseWin|x64
+ ReleaseWin|x86 = ReleaseWin|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.ActiveCfg = DebugWin|x64
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.Build.0 = DebugWin|x64
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.ActiveCfg = DebugWin|x86
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.Build.0 = DebugWin|x86
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.Build.0 = ReleaseWin|x64
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86
- {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.Build.0 = ReleaseWin|x86
-
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.ActiveCfg = DebugLinux|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x64.Build.0 = DebugLinux|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugLinux|x86.Build.0 = DebugLinux|x86
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.ActiveCfg = DebugWin|x64
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x64.Build.0 = DebugWin|x64
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.ActiveCfg = DebugWin|x86
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.DebugWin|x86.Build.0 = DebugWin|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x64.Build.0 = ReleaseLinux|x64
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x64.Build.0 = ReleaseWin|x64
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86
+ {2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}.ReleaseWin|x86.Build.0 = ReleaseWin|x86
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.ActiveCfg = DebugLinux|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x64.Build.0 = DebugLinux|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.ActiveCfg = DebugWin|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x64.Build.0 = DebugWin|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.DebugWin|x86.ActiveCfg = DebugWin|x86
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x64.ActiveCfg = DebugLinux|x64
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x64.ActiveCfg = DebugWin|x64
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.DebugWin|x86.ActiveCfg = DebugWin|x86
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|x64
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64
+ {6F3E1874-F28A-40E9-AFBD-31934D593679}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Vocaluxe/Menu/Animations/CAnimation.cs b/Vocaluxe/Animations/CAnimation.cs
similarity index 100%
rename from Vocaluxe/Menu/Animations/CAnimation.cs
rename to Vocaluxe/Animations/CAnimation.cs
diff --git a/Vocaluxe/Menu/Animations/CAnimationFramework.cs b/Vocaluxe/Animations/CAnimationFramework.cs
similarity index 100%
rename from Vocaluxe/Menu/Animations/CAnimationFramework.cs
rename to Vocaluxe/Animations/CAnimationFramework.cs
diff --git a/Vocaluxe/Menu/Animations/CAnimationResize.cs b/Vocaluxe/Animations/CAnimationResize.cs
similarity index 100%
rename from Vocaluxe/Menu/Animations/CAnimationResize.cs
rename to Vocaluxe/Animations/CAnimationResize.cs
diff --git a/Vocaluxe/Menu/Animations/IAnimation.cs b/Vocaluxe/Animations/IAnimation.cs
similarity index 100%
rename from Vocaluxe/Menu/Animations/IAnimation.cs
rename to Vocaluxe/Animations/IAnimation.cs
diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs
index fb3ea35c..258e811f 100644
--- a/Vocaluxe/Base/CBackgroundMusic.cs
+++ b/Vocaluxe/Base/CBackgroundMusic.cs
@@ -1,14 +1,15 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
using System.Text;
using System.IO;
using Vocaluxe.Base;
using System.Diagnostics;
-using Vocaluxe.Lib.Song;
using Vocaluxe.Lib.Draw;
-using System.Drawing;
+
using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs
index 14ecf859..ed27480a 100644
--- a/Vocaluxe/Base/CConfig.cs
+++ b/Vocaluxe/Base/CConfig.cs
@@ -12,183 +12,10 @@ using OpenTK.Platform;
using Vocaluxe.Lib.Sound;
using Vocaluxe.Lib.Webcam;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
- #region Enums
- public enum ERenderer
- {
-#if WIN
- TR_CONFIG_DIRECT3D,
-#endif
- TR_CONFIG_OPENGL,
- TR_CONFIG_SOFTWARE
- }
-
- public enum EAntiAliasingModes
- {
- x0 = 0,
- x2 = 2,
- x4 = 4,
- x8 = 8,
- x16 = 16,
- x32 = 32
- }
-
- public enum EColorDeep
- {
- Bit8 = 8,
- Bit16 = 16,
- Bit24 = 24,
- Bit32 = 32
- }
-
- public enum ETextureQuality
- {
- TR_CONFIG_TEXTURE_LOWEST,
- TR_CONFIG_TEXTURE_LOW,
- TR_CONFIG_TEXTURE_MEDIUM,
- TR_CONFIG_TEXTURE_HIGH,
- TR_CONFIG_TEXTURE_HIGHEST
- }
-
- public enum EOffOn
- {
- TR_CONFIG_OFF,
- TR_CONFIG_ON
- }
-
- public enum EDebugLevel
- {
- // don't change the order!
- TR_CONFIG_OFF, //no debug infos
- TR_CONFIG_ONLY_FPS,
- TR_CONFIG_LEVEL1,
- TR_CONFIG_LEVEL2,
- TR_CONFIG_LEVEL3,
- TR_CONFIG_LEVEL_MAX //all debug infos
- }
-
- public enum EBufferSize
- {
- b0 = 0,
- b512 = 512,
- b1024 = 1024,
- b1536 = 1536,
- b2048 = 2048,
- b2560 = 2560,
- b3072 = 3072,
- b3584 = 3584,
- b4096 = 4096
- }
-
- public enum EPlaybackLib
- {
- PortAudio,
- OpenAL
- }
-
- public enum EWebcamLib
- {
- OpenCV,
- AForgeNet
- }
-
- public enum ERecordLib
- {
-#if WIN
- DirectSound,
-#endif
- PortAudio
- }
-
- public enum EVideoDecoder
- {
- FFmpeg
- }
-
- public enum ESongMenu
- {
- //TR_CONFIG_LIST, //a simple list
- //TR_CONFIG_DREIDEL, //as in ultrastar deluxe
- TR_CONFIG_TILE_BOARD, //chessboard like
- //TR_CONFIG_BOOK //for playlists
- }
-
- public enum ESongSorting
- {
- TR_CONFIG_NONE,
- //TR_CONFIG_RANDOM,
- TR_CONFIG_FOLDER,
- TR_CONFIG_ARTIST,
- TR_CONFIG_ARTIST_LETTER,
- TR_CONFIG_TITLE_LETTER,
- TR_CONFIG_EDITION,
- TR_CONFIG_GENRE,
- TR_CONFIG_LANGUAGE,
- TR_CONFIG_YEAR,
- TR_CONFIG_DECADE
- }
-
- public enum ECoverLoading
- {
- TR_CONFIG_COVERLOADING_ONDEMAND,
- TR_CONFIG_COVERLOADING_ATSTART,
- TR_CONFIG_COVERLOADING_DYNAMIC
- }
-
- public enum EGameDifficulty
- {
- TR_CONFIG_EASY,
- TR_CONFIG_NORMAL,
- TR_CONFIG_HARD
- }
-
- public enum ETimerMode
- {
- TR_CONFIG_TIMERMODE_CURRENT,
- TR_CONFIG_TIMERMODE_REMAINING,
- TR_CONFIG_TIMERMODE_TOTAL
- }
-
- public enum ETimerLook
- {
- TR_CONFIG_TIMERLOOK_NORMAL,
- TR_CONFIG_TIMERLOOK_EXPANDED
- }
-
- public enum EBackgroundMusicSource
- {
- TR_CONFIG_NO_OWN_MUSIC,
- TR_CONFIG_OWN_MUSIC,
- TR_CONFIG_ONLY_OWN_MUSIC
- }
-
- public enum EPlayerInfo
- {
- TR_CONFIG_PLAYERINFO_BOTH,
- TR_CONFIG_PLAYERINFO_NAME,
- TR_CONFIG_PLAYERINFO_AVATAR,
- TR_CONFIG_PLAYERINFO_OFF
- }
-
- public enum EFadePlayerInfo
- {
- TR_CONFIG_FADEPLAYERINFO_ALL,
- TR_CONFIG_FADEPLAYERINFO_INFO,
- TR_CONFIG_FADEPLAYERINFO_OFF
- }
-
- public enum ELyricStyle
- {
- Fill,
- Jump,
- Slide,
- Zoom
- }
-
- #endregion Enums
-
static class CConfig
{
private static XmlWriterSettings _settings = new XmlWriterSettings();
@@ -513,7 +340,7 @@ namespace Vocaluxe.Base
#region Debug
writer.WriteStartElement("Debug");
- writer.WriteComment("DebugLevel: " + ListStrings(Enum.GetNames(typeof(EDebugLevel))));
+ writer.WriteComment("DebugLevel: " + CHelper.ListStrings(Enum.GetNames(typeof(EDebugLevel))));
writer.WriteElementString("DebugLevel", Enum.GetName(typeof(EDebugLevel), DebugLevel));
writer.WriteEndElement();
@@ -522,10 +349,10 @@ namespace Vocaluxe.Base
#region Graphics
writer.WriteStartElement("Graphics");
- writer.WriteComment("Renderer: " + ListStrings(Enum.GetNames(typeof(ERenderer))));
+ writer.WriteComment("Renderer: " + CHelper.ListStrings(Enum.GetNames(typeof(ERenderer))));
writer.WriteElementString("Renderer", Enum.GetName(typeof(ERenderer), Renderer));
- writer.WriteComment("TextureQuality: " + ListStrings(Enum.GetNames(typeof(ETextureQuality))));
+ writer.WriteComment("TextureQuality: " + CHelper.ListStrings(Enum.GetNames(typeof(ETextureQuality))));
writer.WriteElementString("TextureQuality", Enum.GetName(typeof(ETextureQuality), TextureQuality));
writer.WriteComment("CoverSize (pixels): 32, 64, 128, 256, 512, 1024 (default: 128)");
@@ -535,19 +362,19 @@ namespace Vocaluxe.Base
writer.WriteElementString("ScreenW", ScreenW.ToString());
writer.WriteElementString("ScreenH", ScreenH.ToString());
- writer.WriteComment("AAMode: " + ListStrings(Enum.GetNames(typeof(EAntiAliasingModes))));
+ writer.WriteComment("AAMode: " + CHelper.ListStrings(Enum.GetNames(typeof(EAntiAliasingModes))));
writer.WriteElementString("AAMode", Enum.GetName(typeof(EAntiAliasingModes), AAMode));
- writer.WriteComment("Colors: " + ListStrings(Enum.GetNames(typeof(EColorDeep))));
+ writer.WriteComment("Colors: " + CHelper.ListStrings(Enum.GetNames(typeof(EColorDeep))));
writer.WriteElementString("Colors", Enum.GetName(typeof(EColorDeep), Colors));
writer.WriteComment("MaxFPS should be between 1..200");
writer.WriteElementString("MaxFPS", MaxFPS.ToString("#"));
- writer.WriteComment("VSync: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("VSync: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VSync", Enum.GetName(typeof(EOffOn), VSync));
- writer.WriteComment("FullScreen: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("FullScreen: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("FullScreen", Enum.GetName(typeof(EOffOn), FullScreen));
writer.WriteComment("FadeTime should be between 0..3 Seconds");
@@ -568,25 +395,25 @@ namespace Vocaluxe.Base
writer.WriteComment("Name of cover-theme");
writer.WriteElementString("Cover", CoverTheme);
- writer.WriteComment("Draw note-lines:" + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Draw note-lines:" + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("DrawNoteLines", Enum.GetName(typeof(EOffOn), DrawNoteLines));
- writer.WriteComment("Draw tone-helper:" + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Draw tone-helper:" + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("DrawToneHelper", Enum.GetName(typeof(EOffOn), DrawToneHelper));
- writer.WriteComment("Look of timer:" + ListStrings(Enum.GetNames(typeof(ETimerLook))));
+ writer.WriteComment("Look of timer:" + CHelper.ListStrings(Enum.GetNames(typeof(ETimerLook))));
writer.WriteElementString("TimerLook", Enum.GetName(typeof(ETimerLook), TimerLook));
- writer.WriteComment("Information about players on SingScreen:" + ListStrings(Enum.GetNames(typeof(EPlayerInfo))));
+ writer.WriteComment("Information about players on SingScreen:" + CHelper.ListStrings(Enum.GetNames(typeof(EPlayerInfo))));
writer.WriteElementString("PlayerInfo", Enum.GetName(typeof(EPlayerInfo), PlayerInfo));
- writer.WriteComment("Fade player-information with lyrics and notebars:" + ListStrings(Enum.GetNames(typeof(EFadePlayerInfo))));
+ writer.WriteComment("Fade player-information with lyrics and notebars:" + CHelper.ListStrings(Enum.GetNames(typeof(EFadePlayerInfo))));
writer.WriteElementString("FadePlayerInfo", Enum.GetName(typeof(EFadePlayerInfo), FadePlayerInfo));
- writer.WriteComment("Cover Loading:" + ListStrings(Enum.GetNames(typeof(ECoverLoading))));
+ writer.WriteComment("Cover Loading:" + CHelper.ListStrings(Enum.GetNames(typeof(ECoverLoading))));
writer.WriteElementString("CoverLoading", Enum.GetName(typeof(ECoverLoading), CoverLoading));
- writer.WriteComment("Lyric Style:" + ListStrings(Enum.GetNames(typeof(ELyricStyle))));
+ writer.WriteComment("Lyric Style:" + CHelper.ListStrings(Enum.GetNames(typeof(ELyricStyle))));
writer.WriteElementString("LyricStyle", Enum.GetName(typeof(ELyricStyle), LyricStyle));
writer.WriteEndElement();
@@ -595,13 +422,13 @@ namespace Vocaluxe.Base
#region Sound
writer.WriteStartElement("Sound");
- writer.WriteComment("PlayBackLib: " + ListStrings(Enum.GetNames(typeof(EPlaybackLib))));
+ writer.WriteComment("PlayBackLib: " + CHelper.ListStrings(Enum.GetNames(typeof(EPlaybackLib))));
writer.WriteElementString("PlayBackLib", Enum.GetName(typeof(EPlaybackLib), PlayBackLib));
- writer.WriteComment("RecordLib: " + ListStrings(Enum.GetNames(typeof(ERecordLib))));
+ writer.WriteComment("RecordLib: " + CHelper.ListStrings(Enum.GetNames(typeof(ERecordLib))));
writer.WriteElementString("RecordLib", Enum.GetName(typeof(ERecordLib), RecordLib));
- writer.WriteComment("AudioBufferSize: " + ListStrings(Enum.GetNames(typeof(EBufferSize))));
+ writer.WriteComment("AudioBufferSize: " + CHelper.ListStrings(Enum.GetNames(typeof(EBufferSize))));
writer.WriteElementString("AudioBufferSize", Enum.GetName(typeof(EBufferSize), AudioBufferSize));
writer.WriteComment("AudioLatency from -500 to 500 ms");
@@ -652,28 +479,28 @@ namespace Vocaluxe.Base
}
}
- writer.WriteComment("SongMenu: " + ListStrings(Enum.GetNames(typeof(ESongMenu))));
+ writer.WriteComment("SongMenu: " + CHelper.ListStrings(Enum.GetNames(typeof(ESongMenu))));
writer.WriteElementString("SongMenu", Enum.GetName(typeof(ESongMenu), SongMenu));
- writer.WriteComment("SongSorting: " + ListStrings(Enum.GetNames(typeof(ESongSorting))));
+ writer.WriteComment("SongSorting: " + CHelper.ListStrings(Enum.GetNames(typeof(ESongSorting))));
writer.WriteElementString("SongSorting", Enum.GetName(typeof(ESongSorting), SongSorting));
- writer.WriteComment("Ignore articles on song-sorting: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Ignore articles on song-sorting: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("IgnoreArticles", Enum.GetName(typeof(EOffOn), IgnoreArticles));
writer.WriteComment("ScoreAnimationTime: Values >= 1 or 0 for no animation. Time is in seconds.");
writer.WriteElementString("ScoreAnimationTime", ScoreAnimationTime.ToString());
- writer.WriteComment("TimerMode: " + ListStrings(Enum.GetNames(typeof(ETimerMode))));
+ writer.WriteComment("TimerMode: " + CHelper.ListStrings(Enum.GetNames(typeof(ETimerMode))));
writer.WriteElementString("TimerMode", Enum.GetName(typeof(ETimerMode), TimerMode));
writer.WriteComment("NumPlayer: 1.." + CSettings.MaxNumPlayer.ToString());
writer.WriteElementString("NumPlayer", NumPlayer.ToString());
- writer.WriteComment("Order songs in tabs: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Order songs in tabs: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("Tabs", Enum.GetName(typeof(EOffOn), Tabs));
- writer.WriteComment("Lyrics also on Top of screen: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Lyrics also on Top of screen: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("LyricsOnTop", Enum.GetName(typeof(EOffOn), LyricsOnTop));
writer.WriteComment("Default profile for players 1..." + CSettings.MaxNumPlayer.ToString() + ":");
@@ -690,22 +517,22 @@ namespace Vocaluxe.Base
#region Video
writer.WriteStartElement("Video");
- writer.WriteComment("VideoDecoder: " + ListStrings(Enum.GetNames(typeof(EVideoDecoder))));
+ writer.WriteComment("VideoDecoder: " + CHelper.ListStrings(Enum.GetNames(typeof(EVideoDecoder))));
writer.WriteElementString("VideoDecoder", Enum.GetName(typeof(EVideoDecoder), VideoDecoder));
- writer.WriteComment("VideoBackgrounds: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("VideoBackgrounds: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideoBackgrounds", Enum.GetName(typeof(EOffOn), VideoBackgrounds));
- writer.WriteComment("VideoPreview: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("VideoPreview: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideoPreview", Enum.GetName(typeof(EOffOn), VideoPreview));
- writer.WriteComment("Show Videos while singing: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Show Videos while singing: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideosInSongs", Enum.GetName(typeof(EOffOn), VideosInSongs));
- writer.WriteComment("Show backgroundmusic videos as background: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
+ writer.WriteComment("Show backgroundmusic videos as background: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideosToBackground", Enum.GetName(typeof(EOffOn), VideosToBackground));
- writer.WriteComment("WebcamLib: " + ListStrings(Enum.GetNames(typeof(EWebcamLib))));
+ writer.WriteComment("WebcamLib: " + CHelper.ListStrings(Enum.GetNames(typeof(EWebcamLib))));
writer.WriteElementString("WebcamLib", Enum.GetName(typeof(EWebcamLib), WebcamLib));
writer.WriteStartElement("WebcamConfig");
@@ -1055,23 +882,6 @@ namespace Vocaluxe.Base
return true;
}
- ///
- /// Concat strings into one string with ", " as separator.
- ///
- public static string ListStrings(string[] str)
- {
- string _Result = string.Empty;
-
- for (int i = 0; i < str.Length; i++)
- {
- _Result += str[i];
- if(i < str.Length - 1)
- _Result += ", ";
- }
-
- return _Result;
- }
-
///
/// Use saved players from config now for games
///
@@ -1098,8 +908,5 @@ namespace Vocaluxe.Base
}
}
}
-
-
-
}
}
diff --git a/Vocaluxe/Base/CCover.cs b/Vocaluxe/Base/CCover.cs
index 22b699d9..c63082f8 100644
--- a/Vocaluxe/Base/CCover.cs
+++ b/Vocaluxe/Base/CCover.cs
@@ -6,6 +6,7 @@ using System.Xml;
using System.Xml.XPath;
using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs
index d46eae86..743e0a0b 100644
--- a/Vocaluxe/Base/CDataBase.cs
+++ b/Vocaluxe/Base/CDataBase.cs
@@ -20,7 +20,8 @@ using SQLiteDataReader = Mono.Data.Sqlite.SqliteDataReader;
using Community.CsharpSqlite;
using Vocaluxe.Lib.Draw;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/Base/CDraw.cs b/Vocaluxe/Base/CDraw.cs
index e468162e..7cc74e46 100644
--- a/Vocaluxe/Base/CDraw.cs
+++ b/Vocaluxe/Base/CDraw.cs
@@ -231,7 +231,7 @@ namespace Vocaluxe.Base
_Draw.DrawTexture(Texture, rect, color, bounds);
}
- public static void DrawTexture(STexture Texture, SRectF rect, SColorF color,bool mirrored)
+ public static void DrawTexture(STexture Texture, SRectF rect, SColorF color, bool mirrored)
{
_Draw.DrawTexture(Texture, rect, color, mirrored);
}
@@ -269,491 +269,4 @@ namespace Vocaluxe.Base
return _Draw.TextureCount();
}
}
-
- enum EParticeType
- {
- Twinkle,
- Star,
- Snow,
- Flare,
- PerfNoteStar
- }
-
- class CParticle
- {
- #region private vars
- private string _TextureName;
- private STexture _Texture;
- private SRectF _Rect;
- private float _Size;
- private SColorF _Color;
- private float _Alpha;
- private float _Angle; //0..360°
- private float _MaxAge; //[s]
- private float _Age; //[s]
- private float _Vx; //movement speed in x-axis [pix/s]
- private float _Vy; //movement speed in y-axis [pix/s]
- private float _Vr; //rotation speed [rpm]
- private float _Rotation; //start rotation 0..360°
- private float _Vsize; //size changing speed: period [s]
- private float _LastTime;
- private EParticeType _Type;
-
- private Stopwatch _Timer;
- #endregion private vars
-
- #region public vars
- //public bool Visible;
- public float Alpha2 = 1f;
-
- public float X
- {
- get { return _Rect.X; }
- set { _Rect.X = value; }
- }
-
- public float Y
- {
- get { return _Rect.Y; }
- set { _Rect.Y = value; }
- }
-
- public float Size
- {
- get { return _Size; }
- set
- {
- _Rect.W = value;
- _Rect.H = value;
- _Size = value;
- }
- }
-
- public float Alpha
- {
- get { return _Alpha; }
- set { _Alpha = value; }
- }
-
- public SColorF Color
- {
- get { return _Color; }
- set { _Color = value; }
- }
-
- public bool IsAlive
- {
- get { return (_Age < _MaxAge || _MaxAge == 0f); }
- }
- #endregion public vars
-
- #region Constructors
- public CParticle(string textureName, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, EParticeType type)
- {
- _TextureName = textureName;
- _Texture = new STexture(-1);
- _Color = color;
- _Rect = new SRectF(x, y, size, size, z);
- _Size = size;
- _Alpha = 1f;
- _Angle = 0f;
- _Vx = vx;
- _Vy = vy;
- _Vr = vr;
- _Vsize = vsize;
- _LastTime = 0f;
- _Type = type;
-
- _Timer = new Stopwatch();
- _Age = 0f;
- _MaxAge = maxage;
- _Rotation = (float)(CGame.Rand.NextDouble() * 360.0);
- }
-
- public CParticle(STexture texture, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize, EParticeType type)
- {
- _TextureName = String.Empty;
- _Texture = texture;
- _Color = color;
- _Rect = new SRectF(x, y, size, size, z);
- _Size = size;
- _Alpha = 1f;
- _Angle = 0f;
- _Vx = vx;
- _Vy = vy;
- _Vr = vr;
- _Vsize = vsize;
- _LastTime = 0f;
- _Type = type;
-
- _Timer = new Stopwatch();
- _Age = 0f;
- _MaxAge = maxage;
- _Rotation = (float)(CGame.Rand.NextDouble() * 360.0);
- }
-
- #endregion Constructors
-
- public void Update()
- {
- if (!IsAlive)
- return;
-
- if (!_Timer.IsRunning)
- _Timer.Start();
-
- float CurrentTime = _Timer.ElapsedMilliseconds / 1000f;
- float timediff = CurrentTime - _LastTime;
-
- _Age = CurrentTime;
-
- // update alpha
- if (_MaxAge > 0f)
- {
- switch (_Type)
- {
- case EParticeType.Twinkle:
- _Alpha = 1f - _Age / _MaxAge;
- break;
-
- case EParticeType.Star:
- _Alpha = 1f - _Age / _MaxAge;
- break;
-
- case EParticeType.Snow:
- _Alpha = (float)Math.Sqrt((Math.Sin(_Age / _MaxAge * Math.PI * 2 - 0.5 * Math.PI) + 1) / 2);
- break;
-
- case EParticeType.Flare:
- _Alpha = 1f - _Age / _MaxAge;
- break;
-
- case EParticeType.PerfNoteStar:
- _Alpha = 1f - _Age / _MaxAge;
- break;
-
- default:
- break;
- }
-
- }
-
- // update position
- switch (_Type)
- {
- case EParticeType.Twinkle:
- X += _Vx * timediff;
- Y += _Vy * timediff;
- break;
-
- case EParticeType.Star:
- X += _Vx * timediff;
- Y += _Vy * timediff;
- break;
-
- case EParticeType.Snow:
- int maxy = (int)Math.Round(CSettings.iRenderH - _Size * 0.4f);
-
- if (Math.Round(Y) < maxy)
- {
- float vdx = 0f;
- if (_Vx != 0)
- vdx = (float)Math.Sin(CurrentTime / _Vx * Math.PI);
-
- X += _Vx * timediff * (0.5f + vdx);
-
- Y += _Vy * timediff * (vdx * vdx / 2f + 0.5f);
- if (Y >= maxy)
- Y = maxy;
- }
- break;
-
- case EParticeType.Flare:
- X += _Vx * timediff;
- Y += _Vy * timediff;
- break;
-
- case EParticeType.PerfNoteStar:
- X += _Vx * timediff;
- Y += _Vy * timediff;
- break;
-
- default:
- break;
- }
-
-
- // update size
- if (_Vsize != 0f)
- {
- float size = _Size;
- switch (_Type)
- {
- case EParticeType.Twinkle:
- size = _Size * (1f - CurrentTime / _Vsize);
- break;
-
- case EParticeType.Star:
- size = _Size * (1f - CurrentTime / _Vsize);
- break;
-
- case EParticeType.Snow:
- size = _Size * (float)Math.Sqrt((Math.Sin(CurrentTime / _Vsize * Math.PI * 2 - 0.5 * Math.PI) + 1) / 2);
- break;
-
- case EParticeType.Flare:
- size = _Size * (1f - CurrentTime / _Vsize);
- break;
-
- case EParticeType.PerfNoteStar:
- size = _Size * (1f - CurrentTime / _Vsize);
- break;
-
- default:
- break;
- }
-
- _Rect.X += (_Rect.W - size) / 2f;
- _Rect.Y += (_Rect.H - size) / 2f;
- _Rect.W = size;
- _Rect.H = size;
- }
-
- // update rotation
- if (_Vr != 0f)
- {
- float r = CurrentTime * _Vr / 60f;
- _Angle = _Rotation + 360f * (r - (float)Math.Floor(r));
- _Rect.Rotation = _Angle;
- }
-
- _LastTime = CurrentTime;
- }
-
- public void Pause()
- {
- _Timer.Stop();
- }
-
- public void Resume()
- {
- _Timer.Start();
- }
-
- public void Draw()
- {
- if (_TextureName != String.Empty)
- CDraw.DrawTexture(CTheme.GetSkinTexture(_TextureName), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
- else
- CDraw.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
- }
- }
-
- class CParticleEffect
- {
- private List _Stars;
- private string _TextureName;
- private STexture _Texture;
- private int _MaxNumber;
- private SRectF _Area;
- private SColorF _Color;
- private float _Size;
- private EParticeType _Type;
- private Stopwatch _SpawnTimer;
- private float _NextSpawnTime;
-
- public float Alpha = 1f;
-
- public bool IsAlive
- {
- get
- {
- return (_Stars.Count > 0 || !_SpawnTimer.IsRunning);
- }
- }
-
- public SRectF Area
- {
- get { return _Area; }
- set { _Area = value; }
- }
-
- public CParticleEffect(int MaxNumber, SColorF Color, SRectF Area, string TextureName, float Size, EParticeType Type)
- {
- _Stars = new List();
- _Area = Area;
- _Color = Color;
- _TextureName = TextureName;
- _Texture = new STexture(-1);
- _MaxNumber = MaxNumber;
- _Size = Size;
- _Type = Type;
- _SpawnTimer = new Stopwatch();
- _NextSpawnTime = 0f;
- }
-
- public CParticleEffect(int MaxNumber, SColorF Color, SRectF Area, STexture texture, float Size, EParticeType Type)
- {
- _Stars = new List();
- _Area = Area;
- _Color = Color;
- _TextureName = String.Empty;
- _Texture = texture;
- _MaxNumber = MaxNumber;
- _Size = Size;
- _Type = Type;
- _SpawnTimer = new Stopwatch();
- _NextSpawnTime = 0f;
- }
-
- public void Update()
- {
- bool DoSpawn = false;
- if (!_SpawnTimer.IsRunning)
- {
- _SpawnTimer.Start();
- _NextSpawnTime = 0f;
- DoSpawn = true;
- }
-
- if (_SpawnTimer.ElapsedMilliseconds / 1000f > _NextSpawnTime && _NextSpawnTime >= 0f)
- {
- DoSpawn = true;
- _SpawnTimer.Reset();
- _SpawnTimer.Start();
- }
-
- while (_Stars.Count < _MaxNumber && DoSpawn)
- {
- float size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- float lifetime = 0f;
- float vx = 0f;
- float vy = 0f;
- float vr = 0f;
- float vsize = 0f;
- _NextSpawnTime = 0f;
-
- switch (_Type)
- {
- case EParticeType.Twinkle:
- size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- lifetime = CGame.Rand.Next(500) / 1000f + 0.5f;
- vx = -CGame.Rand.Next(10000) / 50f + 100f;
- vy = -CGame.Rand.Next(10000) / 50f + 100f;
- vr = -CGame.Rand.Next(500) / 100f + 2.5f;
- vsize = lifetime * 2f;
- break;
-
- case EParticeType.Star:
- size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- lifetime = CGame.Rand.Next(1000) / 500f + 0.2f;
- vx = -CGame.Rand.Next(1000) / 50f + 10f;
- vy = -CGame.Rand.Next(1000) / 50f + 10f;
- vr = -CGame.Rand.Next(500) / 100f + 2.5f;
- vsize = lifetime * 2f;
- break;
-
- case EParticeType.Snow:
- size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- lifetime = CGame.Rand.Next(5000) / 50f + 10f;
- vx = -CGame.Rand.Next(1000) / 50f + 10f;
- vy = CGame.Rand.Next(1000) / 50f + Math.Abs(vx) + 10f;
- vr = -CGame.Rand.Next(200) / 50f + 2f;
- vsize = lifetime * 2f;
-
- _NextSpawnTime = lifetime / _MaxNumber;
- DoSpawn = false;
- break;
-
- case EParticeType.Flare:
- size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- lifetime = CGame.Rand.Next(500) / 1000f + 0.1f;
- vx = -CGame.Rand.Next(2000) / 50f;
- vy = -CGame.Rand.Next(2000) / 50f + 20f;
- vr = -CGame.Rand.Next(2000) / 50f + 20f;
- vsize = lifetime * 2f;
- break;
-
- case EParticeType.PerfNoteStar:
- size = CGame.Rand.Next((int)_Size / 2) + _Size / 2;
- lifetime = CGame.Rand.Next(1000) / 500f + 1.2f;
- vx = 0f;
- vy = 0f;
- vr = CGame.Rand.Next(500) / 50f + 10f;
- vsize = lifetime * 2f;
- break;
-
- default:
- break;
- }
-
- int w = (int)(_Area.W - size / 4f);
- int h = (int)(_Area.H - size / 4f);
-
- if (w < 0)
- w = 0;
-
- if (h < 0)
- h = 0;
-
- CParticle star;
- if (_TextureName != String.Empty)
- {
- star = new CParticle(_TextureName, _Color,
- CGame.Rand.Next(w) + _Area.X - size / 4f,
- CGame.Rand.Next(h) + _Area.Y - size / 4f,
- size, lifetime, _Area.Z, vx, vy, vr, vsize, _Type);
- }
- else
- {
- star = new CParticle(_Texture, _Color,
- CGame.Rand.Next(w) + _Area.X - size / 4f,
- CGame.Rand.Next(h) + _Area.Y - size / 4f,
- size, lifetime, _Area.Z, vx, vy, vr, vsize, _Type);
- }
-
- _Stars.Add(star);
- }
-
- if (_Type == EParticeType.Flare || _Type == EParticeType.PerfNoteStar || _Type == EParticeType.Twinkle)
- _NextSpawnTime = -1f;
-
- int i = 0;
- while (i < _Stars.Count)
- {
- _Stars[i].Update();
- if (!_Stars[i].IsAlive)
- {
- _Stars.RemoveAt(i);
- }
- else
- i++;
- }
- }
-
- public void Pause()
- {
- foreach (CParticle star in _Stars)
- {
- star.Pause();
- }
- }
-
- public void Resume()
- {
- foreach (CParticle star in _Stars)
- {
- star.Resume();
- }
- }
-
- public void Draw()
- {
- foreach (CParticle star in _Stars)
- {
- star.Alpha2 = Alpha;
- star.Draw();
- }
- }
- }
}
diff --git a/Vocaluxe/Base/CFont.cs b/Vocaluxe/Base/CFont.cs
index 0c3fa048..28b3d2f7 100644
--- a/Vocaluxe/Base/CFont.cs
+++ b/Vocaluxe/Base/CFont.cs
@@ -15,29 +15,7 @@ using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
namespace Vocaluxe.Base
-{
- public enum EAlignment
- {
- Left,
- Center,
- Right
- }
-
- public enum EHAlignment
- {
- Top,
- Center,
- Bottom
- }
-
- public enum EStyle
- {
- Normal,
- Italic,
- Bold,
- BoldItalic
- }
-
+{
class CGlyph
{
private float _SIZEh = 50f;
@@ -298,6 +276,7 @@ namespace Vocaluxe.Base
public string Name;
public bool IsThemeFont;
+ public int PartyModeID;
public string ThemeName;
public string Folder;
@@ -323,6 +302,9 @@ namespace Vocaluxe.Base
private static int _CurrentFont;
private static float _Height = 1f;
+ public static int PartyModeID
+ { get; set; }
+
public static EStyle Style = EStyle.Normal;
public static int CurrentFont
@@ -377,6 +359,7 @@ namespace Vocaluxe.Base
_settings.ConformanceLevel = ConformanceLevel.Document;
_CurrentFont = 0;
+ PartyModeID = -1;
BuildFonts();
}
@@ -586,7 +569,20 @@ namespace Vocaluxe.Base
public static void SetFont(string FontName)
{
- int Index = GetFontIndex(CConfig.Theme, FontName);
+ int Index = -1;
+
+ if (PartyModeID != -1)
+ {
+ Index = GetFontIndexParty(PartyModeID, FontName);
+
+ if (Index >= 0 && Index < _Fonts.Count)
+ {
+ _CurrentFont = Index;
+ return;
+ }
+ }
+
+ Index = GetFontIndex(CConfig.Theme, FontName);
if (Index >= 0 && Index < _Fonts.Count)
{
@@ -612,7 +608,7 @@ namespace Vocaluxe.Base
public static RectangleF GetTextBounds(CText text, float height)
{
Height = height;
- return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text)), GetTextHeight(CLanguage.Translate(text.Text)));
+ return new RectangleF(text.X, text.Y, GetTextWidth(CLanguage.Translate(text.Text, text.PartyModeID)), GetTextHeight(CLanguage.Translate(text.Text, text.PartyModeID)));
}
public static float GetTextWidth(string text)
@@ -720,6 +716,7 @@ namespace Vocaluxe.Base
sf.Name = name;
sf.IsThemeFont = false;
sf.ThemeName = String.Empty;
+ sf.PartyModeID = -1;
CHelper.GetValueFromXML("//root/Font" + i.ToString() + "/FileItalic", navigator, ref value, value);
value = Path.Combine(Directory.GetCurrentDirectory(),
@@ -769,6 +766,7 @@ namespace Vocaluxe.Base
sf.IsThemeFont = true;
sf.ThemeName = ThemeName;
+ sf.PartyModeID = -1;
bool ok = true;
@@ -889,6 +887,75 @@ namespace Vocaluxe.Base
}
}
+ ///
+ /// Loads party mode fonts from skin file
+ ///
+ public static void LoadPartyModeFonts(int PartyModeID, string FontFolder, XPathNavigator navigator)
+ {
+ string value = string.Empty;
+ int i = 1;
+ while (CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/Folder", navigator, ref value, value))
+ {
+ SFont sf = new SFont();
+ sf.Folder = value;
+
+ sf.IsThemeFont = false;
+ sf.ThemeName = String.Empty;
+ sf.PartyModeID = PartyModeID;
+
+ bool ok = true;
+
+ ok &= CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/FileNormal", navigator, ref value, value);
+ sf.FileNormal = value;
+ value = Path.Combine(FontFolder, Path.Combine(sf.Folder, value));
+ CFont f = new CFont(value);
+ sf.Normal = f;
+
+ string name = String.Empty;
+ ok &= CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/Name", navigator, ref name, value);
+ sf.Name = name;
+
+ ok &= CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/FileItalic", navigator, ref value, value);
+ sf.FileItalic = value;
+ value = Path.Combine(FontFolder, Path.Combine(sf.Folder, value));
+ f = new CFont(value);
+ sf.Italic = f;
+
+ ok &= CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/FileBold", navigator, ref value, value);
+ sf.FileBold = value;
+ value = Path.Combine(FontFolder, Path.Combine(sf.Folder, value));
+ f = new CFont(value);
+ sf.Bold = f;
+
+ ok &= CHelper.GetValueFromXML("//root/Fonts/Font" + i.ToString() + "/FileBoldItalic", navigator, ref value, value);
+ sf.FileBoldItalic = value;
+ value = Path.Combine(FontFolder, Path.Combine(sf.Folder, value));
+ f = new CFont(value);
+ sf.BoldItalic = f;
+
+ sf.Outline = 0f;
+ ok &= CHelper.TryGetFloatValueFromXML("//root/Fonts/Font" + i.ToString() + "/Outline", navigator, ref sf.Outline);
+
+ sf.OutlineColor = new SColorF(0f, 0f, 0f, 1f);
+ ok &= CHelper.TryGetFloatValueFromXML("//root/Fonts/Font" + i.ToString() + "/OutlineColorR", navigator, ref sf.OutlineColor.R);
+ ok &= CHelper.TryGetFloatValueFromXML("//root/Fonts/Font" + i.ToString() + "/OutlineColorG", navigator, ref sf.OutlineColor.G);
+ ok &= CHelper.TryGetFloatValueFromXML("//root/Fonts/Font" + i.ToString() + "/OutlineColorB", navigator, ref sf.OutlineColor.B);
+ ok &= CHelper.TryGetFloatValueFromXML("//root/Fonts/Font" + i.ToString() + "/OutlineColorA", navigator, ref sf.OutlineColor.A);
+
+ if (ok)
+ _Fonts.Add(sf);
+ else
+ {
+ CLog.LogError("Error loading theme fonts for party mode from Folder \"" + FontFolder + "\": Error in Font" + i.ToString());
+ }
+ i++;
+ }
+
+ CLog.StartBenchmark(1, "BuildGlyphs");
+ BuildGlyphs();
+ CLog.StopBenchmark(1, "BuildGlyphs");
+ }
+
private static int GetFontIndex(string ThemeName, string FontName)
{
if (ThemeName == String.Empty || FontName == String.Empty)
@@ -903,6 +970,20 @@ namespace Vocaluxe.Base
return -1;
}
+ private static int GetFontIndexParty(int PartyModeID, string FontName)
+ {
+ if (PartyModeID == -1 || FontName == String.Empty)
+ return -1;
+
+ for (int i = 0; i < _Fonts.Count; i++)
+ {
+ if (!_Fonts[i].IsThemeFont && _Fonts[i].Name == FontName && _Fonts[i].PartyModeID == PartyModeID)
+ return i;
+ }
+
+ return -1;
+ }
+
private static void BuildGlyphs()
{
string Text = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890";
diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs
index 1f65f207..81d5ffe9 100644
--- a/Vocaluxe/Base/CGame.cs
+++ b/Vocaluxe/Base/CGame.cs
@@ -6,42 +6,12 @@ using System.Text;
using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SingNotes;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Base
{
- struct SPlayer
- {
- public int ProfileID;
- public string Name;
- public EGameDifficulty Difficulty;
- public double Points;
- public double PointsLineBonus;
- public double PointsGoldenNotes;
- public int NoteDiff;
- public int LineNr;
- public List SingLine;
- public int CurrentLine;
- public int CurrentNote;
-
- public int SongID;
- public bool Medley;
- public bool Duet;
- public bool ShortSong;
- public long DateTicks;
- public bool SongFinished;
- }
-
- struct SScores
- {
- public string Name;
- public int Score;
- public string Date;
- public EGameDifficulty Difficulty;
- public int LineNr;
- public int ID;
- }
-
static class CGame
{
private static IGameMode _GameMode;
@@ -349,7 +319,7 @@ namespace Vocaluxe.Base
{
CNote nt = _Player[p].SingLine[Line].LastNote;
if (notes[Note].StartBeat == beat || nt.EndBeat + 1 != beat || nt.Tone != Tone)
- _Player[p].SingLine[Line].AddNote(new CNote(beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
+ _Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
else
{
_Player[p].SingLine[Line].IncLastNoteLength();
@@ -357,7 +327,7 @@ namespace Vocaluxe.Base
}
else
{
- _Player[p].SingLine[Line].AddNote(new CNote(beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
+ _Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
}
_Player[p].SingLine[Line].LastNote.IsPerfect(notes[Note]);
@@ -369,7 +339,7 @@ namespace Vocaluxe.Base
{
CNote nt = _Player[p].SingLine[Line].LastNote;
if (nt.EndBeat + 1 != beat || nt.Hit)
- _Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
+ _Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
else
{
if (nt.Tone == TonePlayer && nt.EndBeat + 1 == beat)
@@ -378,13 +348,13 @@ namespace Vocaluxe.Base
}
else
{
- _Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
+ _Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
}
}
}
else
{
- _Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
+ _Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
}
}
diff --git a/Vocaluxe/Menu/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs
similarity index 90%
rename from Vocaluxe/Menu/CGraphics.cs
rename to Vocaluxe/Base/CGraphics.cs
index 75b8b52e..68048f00 100644
--- a/Vocaluxe/Menu/CGraphics.cs
+++ b/Vocaluxe/Base/CGraphics.cs
@@ -5,38 +5,12 @@ using System.Drawing;
using System.Text;
using System.Windows.Forms;
-using Vocaluxe.Base;
-using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
+using Vocaluxe.PartyModes;
using Vocaluxe.Screens;
-namespace Vocaluxe.Menu
+namespace Vocaluxe.Base
{
- enum EScreens
- {
- ScreenTest = 0,
- ScreenLoad = 1,
- ScreenMain = 2,
- ScreenSong = 3,
- ScreenOptions = 4,
- ScreenSing = 5,
- ScreenProfiles = 6,
- ScreenScore = 7,
- ScreenHighscore = 8,
-
- ScreenOptionsGame = 9,
- ScreenOptionsSound = 10,
- ScreenOptionsRecord = 11,
- ScreenOptionsVideo = 12,
- ScreenOptionsLyrics = 13,
- ScreenOptionsTheme = 14,
-
- ScreenNames = 15,
-
- ScreenCredits = 16,
-
- ScreenNull = -1
- }
-
enum EPopupScreens
{
PopupPlayerControl = 0,
@@ -194,12 +168,13 @@ namespace Vocaluxe.Menu
private static float _GlobalAlpha;
private static float _ZOffset;
+ private static IMenu _OldScreen;
private static EScreens _CurrentScreen;
private static EScreens _NextScreen;
private static EPopupScreens _CurrentPopupScreen;
- private static List _Screens = new List();
- private static List _PopupScreens = new List();
+ private static List _Screens = new List();
+ private static List _PopupScreens = new List();
private static float _SavedBackgroundMusicVolume;
private static float _SavedPreviewMusicVolume;
@@ -244,6 +219,8 @@ namespace Vocaluxe.Menu
_Screens.Add(new CScreenOptionsTheme());
_Screens.Add(new CScreenNames());
_Screens.Add(new CScreenCredits());
+ _Screens.Add(new CScreenParty());
+ _Screens.Add(new CScreenPartyDummy());
_PopupScreens.Add(new CPopupScreenPlayerControl());
_PopupScreens.Add(new CPopupScreenVolumeControl());
@@ -276,13 +253,15 @@ namespace Vocaluxe.Menu
for (int i = 0; i < _Screens.Count; i++)
{
CLog.StartBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
- _Screens[i].LoadTheme();
+ _Screens[i].Initialize(CMain.Base);
+ _Screens[i].LoadTheme(CTheme.GetThemeScreensPath());
CLog.StopBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
- _PopupScreens[i].LoadTheme();
+ _PopupScreens[i].Initialize(CMain.Base);
+ _PopupScreens[i].LoadTheme(CTheme.GetThemeScreensPath());
}
}
@@ -296,7 +275,7 @@ namespace Vocaluxe.Menu
for (int i = 0; i < _PopupScreens.Count; i++)
{
- _PopupScreens[i].ReloadTheme();
+ _PopupScreens[i].ReloadTheme();
}
}
@@ -324,7 +303,7 @@ namespace Vocaluxe.Menu
for (int i = 0; i < _PopupScreens.Count; i++)
{
- _PopupScreens[i].SaveTheme();
+ _PopupScreens[i].SaveTheme();
}
}
@@ -357,6 +336,7 @@ namespace Vocaluxe.Menu
{
_Run &= HandleInputs(Keys, Mouse);
_Run &= Update();
+ CParty.UpdateGame();
}
else
{
@@ -374,7 +354,16 @@ namespace Vocaluxe.Menu
_Fading = true;
_FadingTimer.Reset();
_FadingTimer.Start();
- _Screens[(int)_NextScreen].OnShow();
+
+ if (_NextScreen == EScreens.ScreenPartyDummy)
+ {
+ CFonts.PartyModeID = CParty.CurrentPartyModeID;
+ _Screens[(int)_NextScreen].OnShow();
+ CFonts.PartyModeID = -1;
+ }
+ else
+ _Screens[(int)_NextScreen].OnShow();
+
HidePopup(EPopupScreens.PopupPlayerControl);
}
@@ -392,11 +381,28 @@ namespace Vocaluxe.Menu
_GlobalAlpha = 1f;// -factor / 100f;
_ZOffset = CSettings.zFar/2;
- _Screens[(int)_CurrentScreen].Draw();
+
+ if (_CurrentScreen == EScreens.ScreenPartyDummy)
+ {
+ CFonts.PartyModeID = CParty.CurrentPartyModeID;
+ _OldScreen.Draw();
+ CFonts.PartyModeID = -1;
+ }
+ else
+ _OldScreen.Draw();
+
_GlobalAlpha = factor;
_ZOffset = 0f;
- _Screens[(int)_NextScreen].Draw();
+
+ if (_NextScreen == EScreens.ScreenPartyDummy)
+ {
+ CFonts.PartyModeID = CParty.CurrentPartyModeID;
+ _Screens[(int)_NextScreen].Draw();
+ CFonts.PartyModeID = -1;
+ }
+ else
+ _Screens[(int)_NextScreen].Draw();
_GlobalAlpha = 1f;
}
@@ -409,14 +415,32 @@ namespace Vocaluxe.Menu
CBackgroundMusic.Play();
_Screens[(int)_CurrentScreen].OnShowFinish();
_Screens[(int)_CurrentScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
- _Screens[(int)_CurrentScreen].Draw();
+
+ if (_CurrentScreen == EScreens.ScreenPartyDummy)
+ {
+ CFonts.PartyModeID = CParty.CurrentPartyModeID;
+ _Screens[(int)_CurrentScreen].Draw();
+ CFonts.PartyModeID = -1;
+ }
+ else
+ _Screens[(int)_CurrentScreen].Draw();
+
_Fading = false;
_FadingTimer.Stop();
}
}
else
{
- _Screens[(int)_CurrentScreen].Draw();
+ if (_CurrentScreen == EScreens.ScreenPartyDummy)
+ {
+ CFonts.PartyModeID = CParty.CurrentPartyModeID;
+ _Screens[(int)_CurrentScreen].Draw();
+ CFonts.PartyModeID = -1;
+ }
+ else
+ _Screens[(int)_CurrentScreen].Draw();
+
+ _OldScreen = _Screens[(int)_CurrentScreen];
}
for (int i = 0; i < _PopupScreens.Count; i++)
@@ -432,9 +456,21 @@ namespace Vocaluxe.Menu
public static void FadeTo(EScreens Screen)
{
+ if (Screen == EScreens.ScreenPartyDummy)
+ {
+ EScreens alt;
+ CMenu scr = CParty.GetNextPartyScreen(out alt);
+ if (scr == null)
+ {
+ _NextScreen = alt;
+ return;
+ }
+ _Screens[(int)EScreens.ScreenPartyDummy] = scr;
+ }
+
_NextScreen = Screen;
}
-
+
public static void ShowPopup(EPopupScreens PopupScreen)
{
_PopupScreens[(int)PopupScreen].OnShow();
@@ -543,7 +579,7 @@ namespace Vocaluxe.Menu
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
- bool isOverPopupPlayerControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupPlayerControl].ScreenArea, MouseEvent);
+ bool isOverPopupPlayerControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupPlayerControl].GetScreenArea(), MouseEvent);
if (PopupPlayerControlAllowed && isOverPopupPlayerControl)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
@@ -553,7 +589,7 @@ namespace Vocaluxe.Menu
if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl)
HidePopup(EPopupScreens.PopupPlayerControl);
- bool isOverPopupVolumeControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupVolumeControl].ScreenArea, MouseEvent);
+ bool isOverPopupVolumeControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupVolumeControl].GetScreenArea(), MouseEvent);
if (PopupVolumeControlAllowed && isOverPopupVolumeControl)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
diff --git a/Vocaluxe/Base/CInput.cs b/Vocaluxe/Base/CInput.cs
index 28af9bf8..e6465d31 100644
--- a/Vocaluxe/Base/CInput.cs
+++ b/Vocaluxe/Base/CInput.cs
@@ -4,6 +4,7 @@ using System.Text;
using Vocaluxe.Lib.Input;
using Vocaluxe.Lib.Input.WiiMote;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/Base/CLanguage.cs b/Vocaluxe/Base/CLanguage.cs
index 6b209bba..31689fdc 100644
--- a/Vocaluxe/Base/CLanguage.cs
+++ b/Vocaluxe/Base/CLanguage.cs
@@ -6,6 +6,8 @@ using System.Text;
using System.Xml;
using System.Xml.XPath;
+using Vocaluxe.Menu;
+
namespace Vocaluxe.Base
{
struct SLanguage
@@ -14,6 +16,13 @@ namespace Vocaluxe.Base
public string LanguageFilePath;
public Hashtable Texts;
+ public List PartyModeTexts;
+ }
+
+ struct SPartyLanguage
+ {
+ public int PartyModeID;
+ public Hashtable Texts;
}
static class CLanguage
@@ -64,22 +73,32 @@ namespace Vocaluxe.Base
public static bool SetLanguage(string Language)
{
- for (int i = 0; i < _Languages.Count; i++)
+ int nr = GetLanguageNr(Language);
+ if (nr != -1)
{
- if (_Languages[i].Name == Language)
- {
- _CurrentLanguage = i;
- return true;
- }
+ _CurrentLanguage = nr;
+ return true;
}
return false;
}
+ public static int GetLanguageNr(string Language)
+ {
+ for (int i = 0; i < _Languages.Count; i++)
+ {
+ if (_Languages[i].Name == Language)
+ return i;
+ }
+ return -1;
+ }
+
public static string Translate(string KeyWord)
{
- if (KeyWord == null)
- return null;
+ return Translate(KeyWord, -1);
+ }
+ public static string Translate(string KeyWord, int PartyModeID)
+ {
if (KeyWord.Length < 3)
return KeyWord;
@@ -87,14 +106,38 @@ namespace Vocaluxe.Base
if (tag != "TR_")
return KeyWord;
- string result = String.Empty;
- try
+ string result = null;
+
+ int PartyModeNr = GetPartyModeNr(PartyModeID, _CurrentLanguage);
+ if (PartyModeID != -1)
{
- result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
+ if (PartyModeNr != -1)
+ {
+ try
+ {
+ result = (string)_Languages[_CurrentLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
+ }
+ catch { }
+ }
+
+ if (result == null && (PartyModeNr = GetPartyModeNr(PartyModeID, _FallbackLanguage)) != -1)
+ {
+ try
+ {
+ result = (string)_Languages[_FallbackLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
+ }
+ catch { }
+ }
}
- catch (Exception)
+
+
+ if (result == null)
{
- ;
+ try
+ {
+ result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
+ }
+ catch { }
}
if (result == null)
@@ -104,10 +147,7 @@ namespace Vocaluxe.Base
{
result = (string)_Languages[_FallbackLanguage].Texts[KeyWord];
}
- catch (Exception)
- {
- ;
- }
+ catch { }
if (result == null)
return KeyWord;
@@ -117,6 +157,11 @@ namespace Vocaluxe.Base
}
public static bool TranslationExists(string KeyWord)
+ {
+ return TranslationExists(KeyWord, -1);
+ }
+
+ public static bool TranslationExists(string KeyWord, int PartyModeID)
{
if (KeyWord.Length < 3)
return false;
@@ -126,13 +171,37 @@ namespace Vocaluxe.Base
return false;
string result = String.Empty;
- try
+
+ int PartyModeNr = GetPartyModeNr(PartyModeID, _CurrentLanguage);
+ if (PartyModeID != -1)
{
- result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
+ if (PartyModeNr != -1)
+ {
+ try
+ {
+ result = (string)_Languages[_CurrentLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
+ }
+ catch { }
+ }
+
+ if (result == null && (PartyModeNr = GetPartyModeNr(PartyModeID, _FallbackLanguage)) != -1)
+ {
+ try
+ {
+ result = (string)_Languages[_FallbackLanguage].PartyModeTexts[PartyModeNr].Texts[KeyWord];
+ }
+ catch { }
+ }
}
- catch (Exception)
+
+
+ if (result == null)
{
- ;
+ try
+ {
+ result = (string)_Languages[_CurrentLanguage].Texts[KeyWord];
+ }
+ catch { }
}
if (result == null)
@@ -142,10 +211,7 @@ namespace Vocaluxe.Base
{
result = (string)_Languages[_FallbackLanguage].Texts[KeyWord];
}
- catch (Exception)
- {
- ;
- }
+ catch { }
if (result == null)
return false;
@@ -154,6 +220,82 @@ namespace Vocaluxe.Base
return true;
}
+ public static bool LoadPartyLanguageFiles(int PartyModeID, string Path)
+ {
+ List files = new List();
+ files.AddRange(Helper.ListFiles(Path, "*.xml", true, true));
+
+ foreach (string file in files)
+ {
+ if (!LoadPartyLanguageFile(PartyModeID, file))
+ return false;
+ }
+ return true;
+ }
+
+ private static bool LoadPartyLanguageFile(int PartyModeID, string file)
+ {
+ bool loaded = false;
+ XPathDocument xPathDoc = null;
+ XPathNavigator navigator = null;
+
+ try
+ {
+ xPathDoc = new XPathDocument(file);
+ navigator = xPathDoc.CreateNavigator();
+ loaded = true;
+ }
+ catch (Exception e)
+ {
+ loaded = false;
+ if (navigator != null)
+ navigator = null;
+
+ if (xPathDoc != null)
+ xPathDoc = null;
+
+ CLog.LogError("Error opening Party Language File " + file + ": " + e.Message);
+ }
+
+ if (loaded)
+ {
+ string value = string.Empty;
+ if (loaded == CHelper.GetValueFromXML("//root/Info/Name", navigator, ref value, value))
+ {
+ int nr = GetLanguageNr(value);
+
+ if (nr == -1)
+ return true;
+
+ SPartyLanguage lang = new SPartyLanguage();
+ lang.PartyModeID = PartyModeID;
+ lang.Texts = new Hashtable();
+
+ List texts = CHelper.GetValuesFromXML("Texts", navigator);
+ for (int i = 0; i < texts.Count; i++)
+ {
+ if (CHelper.GetValueFromXML("//root/Texts/" + texts[i], navigator, ref value, value))
+ {
+ try
+ {
+ lang.Texts.Add(texts[i], value);
+ }
+ catch (Exception e)
+ {
+ CLog.LogError("Error reading Party Language File " + file + ": " + e.Message);
+ return false;
+ }
+ }
+
+ }
+ _Languages[nr].PartyModeTexts.Add(lang);
+ return true;
+ }
+ }
+ CLog.LogError("Error reading Party Language File " + file);
+ return false;
+ }
+
private static void LoadLanguageFile(string FileName)
{
bool loaded = false;
@@ -191,6 +333,7 @@ namespace Vocaluxe.Base
_FallbackLanguage = _Languages.Count;
lang.Texts = new Hashtable();
+ lang.PartyModeTexts = new List();
List texts = CHelper.GetValuesFromXML("Texts", navigator);
for (int i = 0; i < texts.Count; i++)
@@ -213,5 +356,15 @@ namespace Vocaluxe.Base
}
}
}
+
+ private static int GetPartyModeNr(int PartyModeID, int Language)
+ {
+ for (int i = 0; i < _Languages[Language].PartyModeTexts.Count; i++)
+ {
+ if (_Languages[Language].PartyModeTexts[i].PartyModeID == PartyModeID)
+ return i;
+ }
+ return -1;
+ }
}
}
diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs
new file mode 100644
index 00000000..e4bcb757
--- /dev/null
+++ b/Vocaluxe/Base/CMain.cs
@@ -0,0 +1,821 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+using Vocaluxe.GameModes;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
+
+namespace Vocaluxe.Base
+{
+ static class CMain
+ {
+ public static IConfig Config = new BConfig();
+ public static ISettings Settings = new BSettings();
+ public static ITheme Theme = new BTheme();
+ public static IHelper Helper = new BHelper();
+ public static IBackgroundMusic BackgroundMusic = new BBackgroundMusic();
+ public static IDrawing Draw = new BDraw();
+ public static IGraphics Graphics = new BGraphics();
+ public static ILog Log = new BLog();
+ public static IFonts Fonts = new BFonts();
+ public static ILanguage Language = new BLanguage();
+ public static IGame Game = new BGame();
+ public static IProfiles Profiles = new BProfiles();
+ public static IRecording Record = new BRecord();
+ public static ISongs Songs = new BSongs();
+ public static IVideo Video = new BVideo();
+ public static ISound Sound = new BSound();
+ public static ICover Cover = new BCover();
+ public static IDataBase DataBase = new BDataBase();
+ public static IInputs Input = new BInputs();
+ public static IPlaylist Playlist = new BPlaylist();
+
+
+ public static Basic Base = new Basic(
+ Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics, Fonts, Language, Game, Profiles, Record, Songs, Video, Sound, Cover, DataBase, Input, Playlist);
+ }
+
+ class BConfig : IConfig
+ {
+ public void SetBackgroundMusicVolume(int NewVolume)
+ {
+ if (NewVolume < 0)
+ CConfig.BackgroundMusicVolume = 0;
+ else if (NewVolume > 100)
+ CConfig.BackgroundMusicVolume = 100;
+ else
+ CConfig.BackgroundMusicVolume = NewVolume;
+
+ CConfig.SaveConfig();
+ }
+
+ public int GetBackgroundMusicVolume()
+ {
+ return CConfig.BackgroundMusicVolume;
+ }
+
+ public int GetPreviewMusicVolume()
+ {
+ return CConfig.PreviewMusicVolume;
+ }
+
+ public ESongMenu GetSongMenuType()
+ {
+ return CConfig.SongMenu;
+ }
+
+ public EOffOn GetVideosToBackground()
+ {
+ return CConfig.VideosToBackground;
+ }
+
+ public EOffOn GetVideoBackgrounds()
+ {
+ return CConfig.VideoBackgrounds;
+ }
+
+ public EOffOn GetVideoPreview()
+ {
+ return CConfig.VideoPreview;
+ }
+
+ public EOffOn GetDrawNoteLines()
+ {
+ return CConfig.DrawNoteLines;
+ }
+
+ public EOffOn GetDrawToneHelper()
+ {
+ return CConfig.DrawToneHelper;
+ }
+
+ public int GetCoverSize()
+ {
+ return CConfig.CoverSize;
+ }
+
+ public List GetSongFolder()
+ {
+ return CConfig.SongFolder;
+ }
+
+ public ESongSorting GetSongSorting()
+ {
+ return CConfig.SongSorting;
+ }
+
+ public EOffOn GetTabs()
+ {
+ return CConfig.Tabs;
+ }
+
+ public EOffOn GetIgnoreArticles()
+ {
+ return CConfig.IgnoreArticles;
+ }
+
+ public bool IsMicConfigured(int PlayerNr)
+ {
+ return CConfig.IsMicConfig(PlayerNr);
+ }
+
+ public int GetMaxNumMics()
+ {
+ int max = 0;
+ for (int i = 0; i < CSettings.MaxNumPlayer; i++)
+ {
+ if (CConfig.IsMicConfig(i + 1))
+ max = i + 1;
+ else
+ break;
+ }
+ return max;
+ }
+ }
+
+ class BSettings : ISettings
+ {
+ public int GetRenderW()
+ {
+ return CSettings.iRenderW;
+ }
+
+ public int GetRenderH()
+ {
+ return CSettings.iRenderH;
+ }
+
+ public bool IsTabNavigation()
+ {
+ return CSettings.TabNavigation;
+ }
+
+ public float GetZFar()
+ {
+ return CSettings.zFar;
+ }
+
+ public float GetZNear()
+ {
+ return CSettings.zNear;
+ }
+
+ public EGameState GetGameState()
+ {
+ return CSettings.GameState;
+ }
+
+ public int GetToneMin()
+ {
+ return CSettings.ToneMin;
+ }
+
+ public int GetToneMax()
+ {
+ return CSettings.ToneMax;
+ }
+
+ public int GetNumNoteLines()
+ {
+ return CSettings.NumNoteLines;
+ }
+
+ public int GetMaxNumPlayer()
+ {
+ return CSettings.MaxNumPlayer;
+ }
+
+ public float GetDefaultMedleyFadeInTime()
+ {
+ return CSettings.DefaultMedleyFadeInTime;
+ }
+
+ public float GetDefaultMedleyFadeOutTime()
+ {
+ return CSettings.DefaultMedleyFadeOutTime;
+ }
+
+ public int GetMedleyMinSeriesLength()
+ {
+ return CSettings.MedleyMinSeriesLength;
+ }
+
+ public float GetMedleyMinDuration()
+ {
+ return CSettings.MedleyMinDuration;
+ }
+ }
+
+ class BTheme : ITheme
+ {
+ public string GetThemeScreensPath()
+ {
+ return CTheme.GetThemeScreensPath();
+ }
+
+ public int GetSkinIndex()
+ {
+ return CTheme.GetSkinIndex();
+ }
+
+ public STexture GetSkinTexture(string TextureName)
+ {
+ return CTheme.GetSkinTexture(TextureName);
+ }
+
+ public STexture GetSkinVideoTexture(string VideoName)
+ {
+ return CTheme.GetSkinVideoTexture(VideoName);
+ }
+
+ public void SkinVideoResume(string VideoName)
+ {
+ CTheme.SkinVideoResume(VideoName);
+ }
+
+ public void SkinVideoPause(string VideoName)
+ {
+ CTheme.SkinVideoPause(VideoName);
+ }
+
+ public SColorF GetColor(string ColorName)
+ {
+ return CTheme.GetColor(ColorName);
+ }
+
+ public bool GetColor(string ColorName, int SkinIndex, ref SColorF Color)
+ {
+ return CTheme.GetColor(ColorName, SkinIndex, ref Color);
+ }
+
+ public SColorF GetPlayerColor(int PlayerNr)
+ {
+ return CTheme.GetPlayerColor(PlayerNr);
+ }
+
+ public void UnloadSkins()
+ {
+ CTheme.UnloadSkins();
+ }
+
+ public void ListSkins()
+ {
+ CTheme.ListSkins();
+ }
+
+ public void LoadSkins()
+ {
+ CTheme.LoadSkins();
+ }
+
+ public void LoadTheme()
+ {
+ CTheme.LoadTheme();
+ }
+
+ }
+
+ class BHelper : IHelper
+ {
+ }
+
+ class BBackgroundMusic : IBackgroundMusic
+ {
+ public bool IsDisabled()
+ {
+ return CBackgroundMusic.Disabled;
+ }
+
+ public bool IsPlaying()
+ {
+ return CBackgroundMusic.Playing;
+ }
+
+ public bool SongHasVideo()
+ {
+ return CBackgroundMusic.SongHasVideo;
+ }
+
+ public bool VideoEnabled()
+ {
+ return CBackgroundMusic.VideoEnabled;
+ }
+
+
+ public void Next()
+ {
+ CBackgroundMusic.Next();
+ }
+
+ public void Previous()
+ {
+ CBackgroundMusic.Previous();
+ }
+
+ public void Pause()
+ {
+ CBackgroundMusic.Pause();
+ }
+
+ public void Play()
+ {
+ CBackgroundMusic.Play();
+ }
+
+
+ public void ApplyVolume()
+ {
+ CBackgroundMusic.ApplyVolume();
+ }
+
+ public STexture GetVideoTexture()
+ {
+ return CBackgroundMusic.GetVideoTexture();
+ }
+ }
+
+ class BDraw : IDrawing
+ {
+ public RectangleF GetTextBounds(CText text)
+ {
+ return CDraw.GetTextBounds(text);
+ }
+
+ public void DrawTexture(STexture Texture, SRectF Rect)
+ {
+ CDraw.DrawTexture(Texture, Rect);
+ }
+
+ public void DrawTexture(STexture Texture, SRectF Rect, SColorF Color)
+ {
+ CDraw.DrawTexture(Texture, Rect, Color);
+ }
+
+ public void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds)
+ {
+ CDraw.DrawTexture(Texture, Rect, Color, Bounds);
+ }
+
+ public void DrawTexture(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, bool Mirrored)
+ {
+ CDraw.DrawTexture(Texture, Rect, Color, Bounds, Mirrored);
+ }
+
+ public void DrawTextureReflection(STexture Texture, SRectF Rect, SColorF Color, SRectF Bounds, float ReflectionSpace, float ReflectionHeight)
+ {
+ CDraw.DrawTextureReflection(Texture, Rect, Color, Bounds, ReflectionSpace, ReflectionHeight);
+ }
+
+ public void RemoveTexture(ref STexture Texture)
+ {
+ CDraw.RemoveTexture(ref Texture);
+ }
+
+ public void DrawColor(SColorF Color, SRectF Rect)
+ {
+ CDraw.DrawColor(Color, Rect);
+ }
+
+ public void DrawColorReflection(SColorF Color, SRectF Rect, float Space, float Height)
+ {
+ CDraw.DrawColorReflection(Color, Rect, Space, Height);
+ }
+ }
+
+ class BGraphics : IGraphics
+ {
+ public void ReloadTheme()
+ {
+ CGraphics.ReloadTheme();
+ }
+
+ public void SaveTheme()
+ {
+ CGraphics.SaveTheme();
+ }
+
+ public void FadeTo(EScreens NextScreen)
+ {
+ CGraphics.FadeTo(NextScreen);
+ }
+
+ public float GetGlobalAlpha()
+ {
+ return CGraphics.GlobalAlpha;
+ }
+ }
+
+ class BLog : ILog
+ {
+ public void LogError(string ErrorText)
+ {
+ CLog.LogError(ErrorText);
+ }
+ }
+
+ class BFonts : IFonts
+ {
+ public void SetFont(string FontName)
+ {
+ CFonts.SetFont(FontName);
+ }
+
+ public void SetStyle(EStyle FontStyle)
+ {
+ CFonts.Style = FontStyle;
+ }
+
+ public RectangleF GetTextBounds(CText Text, float TextHeight)
+ {
+ return CFonts.GetTextBounds(Text, TextHeight);
+ }
+
+ public void DrawText(string Text, float TextHeight, float x, float y, float z, SColorF Color)
+ {
+ CFonts.DrawText(Text, TextHeight, x, y, z, Color);
+ }
+
+ public void DrawTextReflection(string Text, float TextHeight, float x, float y, float z, SColorF Color, float ReflectionSpace, float ReflectionHeight)
+ {
+ CFonts.DrawTextReflection(Text, TextHeight, x, y, z, Color, ReflectionSpace, ReflectionHeight);
+ }
+
+ public void DrawText(string Text, float TextHeight, float x, float y, float z, SColorF Color, float Begin, float End)
+ {
+ CFonts.DrawText(Text, TextHeight, x, y, z, Color, Begin, End);
+ }
+ }
+
+ class BLanguage : ILanguage
+ {
+ public string Translate(string KeyWord)
+ {
+ return CLanguage.Translate(KeyWord);
+ }
+
+ public string Translate(string KeyWord, int PartyModeID)
+ {
+ return CLanguage.Translate(KeyWord, PartyModeID);
+ }
+
+ public bool TranslationExists(string KeyWord)
+ {
+ return CLanguage.TranslationExists(KeyWord);
+ }
+ }
+
+ class BGame : IGame
+ {
+ public int GetNumPlayer()
+ {
+ return CGame.NumPlayer;
+ }
+
+ public void SetNumPlayer(int NumPlayer)
+ {
+ CGame.NumPlayer = NumPlayer;
+ }
+
+ public SPlayer[] GetPlayer()
+ {
+ return CGame.Player;
+ }
+
+ public float GetMidBeatD()
+ {
+ return CGame.MidBeatD;
+ }
+
+ public int GetCurrentBeatD()
+ {
+ return CGame.ActBeatD;
+ }
+
+ public int GetRandom(int Max)
+ {
+ return CGame.Rand.Next(Max);
+ }
+
+ public double GetRandomDouble()
+ {
+ return CGame.Rand.NextDouble();
+ }
+
+ public float GetTimeFromBeats(float Beat, float BPM)
+ {
+ return CGame.GetTimeFromBeats(Beat, BPM);
+ }
+
+ public void AddSong(int SongID, EGameMode GameMode)
+ {
+ CGame.AddSong(SongID, GameMode);
+ }
+
+ public void Reset()
+ {
+ CGame.Reset();
+ }
+
+ public void ClearSongs()
+ {
+ CGame.ClearSongs();
+ }
+
+ public int GetNumSongs()
+ {
+ return CGame.GetNumSongs();
+ }
+ }
+
+ class BProfiles : IProfiles
+ {
+ public SProfile[] GetProfiles()
+ {
+ return CProfiles.Profiles;
+ }
+ }
+
+ class BRecord : IRecording
+ {
+ public int GetToneAbs(int PlayerNr)
+ {
+ return CSound.RecordGetToneAbs(PlayerNr);
+ }
+ }
+
+ class BSongs : ISongs
+ {
+ public int GetNumVisibleSongs()
+ {
+ return CSongs.NumVisibleSongs;
+ }
+
+ public int GetNumCategories()
+ {
+ return CSongs.NumCategories;
+ }
+
+ public int NumSongsInCategory(int CategoryIndex)
+ {
+ return CSongs.NumSongsInCategory(CategoryIndex);
+ }
+
+ public int GetCurrentCategoryIndex()
+ {
+ return CSongs.Category;
+ }
+
+ public EOffOn GetTabs()
+ {
+ return CSongs.Tabs;
+ }
+
+ public string GetSearchFilter()
+ {
+ return CSongs.SearchFilter;
+ }
+
+ public void SetCategory(int CategoryIndex)
+ {
+ CSongs.Category = CategoryIndex;
+ }
+
+ public void UpdateRandomSongList()
+ {
+ CSongs.UpdateRandomSongList();
+ }
+
+ public CSong GetVisibleSong(int VisibleIndex)
+ {
+ if (VisibleIndex >= CSongs.NumVisibleSongs)
+ return null;
+
+ CSong song = CSongs.VisibleSongs[VisibleIndex];
+ if (song == null)
+ return null;
+
+ return new CSong(song);
+ }
+
+ public CSong GetSongByID(int SongID)
+ {
+ return new CSong(CSongs.GetSong(SongID));
+ }
+
+ public CCategory GetCategory(int Index)
+ {
+ if (Index >= CSongs.NumCategories)
+ return null;
+
+ return new CCategory(CSongs.Categories[Index]);
+ }
+
+ public void AddPartySongSung(int SongID)
+ {
+ CSongs.AddPartySongSung(SongID);
+ }
+
+ public void ResetPartySongSung()
+ {
+ CSongs.ResetPartySongSung();
+ }
+
+ public void ResetPartySongSung(int CatIndex)
+ {
+ CSongs.ResetPartySongSung(CatIndex);
+ }
+
+ public void NextCategory()
+ {
+ CSongs.NextCategory();
+ }
+
+ public void PrevCategory()
+ {
+ CSongs.PrevCategory();
+ }
+ }
+
+ class BVideo : IVideo
+ {
+ public int Load(string VideoFileName)
+ {
+ return CVideo.VdLoad(VideoFileName);
+ }
+
+ public bool Skip(int VideoStream, float StartPosition, float VideoGap)
+ {
+ return CVideo.VdSkip(VideoStream, StartPosition, VideoGap);
+ }
+
+ public bool GetFrame(int VideoStream, ref STexture VideoTexture, float Time, ref float VideoTime)
+ {
+ return CVideo.VdGetFrame(VideoStream, ref VideoTexture, Time, ref VideoTime);
+ }
+
+ public bool IsFinished(int VideoStream)
+ {
+ return CVideo.VdFinished(VideoStream);
+ }
+
+ public bool Close(int VideoStream)
+ {
+ return CVideo.VdClose(VideoStream);
+ }
+
+ }
+
+ class BSound : ISound
+ {
+ public int Load(string SoundFile, bool Prescan)
+ {
+ return CSound.Load(SoundFile, Prescan);
+ }
+
+ public void SetPosition(int SoundStream, float NewPosition)
+ {
+ CSound.SetPosition(SoundStream, NewPosition);
+ }
+
+ public void Play(int SoundStream)
+ {
+ CSound.Play(SoundStream);
+ }
+
+ public void Fade(int SoundStream, float TargetVolume, float Duration)
+ {
+ CSound.Fade(SoundStream, TargetVolume, Duration);
+ }
+
+ public bool IsFinished(int SoundStream)
+ {
+ return CSound.IsFinished(SoundStream);
+ }
+
+ public float GetPosition(int SoundStream)
+ {
+ return CSound.GetPosition(SoundStream);
+ }
+
+ public float GetLength(int SoundStream)
+ {
+ return CSound.GetLength(SoundStream);
+ }
+
+ public void FadeAndStop(int SoundStream, float TargetVolume, float Duration)
+ {
+ CSound.FadeAndStop(SoundStream, TargetVolume, Duration);
+ }
+
+ public void SetStreamVolume(int SoundStream, float Volume)
+ {
+ CSound.SetStreamVolume(SoundStream, Volume);
+ }
+
+ public void SetStreamVolumeMax(int SoundStream, float MaxVolume)
+ {
+ CSound.SetStreamVolumeMax(SoundStream, MaxVolume);
+ }
+ }
+
+ class BCover : ICover
+ {
+ public STexture GetNoCover()
+ {
+ return CCover.NoCover;
+ }
+ }
+
+ class BDataBase : IDataBase
+ {
+ public bool GetCover(string FileName, ref STexture Texture, int CoverSize)
+ {
+ return CDataBase.GetCover(FileName, ref Texture, CoverSize);
+ }
+ }
+
+ class BInputs : IInputs
+ {
+ public void SetRumble(float Duration)
+ {
+ CInput.SetRumble(Duration);
+ }
+ }
+
+ class BPlaylist : IPlaylist
+ {
+ public void SetPlaylistName(int PlaylistID, string Name)
+ {
+ CPlaylists.SetPlaylistName(PlaylistID, Name);
+ }
+
+ public string GetPlaylistName(int PlaylistID)
+ {
+ return CPlaylists.GetPlaylistName(PlaylistID);
+ }
+
+ public void DeletePlaylist(int PlaylistID)
+ {
+ CPlaylists.DeletePlaylist(PlaylistID);
+ }
+
+ public void SavePlaylist(int PlaylistID)
+ {
+ CPlaylists.SavePlaylist(PlaylistID);
+ }
+
+ public int GetNumPlaylists()
+ {
+ return CPlaylists.NumPlaylists;
+ }
+
+
+
+ public void AddPlaylistSong(int PlaylistID, int SongID)
+ {
+ CPlaylists.AddPlaylistSong(PlaylistID, SongID);
+ }
+
+ public void AddPlaylistSong(int PlaylistID, int SongID, EGameMode GameMode)
+ {
+ CPlaylists.AddPlaylistSong(PlaylistID, SongID, GameMode);
+ }
+
+ public void InsertPlaylistSong(int PlaylistID, int PositionIndex, int SongID, EGameMode GameMode)
+ {
+ CPlaylists.InsertPlaylistSong(PlaylistID, PositionIndex, SongID, GameMode);
+ }
+
+ public void MovePlaylistSong(int PlaylistID, int SourceIndex, int DestIndex)
+ {
+ CPlaylists.MovePlaylistSong(PlaylistID, SourceIndex, DestIndex);
+ }
+
+ public void MovePlaylistSongDown(int PlaylistID, int SongIndex)
+ {
+ CPlaylists.MovePlaylistSongDown(PlaylistID, SongIndex);
+ }
+
+ public void MovePlaylistSongUp(int PlaylistID, int SongIndex)
+ {
+ CPlaylists.MovePlaylistSongUp(PlaylistID, SongIndex);
+ }
+
+ public void DeletePlaylistSong(int PlaylistID, int SongIndex)
+ {
+ CPlaylists.DeletePlaylistSong(PlaylistID, SongIndex);
+ }
+
+ public int GetPlaylistSongCount(int PlaylistID)
+ {
+ return CPlaylists.GetPlaylistSongCount(PlaylistID);
+ }
+
+ public CPlaylistSong GetPlaylistSong(int PlaylistID, int SongIndex)
+ {
+ return CPlaylists.GetPlaylistSong(PlaylistID, SongIndex);
+ }
+ }
+}
diff --git a/Vocaluxe/Base/CParty.cs b/Vocaluxe/Base/CParty.cs
new file mode 100644
index 00000000..02b65164
--- /dev/null
+++ b/Vocaluxe/Base/CParty.cs
@@ -0,0 +1,395 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using System.Xml;
+using System.Xml.XPath;
+
+using Vocaluxe.Menu;
+using Vocaluxe.PartyModes;
+
+namespace Vocaluxe.Base
+{
+ #region Structs
+ struct SPartyMode
+ {
+ public int PartyModeID;
+ public int PartyModeSystemVersion;
+ public string Name;
+ public string Description;
+ public string Author;
+ public string Folder;
+ public string PartyModeFile;
+ public List ScreenFiles;
+ public int PartyModeVersionMajor;
+ public int PartyModeVersionMinor;
+ public string TargetAudience;
+ public bool NoErrors;
+ public IPartyMode PartyMode;
+ }
+ #endregion Structs
+
+
+ static class CParty
+ {
+ const int PartyModeSystemVersion = 1;
+
+ private static CHelper Helper;
+ private static Dictionary _PartyModes;
+ private static Queue _IDs;
+
+ private static int _NormalGameModeID;
+ private static SPartyMode _CurrentPartyMode;
+
+ #region public stuff
+ public static void Init()
+ {
+ Helper = new CHelper();
+ _PartyModes = new Dictionary();
+ _IDs = new Queue(1000);
+
+ for (int i = 0; i < 1000; i++)
+ _IDs.Enqueue(i);
+
+ //add dummy normal game mode and set it as default
+ SPartyMode pm = new SPartyMode();
+ pm.PartyMode = new CPartyModeNone();
+ pm.ScreenFiles = new List();
+ pm.PartyMode.Initialize(CMain.Base);
+ pm.PartyModeID = _IDs.Dequeue();
+ _NormalGameModeID = pm.PartyModeID;
+ _PartyModes.Add(pm.PartyModeID, pm);
+ _CurrentPartyMode = pm;
+
+ //load other party modes
+ LoadPartyModes();
+ }
+
+ public static int CurrentPartyModeID
+ {
+ get
+ {
+ if (_CurrentPartyMode.PartyModeID != _NormalGameModeID)
+ return _CurrentPartyMode.PartyModeID;
+
+ return -1;
+ }
+ }
+
+ public static int NumModes
+ {
+ get { return _PartyModes.Count; }
+ }
+
+ public static List GetPartyModeInfos()
+ {
+ List infos = new List();
+
+ int[] UsedKeys = new int[_PartyModes.Count];
+ _PartyModes.Keys.CopyTo(UsedKeys, 0);
+
+ for (int i = 0; i < UsedKeys.Length; i++)
+ {
+ if (UsedKeys[i] != _NormalGameModeID)
+ {
+ SPartyMode mode = new SPartyMode();
+ _PartyModes.TryGetValue(UsedKeys[i], out mode);
+
+ if (mode.PartyMode != null)
+ {
+ SPartyModeInfos info = new SPartyModeInfos();
+
+ info.Author = mode.Author;
+ info.Description = mode.Description;
+ info.Name = mode.Name;
+ info.PartyModeID = mode.PartyModeID;
+ info.Playable = mode.NoErrors;
+ info.VersionMajor = mode.PartyModeVersionMajor;
+ info.VersionMinor = mode.PartyModeVersionMinor;
+
+ info.TargetAudience = mode.TargetAudience;
+ info.MaxPlayers = mode.PartyMode.GetMaxPlayer();
+ info.MinPlayers = mode.PartyMode.GetMinPlayer();
+ info.MaxTeams = mode.PartyMode.GetMaxTeams();
+ info.MinTeams = mode.PartyMode.GetMinTeams();
+
+ infos.Add(info);
+ }
+ }
+ }
+ return infos;
+ }
+
+ public static void SetNormalGameMode()
+ {
+ CSongs.ResetPartySongSung();
+ SetPartyMode(_NormalGameModeID);
+ }
+
+ public static void SetPartyMode(int PartyModeID)
+ {
+ if (!_PartyModes.TryGetValue(PartyModeID, out _CurrentPartyMode))
+ CLog.LogError("CParty: Can't find party mode ID: " + PartyModeID.ToString());
+
+ _CurrentPartyMode.PartyMode.Init();
+ }
+
+ public static CMenu GetNextPartyScreen(out EScreens AlternativeScreen)
+ {
+ return _CurrentPartyMode.PartyMode.GetNextPartyScreen(out AlternativeScreen);
+ }
+ #endregion public stuff
+
+ #region Interface
+ public static void UpdateGame()
+ {
+ _CurrentPartyMode.PartyMode.UpdateGame();
+ }
+
+ public static EScreens GetStartScreen()
+ {
+ return _CurrentPartyMode.PartyMode.GetStartScreen();
+ }
+
+ public static EScreens GetMainScreen()
+ {
+ return _CurrentPartyMode.PartyMode.GetMainScreen();
+ }
+
+ public static ScreenSongOptions GetSongSelectionOptions()
+ {
+ return _CurrentPartyMode.PartyMode.GetScreenSongOptions();
+ }
+
+ public static void SetSearchString(string SearchString, bool Visible)
+ {
+ _CurrentPartyMode.PartyMode.SetSearchString(SearchString, Visible);
+ }
+
+ public static void JokerUsed(int TeamNr)
+ {
+ _CurrentPartyMode.PartyMode.JokerUsed(TeamNr);
+ }
+
+ public static void SongSelected(int SongID)
+ {
+ _CurrentPartyMode.PartyMode.SongSelected(SongID);
+ }
+
+ public static void FinishedSinging()
+ {
+ _CurrentPartyMode.PartyMode.FinishedSinging();
+ }
+
+ public static void LeavingScore()
+ {
+ _CurrentPartyMode.PartyMode.LeavingScore();
+ }
+
+ public static void LeavingHighscore()
+ {
+ _CurrentPartyMode.PartyMode.LeavingHighscore();
+ }
+ #endregion Interface
+
+ #region private stuff
+ private static void LoadPartyModes()
+ {
+ List files = new List();
+ files.AddRange(Helper.ListFiles(CSettings.sFolderPartyModes, "*.xml", false, true));
+
+ foreach (string file in files)
+ {
+ SPartyMode pm = LoadPartyMode(file);
+ _PartyModes.Add(pm.PartyModeID, pm);
+ }
+ }
+
+ private static SPartyMode LoadPartyMode(string file)
+ {
+ SPartyMode pm = new SPartyMode();
+ pm.PartyModeID = _IDs.Dequeue();
+ pm.ScreenFiles = new List();
+ pm.NoErrors = false;
+
+ bool loaded = false;
+ XPathDocument xPathDoc = null;
+ XPathNavigator navigator = null;
+
+ try
+ {
+ xPathDoc = new XPathDocument(file);
+ navigator = xPathDoc.CreateNavigator();
+ loaded = true;
+ }
+ catch (Exception e)
+ {
+ loaded = false;
+ if (navigator != null)
+ navigator = null;
+
+ if (xPathDoc != null)
+ xPathDoc = null;
+
+ CLog.LogError("Error opening party mode file " + file + ": " + e.Message);
+ }
+
+ if (loaded)
+ {
+ loaded &= CHelper.TryGetIntValueFromXML("//root/PartyModeSystemVersion", navigator, ref pm.PartyModeSystemVersion);
+ loaded &= CHelper.GetValueFromXML("//root/Info/Name", navigator, ref pm.Name, "ERROR Name");
+ loaded &= CHelper.GetValueFromXML("//root/Info/Description", navigator, ref pm.Description, "ERROR Description");
+ loaded &= CHelper.GetValueFromXML("//root/Info/Author", navigator, ref pm.Author, "ERROR Author");
+ loaded &= CHelper.GetValueFromXML("//root/Info/Folder", navigator, ref pm.Folder, "ERROR Folder");
+ loaded &= CHelper.GetValueFromXML("//root/Info/PartyModeFile", navigator, ref pm.PartyModeFile, "ERROR PartyModeFile");
+ loaded &= CHelper.GetInnerValuesFromXML("PartyScreens", navigator, ref pm.ScreenFiles);
+ loaded &= CHelper.TryGetIntValueFromXML("//root/Info/PartyModeVersionMajor", navigator, ref pm.PartyModeVersionMajor);
+ loaded &= CHelper.TryGetIntValueFromXML("//root/Info/PartyModeVersionMinor", navigator, ref pm.PartyModeVersionMinor);
+ loaded &= CHelper.GetValueFromXML("//root/Info/TargetAudience", navigator, ref pm.TargetAudience, "ERROR TargetAudience");
+
+ if (pm.PartyModeSystemVersion != PartyModeSystemVersion)
+ {
+ CLog.LogError("Error loading PartyMode file (wrong PartyModeSystemVersion): " + file);
+ return pm;
+ }
+
+ if (pm.ScreenFiles.Count == 0)
+ {
+ CLog.LogError("Error loading PartyMode file (no ScreenFiles found): " + file);
+ return pm;
+ }
+ }
+
+ if (!loaded)
+ {
+ CLog.LogError("Error loading PartyMode file: " + file);
+ return pm;
+ }
+
+ string PathToCode = Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeCode);
+
+ List FilesToCompile = new List();
+ FilesToCompile.AddRange(Helper.ListFiles(PathToCode, "*.cs", false, true));
+
+ Assembly Output = CompileFiles(FilesToCompile.ToArray());
+ if (Output == null)
+ return pm;
+
+ if (!CLanguage.LoadPartyLanguageFiles(pm.PartyModeID, Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeLanguages)))
+ {
+ CLog.LogError("Error loading language files for PartyMode: " + file);
+ return pm;
+ }
+
+ object Instance = Output.CreateInstance("Vocaluxe.PartyModes." + pm.PartyModeFile);
+ if (Instance == null)
+ {
+ CLog.LogError("Error creating Instance of PartyMode file: " + file);
+ return pm;
+ }
+
+ try
+ {
+ pm.PartyMode = (IPartyMode)Instance;
+ }
+ catch (Exception e)
+ {
+ CLog.LogError("Error casting PartyMode file: " + file + "; " + e.Message);
+ return pm;
+ }
+ pm.PartyMode.Initialize(CMain.Base);
+
+ foreach (string screenfile in pm.ScreenFiles)
+ {
+ string XmlPath = Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeScreens);
+ CMenuParty Screen = GetPartyScreenInstance(
+ Output,
+ screenfile,
+ Path.Combine(Path.Combine(CSettings.sFolderPartyModes, pm.Folder), CSettings.sFolderPartyModeScreens)
+ );
+
+ if (Screen != null)
+ {
+ Screen.Initialize(CMain.Base);
+ Screen.AssingPartyMode(pm.PartyMode);
+ Screen.SetPartyModeID(pm.PartyModeID);
+ Screen.LoadTheme(XmlPath);
+ pm.PartyMode.AddScreen(Screen, screenfile);
+ }
+ else
+ return pm;
+ }
+
+ pm.NoErrors = true;
+ return pm;
+ }
+
+ private static Assembly CompileFiles(string[] files)
+ {
+ if (files == null)
+ return null;
+
+ if (files.Length == 0)
+ return null;
+
+ CompilerParameters Params = new CompilerParameters();
+ Params.ReferencedAssemblies.Add("System.Windows.Forms.dll");
+ Params.ReferencedAssemblies.Add("VocaluxeLib.dll");
+ Params.GenerateInMemory = true;
+#if DEBUG
+ Params.IncludeDebugInformation = true;
+#endif
+
+ CodeDomProvider CDP = CodeDomProvider.CreateProvider("CSharp");
+ CompilerResults CompileResult = null;
+
+ try
+ {
+ CompileResult = CDP.CompileAssemblyFromFile(Params, files);
+ }
+ catch (Exception e)
+ {
+ CLog.LogError("Error Compiling Source (" + CHelper.ListStrings(files) + "): " + e.Message);
+ return null;
+ }
+
+ if (CompileResult.Errors.Count > 0)
+ {
+ for (int i = 0; i < CompileResult.Errors.Count; i++)
+ {
+ CLog.LogError("Error Compiling Source (" + CHelper.ListStrings(files) + "): " + CompileResult.Errors[i].ErrorText);
+ }
+ return null;
+ }
+ return CompileResult.CompiledAssembly;
+ }
+
+ private static CMenuParty GetPartyScreenInstance(Assembly Assembly, string ScreenName, string XmlPath)
+ {
+ if (Assembly == null)
+ return null;
+
+ object Instance = Assembly.CreateInstance("Vocaluxe.PartyModes." + ScreenName);
+ if (Instance == null)
+ {
+ CLog.LogError("Error creating Instance of PartyScreen: " + ScreenName);
+ return null;
+ }
+
+ CMenuParty Screen = null;
+ try
+ {
+ Screen = (CMenuParty)Instance;
+ }
+ catch (Exception e)
+ {
+ CLog.LogError("Error casting PartyScreen: " + ScreenName + "; " + e.Message);
+ return null;
+ }
+ return Screen;
+ }
+ #endregion private stuff
+ }
+}
diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs
index c509f4f6..917314e6 100644
--- a/Vocaluxe/Base/CPlaylists.cs
+++ b/Vocaluxe/Base/CPlaylists.cs
@@ -5,8 +5,10 @@ using System.Text;
using System.Xml;
using System.Xml.XPath;
-using Vocaluxe.Lib.Song;
using Vocaluxe.Lib.Playlist;
+using Vocaluxe.GameModes;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Base
{
@@ -59,16 +61,20 @@ namespace Vocaluxe.Base
SortPlaylistsByName();
}
- #region private methods
-
- private static void SortPlaylistsByName()
+ public static string GetPlaylistName(int PlaylistID)
{
- _Playlists.Sort(CompareByPlaylistName);
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return "Error: Can't find Playlist";
+
+ return _Playlists[PlaylistID].PlaylistName;
}
- private static int CompareByPlaylistName(CPlaylistFile a, CPlaylistFile b)
+ public static void SetPlaylistName(int PlaylistID, string Name)
{
- return String.Compare(a.PlaylistName, b.PlaylistName);
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].PlaylistName = Name;
}
public static void DeletePlaylist(int PlaylistID)
@@ -104,6 +110,93 @@ namespace Vocaluxe.Base
return (_Playlists.Count - 1);
}
+
+
+ public static void AddPlaylistSong(int PlaylistID, int SongID)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].AddSong(SongID);
+ }
+
+ public static void AddPlaylistSong(int PlaylistID, int SongID, EGameMode GameMode)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].AddSong(SongID, GameMode);
+ }
+
+ public static void InsertPlaylistSong(int PlaylistID, int PositionIndex, int SongID, EGameMode GameMode)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].SongInsert(PositionIndex, SongID, GameMode);
+ }
+
+ public static void MovePlaylistSong(int PlaylistID, int SourceIndex, int DestIndex)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].SongMove(SourceIndex, DestIndex);
+ }
+
+ public static void MovePlaylistSongDown(int PlaylistID, int SongIndex)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].SongDown(SongIndex);
+ }
+
+ public static void MovePlaylistSongUp(int PlaylistID, int SongIndex)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].SongUp(SongIndex);
+ }
+
+ public static void DeletePlaylistSong(int PlaylistID, int SongIndex)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return;
+
+ _Playlists[PlaylistID].DeleteSong(SongIndex);
+ }
+
+ public static int GetPlaylistSongCount(int PlaylistID)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return 0;
+
+ return _Playlists[PlaylistID].Songs.Count;
+ }
+
+ public static CPlaylistSong GetPlaylistSong(int PlaylistID, int SongIndex)
+ {
+ if (PlaylistID >= _Playlists.Count || PlaylistID < 0)
+ return null;
+
+ if (SongIndex >= _Playlists[PlaylistID].Songs.Count)
+ return null;
+
+ return _Playlists[PlaylistID].Songs[SongIndex];
+ }
+
+ #region private methods
+ private static void SortPlaylistsByName()
+ {
+ _Playlists.Sort(CompareByPlaylistName);
+ }
+
+ private static int CompareByPlaylistName(CPlaylistFile a, CPlaylistFile b)
+ {
+ return String.Compare(a.PlaylistName, b.PlaylistName);
+ }
#endregion
}
}
diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs
index ed73ed31..c1eedb3f 100644
--- a/Vocaluxe/Base/CProfiles.cs
+++ b/Vocaluxe/Base/CProfiles.cs
@@ -6,32 +6,10 @@ using System.Xml;
using System.Xml.XPath;
using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
-{
- struct SProfile
- {
- public string PlayerName;
- public string ProfileFile;
-
- public EGameDifficulty Difficulty;
- public SAvatar Avatar;
- public EOffOn GuestProfile;
- public EOffOn Active;
- }
-
- struct SAvatar
- {
- public string FileName;
- public STexture Texture;
-
- public SAvatar(int dummy)
- {
- FileName = String.Empty;
- Texture = new STexture(-1);
- }
- }
-
+{
static class CProfiles
{
private static XmlWriterSettings _settings = new XmlWriterSettings();
diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs
index cd357399..27c65435 100644
--- a/Vocaluxe/Base/CSettings.cs
+++ b/Vocaluxe/Base/CSettings.cs
@@ -3,15 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
+using Vocaluxe.Menu;
+
namespace Vocaluxe.Base
{
- public enum EGameState
- {
- Start,
- Normal,
- EditTheme
- }
-
enum ERevision
{
Alpha,
@@ -96,6 +91,12 @@ namespace Vocaluxe.Base
public const string sFolderBackgroundMusic = "BackgroundMusic";
public static string sFolderPlaylists = "Playlists";
+
+ public static string sFolderPartyModes = "PartyModes";
+ public const string sFolderPartyModeCode = "Code";
+ public const string sFolderPartyModeScreens = "Screens";
+ public const string sFolderPartyModeLanguages = "Languages";
+
//public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
public const int ToneMin = -36;
public const int ToneMax = 89;
diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs
index 147e1c01..c095081d 100644
--- a/Vocaluxe/Base/CSongs.cs
+++ b/Vocaluxe/Base/CSongs.cs
@@ -8,8 +8,9 @@ using System.Text.RegularExpressions;
using System.Threading;
using Vocaluxe.Lib.Draw;
-using Vocaluxe.Lib.Song;
+
using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Base
{
@@ -20,6 +21,7 @@ namespace Vocaluxe.Base
public int CatIndex;
public bool Visible;
+ public bool PartyHidden;
public SongPointer(int ID, string sortString)
{
@@ -27,20 +29,7 @@ namespace Vocaluxe.Base
SortString = sortString;
CatIndex = -1;
Visible = false;
- }
- }
-
- public class CCategory
- {
- public string Name = String.Empty;
- public STexture CoverTextureSmall = new STexture();
- public STexture CoverTextureBig = new STexture();
-
- public CCategory(string name, STexture CoverSmall, STexture CoverBig)
- {
- Name = name;
- CoverTextureSmall = CoverSmall;
- CoverTextureBig = CoverBig;
+ PartyHidden = false;
}
}
@@ -62,6 +51,9 @@ namespace Vocaluxe.Base
private static string _SearchFilter = String.Empty;
private static EOffOn _Tabs = CConfig.Tabs;
+ private static EOffOn _IgnoreArticles = CConfig.IgnoreArticles;
+ private static ESongSorting _SongSorting = CConfig.SongSorting;
+ private static bool _ShowDuetSongs = true;
private static Thread _CoverLoaderThread = new Thread(new ThreadStart(_LoadCover));
@@ -70,14 +62,13 @@ namespace Vocaluxe.Base
get { return _SearchFilter; }
set
{
- _SearchFilter = value;
- if (_SearchFilter.Length > 0)
+ if (value.Length > 0)
{
- _Sort(CConfig.SongSorting, EOffOn.TR_CONFIG_OFF, _SearchFilter);
+ _Sort(_SongSorting, EOffOn.TR_CONFIG_OFF, _IgnoreArticles, value, false, _ShowDuetSongs);
}
else
{
- Sort();
+ _Sort(_SongSorting, _Tabs, _IgnoreArticles, value, false, _ShowDuetSongs);
}
}
}
@@ -87,6 +78,11 @@ namespace Vocaluxe.Base
get { return _Tabs; }
}
+ public static EOffOn IgnoreArticles
+ {
+ get { return _IgnoreArticles; }
+ }
+
public static bool SongsLoaded
{
get { return _SongsLoaded; }
@@ -131,13 +127,13 @@ namespace Vocaluxe.Base
get { return _CatIndex; }
set
{
- if ((_Categories.Count > value) && (value >= -1))
+ if ((_Categories.Count > value) && (value >= -1) && _CatIndex != value)
{
_CatIndex = value;
for (int i = 0; i < _SongsSortList.Length; i++)
{
- _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex);
+ _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex && !_SongsSortList[i].PartyHidden);
}
}
}
@@ -156,7 +152,7 @@ namespace Vocaluxe.Base
int num = 0;
for (int i = 0; i < _SongsSortList.Length; i++)
{
- if (_SongsSortList[i].CatIndex == CatIndex)
+ if (_SongsSortList[i].CatIndex == CatIndex && !_SongsSortList[i].PartyHidden)
num++;
}
return num;
@@ -225,7 +221,7 @@ namespace Vocaluxe.Base
_CoverLoaded = true;
}
- public static string GetActualCategoryName()
+ public static string GetCurrentCategoryName()
{
if ((_Categories.Count > 0) && (_CatIndex >= 0) && (_Categories.Count > _CatIndex))
return _Categories[_CatIndex].Name;
@@ -243,6 +239,48 @@ namespace Vocaluxe.Base
return null;
}
+ public static void AddPartySongSung(int SongID)
+ {
+ int cat = -1;
+ for (int i = 0; i < _SongsSortList.Length; i++)
+ {
+ if (SongID == _SongsSortList[i].SongID)
+ {
+ _SongsSortList[i].PartyHidden = true;
+ _SongsSortList[i].Visible = false;
+ cat = _SongsSortList[i].CatIndex;
+ break;
+ }
+ }
+
+ if (cat != -1)
+ {
+ if (NumSongsInCategory(cat) == 0)
+ ResetPartySongSung(cat);
+ }
+ }
+
+ public static void ResetPartySongSung()
+ {
+ for (int i = 0; i < _SongsSortList.Length; i++)
+ {
+ _SongsSortList[i].PartyHidden = false;
+ _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex && !_SongsSortList[i].PartyHidden);
+ }
+ }
+
+ public static void ResetPartySongSung(int CatIndex)
+ {
+ for (int i = 0; i < _SongsSortList.Length; i++)
+ {
+ if (_SongsSortList[i].CatIndex == CatIndex)
+ {
+ _SongsSortList[i].PartyHidden = false;
+ _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex && !_SongsSortList[i].PartyHidden);
+ }
+ }
+ }
+
public static int GetVisibleSongNumber(int SongID)
{
int i = -1;
@@ -329,41 +367,52 @@ namespace Vocaluxe.Base
get { return _Categories.ToArray(); }
}
- public static void Sort()
+ public static void Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString)
{
- _Sort(CConfig.SongSorting, CConfig.Tabs, String.Empty);
+ _Sort(Sorting, Tabs, IgnoreArticles, SearchString, false, _ShowDuetSongs);
}
- public static void Sort(ESongSorting sorting)
+ public static void Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, String SearchString, bool ShowDuetSongs)
{
- _Sort(sorting, CConfig.Tabs, String.Empty);
+ _Sort(Sorting, Tabs, IgnoreArticles, SearchString, false, ShowDuetSongs);
}
- private static void _Sort(ESongSorting sorting, EOffOn Tabs, string SearchString)
+ private static void _Sort(ESongSorting Sorting, EOffOn Tabs, EOffOn IgnoreArticles, string SearchString, bool force, bool ShowDuetSongs)
{
if (_Songs.Count == 0)
return;
+ if (!force && Sorting == _SongSorting && Tabs == _Tabs && IgnoreArticles == _IgnoreArticles && SearchString == _SearchFilter && ShowDuetSongs == _ShowDuetSongs)
+ return; //nothing to do
+
_Categories.Clear();
string category = String.Empty;
+ _IgnoreArticles = IgnoreArticles;
+ _SongSorting = Sorting;
_Tabs = Tabs;
+ _ShowDuetSongs = ShowDuetSongs;
+
+ _SearchFilter = SearchString;
List _SortList = new List();
List _SongList = new List();
foreach (CSong song in _Songs)
{
- if (SearchString == String.Empty)
- _SongList.Add(song);
- else
+ if (!song.IsDuet || _ShowDuetSongs)
{
- if (song.Title.ToUpper().Contains(SearchString.ToUpper()) || song.Artist.ToUpper().Contains(SearchString.ToUpper()))
+ if (_SearchFilter == String.Empty)
_SongList.Add(song);
+ else
+ {
+ if (song.Title.ToUpper().Contains(_SearchFilter.ToUpper()) || song.Artist.ToUpper().Contains(_SearchFilter.ToUpper()))
+ _SongList.Add(song);
+ }
}
}
- switch (sorting)
+ switch (_SongSorting)
{
case ESongSorting.TR_CONFIG_EDITION:
foreach (CSong song in _SongList)
@@ -384,7 +433,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -450,7 +499,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -535,7 +584,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -578,7 +627,7 @@ namespace Vocaluxe.Base
_SortList.Sort(delegate(SongPointer s1, SongPointer s2)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
int res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -614,7 +663,7 @@ namespace Vocaluxe.Base
case ESongSorting.TR_CONFIG_ARTIST_LETTER:
foreach (CSong song in _SongList)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
_SortList.Add(new SongPointer(song.ID, song.ArtistSorting));
else
_SortList.Add(new SongPointer(song.ID, song.Artist));
@@ -625,7 +674,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper());
}
@@ -672,7 +721,7 @@ namespace Vocaluxe.Base
case ESongSorting.TR_CONFIG_TITLE_LETTER:
foreach (CSong song in _SongList)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
_SortList.Add(new SongPointer(song.ID, song.TitleSorting));
else
_SortList.Add(new SongPointer(song.ID, song.Title));
@@ -683,7 +732,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper());
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
return _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
}
@@ -738,7 +787,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.CompareTo(s2.SortString);
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -797,7 +846,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.CompareTo(s2.SortString);
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -863,7 +912,7 @@ namespace Vocaluxe.Base
int res = s1.SortString.CompareTo(s2.SortString);
if (res == 0)
{
- if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON)
+ if (_IgnoreArticles == EOffOn.TR_CONFIG_ON)
{
res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper());
if (res == 0)
@@ -950,7 +999,7 @@ namespace Vocaluxe.Base
CLog.StartBenchmark(2, "Read TXTs");
foreach (string file in files)
{
- CSong Song = new CSong();
+ CSong Song = new CSong(CMain.Base);
if (Song.ReadTXTSong(file))
{
Song.ID = _Songs.Count;
@@ -960,7 +1009,7 @@ namespace Vocaluxe.Base
CLog.StopBenchmark(2, "Read TXTs");
CLog.StartBenchmark(2, "Sort Songs");
- Sort(CConfig.SongSorting);
+ _Sort(CConfig.SongSorting, CConfig.Tabs, CConfig.IgnoreArticles, String.Empty, true, true);
CLog.StopBenchmark(2, "Sort Songs");
Category = -1;
_SongsLoaded = true;
diff --git a/Vocaluxe/Base/CSound.cs b/Vocaluxe/Base/CSound.cs
index 7f6414d4..d77c10ad 100644
--- a/Vocaluxe/Base/CSound.cs
+++ b/Vocaluxe/Base/CSound.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Text;
using Vocaluxe.Lib.Sound;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/Base/CTheme.cs b/Vocaluxe/Base/CTheme.cs
index 66ee9023..da75d10e 100644
--- a/Vocaluxe/Base/CTheme.cs
+++ b/Vocaluxe/Base/CTheme.cs
@@ -126,8 +126,6 @@ namespace Vocaluxe.Base
_settings.Encoding = Encoding.UTF8;
_settings.ConformanceLevel = ConformanceLevel.Document;
- //ThemeColors.Player = new SColorF[6];
-
ListThemes();
ListSkins();
diff --git a/Vocaluxe/Base/CUtility.cs b/Vocaluxe/Base/CUtility.cs
index 4f98fbc4..81029815 100644
--- a/Vocaluxe/Base/CUtility.cs
+++ b/Vocaluxe/Base/CUtility.cs
@@ -10,130 +10,10 @@ using System.Xml;
using System.Xml.XPath;
using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
- [Flags]
- public enum EModifier
- {
- None,
- Shift,
- Alt,
- Ctrl
- }
-
- public enum ESender
- {
- Mouse,
- Keyboard,
- WiiMote,
- Gamepad
- }
-
- public struct KeyEvent
- {
- public ESender Sender;
- public bool ModALT;
- public bool ModSHIFT;
- public bool ModCTRL;
- public bool KeyPressed;
- public bool Handled;
- public Keys Key;
- public Char Unicode;
- public EModifier Mod;
-
- public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key)
- {
- Sender = sender;
- ModALT = alt;
- ModSHIFT = shift;
- ModCTRL = ctrl;
- KeyPressed = pressed;
- Unicode = unicode;
- Key = key;
- Handled = false;
-
- EModifier mALT = EModifier.None;
- EModifier mSHIFT = EModifier.None;
- EModifier mCTRL = EModifier.None;
-
- if (alt)
- mALT = EModifier.Alt;
-
- if (shift)
- mSHIFT = EModifier.Shift;
-
- if (ctrl)
- mCTRL = EModifier.Ctrl;
-
- if (!alt && !shift && !ctrl)
- Mod = EModifier.None;
- else
- Mod = mALT | mSHIFT | mCTRL;
- }
- }
-
- public struct MouseEvent
- {
- public ESender Sender;
- public int X;
- public int Y;
- public bool LB; //left button click
- public bool LD; //left button double click
- public bool RB; //right button click
- public bool MB; //middle button click
-
- public bool LBH; //left button hold (when moving)
- public bool RBH; //right button hold (when moving)
- public bool MBH; //middle button hold (when moving)
-
- public bool ModALT;
- public bool ModSHIFT;
- public bool ModCTRL;
-
- public EModifier Mod;
- public int Wheel;
-
- public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh)
- {
- Sender = sender;
- X = x;
- Y = y;
- LB = lb;
- LD = ld;
- RB = rb;
- MB = mb;
-
- LBH = lbh;
- RBH = rbh;
- MBH = mbh;
-
- ModALT = alt;
- ModSHIFT = shift;
- ModCTRL = ctrl;
-
- EModifier mALT = EModifier.None;
- EModifier mSHIFT = EModifier.None;
- EModifier mCTRL = EModifier.None;
-
- if (alt)
- mALT = EModifier.Alt;
-
- if (shift)
- mSHIFT = EModifier.Shift;
-
- if (ctrl)
- mCTRL = EModifier.Ctrl;
-
- if (!alt && !shift && !ctrl)
- Mod = EModifier.None;
- else
- Mod = mALT | mSHIFT | mCTRL;
-
- Wheel = wheel;
- }
- }
-
static class CTime
{
private static Stopwatch _Stopwatch = new Stopwatch();
@@ -468,323 +348,4 @@ namespace Vocaluxe.Base
}
}
-
- class CHelper
- {
- public static int TryReadInt(StreamReader sr)
- {
- char chr = '0';
- string value = String.Empty;
-
- try
- {
- chr = (char)sr.Peek();
- while ((chr.CompareTo(' ') != 0) && ((int)chr != 19) && ((int)chr != 16) && ((int)chr != 13))
- {
- chr = (char)sr.Read();
- value += chr.ToString();
- chr = (char)sr.Peek();
- }
- }
- catch (Exception)
- {
- return 0;
- }
- int result = 0;
- int.TryParse(value, out result);
- return result;
- }
-
- public static void SetRect(RectangleF Bounds, ref RectangleF Rect, float RectAspect, EAspect Aspect)
- {
- float rW = Bounds.Right - Bounds.Left;
- float rH = Bounds.Bottom - Bounds.Top;
- float rA = rW / rH;
-
- float ScaledWidth = rW;
- float ScaledHeight = rH;
-
- switch (Aspect)
- {
- case EAspect.Crop:
- if (rA >= RectAspect)
- {
- ScaledWidth = rW;
- ScaledHeight = rH * rA / RectAspect;
- }
- else
- {
- ScaledHeight = rH;
- ScaledWidth = rW * RectAspect / rA;
- }
- break;
- case EAspect.LetterBox:
- if (RectAspect >= 1)
- {
- ScaledWidth = rW;
- ScaledHeight = rH * rA / RectAspect;
- }
- else
- {
- ScaledHeight = rH;
- ScaledWidth = rW * RectAspect / rA;
- }
- break;
- default:
- ScaledWidth = rW;
- ScaledHeight = rH;
- break;
- }
-
- float Left = (rW - ScaledWidth) / 2 + Bounds.Left;
- float Rigth = Left + ScaledWidth;
-
- float Upper = (rH - ScaledHeight) / 2 + Bounds.Top;
- float Lower = Upper + ScaledHeight;
-
- Rect = new RectangleF(Left, Upper, Rigth - Left, Lower - Upper);
- }
-
- public static bool TryGetEnumValueFromXML(string Cast, XPathNavigator Navigator, ref T value)
- where T : struct
- {
- string val = String.Empty;
- if (GetValueFromXML(Cast, Navigator, ref val, Enum.GetName(typeof(T), value)))
- {
- TryParse(val, out value, true);
- return true;
- }
- return false;
- }
-
- public static bool TryGetIntValueFromXML(string Cast, XPathNavigator Navigator, ref int value)
- {
- string val = String.Empty;
- if (GetValueFromXML(Cast, Navigator, ref val, value.ToString()))
- {
- int res = 0;
- if (int.TryParse(val, out res))
- {
- value = res;
- return true;
- }
- }
- return false;
- }
-
- public static bool TryGetFloatValueFromXML(string Cast, XPathNavigator Navigator, ref float value)
- {
- string val = String.Empty;
- if (GetValueFromXML(Cast, Navigator, ref val, value.ToString()))
- {
- float res = 0;
- if (TryParse(val, out res))
- {
- value = res;
- return true;
- }
- }
- return false;
- }
-
- public static bool GetValueFromXML(string Cast, XPathNavigator Navigator, ref string Value, string DefaultValue)
- {
- XPathNodeIterator iterator;
- int results = 0;
- string val = string.Empty;
-
- try
- {
- Navigator.MoveToFirstChild();
- iterator = Navigator.Select(Cast);
-
- while (iterator.MoveNext())
- {
- val = iterator.Current.Value;
- results++;
- }
- }
- catch (Exception)
- {
- results = 0;
- }
-
- if ((results == 0) || (results > 1))
- {
- Value = DefaultValue;
- return false;
- }
- else
- {
- Value = val;
- return true;
- }
-
- }
-
- public static List GetValuesFromXML(string Cast, XPathNavigator Navigator)
- {
- List values = new List();
-
- try
- {
- Navigator.MoveToRoot();
- Navigator.MoveToFirstChild();
- Navigator.MoveToFirstChild();
-
- while (Navigator.Name != Cast)
- Navigator.MoveToNext();
-
- Navigator.MoveToFirstChild();
-
- values.Add(Navigator.LocalName);
- while(Navigator.MoveToNext())
- values.Add(Navigator.LocalName);
-
- }
- catch (Exception)
- {
-
- }
-
- return values;
- }
-
- public static bool ItemExistsInXML(string Cast, XPathNavigator Navigator)
- {
- XPathNodeIterator iterator;
- int results = 0;
-
- try
- {
- Navigator.MoveToFirstChild();
- iterator = Navigator.Select(Cast);
-
- while (iterator.MoveNext())
- results++;
- }
- catch (Exception)
- {
- results = 0;
- }
-
- if (results == 0)
- return false;
-
- return true;
- }
-
- public List ListFiles(string path, string cast)
- {
- return ListFiles(path, cast, false, false);
- }
-
- public List ListFiles(string path, string cast, bool recursive)
- {
- return ListFiles(path, cast, recursive, false);
- }
-
- public List ListFiles(string path, string cast, bool recursive, bool fullpath)
- {
- List files = new List();
- DirectoryInfo dir = new DirectoryInfo(path);
-
- try
- {
-
- foreach (FileInfo file in dir.GetFiles(cast))
- {
- if (!fullpath)
- files.Add(file.Name);
- else
- //files.Add(Path.Combine(file.DirectoryName, file.Name));
- files.Add(file.FullName);
- }
-
- if (recursive)
- {
- foreach (DirectoryInfo di in dir.GetDirectories())
- {
- files.AddRange(ListFiles(di.FullName, cast, recursive, fullpath));
- }
- }
- } catch (Exception)
- {
-
- }
-
- return files;
- }
-
- public static bool TryParse(string value, out T result)
- where T : struct
- {
- return TryParse(value, out result, false);
- }
-
- public static bool TryParse(string value, out T result, bool ignoreCase)
- where T : struct
- {
- result = default(T);
- try
- {
- result = (T)Enum.Parse(typeof(T), value, ignoreCase);
- return true;
- }
- catch { }
-
- return false;
- }
-
- public static bool TryParse(string value, out float result)
- {
- value = value.Replace(',', '.');
- return float.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, NumberFormatInfo.InvariantInfo, out result);
- }
-
- public static bool IsInBounds(SRectF bounds, MouseEvent MouseEvent)
- {
- return IsInBounds(bounds, MouseEvent.X, MouseEvent.Y);
- }
-
- public static bool IsInBounds(SRectF bounds, int x, int y)
- {
- return ((bounds.X <= x) && (bounds.X + bounds.W >= x) && (bounds.Y <= y) && (bounds.Y + bounds.H >= y));
- }
- }
-
- static class CEncoding
- {
- public static Encoding GetEncoding(string EncodingName)
- {
- switch (EncodingName)
- {
- case "AUTO":
- return Encoding.Default;
- case "CP1250":
- return Encoding.GetEncoding(1250);
- case "CP1252":
- return Encoding.GetEncoding(1252);
- case "LOCALE":
- return Encoding.Default;
- case "UTF8":
- return Encoding.UTF8;
- default:
- return Encoding.UTF8;
- }
- }
-
- public static string GetEncodingName(Encoding Enc)
- {
- string Result = "UTF8";
-
- if (Enc.CodePage == 1250)
- Result = "CP1250";
-
- if (Enc.CodePage == 1252)
- Result = "CP1252";
-
- return Result;
- }
- }
}
diff --git a/Vocaluxe/Base/CVideo.cs b/Vocaluxe/Base/CVideo.cs
index 718222b4..04dad94b 100644
--- a/Vocaluxe/Base/CVideo.cs
+++ b/Vocaluxe/Base/CVideo.cs
@@ -4,7 +4,7 @@ using System.Diagnostics;
using System.Drawing;
using System.Text;
-using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
using Vocaluxe.Lib.Video;
namespace Vocaluxe.Base
diff --git a/Vocaluxe/Base/CWebcam.cs b/Vocaluxe/Base/CWebcam.cs
index cb735d77..5b8c4a64 100644
--- a/Vocaluxe/Base/CWebcam.cs
+++ b/Vocaluxe/Base/CWebcam.cs
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
using System.Text;
using Vocaluxe.Lib.Webcam;
using Vocaluxe.Lib.Draw;
-using System.Drawing;
+using Vocaluxe.Menu;
+
namespace Vocaluxe.Base
{
diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs
index b58ca133..bac7fb6e 100644
--- a/Vocaluxe/GameModes/CGameMode.cs
+++ b/Vocaluxe/GameModes/CGameMode.cs
@@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.Text;
using Vocaluxe.Base;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.GameModes
{
diff --git a/Vocaluxe/GameModes/IGameMode.cs b/Vocaluxe/GameModes/IGameMode.cs
index 79a8fefc..67c87afb 100644
--- a/Vocaluxe/GameModes/IGameMode.cs
+++ b/Vocaluxe/GameModes/IGameMode.cs
@@ -3,18 +3,11 @@ using System.Collections.Generic;
using System.Text;
using Vocaluxe.Base;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.GameModes
{
- public enum EGameMode
- {
- TR_GAMEMODE_NORMAL,
- TR_GAMEMODE_MEDLEY,
- TR_GAMEMODE_DUET,
- TR_GAMEMODE_SHORTSONG
- }
-
interface IGameMode
{
void Init();
diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs
index 7f39b5b0..fe6fcf42 100644
--- a/Vocaluxe/Lib/Draw/IDraw.cs
+++ b/Vocaluxe/Lib/Draw/IDraw.cs
@@ -8,122 +8,6 @@ using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Draw
{
- #region Structs
- public struct SColorF
- {
- public float R;
- public float G;
- public float B;
- public float A;
-
- public SColorF(float r, float g, float b, float a)
- {
- R = r;
- G = g;
- B = b;
- A = a;
- }
-
- public SColorF(SColorF Color)
- {
- R = Color.R;
- G = Color.G;
- B = Color.B;
- A = Color.A;
- }
- }
-
- public struct SRectF
- {
- public float X;
- public float Y;
- public float W;
- public float H;
- public float Z;
- public float Rotation; //0..360°
-
- public SRectF(float x, float y, float w, float h, float z)
- {
- X = x;
- Y = y;
- W = w;
- H = h;
- Z = z;
- Rotation = 0f;
- }
-
- public SRectF(SRectF rect)
- {
- X = rect.X;
- Y = rect.Y;
- W = rect.W;
- H = rect.H;
- Z = rect.Z;
- Rotation = 0f;
- }
- }
-
- public struct SPoint3f
- {
- public float X;
- public float Y;
- public float Z;
- }
-
- public struct SPoint3
- {
- public int X;
- public int Y;
- public int Z;
- }
-
- public struct STexture
- {
- public int index;
- public int PBO;
- public int ID;
-
- public string TexturePath;
-
- public float width;
- public float height;
- public SRectF rect;
-
- public float w2; //power of 2 width
- public float h2; //power of 2 height
- public float width_ratio;
- public float height_ratio;
-
- public SColorF color;
-
- public STexture(int Index)
- {
- index = Index;
- PBO = 0;
- ID = -1;
- TexturePath = String.Empty;
-
- width = 1f;
- height = 1f;
- rect = new SRectF(0f, 0f, 1f, 1f, 0f);
-
- w2 = 2f;
- h2 = 2f;
- width_ratio = 0.5f;
- height_ratio = 0.5f;
-
- color = new SColorF(1f, 1f, 1f, 1f);
- }
- }
- #endregion Structs
-
- enum EAspect
- {
- Crop,
- LetterBox,
- Stretch
- }
-
interface IDraw
{
bool Init();
diff --git a/Vocaluxe/Lib/Input/IInput.cs b/Vocaluxe/Lib/Input/IInput.cs
index 86dcde04..9ccfa247 100644
--- a/Vocaluxe/Lib/Input/IInput.cs
+++ b/Vocaluxe/Lib/Input/IInput.cs
@@ -5,6 +5,7 @@ using System.Drawing;
using System.Text;
using Vocaluxe.Base;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Input
{
diff --git a/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs b/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs
index 4578723c..8af2e202 100644
--- a/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs
+++ b/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs
@@ -7,6 +7,7 @@ using System.Text;
using System.Threading;
using Vocaluxe.Base;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Input.WiiMote
{
diff --git a/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs b/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs
index 892bb2d4..4992a38d 100644
--- a/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs
+++ b/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs
@@ -10,6 +10,7 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Lib.Input;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Input.WiiMote
{
diff --git a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs
index 57e9fb55..e319b12c 100644
--- a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs
+++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs
@@ -7,34 +7,11 @@ using System.Xml.XPath;
using Vocaluxe.Base;
using Vocaluxe.GameModes;
-using Vocaluxe.Lib.Song;
-
+using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Lib.Playlist
{
- public class CPlaylistSong
- {
- public int SongID;
- public EGameMode GameMode;
-
- public CPlaylistSong(int SongID, EGameMode gm)
- {
- this.SongID = SongID;
- this.GameMode = gm;
- }
-
- public CPlaylistSong()
- {
- GameMode = EGameMode.TR_GAMEMODE_NORMAL;
- }
-
- public CPlaylistSong(CPlaylistSong ps)
- {
- SongID = ps.SongID;
- GameMode = ps.GameMode;
- }
- }
-
public class CPlaylistFile
{
private static XmlWriterSettings _settings = new XmlWriterSettings();
diff --git a/Vocaluxe/Lib/Video/CVideoDecoder.cs b/Vocaluxe/Lib/Video/CVideoDecoder.cs
index 1c6d673c..da4150db 100644
--- a/Vocaluxe/Lib/Video/CVideoDecoder.cs
+++ b/Vocaluxe/Lib/Video/CVideoDecoder.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
-using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Video
{
diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs
index a9cacb6d..9b0f7828 100644
--- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs
+++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs
@@ -9,6 +9,7 @@ using System.Threading;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Lib.Video.Acinerella;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Video
{
diff --git a/Vocaluxe/Lib/Video/IVideoDecoder.cs b/Vocaluxe/Lib/Video/IVideoDecoder.cs
index 374964e0..2f12f2b3 100644
--- a/Vocaluxe/Lib/Video/IVideoDecoder.cs
+++ b/Vocaluxe/Lib/Video/IVideoDecoder.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using Vocaluxe.Lib.Draw;
+using Vocaluxe.Menu;
namespace Vocaluxe.Lib.Video
{
diff --git a/Vocaluxe/Lib/Webcam/CAForgeNet.cs b/Vocaluxe/Lib/Webcam/CAForgeNet.cs
index 0d520e1a..cbddcedc 100644
--- a/Vocaluxe/Lib/Webcam/CAForgeNet.cs
+++ b/Vocaluxe/Lib/Webcam/CAForgeNet.cs
@@ -10,6 +10,8 @@ using System.Runtime.InteropServices;
using Vocaluxe.Lib.Draw;
using System.Threading;
+using Vocaluxe.Menu;
+
namespace Vocaluxe.Lib.Webcam
{
class CAForgeNet : IWebcam
diff --git a/Vocaluxe/Lib/Webcam/IWebcam.cs b/Vocaluxe/Lib/Webcam/IWebcam.cs
index 5b0ed223..066b83c3 100644
--- a/Vocaluxe/Lib/Webcam/IWebcam.cs
+++ b/Vocaluxe/Lib/Webcam/IWebcam.cs
@@ -4,6 +4,8 @@ using System.Text;
using Vocaluxe.Lib.Draw;
using System.Drawing;
+using Vocaluxe.Menu;
+
namespace Vocaluxe.Lib.Webcam
{
struct SWebcamDevice
diff --git a/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs b/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs
deleted file mode 100644
index 93698740..00000000
--- a/Vocaluxe/Menu/SingNotes/CSingNotesClassic.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Vocaluxe.Menu.SingNotes
-{
- class CSingNotesClassic : CSingNotes
- {
- }
-}
diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs b/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs
deleted file mode 100644
index ed6e433b..00000000
--- a/Vocaluxe/Menu/SongMenu/CSongMenuBook.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Vocaluxe.Menu.SongMenu
-{
- class CSongMenuBook : CSongMenuFramework
- {
- }
-}
diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuList.cs b/Vocaluxe/Menu/SongMenu/CSongMenuList.cs
deleted file mode 100644
index c7dc8a0f..00000000
--- a/Vocaluxe/Menu/SongMenu/CSongMenuList.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Vocaluxe.Menu.SongMenu
-{
- class CSongMenuList : CSongMenuFramework
- {
- }
-}
diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs
index 92d59f0b..90e583d8 100644
--- a/Vocaluxe/Program.cs
+++ b/Vocaluxe/Program.cs
@@ -154,6 +154,11 @@ namespace Vocaluxe
CLog.StartBenchmark(0, "Init Game");
CGame.Init();
CLog.StopBenchmark(0, "Init Game");
+
+ // Init Party Modes;
+ CLog.StartBenchmark(0, "Init Party Modes");
+ CParty.Init();
+ CLog.StopBenchmark(0, "Init Party Modes");
}
catch (Exception e)
{
diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
index f1b206b2..ee383668 100644
--- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
+++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -76,7 +76,6 @@ namespace Vocaluxe.Screens
public CPopupScreenPlayerControl()
{
- Init();
}
protected override void Init()
@@ -101,9 +100,9 @@ namespace Vocaluxe.Screens
_ThemeButtons = buttons.ToArray();
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
}
diff --git a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
index a3c0f4aa..4f02e208 100644
--- a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
+++ b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -24,7 +24,6 @@ namespace Vocaluxe.Screens
public CPopupScreenVolumeControl()
{
- Init();
}
protected override void Init()
@@ -39,9 +38,9 @@ namespace Vocaluxe.Screens
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
SelectSlides[htSelectSlides(SelectSlideVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs
index 0327b38c..f056ccb8 100644
--- a/Vocaluxe/Screens/CScreenCredits.cs
+++ b/Vocaluxe/Screens/CScreenCredits.cs
@@ -59,7 +59,6 @@ namespace Vocaluxe.Screens
public CScreenCredits()
{
- Init();
}
protected override void Init()
@@ -107,7 +106,7 @@ namespace Vocaluxe.Screens
paragraphs.Add(words);
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
//Vocaluxe-Logo
CDataBase.GetCreditsRessource("Logo_voc.png", ref _TexLogo);
@@ -149,7 +148,7 @@ namespace Vocaluxe.Screens
if (paragraphs[i][e] != null)
{
string newline = line + " " + paragraphs[i][e];
- CText text = new CText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
+ CText text = GetNewText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line);
if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 220))
{
line = line + " " + paragraphs[i][e];
@@ -175,9 +174,9 @@ namespace Vocaluxe.Screens
}
- public override void ReloadTheme() {}
+ public override void ReloadTheme() { }
- public override void SaveTheme() {}
+ public override void SaveTheme() { }
public override void UnloadTextures() {}
@@ -240,12 +239,12 @@ namespace Vocaluxe.Screens
base.OnShow();
//Vocaluxe-Logo
- logo = new CStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((CSettings.iRenderW - _TexLogo.width) / 2, -270, _TexLogo.width, _TexLogo.height, -2));
+ logo = GetNewStatic(_TexLogo, new SColorF(1, 1, 1, 1), new SRectF((CSettings.iRenderW - _TexLogo.width) / 2, -270, _TexLogo.width, _TexLogo.height, -2));
//Little stars for logo
int numstars = (int)(logo.Rect.W * 0.25f / 2f);
- starsRed = new CParticleEffect(numstars, new SColorF(1, 0, 0, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);
- starsBlue = new CParticleEffect(numstars, new SColorF(0.149f, 0.415f, 0.819f, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);
+ starsRed = GetNewParticleEffect(numstars, new SColorF(1, 0, 0, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);
+ starsBlue = GetNewParticleEffect(numstars, new SColorF(0.149f, 0.415f, 0.819f, 1), new SRectF(logo.Rect.X, logo.Rect.Y, logo.Rect.W, logo.Rect.H, -1), _TexPerfectNoteStar, 35, EParticeType.Star);
//Credit names
_CreditNames = new List();
@@ -253,72 +252,72 @@ namespace Vocaluxe.Screens
//brunzel
CCreditName CreditEntryBrunzel = new CCreditName();
- CreditEntryBrunzel.image = new CStatic(_TexNameBrunzel, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
+ CreditEntryBrunzel.image = GetNewStatic(_TexNameBrunzel, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
CreditEntryBrunzel.particleRect = new SRectF(CreditEntryBrunzel.image.Rect.X + 342, CreditEntryBrunzel.image.Rect.Y + 4, 30, 30, -5);
- CreditEntryBrunzel.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryBrunzel.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
+ CreditEntryBrunzel.particle = GetNewParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryBrunzel.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryBrunzel.active = true;
CreditEntryBrunzel.direction = EDirection.Left;
_CreditNames.Add(CreditEntryBrunzel);
//Darkice
CCreditName CreditEntryDarkice = new CCreditName();
- CreditEntryDarkice.image = new CStatic(_TexNameDarkice, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 400, 120, -4));
+ CreditEntryDarkice.image = GetNewStatic(_TexNameDarkice, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 400, 120, -4));
CreditEntryDarkice.particleRect = new SRectF(CreditEntryDarkice.image.Rect.X + 242, CreditEntryDarkice.image.Rect.Y + 23, 30, 30, -5);
- CreditEntryDarkice.particle = new CParticleEffect(8, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryDarkice.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
+ CreditEntryDarkice.particle = GetNewParticleEffect(8, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryDarkice.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryDarkice.active = true;
CreditEntryDarkice.direction = EDirection.Right;
_CreditNames.Add(CreditEntryDarkice);
//flokuep
CCreditName CreditEntryFlokuep = new CCreditName();
- CreditEntryFlokuep.image = new CStatic(_TexNameFlokuep, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
+ CreditEntryFlokuep.image = GetNewStatic(_TexNameFlokuep, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 400, 120, -4));
CreditEntryFlokuep.particleRect = new SRectF(CreditEntryFlokuep.image.Rect.X + 141, CreditEntryFlokuep.image.Rect.Y - 2, 30, 30, -5);
- CreditEntryFlokuep.particle = new CParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryFlokuep.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
+ CreditEntryFlokuep.particle = GetNewParticleEffect(8, new SColorF(1, 0, 0, 1), CreditEntryFlokuep.particleRect, _TexPerfectNoteStar, 35, EParticeType.Star);
CreditEntryFlokuep.active = true;
CreditEntryFlokuep.direction = EDirection.Left;
_CreditNames.Add(CreditEntryFlokuep);
//bohning
CCreditName CreditEntryBohning = new CCreditName();
- CreditEntryBohning.image = new CStatic(_TexNameBohning, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
+ CreditEntryBohning.image = GetNewStatic(_TexNameBohning, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryBohning.particleRect = new SRectF(CreditEntryBohning.image.Rect.X + 172, CreditEntryBohning.image.Rect.Y + 16, 10, 10, -5);
- CreditEntryBohning.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBohning.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
+ CreditEntryBohning.particle = GetNewParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBohning.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryBohning.active = true;
CreditEntryBohning.direction = EDirection.Right;
_CreditNames.Add(CreditEntryBohning);
//mesand
CCreditName CreditEntryMesand = new CCreditName();
- CreditEntryMesand.image = new CStatic(_TexNameMesand, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
+ CreditEntryMesand.image = GetNewStatic(_TexNameMesand, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
CreditEntryMesand.particleRect = new SRectF(CreditEntryMesand.image.Rect.X + 240, CreditEntryMesand.image.Rect.Y - 2, 10, 10, -5);
- CreditEntryMesand.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntryMesand.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
+ CreditEntryMesand.particle = GetNewParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntryMesand.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryMesand.active = true;
CreditEntryMesand.direction = EDirection.Left;
_CreditNames.Add(CreditEntryMesand);
//babene03
CCreditName CreditEntryBabene03 = new CCreditName();
- CreditEntryBabene03.image = new CStatic(_TexNameBabene03, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
+ CreditEntryBabene03.image = GetNewStatic(_TexNameBabene03, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryBabene03.particleRect = new SRectF(CreditEntryBabene03.image.Rect.X + 7, CreditEntryBabene03.image.Rect.Y + 4, 10, 10, -5);
- CreditEntryBabene03.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBabene03.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
+ CreditEntryBabene03.particle = GetNewParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryBabene03.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryBabene03.active = true;
CreditEntryBabene03.direction = EDirection.Right;
_CreditNames.Add(CreditEntryBabene03);
//pantero
CCreditName CreditEntrypantero = new CCreditName();
- CreditEntrypantero.image = new CStatic(_TexNamePantero, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
+ CreditEntrypantero.image = GetNewStatic(_TexNamePantero, new SColorF(1, 1, 1, 1), new SRectF(-450, 580, 350, 110, -4));
CreditEntrypantero.particleRect = new SRectF(CreditEntrypantero.image.Rect.X + 140, CreditEntrypantero.image.Rect.Y + 15, 10, 10, -5);
- CreditEntrypantero.particle = new CParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntrypantero.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
+ CreditEntrypantero.particle = GetNewParticleEffect(4, new SColorF(1, 0, 0, 1), CreditEntrypantero.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntrypantero.active = true;
CreditEntrypantero.direction = EDirection.Left;
_CreditNames.Add(CreditEntrypantero);
//Pinky007
CCreditName CreditEntryPinky007 = new CCreditName();
- CreditEntryPinky007.image = new CStatic(_TexNamePinky007, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
+ CreditEntryPinky007.image = GetNewStatic(_TexNamePinky007, new SColorF(1, 1, 1, 1), new SRectF(CSettings.iRenderW, 580, 350, 110, -4));
CreditEntryPinky007.particleRect = new SRectF(CreditEntryPinky007.image.Rect.X + 42, CreditEntryPinky007.image.Rect.Y + 15, 10, 10, -5);
- CreditEntryPinky007.particle = new CParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryPinky007.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
+ CreditEntryPinky007.particle = GetNewParticleEffect(4, new SColorF(0.149f, 0.415f, 0.819f, 1), CreditEntryPinky007.particleRect, _TexPerfectNoteStar, 25, EParticeType.Star);
CreditEntryPinky007.active = true;
CreditEntryPinky007.direction = EDirection.Right;
_CreditNames.Add(CreditEntryPinky007);
diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs
index 9cdc6c38..a8551bb7 100644
--- a/Vocaluxe/Screens/CScreenHighscore.cs
+++ b/Vocaluxe/Screens/CScreenHighscore.cs
@@ -5,8 +5,8 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.GameModes;
-using Vocaluxe.Lib.Song;
using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -31,7 +31,6 @@ namespace Vocaluxe.Screens
public CScreenHighscore()
{
- Init();
}
protected override void Init()
@@ -90,11 +89,8 @@ namespace Vocaluxe.Screens
{
case Keys.Escape:
case Keys.Back:
- CGraphics.FadeTo(EScreens.ScreenSong);
- break;
-
case Keys.Enter:
- CGraphics.FadeTo(EScreens.ScreenSong);
+ LeaveScreen();
break;
case Keys.Down:
@@ -127,12 +123,12 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB)
{
- CGraphics.FadeTo(EScreens.ScreenSong);
+ LeaveScreen();
}
if (MouseEvent.RB)
{
- CGraphics.FadeTo(EScreens.ScreenSong);
+ LeaveScreen();
}
if (MouseEvent.MB)
@@ -333,5 +329,10 @@ namespace Vocaluxe.Screens
_Round = 0;
UpdateRound();
}
+
+ private void LeaveScreen()
+ {
+ CParty.LeavingHighscore();
+ }
}
}
diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs
index 41f373b2..f7e28732 100644
--- a/Vocaluxe/Screens/CScreenLoad.cs
+++ b/Vocaluxe/Screens/CScreenLoad.cs
@@ -9,8 +9,8 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
-using Vocaluxe.Lib.Song;
using Vocaluxe.Menu;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -36,7 +36,6 @@ namespace Vocaluxe.Screens
public CScreenLoad()
{
- Init();
}
protected override void Init()
diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs
index 76dd28c0..79f31142 100644
--- a/Vocaluxe/Screens/CScreenMain.cs
+++ b/Vocaluxe/Screens/CScreenMain.cs
@@ -19,6 +19,7 @@ namespace Vocaluxe.Screens
const int ScreenVersion = 1;
const string ButtonSing = "ButtonSing";
+ const string ButtonParty = "ButtonParty";
const string ButtonOptions = "ButtonOptions";
const string ButtonProfiles = "ButtonProfiles";
const string ButtonExit = "ButtonExit";
@@ -27,7 +28,6 @@ namespace Vocaluxe.Screens
public CScreenMain()
{
- Init();
}
protected override void Init()
@@ -37,12 +37,12 @@ namespace Vocaluxe.Screens
_ThemeName = "ScreenMain";
_ScreenVersion = ScreenVersion;
_ThemeStatics = new string[] { "StaticMenuBar" };
- _ThemeButtons = new string[] { ButtonSing, ButtonOptions, ButtonProfiles, ButtonExit };
+ _ThemeButtons = new string[] { ButtonSing, ButtonParty, ButtonOptions, ButtonProfiles, ButtonExit };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
}
public override bool HandleInput(KeyEvent KeyEvent)
@@ -75,7 +75,13 @@ namespace Vocaluxe.Screens
case Keys.Enter:
if (Buttons[htButtons(ButtonSing)].Selected)
+ {
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
+ }
+
+ if (Buttons[htButtons(ButtonParty)].Selected)
+ CGraphics.FadeTo(EScreens.ScreenParty);
if (Buttons[htButtons(ButtonOptions)].Selected)
CGraphics.FadeTo(EScreens.ScreenOptions);
@@ -99,7 +105,13 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent))
{
if (Buttons[htButtons(ButtonSing)].Selected)
+ {
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
+ }
+
+ if (Buttons[htButtons(ButtonParty)].Selected)
+ CGraphics.FadeTo(EScreens.ScreenParty);
if (Buttons[htButtons(ButtonOptions)].Selected)
CGraphics.FadeTo(EScreens.ScreenOptions);
diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs
index 4e838086..38cac5cd 100644
--- a/Vocaluxe/Screens/CScreenNames.cs
+++ b/Vocaluxe/Screens/CScreenNames.cs
@@ -43,7 +43,6 @@ namespace Vocaluxe.Screens
public CScreenNames()
{
- Init();
}
protected override void Init()
@@ -92,13 +91,13 @@ namespace Vocaluxe.Screens
texts.AddRange(EqualizerPlayer);
_ThemeEqualizers = texts.ToArray();
- chooseAvatarStatic = new CStatic();
+ chooseAvatarStatic = GetNewStatic();
chooseAvatarStatic.Visible = false;
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
_PlayerNr = new int[CSettings.MaxNumPlayer];
for (int i = 0; i < _PlayerNr.Length; i++)
diff --git a/Vocaluxe/Screens/CScreenOptions.cs b/Vocaluxe/Screens/CScreenOptions.cs
index 851919bf..755a03c3 100644
--- a/Vocaluxe/Screens/CScreenOptions.cs
+++ b/Vocaluxe/Screens/CScreenOptions.cs
@@ -23,7 +23,6 @@ namespace Vocaluxe.Screens
public CScreenOptions()
{
- Init();
}
protected override void Init()
@@ -53,6 +52,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
diff --git a/Vocaluxe/Screens/CScreenOptionsGame.cs b/Vocaluxe/Screens/CScreenOptionsGame.cs
index be4224ea..b2c597ce 100644
--- a/Vocaluxe/Screens/CScreenOptionsGame.cs
+++ b/Vocaluxe/Screens/CScreenOptionsGame.cs
@@ -32,7 +32,6 @@ namespace Vocaluxe.Screens
public CScreenOptionsGame()
{
- Init();
}
protected override void Init()
@@ -55,9 +54,9 @@ namespace Vocaluxe.Screens
}
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLanguage)].AddValues(_Languages);
SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection = _CurrentLang;
@@ -89,6 +88,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
@@ -166,11 +166,15 @@ namespace Vocaluxe.Screens
if (_SongSortingOld != CConfig.SongSorting || _TabsOld != CConfig.Tabs || _LanguageOld != CConfig.Language)
{
- CSongs.Sort(CConfig.SongSorting);
+ CSongs.Sort(CConfig.SongSorting, CConfig.Tabs, CConfig.IgnoreArticles, String.Empty);
CSongs.Category = -1;
}
CLanguage.SetLanguage(CConfig.Language);
+
+ _SongSortingOld = CConfig.SongSorting;
+ _TabsOld = CConfig.Tabs;
+ _LanguageOld = CConfig.Language;
}
}
}
diff --git a/Vocaluxe/Screens/CScreenOptionsLyrics.cs b/Vocaluxe/Screens/CScreenOptionsLyrics.cs
index 6224f0fa..302ec76d 100644
--- a/Vocaluxe/Screens/CScreenOptionsLyrics.cs
+++ b/Vocaluxe/Screens/CScreenOptionsLyrics.cs
@@ -20,7 +20,6 @@ namespace Vocaluxe.Screens
public CScreenOptionsLyrics()
{
- Init();
}
protected override void Init()
@@ -34,9 +33,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideLyricStyle, SelectSlideLyricsOnTop };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLyricStyle)].SetValues((int)CConfig.LyricStyle);
SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues((int)CConfig.LyricsOnTop);
}
@@ -60,6 +59,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs
index c4566428..3f06c4dc 100644
--- a/Vocaluxe/Screens/CScreenOptionsRecord.cs
+++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs
@@ -56,7 +56,6 @@ namespace Vocaluxe.Screens
public CScreenOptionsRecord()
{
- Init();
}
protected override void Init()
@@ -77,9 +76,9 @@ namespace Vocaluxe.Screens
_ThemeEqualizers = new string[] { EqualizerChannel1, EqualizerChannel2 };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
int max = CSettings.MaxNumPlayer + 1;
if (max > 7)
@@ -133,6 +132,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
diff --git a/Vocaluxe/Screens/CScreenOptionsSound.cs b/Vocaluxe/Screens/CScreenOptionsSound.cs
index 519fddfc..e4d3ac44 100644
--- a/Vocaluxe/Screens/CScreenOptionsSound.cs
+++ b/Vocaluxe/Screens/CScreenOptionsSound.cs
@@ -27,7 +27,6 @@ namespace Vocaluxe.Screens
public CScreenOptionsSound()
{
- Init();
}
protected override void Init()
@@ -41,9 +40,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideBackgroundMusic, SelectSlideBackgroundMusicVolume, SelectSlideBackgroundMusicSource, SelectSlidePreviewMusicVolume, SelectSlideGameMusicVolume };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].SetValues((int)CConfig.BackgroundMusic);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"});
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5;
@@ -75,6 +74,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs
index 7250b268..9b596f32 100644
--- a/Vocaluxe/Screens/CScreenOptionsTheme.cs
+++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs
@@ -33,7 +33,6 @@ namespace Vocaluxe.Screens
public CScreenOptionsTheme()
{
- Init();
}
protected override void Init()
@@ -55,9 +54,9 @@ namespace Vocaluxe.Screens
};
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideTheme)].AddValues(CTheme.ThemeNames);
SelectSlides[htSelectSlides(SelectSlideTheme)].Selection = CTheme.GetThemeIndex();
@@ -91,6 +90,11 @@ namespace Vocaluxe.Screens
Close();
break;
+ case Keys.S:
+ CParty.SetNormalGameMode();
+ CGraphics.FadeTo(EScreens.ScreenSong);
+ break;
+
case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected)
{
@@ -174,7 +178,7 @@ namespace Vocaluxe.Screens
if (_OldCoverTheme != SelectSlides[htSelectSlides(SelectSlideCover)].Selection)
{
CCover.ReloadCover();
- CSongs.Sort(CConfig.SongSorting);
+ CSongs.Sort(CConfig.SongSorting, CConfig.Tabs, CConfig.IgnoreArticles, String.Empty);
}
if (_OldTheme != SelectSlides[htSelectSlides(SelectSlideTheme)].Selection)
diff --git a/Vocaluxe/Screens/CScreenOptionsVideo.cs b/Vocaluxe/Screens/CScreenOptionsVideo.cs
index 3e15a258..d3daba86 100644
--- a/Vocaluxe/Screens/CScreenOptionsVideo.cs
+++ b/Vocaluxe/Screens/CScreenOptionsVideo.cs
@@ -27,13 +27,12 @@ namespace Vocaluxe.Screens
private const string ButtonExit = "ButtonExit";
private SWebcamConfig _Config;
- Lib.Draw.STexture _WebcamTexture = new Lib.Draw.STexture(-1);
+ STexture _WebcamTexture = new STexture(-1);
private int _DeviceNr;
private int _CapabilityNr;
public CScreenOptionsVideo()
{
- Init();
}
protected override void Init()
@@ -48,9 +47,9 @@ namespace Vocaluxe.Screens
_ThemeSelectSlides = new string[] { SelectSlideVideoBackgrounds, SelectSlideVideoPreview, SelectSlideVideosInSongs, SelectSlideVideosToBackground, SelectSlideWebcamDevices, SelectSlideWebcamCapabilities };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].SetValues((int)CConfig.VideoBackgrounds);
SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues((int)CConfig.VideoPreview);
@@ -77,6 +76,7 @@ namespace Vocaluxe.Screens
break;
case Keys.S:
+ CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong);
break;
diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs
new file mode 100644
index 00000000..acb2d899
--- /dev/null
+++ b/Vocaluxe/Screens/CScreenParty.cs
@@ -0,0 +1,206 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+using Vocaluxe.Base;
+using Vocaluxe.Menu;
+
+namespace Vocaluxe.Screens
+{
+ class CScreenParty : CMenu
+ {
+ // Version number for theme files. Increment it, if you've changed something on the theme files!
+ const int ScreenVersion = 1;
+
+ const string TextDescription = "TextDescription";
+ const string TextTargetAudience = "TextTargetAudience";
+ const string TextNumTeams = "TextNumTeams";
+ const string TextNumPlayers = "TextNumPlayers";
+ const string TextAuthor = "TextAuthor";
+ const string TextVersion = "TextVersion";
+ const string TextError = "TextError";
+ const string ButtonStart = "ButtonStart";
+ const string ButtonExit = "ButtonExit";
+ const string SelectSlideModes = "SelectSlideModes";
+
+ private List _PartyModeInfos;
+
+ public CScreenParty()
+ {
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+
+ _ThemeName = "ScreenParty";
+ _ScreenVersion = ScreenVersion;
+ _ThemeTexts = new string[] { TextDescription, TextTargetAudience, TextNumTeams, TextNumPlayers, TextAuthor, TextVersion, TextError };
+ _ThemeButtons = new string[] { ButtonStart, ButtonExit };
+ _ThemeSelectSlides = new string[] { SelectSlideModes };
+ }
+
+ public override void LoadTheme(string XmlPath)
+ {
+ base.LoadTheme(XmlPath);
+ }
+
+ public override bool HandleInput(KeyEvent KeyEvent)
+ {
+ base.HandleInput(KeyEvent);
+
+ if (KeyEvent.KeyPressed)
+ {
+
+ }
+ else
+ {
+ switch (KeyEvent.Key)
+ {
+ case Keys.Back:
+ case Keys.Escape:
+ CGraphics.FadeTo(EScreens.ScreenMain);
+ break;
+
+ case Keys.Enter:
+ if (Buttons[htButtons(ButtonStart)].Selected)
+ StartPartyMode();
+
+ if (Buttons[htButtons(ButtonExit)].Selected)
+ CGraphics.FadeTo(EScreens.ScreenMain);
+ break;
+
+ case Keys.Left:
+ case Keys.Right:
+ if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected)
+ UpdateSelection();
+ break;
+ }
+ }
+ return true;
+ }
+
+ public override bool HandleMouse(MouseEvent MouseEvent)
+ {
+ base.HandleMouse(MouseEvent);
+
+ if (MouseEvent.LB && IsMouseOver(MouseEvent))
+ {
+ if (Buttons[htButtons(ButtonStart)].Selected)
+ StartPartyMode();
+
+ if (Buttons[htButtons(ButtonExit)].Selected)
+ CGraphics.FadeTo(EScreens.ScreenMain);
+
+ if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected)
+ UpdateSelection();
+ }
+
+ if (MouseEvent.RB)
+ {
+ CGraphics.FadeTo(EScreens.ScreenMain);
+ }
+
+ return true;
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+
+ _PartyModeInfos = CParty.GetPartyModeInfos();
+
+ SelectSlides[htSelectSlides(SelectSlideModes)].Clear();
+ foreach (SPartyModeInfos info in _PartyModeInfos)
+ {
+ SelectSlides[htSelectSlides(SelectSlideModes)].AddValue(info.Name, info.PartyModeID);
+ }
+ SelectSlides[htSelectSlides(SelectSlideModes)].Selection = 0;
+ UpdateSelection();
+ }
+
+ public override bool UpdateGame()
+ {
+ return true;
+ }
+
+ public override bool Draw()
+ {
+ base.Draw();
+
+ return true;
+ }
+
+ public override void OnClose()
+ {
+ base.OnClose();
+ }
+
+ private void UpdateSelection()
+ {
+ if (_PartyModeInfos.Count == 0)
+ return;
+
+ int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection;
+ if (index >= _PartyModeInfos.Count)
+ return;
+
+ //Description
+ Texts[htTexts(TextDescription)].PartyModeID = _PartyModeInfos[index].PartyModeID;
+ Texts[htTexts(TextDescription)].Text = _PartyModeInfos[index].Description;
+ //TargetAudience
+ Texts[htTexts(TextTargetAudience)].PartyModeID = _PartyModeInfos[index].PartyModeID;
+ Texts[htTexts(TextTargetAudience)].Text = _PartyModeInfos[index].TargetAudience;
+ //NumTeams
+ if (_PartyModeInfos[index].MaxTeams == 0)
+ Texts[htTexts(TextNumTeams)].Text = "TR_SCREENPARTY_NOTEAMS";
+ else if (_PartyModeInfos[index].MaxTeams == _PartyModeInfos[index].MinTeams)
+ Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MaxTeams.ToString();
+ else if (_PartyModeInfos[index].MaxTeams > _PartyModeInfos[index].MinTeams)
+ Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MinTeams + " - " + _PartyModeInfos[index].MaxTeams;
+ //NumPlayers
+ if (_PartyModeInfos[index].MaxPlayers == _PartyModeInfos[index].MinPlayers)
+ Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MaxTeams.ToString();
+ else if (_PartyModeInfos[index].MaxPlayers > _PartyModeInfos[index].MinPlayers)
+ Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers;
+ //Author
+ Texts[htTexts(TextAuthor)].Text = _PartyModeInfos[index].Author;
+ Texts[htTexts(TextAuthor)].PartyModeID = _PartyModeInfos[index].PartyModeID;
+ //Version
+ Texts[htTexts(TextVersion)].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor;
+ Texts[htTexts(TextVersion)].PartyModeID = _PartyModeInfos[index].PartyModeID;
+
+ if (!_PartyModeInfos[index].Playable)
+ {
+ Buttons[htButtons(ButtonStart)].Visible = false;
+ Texts[htTexts(TextError)].Visible = true;
+ }
+ else
+ {
+ Buttons[htButtons(ButtonStart)].Visible = true;
+ Texts[htTexts(TextError)].Visible = false;
+ }
+ }
+
+ private void StartPartyMode()
+ {
+ if (_PartyModeInfos.Count == 0)
+ return;
+
+ int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection;
+ if (index >= _PartyModeInfos.Count)
+ return;
+
+ if (_Base.Config.GetMaxNumMics() == 0)
+ return; //TODO: Add message!
+
+ if (_PartyModeInfos[index].Playable)
+ {
+ CParty.SetPartyMode(_PartyModeInfos[index].PartyModeID);
+ CGraphics.FadeTo(EScreens.ScreenPartyDummy);
+ }
+ //TODO: else Message!
+ }
+ }
+}
diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs
index ec94f1e5..a5ed50ea 100644
--- a/Vocaluxe/Screens/CScreenProfiles.cs
+++ b/Vocaluxe/Screens/CScreenProfiles.cs
@@ -41,12 +41,11 @@ namespace Vocaluxe.Screens
private EEditMode _EditMode;
- private Lib.Draw.STexture _WebcamTexture = new Lib.Draw.STexture(-1);
+ private STexture _WebcamTexture = new STexture(-1);
private Bitmap _Snapshot = null;
public CScreenProfiles()
{
- Init();
}
protected override void Init()
@@ -62,9 +61,9 @@ namespace Vocaluxe.Screens
_EditMode = EEditMode.None;
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false;
diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs
index 5f652325..7f757743 100644
--- a/Vocaluxe/Screens/CScreenScore.cs
+++ b/Vocaluxe/Screens/CScreenScore.cs
@@ -8,7 +8,7 @@ using Vocaluxe.Base;
using Vocaluxe.Menu;
using Vocaluxe.GameModes;
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -33,7 +33,6 @@ namespace Vocaluxe.Screens
public CScreenScore()
{
- Init();
}
protected override void Init()
@@ -69,11 +68,8 @@ namespace Vocaluxe.Screens
{
case Keys.Escape:
case Keys.Back:
- CGraphics.FadeTo(EScreens.ScreenHighscore);
- break;
-
case Keys.Enter:
- CGraphics.FadeTo(EScreens.ScreenHighscore);
+ LeaveScreen();
break;
case Keys.Left:
@@ -99,12 +95,12 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB)
{
- CGraphics.FadeTo(EScreens.ScreenHighscore);
+ LeaveScreen();
}
if (MouseEvent.RB)
{
- CGraphics.FadeTo(EScreens.ScreenHighscore);
+ LeaveScreen();
}
return true;
@@ -366,7 +362,7 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticPointsBarBG[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticAvatar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer);
- Statics[htStatics(StaticAvatar[player, numplayer])].Texture = new Lib.Draw.STexture(-1);
+ Statics[htStatics(StaticAvatar[player, numplayer])].Texture = new STexture(-1);
}
}
}
@@ -390,5 +386,10 @@ namespace Vocaluxe.Screens
UpdateRatings();
}
}
+
+ private void LeaveScreen()
+ {
+ CParty.LeavingScore();
+ }
}
}
\ No newline at end of file
diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs
index ba615c7a..9e95fdd4 100644
--- a/Vocaluxe/Screens/CScreenSing.cs
+++ b/Vocaluxe/Screens/CScreenSing.cs
@@ -9,8 +9,8 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
-
-using Vocaluxe.Lib.Song;
+using Vocaluxe.Menu.SingNotes;
+using Vocaluxe.Menu.SongMenu;
namespace Vocaluxe.Screens
{
@@ -97,7 +97,6 @@ namespace Vocaluxe.Screens
public CScreenSing()
{
- Init();
}
protected override void Init()
@@ -148,9 +147,9 @@ namespace Vocaluxe.Screens
_TimerDuetText2 = new Stopwatch();
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
Statics[htStatics(StaticTimeLine)].Visible = false;
Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false;
@@ -578,8 +577,7 @@ namespace Vocaluxe.Screens
if (CGame.IsFinished())
{
- CGraphics.FadeTo(EScreens.ScreenScore);
- _FadeOut = true;
+ FinishedSinging();
return;
}
@@ -727,8 +725,14 @@ namespace Vocaluxe.Screens
while(!CGame.IsFinished())
CGame.NextRound();
- CGraphics.FadeTo(EScreens.ScreenScore);
+ FinishedSinging();
+ }
+
+ private void FinishedSinging()
+ {
_FadeOut = true;
+ CParty.FinishedSinging();
+
if (_Webcam)
CWebcam.Close();
}
@@ -1358,7 +1362,7 @@ namespace Vocaluxe.Screens
TimeRect trect = new TimeRect();
trect.startBeat = Line[j].FirstNoteBeat;
trect.endBeat = Line[j].EndBeat;
- trect.rect = new CStatic(new STexture(-1),
+ trect.rect = GetNewStatic(new STexture(-1),
new SColorF(1f, 1f, 1f, 1f),
new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime),
stat.Rect.Y,
diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs
index 7266dcdc..2f18a470 100644
--- a/Vocaluxe/Screens/CScreenSong.cs
+++ b/Vocaluxe/Screens/CScreenSong.cs
@@ -9,9 +9,9 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw;
-using Vocaluxe.Lib.Song;
using Vocaluxe.Menu;
using Vocaluxe.Menu.SongMenu;
+using Vocaluxe.PartyModes;
namespace Vocaluxe.Screens
{
@@ -42,6 +42,7 @@ namespace Vocaluxe.Screens
private const string ButtonOptionsSingAll = "ButtonOptionsSingAll";
private const string ButtonOptionsSingAllVisible = "ButtonOptionsSingAllVisible";
private const string ButtonOptionsOpenPlaylist = "ButtonOptionsOpenPlaylist";
+ private const string ButtonStart = "ButtonStart";
private const string SelectSlideOptionsMode = "SelectSlideOptionsMode";
private const string SelectSlideOptionsPlaylistAdd = "SelectSlideOptionsPlaylistAdd";
@@ -55,9 +56,12 @@ namespace Vocaluxe.Screens
private string _SearchText = String.Empty;
private bool _SearchActive = false;
+ private List ButtonsJoker = new List();
+ private List TextsPlayer = new List();
private bool _SongOptionsActive = false;
private bool _PlaylistActive = false;
- private List _AvailableGameModes;
+ private List _AvailableGameModes;
+ private ScreenSongOptions _sso;
private CStatic DragAndDropCover;
private bool DragAndDropActive;
@@ -66,28 +70,55 @@ namespace Vocaluxe.Screens
public CScreenSong()
{
- Init();
-
- _AvailableGameModes = new List();
+ _AvailableGameModes = new List();
}
protected override void Init()
{
base.Init();
+ for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++)
+ {
+ ButtonsJoker.Add("ButtonJoker" + (i + 1));
+ }
+ List blist = new List();
+ blist.AddRange(ButtonsJoker);
+ blist.Add(ButtonOptionsClose);
+ blist.Add(ButtonOptionsPlaylist);
+ blist.Add(ButtonOptionsSing);
+ blist.Add(ButtonOptionsRandom);
+ blist.Add(ButtonOptionsRandomCategory);
+ blist.Add(ButtonOptionsSingAll);
+ blist.Add(ButtonOptionsSingAllVisible);
+ blist.Add(ButtonOptionsOpenPlaylist);
+ blist.Add(ButtonOpenOptions);
+ blist.Add(ButtonStart);
+
+ for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++)
+ {
+ TextsPlayer.Add("TextPlayer" + (i + 1));
+ }
+ List tlist = new List();
+ tlist.AddRange(TextsPlayer);
+ tlist.Add(TextCategory);
+ tlist.Add(TextSelection);
+ tlist.Add(TextSearchBarTitle);
+ tlist.Add(TextSearchBar);
+ tlist.Add(TextOptionsTitle);
+
_ThemeName = "ScreenSong";
_ScreenVersion = ScreenVersion;
_ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG };
- _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle };
- _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonOptionsRandom, ButtonOptionsRandomCategory, ButtonOptionsSingAll, ButtonOptionsSingAllVisible, ButtonOptionsOpenPlaylist, ButtonOpenOptions };
+ _ThemeTexts = tlist.ToArray();
+ _ThemeButtons = blist.ToArray();
_ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylistAdd, SelectSlideOptionsPlaylistOpen };
_ThemeSongMenus = new string[] { SongMenu };
_ThemePlaylists = new string[] { Playlist };
}
- public override void LoadTheme()
+ public override void LoadTheme(string XmlPath)
{
- base.LoadTheme();
+ base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
@@ -103,7 +134,7 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticOptionsBG)].Visible = false;
Playlists[htPlaylists(Playlist)].Visible = false;
- DragAndDropCover = new CStatic();
+ DragAndDropCover = GetNewStatic();
Playlists[htPlaylists(Playlist)].Init();
@@ -138,7 +169,7 @@ namespace Vocaluxe.Screens
if (!_SongOptionsActive)
{
- if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
+ if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode) && KeyEvent.Mod != EModifier.Ctrl)
{
if (_SearchActive)
ApplyNewSearchFilter(_SearchText + KeyEvent.Unicode);
@@ -151,22 +182,43 @@ namespace Vocaluxe.Screens
}
else
{
- SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent);
+ SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent, _sso);
if (KeyEvent.Handled)
return true;
switch (KeyEvent.Key)
{
case Keys.Escape:
- if (CSongs.Category < 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF)
+ if ((CSongs.Category < 0 || !(_sso.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)) && !_sso.Selection.PartyMode)
CGraphics.FadeTo(EScreens.ScreenMain);
break;
case Keys.Enter:
- if (CSongs.NumVisibleSongs > 0)
+ if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
+ {
+ for (int i = 0; i < ButtonsJoker.Count; i++)
+ {
+ if (i < _sso.Selection.NumJokers.Length)
+ {
+ if (Buttons[htButtons(ButtonsJoker[i])].Selected)
+ {
+ SelectNextRandom(i);
+ return true;
+ }
+ }
+ }
+ if (Buttons[htButtons(ButtonStart)].Selected)
+ {
+ HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
+ }
+ }
+ if (CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
{
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
- ToggleSongOptions(ESongOptionsView.Song);
+ {
+ if (!_sso.Selection.PartyMode)
+ ToggleSongOptions(ESongOptionsView.Song);
+ }
}
break;
@@ -185,13 +237,15 @@ namespace Vocaluxe.Screens
ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1));
}
- if (!_SearchActive && CSongs.Category < 0)
+ if (!_SearchActive && (CSongs.Category < 0) && !_sso.Selection.PartyMode)
+ {
CGraphics.FadeTo(EScreens.ScreenMain);
+ }
break;
case Keys.Space:
- if (!_SearchActive)
+ if (!_SearchActive && !_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.General);
break;
@@ -202,7 +256,7 @@ namespace Vocaluxe.Screens
_SearchText = String.Empty;
ApplyNewSearchFilter(_SearchText);
}
- else
+ else if (!_sso.Selection.PartyMode)
{
_SearchActive = true;
}
@@ -210,11 +264,11 @@ namespace Vocaluxe.Screens
//TODO: Delete it! ??? Shouldn't we keep this as shortcut?
case Keys.A:
- if (!_SearchActive && KeyEvent.Mod == EModifier.None)
+ if (!_SearchActive && KeyEvent.Mod == EModifier.None && !_sso.Selection.PartyMode)
{
StartRandomAllSongs();
}
- if (KeyEvent.Mod == EModifier.Ctrl)
+ if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.PartyMode)
{
StartRandomVisibleSongs();
}
@@ -230,7 +284,7 @@ namespace Vocaluxe.Screens
_SearchText = String.Empty;
ApplyNewSearchFilter(_SearchText);
}
- else
+ else if (!_sso.Selection.PartyMode)
{
_SearchActive = true;
}
@@ -239,24 +293,42 @@ namespace Vocaluxe.Screens
//TODO: We need another key for random!
case Keys.R:
- if (!_SearchActive && CSongs.Category != -1 && KeyEvent.Mod == EModifier.Ctrl)
- {
- SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
- }
- else if (CSongs.Category == -1 && KeyEvent.Mod == EModifier.Ctrl)
- {
- SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
- }
+ if (KeyEvent.Mod == EModifier.Ctrl && !_sso.Selection.RandomOnly)
+ SelectNextRandom(-1);
break;
//TODO: Delete that!
case Keys.S:
- if (!_SearchActive && CSongs.NumVisibleSongs > 0)
+ if (!_SearchActive && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
{
StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
}
break;
+ case Keys.D1:
+ SelectNextRandom(0);
+ break;
+
+ case Keys.D2:
+ SelectNextRandom(1);
+ break;
+
+ case Keys.D3:
+ SelectNextRandom(2);
+ break;
+
+ case Keys.D4:
+ SelectNextRandom(3);
+ break;
+
+ case Keys.D5:
+ SelectNextRandom(4);
+ break;
+
+ case Keys.D6:
+ SelectNextRandom(5);
+ break;
+
}
}
}
@@ -383,31 +455,19 @@ namespace Vocaluxe.Screens
return true;
}
- if (CSongs.Category < 0)
+ if (CSongs.Category < 0 && !_sso.Selection.PartyMode)
{
CGraphics.FadeTo(EScreens.ScreenMain);
return true;
}
}
- if (MouseEvent.MB)
+ if (MouseEvent.MB && !_sso.Selection.PartyMode)
{
- if (CSongs.Category != -1)
- {
- ToggleSongOptions(ESongOptionsView.None);
- SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
- return true;
- }
-
- if (CSongs.Category == -1)
- {
- ToggleSongOptions(ESongOptionsView.None);
- SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
- return true;
- }
+ return SelectNextRandom(-1);
}
- if (MouseEvent.LD)
+ if (MouseEvent.LD && !_sso.Selection.PartyMode)
{
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
{
@@ -417,7 +477,7 @@ namespace Vocaluxe.Screens
}
}
- SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent);
+ SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent, _sso);
if (MouseEvent.LB)
{
@@ -487,13 +547,36 @@ namespace Vocaluxe.Screens
OpenPlaylistAction();
return true;
}
+
+ if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
+ {
+ if (Buttons[htButtons(ButtonStart)].Selected)
+ {
+ HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
+ return true;
+ }
+
+ for (int i = 0; i < ButtonsJoker.Count; i++)
+ {
+ if (i < _sso.Selection.NumJokers.Length)
+ {
+ if (Buttons[htButtons(ButtonsJoker[i])].Selected)
+ {
+ SelectNextRandom(i);
+ return true;
+ }
+ }
+ }
+ }
}
-
- if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
+
+ if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1 && !_sso.Selection.PartyMode)
{
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
{
- ToggleSongOptions(ESongOptionsView.Song);
+ if (!_sso.Selection.PartyMode)
+ ToggleSongOptions(ESongOptionsView.Song);
+
return true;
}
else
@@ -503,7 +586,7 @@ namespace Vocaluxe.Screens
}
}
}
-
+
if (MouseEvent.LBH)
{
if (!DragAndDropActive && Playlists[htPlaylists(Playlist)].Visible && CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
@@ -530,8 +613,21 @@ namespace Vocaluxe.Screens
public override void OnShow()
{
base.OnShow();
+
+ _sso = CParty.GetSongSelectionOptions();
+ CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs);
+ _SearchActive = _sso.Sorting.SearchStringVisible;
+ _SearchText = _sso.Sorting.SearchString;
+
CGame.EnterNormalGame();
SongMenus[htSongMenus(SongMenu)].OnShow();
+
+ if (_sso.Selection.PartyMode)
+ _PlaylistActive = false;
+
+ if (_sso.Selection.PartyMode)
+ ToggleSongOptions(ESongOptionsView.None);
+
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive);
SongMenus[htSongMenus(SongMenu)].SetSmallView(Playlists[htPlaylists(Playlist)].Visible);
@@ -541,16 +637,29 @@ namespace Vocaluxe.Screens
DragAndDropActive = false;
Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1;
+
+ UpdateGame();
}
public override bool UpdateGame()
{
- SongMenus[htSongMenus(SongMenu)].Update();
+ _sso = CParty.GetSongSelectionOptions();
+ CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString, _sso.Sorting.ShowDuetSongs);
+ _SearchActive = _sso.Sorting.SearchStringVisible;
+ _SearchText = _sso.Sorting.SearchString;
+
+ if (_sso.Selection.PartyMode)
+ _PlaylistActive = false;
+
+ if (_sso.Selection.PartyMode)
+ ToggleSongOptions(ESongOptionsView.None);
+
+ SongMenus[htSongMenus(SongMenu)].Update(_sso);
if (SongMenus[htSongMenus(SongMenu)].IsSmallView())
CheckPlaylist();
- Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName();
+ Texts[htTexts(TextCategory)].Text = CSongs.GetCurrentCategoryName();
if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF)
CBackgroundMusic.Disabled = true;
@@ -585,6 +694,53 @@ namespace Vocaluxe.Screens
Statics[htStatics(StaticSearchBar)].Visible = false;
}
+ if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
+ {
+ Buttons[htButtons(ButtonStart)].Visible = true;
+
+ if(!SongMenus[htSongMenus(SongMenu)].IsSmallView())
+ SongMenus[htSongMenus(SongMenu)].SetSmallView(true);
+
+ for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++)
+ {
+ if (i < _sso.Selection.NumJokers.Length)
+ {
+ Buttons[htButtons(ButtonsJoker[i])].Visible = true;
+ Buttons[htButtons(ButtonsJoker[i])].Text.Text = _sso.Selection.NumJokers[i].ToString();
+ Texts[htTexts(TextsPlayer[i])].Visible = true;
+
+ bool NameExists = false;
+ if (_sso.Selection.TeamNames != null)
+ {
+ if (_sso.Selection.TeamNames.Length > i)
+ {
+ Texts[htTexts(TextsPlayer[i])].Text = _sso.Selection.TeamNames[i];
+ NameExists = true;
+ }
+ }
+
+ if (!NameExists)
+ Texts[htTexts(TextsPlayer[i])].Text = i.ToString();
+ }
+ else
+ {
+ Buttons[htButtons(ButtonsJoker[i])].Visible = false;
+ Texts[htTexts(TextsPlayer[i])].Visible = false;
+ }
+ }
+ }
+ else
+ {
+ Buttons[htButtons(ButtonStart)].Visible = false;
+ if(SongMenus[htSongMenus(SongMenu)].IsSmallView())
+ SongMenus[htSongMenus(SongMenu)].SetSmallView(false);
+ for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++)
+ {
+ Buttons[htButtons(ButtonsJoker[i])].Visible = false;
+ Texts[htTexts(TextsPlayer[i])].Visible = false;
+ }
+ }
+
return true;
}
@@ -603,6 +759,8 @@ namespace Vocaluxe.Screens
base.OnClose();
CBackgroundMusic.Disabled = false;
SongMenus[htSongMenus(SongMenu)].OnHide();
+
+ CParty.SetSearchString(_SearchText, _SearchActive);
}
public override void ApplyVolume()
@@ -610,6 +768,18 @@ namespace Vocaluxe.Screens
SongMenus[htSongMenus(SongMenu)].ApplyVolume(CConfig.PreviewMusicVolume);
}
+ private void HandlePartySongSelection(int SongNr)
+ {
+ if ((CSongs.Category >= 0) && (SongNr >= 0))
+ {
+ CSong song = CSongs.VisibleSongs[SongNr];
+ if (song != null)
+ {
+ CParty.SongSelected(song.ID);
+ }
+ }
+ }
+
private void StartSong(int SongNr)
{
if ((CSongs.Category >= 0) && (SongNr >= 0))
@@ -622,9 +792,9 @@ namespace Vocaluxe.Screens
else
{
if (CSongs.VisibleSongs[SongNr].IsDuet)
- gm = GameModes.EGameMode.TR_GAMEMODE_DUET;
+ gm = EGameMode.TR_GAMEMODE_DUET;
else
- gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL;
+ gm = EGameMode.TR_GAMEMODE_NORMAL;
}
CGame.Reset();
@@ -642,9 +812,9 @@ namespace Vocaluxe.Screens
{
EGameMode gm;
if (CSongs.VisibleSongs[SongNr].IsDuet)
- gm = GameModes.EGameMode.TR_GAMEMODE_DUET;
+ gm = EGameMode.TR_GAMEMODE_DUET;
else
- gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL;
+ gm = EGameMode.TR_GAMEMODE_NORMAL;
CGame.Reset();
CGame.ClearSongs();
@@ -661,7 +831,7 @@ namespace Vocaluxe.Screens
{
EGameMode gm;
if (CSongs.VisibleSongs[SongNr].Medley.Source != EMedleySource.None)
- gm = GameModes.EGameMode.TR_GAMEMODE_MEDLEY;
+ gm = EGameMode.TR_GAMEMODE_MEDLEY;
else
return;
@@ -729,6 +899,51 @@ namespace Vocaluxe.Screens
CGraphics.FadeTo(EScreens.ScreenNames);
}
+ private bool SelectNextRandom(int TeamNr)
+ {
+ if (TeamNr != -1 && _sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
+ {
+ bool result = false;
+ if (_sso.Selection.NumJokers.Length > TeamNr)
+ {
+ if (_sso.Selection.NumJokers[TeamNr] > 0)
+ {
+ result = SelectNextRandomSong(TeamNr) || SelectNextRandomCategory();
+ CParty.JokerUsed(TeamNr);
+ _sso = CParty.GetSongSelectionOptions();
+ }
+ }
+ return result;
+ }
+
+ if (TeamNr == -1)
+ return SelectNextRandomSong(TeamNr) || SelectNextRandomCategory();
+
+ return false;
+ }
+
+ private bool SelectNextRandomSong(int TeamNr)
+ {
+ if (CSongs.Category != -1)
+ {
+ ToggleSongOptions(ESongOptionsView.None);
+ SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
+ return true;
+ }
+ return false;
+ }
+
+ private bool SelectNextRandomCategory()
+ {
+ if (CSongs.Category == -1)
+ {
+ ToggleSongOptions(ESongOptionsView.None);
+ SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
+ return true;
+ }
+ return false;
+ }
+
private void JumpTo(char Letter)
{
int song = SongMenus[htSongMenus(SongMenu)].GetSelectedSong();
@@ -738,7 +953,7 @@ namespace Vocaluxe.Screens
id = CSongs.VisibleSongs[song].ID;
}
- int visibleID = Array.FindIndex(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
+ int visibleID = Array.FindIndex(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
{
id = visibleID;
@@ -793,20 +1008,20 @@ namespace Vocaluxe.Screens
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear();
if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
- SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_NORMAL));
- _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_NORMAL);
- SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_SHORTSONG));
- _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_SHORTSONG);
+ SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL));
+ _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL);
+ SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG));
+ _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
- SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_DUET));
- _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_DUET);
+ SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
+ _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None)
{
- SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY));
- _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY);
+ SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY));
+ _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_MEDLEY);
}
//Set SelectSlide-Selection to last selected game-mode if possible
for (int i = 0; i < _AvailableGameModes.Count; i++)
@@ -861,15 +1076,16 @@ namespace Vocaluxe.Screens
Buttons[htButtons(ButtonOptionsSingAll)].Visible = false;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false;
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false;
- Buttons[htButtons(ButtonOpenOptions)].Visible = true;
+ Buttons[htButtons(ButtonOpenOptions)].Visible = false;
Texts[htTexts(TextOptionsTitle)].Visible = false;
Statics[htStatics(StaticOptionsBG)].Visible = false;
}
}
+ #region Playlist Actions
public void CheckPlaylist()
{
- if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1)
+ if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1 && _PlaylistActive)
ClosePlaylist();
}
@@ -924,9 +1140,9 @@ namespace Vocaluxe.Screens
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection];
else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
- gm = GameModes.EGameMode.TR_GAMEMODE_DUET;
+ gm = EGameMode.TR_GAMEMODE_DUET;
else
- gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL;
+ gm = EGameMode.TR_GAMEMODE_NORMAL;
//Check if Playlist really exists
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1 >= 0)
@@ -952,9 +1168,9 @@ namespace Vocaluxe.Screens
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection];
else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
- gm = GameModes.EGameMode.TR_GAMEMODE_DUET;
+ gm = EGameMode.TR_GAMEMODE_DUET;
else
- gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL;
+ gm = EGameMode.TR_GAMEMODE_NORMAL;
//Create new playlist
Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist();
@@ -981,9 +1197,9 @@ namespace Vocaluxe.Screens
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection];
else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
- gm = GameModes.EGameMode.TR_GAMEMODE_DUET;
+ gm = EGameMode.TR_GAMEMODE_DUET;
else
- gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL;
+ gm = EGameMode.TR_GAMEMODE_NORMAL;
CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm);
Playlists[htPlaylists(Playlist)].UpdatePlaylist();
Playlists[htPlaylists(Playlist)].ScrollToBottom();
@@ -997,5 +1213,6 @@ namespace Vocaluxe.Screens
else
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = 0;
}
+ #endregion Playlist Actions
}
}
diff --git a/Vocaluxe/Screens/CScreenTest.cs b/Vocaluxe/Screens/CScreenTest.cs
index 9f387043..a203518e 100644
--- a/Vocaluxe/Screens/CScreenTest.cs
+++ b/Vocaluxe/Screens/CScreenTest.cs
@@ -19,7 +19,6 @@ namespace Vocaluxe.Screens
public CScreenTest()
{
- Init();
}
protected override void Init()
diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj
index 35339243..9df8a799 100644
--- a/Vocaluxe/Vocaluxe.csproj
+++ b/Vocaluxe/Vocaluxe.csproj
@@ -180,6 +180,8 @@
+
+
@@ -206,8 +208,6 @@
-
-
@@ -225,30 +225,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Form
@@ -262,6 +239,7 @@
+
@@ -299,7 +277,12 @@
true
-
+
+
+ {D2B6DDEF-E0E1-4DDF-A73A-E6ACEF5C95EC}
+ VocaluxeLib
+
+
+
\ No newline at end of file