From daf1848e4536b8a3d1cf559e5e0371dd0447abe9 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 3 Jul 2012 11:16:43 +0200 Subject: [PATCH 01/67] Fix problem of spaces between P and number in duet-files. --- Vocaluxe/Lib/Song/CSong.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index fee895b1..fe098426 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -420,9 +420,10 @@ namespace Vocaluxe.Lib.Song FileLineNo++; if (TempC.CompareTo('P') == 0) { - char chr = (char)sr.Read(); - int.TryParse(chr.ToString(), out Param1); + char chr; + while ((chr = (char)sr.Read()) == ' '){ } + int.TryParse(chr.ToString(), out Param1); if (Param1 == 1) Player = 0; else if (Param1 == 2) From 4ce5d58072bfbec35391df0659e8ee8e296e6a13 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 5 Jul 2012 18:58:33 +0200 Subject: [PATCH 02/67] fixed SelectAllSongsBug --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 6712531d..385c5c5f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -267,7 +267,7 @@ namespace Vocaluxe.Screens int SongNr = IDs[CGame.Rand.Next(IDs.Count)]; EGameMode gm = EGameMode.Normal; - if (CSongs.VisibleSongs[SongNr].IsDuet) + if (CSongs.AllSongs[SongNr].IsDuet) gm = EGameMode.Duet; CGame.AddSong(SongNr, gm); From 74f24125dafc2d3e562f41069de502e31893e584 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 14:09:05 +0200 Subject: [PATCH 03/67] Added first (playable) Playlist-Element to ScreenSong. Still a lot to do! --- Output/Themes/Ambient/Close.png | Bin 0 -> 5236 bytes Output/Themes/Ambient/Delete.png | Bin 0 -> 5705 bytes Output/Themes/Ambient/Save.png | Bin 0 -> 5036 bytes Output/Themes/Ambient/Screens/ScreenSong.xml | 502 +++++++++++++++++- Output/Themes/Ambient/Sing.png | Bin 0 -> 4616 bytes Output/Themes/Ambient/Skin Blue.xml | 10 + Output/Themes/Ambient/Skin Green.xml | 10 + Output/Themes/Ambient/Skin Red.xml | 10 + Output/Themes/Ambient/Skin Yellow.xml | 10 + .../Themes/Changelog/Changelog_ScreenSong.txt | 11 + Vocaluxe/Base/CPlaylists.cs | 29 + Vocaluxe/Lib/Playlist/CPlaylist.cs | 68 ++- Vocaluxe/Lib/Song/CSong.cs | 18 + Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 113 +++- Vocaluxe/Menu/CSelectSlide.cs | 8 + Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 4 +- Vocaluxe/Screens/CScreenSong.cs | 169 +++++- Vocaluxe/Vocaluxe.csproj | 1 + 19 files changed, 933 insertions(+), 33 deletions(-) create mode 100644 Output/Themes/Ambient/Close.png create mode 100644 Output/Themes/Ambient/Delete.png create mode 100644 Output/Themes/Ambient/Save.png create mode 100644 Output/Themes/Ambient/Sing.png diff --git a/Output/Themes/Ambient/Close.png b/Output/Themes/Ambient/Close.png new file mode 100644 index 0000000000000000000000000000000000000000..b8b8a99477da3831071a68cc0d20b1d06ad8d624 GIT binary patch literal 5236 zcmeHL*E<^y+t#9LZ$%?kiqg_SM9ox+AXceTqgHK=y=#}Wb{eW?tr`{MM{Q}1+VZ1j z%p|rb8Y5cOukXQk@cjqh!TVg-{fwjMzV7RKo`V}@Vx-H?BFsWZN5>A=gPHxU1OLHg z`oHgp;VAKx3y8*_8>$;nAY zMa9O(#(;o;!^1;1Hn!yCWJ84E$jHcz8#g|F{OINBMWIjt06<=To{f#o!oq@@np#I^ zM?^%#+3&Nz>;4=6Rp9@v0=S@O)W75|1eh5;q|;iTefD=?M(SDl)6sD{{0A2*G(Wi0 z(Q&iGVNmlB!frk@dK)__rQE#9BZ6l|RCd=Qbrvw;(%d!shmX?h4;49lSVxKJgE-4wI&sPcG zemoe2iNdtS6S$lnOz^UDy0_WYhEHMjZSR#B%61HjEA19G++4G-G;%j6p~MU7)BIXt z#1r#w?W$ulJmdV2oMeWGFx5o)0P5}m=%YijaX1`P8RBSu)5kx4gPnL14|cGab#kOu69`g5 zUv{`3osJX&hK3PMIfxY!OoC-2M6T3* zQKjO^t&U-&UMp6XO!w=z>yR~MR;nEaM!j3AA6)xK9QUwAEY4mR{rLEDrSO*REqk zf|vRqfl(7ustCp~NeyI_b;>2`n6C&1xw=QBu9e5n52!IxpbYJPWK zdI^mJO|`kOUcLgPVC$tAt$4-$MG^U2=w0$ZnjNr?;bvXRv=Wx(525Y{tMb*YSU@An zH7#-2VY<$!(b}jw#*O#R(xrl@TuIw$^gH+bUrOA*?5GDzOM1R>Yem}Wo}CtdYe6~( zjV;c^C;)`HkGaRvzz{8^mh0JNf4?2^SfX~Uhb>#1W)IAFG? z?C$q>$a}4qOpmqFvp+ldKfcefJak3*J9{JQkJMChh}NH*NAoP-nI>LGV>I<&JBf0^ z3&&=(Y=_be!jqul_o1=nw&{E>XcH`z9N(TsVpwuJ-uDQ4-&fC+`N_9POR)CE+qRL_ zC^O&=&fF=5{Jb~4O|;ndcE+3ix7RXP>!2UN5CzC69j==ba@xb=T7Lgk2`I+OXzw7d zy!`^tsbwF^E&Ys2if=K9c=BbAb>x;|M08_tQqR?}sFo`^PAXm+#n0M;JG*IJ4xEm? zuft~Cc|A1M$mG+~A95beMyUXmI+xVDhwJ-UOgAzmAyv&x+nqHX5j=}GQde54Rpf#F z)ibOAB*cT|1(dTM1AKohh)C->-rS3}4@7$1N9^4o?zxW-wU)Vq+gPc-sk)YWQ;kLz^|J0!^&lxyd^_ z34UD}(t$CzNP_oX+ZWy~g~g??4YdNzE|CT0E3N} zLLLC~q{e!{rl9Sd$-)<>ut=Vi`!AYy21J#AR6p@Z)#;T)omq}!jMEvCecKno`JpC5 zzuM{#4?^qu+V^ck{ONPW;GP<$MG9vW#Hocp%Swurz4D#rL%EDw8r@(kuK`;hVm&MT zu&0wR=@n;2u8EE{T^apnMl4V`f} zp-?nC&=1yqJWo&?fef(Sp&K@G@2@UG6eTXF1~Xcs0|EJB9h`wzzIdp zCtm5BlJ^?bOBq`MxzXz7#QV(j^TRvMwi^~&Q$C0dsQN*irep(1z%6( z!SF=rk8<_HJL84EAy0l{5n}q^PrzK1i_5^U#C=W`%7*)FX(!}@XN5B-F2I;TP$9pXQN$t(qf5mbOI3ON|Q>>zC zL>n{&Ggp}BlB{FE;hQ~3p+GsBMd7`O_J8-Z1VW1tErw+L2g%~W@yI)|;HDsfL2Y!Y zn*1V~p3~~tLRmul($e)9$q{kxEe;`0(mrMUWCX#A(omhjEj(xIN9%j5;XLHQB+J-g z=(FJOsw=h+rFA;#9Q$=b}CGSY3+Kx6)mACCtSJ(X)80dDO9O0VzFjlB; z@Y-$}KY}Y9s_&eDAFmiLQbkW<;MKntueB<7R?~9phgH+i8BeZraAWCbNnb=et5>|` zKB{FFL+`8|CmmPc-?pe?{UF~n*KboW(qHmC;j~{eLnvVePN{cJpDp>OBMR+7MYzK0t@A%*j6f(H&BZv zX|gSy+A*jniNAg`)+*i8R&cdF>P{DGTDhCA2{$AWwEfM$sD=2QY>e?4)XEGF3AMik z4YC`Ehi_6%6*#D}nVO&EnVPdNW2W-nai{GL1KTsRJ(*{K#s7>=Akz`s;!7CC!pCH6 zk#9BxrjZm!D)p(^^Xrh?lA+)|7iqKX#9QF4ee89;j%|t8*sTG|-9cs<5L{YRn+U`2l_7@JGCXJ!^%N~J6) zhh*_6dhi8NRs3aeuLw?f4A@od5#GU9W^X9{uQ(j*XpF(d%rU6z_rdx=QeMH0*B#kj z_2;k19mNIqPZGJV8zt2*N?p;873l^GMJ!TK!P6d}m>MY}ZKD&boPq*lXYNV3||UlUJ7Xmm1ct;|UVi|kBxiwCGH*-P_?Gxwt^ zFZshYS{Sx6H`qD6xgH4;Z}EQ!fa0gC;+yqYDx43=uw2jyTtHhP>dT?hR6R0yWV|EJ2*{~dA=&r8D?~@I?eI0!|8ayh- zKyBNy>MUQA44)RzKi>WnF!sRTnf5eQy(7#cZMAPT6=8C`h~i!!XsE@@Lo=~?8P7=! zQ#On1DcT#!fxhRLrxFsqGF@`+23a+PPTub~5w&^!r9{B4{DYo}Wf0d_P?3+zi()Nb zXPU`Z;QM7Bw{(+IH=ee;?kXUA$M*NGi1syeu{O7ItaK z-?-Uonoye_w%-6qX$S;dAM1F?E&D(?y*j zo7Aoi&)*}0e5uEEB&WYO*)HJX5FRk!bp@_P(^b-5N*6UdzTR&_Jm#l~+Q&{#co+K9 zTsKm!CzLJDST)Cjv+$)g-&jr!c87?6_qD!Bol&Fr5{wxoB#0nUBf2nJ^b#Y8E{`C3 z9la&@dDp!^;(mC~+WYLaKb^hy$CF~HuSG@9N{)wzM+MW?F#cDE|3gxOe|JHmT@4-{ z0iL0*=@UYH!uYs&4GoR{zJ3Sv!0**L4 zJENqee3kl2_o?pqw{Z~>k(!zsFHf)i{e2J!^tSM=jkV44^7134M;HtyJR&){Mo{x)K^6Una9@?2_;<^pVoyUKBs;Gjf*)9v7 z{mx~;1Ymg2vYFpX^*>X=wV5u^Wk1{zrL-(;_eW;jtqB9>KaKR8*7?-L`WrC_XD~m%x+wSn$-kI z&}YNUt$Fh>5NNy3KQ$!7`n=w@8JRqz@XDK)g{8bal0K$yv0`xDZ>9fUYxRn^aGw)? zg{1=y*Xf-(@P>FQv)FQ;`eY2Z=i(M5ziUy9(9iz(L?ZyJ_;DT+y#W#?xGA%aOqxUEPb zqQjqbD0|yJY{-H81-XJ3oz^496a;D(&hf=Y5HS;EW^c=D0Hds;?-CE|o*g_e#Y)&R zvyWB?A)V`0+}7gN^U`IyOzE7}>yO_G=;lf9#EtpJz)R*>VWSUX94^eYQAM@2(z`Pw+bWxOGCQ$w#+Q-D`!%alJ=T~U#9 zCNA5C`+biI^I`U+JVw1RDo4Gt?{(&Ru#T~2-y<%Cia(H2pTnx5xC&aPPm#i>C-se4 z#&%XOdtk1c7XRRmOlN02p3s$<)}48sKl{y3wq>d%vtg4K8EEq}y`Xj9Qt#{Xr#(ge zf#5j$U}Kogl!JU9f%<1;Xw&Q8)o70&d9IenC3;a4W5mF}xpGCoH?998lgQFR~@KNU%UV>~i z6Uq$16@H<@;VOQyu&$xKR>_nHPJ=HxP^MD*(KnTl znf}`^02ijKXY^2oClq9_nQGOeB606_p7-~nSF>!P9%mU3yW+|wsyInoPFQvyFxb&o zHEqi@euKQcpu`)(TTu{>@Kes4FYAF=UVdzzm%jKc>T7Aobzw(e5yx#^rw{{|8|&X`?lx*YFjC6S)!s1o>G^SM2rf^CjnkxAQusMG8@ps5DbxMxz|9}`TefnPVv zn?daRA*AQ?Sml(F|HG8q6M`J?m~))Zd`pwB6pve9L$vVLT-^0LXgYc4_7Q#1dcFB)@Kd!ws&nZ7<1$DowoZ@NipJ6TVy z1jy+pNd|Y#Vt0Bh(#Pt}d1HPNSj>_vX2=;&Hlo=&MC0*!3$x!O#c}VFI!yHnWw1!9 zl_{mp{Oxi+IIDpeKT&~jd+H}x=B$m@tLrsk9 zJsxmVX&`x|or5*6odmW&8Xr3ISo%FV?g=uJ5BYF_n!UT_6N!4tyKh)5rW_nxB z+0=%I2_?nJRB5(liKXrfB7up;V5UuGs*TeTMWBCMxc9>^vcZ-f5$6muG(iQk{y-$M znyp3jIeShacNasweo^gyUBNS^;Q=-!c=k+la4yn!j(y~M9J1_{?+=|Q{C0G+FI-C# z2!GPC!{K!bLU$Y!&t0{qWwB-kWI!j>quX-N_jRbD6X1`NRtlE4HE*#!y>ghsu9L~E zt55fvb+N{6ewqDXfUCpW*>j=??s!}sU&r5Ot!F*v&Iu`;{K3@4;DChVWt}~juJu7u z7`Mr7h8z|7d=T{EbFkFf)Zr|Uzn6f{dVz*du7V)TNG~rPM=hcq>DoXjEY@~`-v{sm z68;{YCMiZF`Pw}&#s{sg+5_Uw`G+o%cR| zucJfT7Q9~Q^K z#qt>mJwP$IhaHp#=jF@aL!oz^e|*K|JkH15y5!uE89m`;dJc2h7U4$WO9=z(QSUIs z#J#$7q~wF0IWN6kEN`7n2D9+Da=nkGsH-~TT5JqmHzfRToT5XrtVth~csqEQ{Nq0m z(8RbR8P~xm{T+Wzd#>6-lZ4CCbJ|KH!_~{&wO56crw~Kd`1;wZyaDA`NP}5sYr;3P zd(r^sq!WS9SNTE_Ui|o#K$Nk9Ybx9?-6=taqqBuEtsgD5_K+?{q*Ws2_r3QT-k$A< z2gt%8_UVyh344^xkTY18i|lsEE!eu>sJ5CIC65@FU`h5B@Pw=qB7S>2q^|oMrp9|o z#EY3k%nL#tfuI=Baa+7%QvIbiKVy=epAG&_DLLqcV)|R%!v5SgA;W_HPd$RPFritp zc48lAoN|M(5{q`Tv<#3}kffH7ceb3djh(~^XYcTM+Jl!2#NhvKxmpOhO}01uY1?G# zrv}(tv0iJ!GVtS+YoVzQe`+cDIYIY(gF)X&ClonsetL7b_}NMOsq)mY$i_n;gYHhlbu;2CJ{)m+I)vRj< zUy1iKBe8%JYwpJs5I_Pl+SV*4?yEU-Wy*9E1EC`?06?^+%}j)77)!1mJzAq+us{;7 z#fhi%jmVNS$7tV($C-+PbF~HJ?D!W_|BN1Sxq77aD7*HJsc|~T|B!t#h+r;bWzz5n zA82SPqrp0qbqcxra$~s2`rYOj-0P;!odN*fwh*m}{O!1lXdyqaW##10Pe9=&p4jC@ zD1FMdx}=NKQiB>wyNqUuGJuVKBQCOa1roaA3wx?FwOU#_1tN-%tXumq+^LU+&maOM zVM~19p-*MyNfCo)Q(l%6OFNd-wdhBFZa`16GsyzY@mj$;WP0t|=S(%P$&pHq`GCr0 zE&P(i?xHTUP4I!wNB@*SnfV{DtfjW4w5F1Op~kBZaBF`=Pwv<3j?KExyKk`8MBV?y zI{ZGH{hiN3L1>0T`;+k1hujF|VOb#`!8n~hoVlD-uBM-E#c81yOLcrn9FJJ+ zaa#CbxAQDz4Xtj1>(7<#+*FmL@qO&TK;9OhT0E)N1&RDq4F+8639XYEvl`$Dq8Zi7 zRUal>W{&IaiK5G1wmR|)>7hZS`5v8m+&gi)!_7ZsbQI7}B2W_ponb|nV*QZ}1B}rQ z4as9WWWw#8!1QTZkC74g@Jl>Mz^KI$k+oYy@m7^C+VB!3w$ ze;fi%c`148fW$uU37NF>P9}mOd2kggnbgKhj>AdHy-Xg7Fh@=%V6VX|GZdY|_q}Sy8FD9flz>dvcuMw)U~iRz2ts6Oo)~g5 z)PRQ9zJ>knFXBcOf5cW7XjGf}+1g}sFe2zuRTTf9W6>nhX>=Ck{t5i%UbrJ|Sg@4^ zqHyFM)PAi25BJRC*%ZOH?AadI!}JS14E{cu_DIo&&&xOi9^%${dI3uvS+>+C`Ak+k zLr`gyCcSSJsaEc{hPQ~5_;*%!w_)L(HfrnKC-Qpp{ zU~FMspS`1h<%W;xN0R?^?63mNX1Z~x+Q%w4JioH=vxJPcm!;|kDdey{fWrmHq!!LR znyF&f89`b{C4#0v!^!xFe>JXr0)yDc(%?G1&b`sO2rWy{@%qv2c5iL=eeVKk)u>Lq2r_*iQc>MB3>v?(74mTkDU zb{??()+<)=J@RuP&cb?T$$d~IPd?HFCu8+m7!r;zilmJf6G5^ueK|vwYBn5=T41{# z+np0wVOZL{GFq5zX61F{QTnyJ)pL(i_PA~EDZl>oIux$HaUSbMfs-6w>XND*`iQDj z$8uy(C4-ODqcP3V@xw|MFN;Gya7!-w6j1eV!@D~4s_nGahB?hj&DCUa+MRBDw!n?f zQ&7gX{X*jKbjdH=cxVq;#|)f%qViYz2Gj9Agl%GE7xMAwe!n#o7@A$Qk8v^vfE^e}fM zDi$L*X2!v~P9s!qW5tyrlobn8>D%M0O@ujKqQ^v2+I*DL+1O9r;js|8Z?wWymt4xXnim0SeiE7c z`o@r2sb~BxqPNR6jB9Cnve>S9Y0^L*Rgz!mGzmV{h2__J!i*@}qOEA*)?Pkqdxhaz zUxt!OB46tcwt+x*z4SEEj(JWu4S9X<2jlyEPiAfj@9eFgPHbLGwY+V~0q@2j*-__;c*PijpoO}zk))wH*(X-IYn3GcQoe$8Wnvr-*1C@ zYS|O{>*P)N^3($omCG?4B0zO|1V_MkHI~N-5-}*di76ggHEwCEzI(kfBql}RMA>^{ zz(KEAtVJPB2VMPK#BqGJc6zzZ@@7%>Q!Dn|V5KoGa|M8f=8$lAUHTgz3NKR0C^DVM zpyWV$p1msH2vn`|^4|EN4!kvJ ri}z<(LhN6|TnLj@uhIVt&1)KGbw1TUu&Sm1JnLXj^ff*`wvYWEC-{n! literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Save.png b/Output/Themes/Ambient/Save.png new file mode 100644 index 0000000000000000000000000000000000000000..1afc31136a75898cc89c655d7add37abe5c468e5 GIT binary patch literal 5036 zcmeHL=QkSw_f8@RRSBVpw1SvbRW*v54HC0f)oj(MS$otd5_`tpv((T zqqRq^qQAcHU-A3!-gBON&;4-Eea>_4m-~c2)=<7qji3eq0M~I?jP}3U_a8vW{^j%# z({ccS4DeV@R}l;X2N8lW7!0Y4gyupQ6c$)mS*)zAFfcGACMD|X>W+<#iHL~Q*Vntb zx*Z)I(a_LDMMbHpsSOPe3EUAVFDtjVv)|go0+xB>uBv;P2CEL&s)0KgP+7cyYp)VwSiTI>YgnjcFgW@c& zuvVTEI$~^~h-ghb%o$T;rQqZc6p8rOuN=S}vqDb&O$~%*%cCEz$+B}FimB>To1U_1 zA4l)@0EpZ3e0;a25B2(QY4g-(`GUfjeDM>$4uOs&=4lm_Qi1W1x}xg59M+zSYh2?LBWA&|C#p$q?*xt)HVsfG12ZN-k1K}8&a@WNWHS%=w7W}00zO` zmB-MsfPAHRaW$mn>z<-IvBL!Vu=J_YU=+OJmr4W-qK2G=H%C6~WoS~nVQW&%vnLpq zo%^@*8&a{-VcepFH;{J*Uzl&<>>RRQbL;lbHv?*8}xDZ7HAMB1zWY?@o8^9Wg;^d=d1pnv(PN`jk03zCyR$An15+su z{aBuTxnZ~CRup~{0Yh8P5%n*COlIe*e3RJX_Y^0SHw4_~d=l>o-rjf!-`=IV?j(b? z4kEk;&`60xNo;aoFAJZ39uYs$qdZdkKCQF4?JUP1Vq2FfV29>aQFYzO@QDNTCO25` zgRsR51YmOmFb|01Uw!`tNnwvru6f5&0j;g1v?-)hIQz3%2p^Z3f_coY+N6t}`I>@D z61TXo%?yvF=T@=C8iyI){8L;wY0C?X|I-ztdK1Uo`)0CsN{RTp4E1Flx;xU!7u2)Z zTk2jyu*0YnD5<$2+);UjN_4voMJS&};mRx2>WloQ-d~Y7Y7_+WhFqWbXCx9j{p_bJbSoAW@I3lAFr9rb}MN zl{8~kOmwCeOr$D8uKuE#5XRTCg%%n%t@`1~8Z?Z5W|*99Lhnk}{eFI#-S6j70rk0t z##cikPx+6 z3`cH)hS$EZh)5^xa_vlE%kP7_rmj+X|+;;1}9`% zql(4z@Un^lwGs!&bU-flIR(?58f3>O#L&g|$Od@E& zoc?^KfW?EMHhab}0I^&u%p@UM-oHZ^^nb9wZHeNtJ+tr*)m^i_S-t6C@3R=~)NX$0NkXBI5WS`0-vDEh4 zp#X@WBmtREXCXxq<}8ZHGPYI~r_zkvLMRuxZmDb_>Cid!1%SULrGYO^@EQZK8m9pl+U1tK-9lDYJV>#%J5ZohTly1{3-0(kysrf_^36T?8q4 zo)u&1UV}=ReM)P;jo8$dY+mqEK);;IHhD@LM<(bL;9~aZM9rvB5RxPd=<5zJrh#nj zZ%P_wjU;INhJ^ZvJXY+AGp%k_p#6+Ycy5^^{8F|zjNmw?+6 zNAR9~G6`J`IDTls{1s2r`A~3K!Zl{mXda%?n{>({xZ;jabH$?erX5sZZ?s3jMW-7G zE`0KX%o$<>uT<(*kLE4SG>s+@_fllDh0OXe7h?M*Q`u4ko5Dyu; zzEVbPc+k*ord;Ty^6%FCCAk#Qim(PQqpJ~A88wlp@nqy$(e3Io#wa#icW3>+{0bX0 zyPID=HBnAV%U}Pz>ebq~haSkl8OGZo+ZPd7ZYyU@&t75I0D_!W*{shjP_a;e_Q16W zFxd7HN~KiZH*0op@V2^3*?8!+d_}_4K@oVrQs0n1+@CIgLq*Jff^zD zZ+dson$+4pJ{dcEu+~GrO-;dk&c1qJWoxC{97%X@)vq7WuF zOBk1uVw#w}ZMikT(2>;lmLqG?D(5vT3s%V4j(glRCK^`FYRt;-DiBTb zJZ+0oW(@3}ZTRBFK;-h(IQhW;9jz~LFi`RQDN*`Lv!(u}Tj)BrCh^h>wI74GUKyM= z7Yh+^r^bqCX{;cKnPNL-hjV zn*SCwHpOAA?5oUaDB~p&aT8pOao-56p`0%#RqW5C<-h3~z+^dEQ&ezeD^^$I>K0k9 zCp6W3{s3Ykq4@gY@_|gUG20Hna*z#SQ6D!loDso%1HFps?n75j9Z-^Y{(Mz-nwnLx zr^-wjq|uN)u+LVSf0KL@K@VSLn7AiW#YRp-c7Pm{m=c$d4iGE45v^t%5vdzA<^k1~ z=hM+~!qDfU5gpVNRdLeqsL*c%Qtw9$^?uafsCdl`@T{$Fi&nLyflU<|G->1nm!V#i z7?4^S%CAh_xb{k-K%m}di|Dt}TlFZ-Otv=?1ysGceU9%JfSC)a1?0-2UKWY?#-Y?_#2sp~+ik<}pL5!cKCAQo#!_vO;Dhfy+#u$3_s~aR?zkNG2 z_0!(aJt0_6l}p64&_T8vBvl(upGQq?Yg!#b_i7A$9ZzzJ?QPN$eIU*puDj~SB9Xc( zyiZ4&5&a*cR6^?~Br(lnO2!|rmmR|g@*f1h$Fg8$B9sPD%)8;eI9rMuzM~(1#8S8S z9MGDFZ5*8TN%d?(tvepAK7xhbRK;(S<}F*U_vDO9@|g(O>0gzhY!sC)1c<4Z8}#l6 zw(-X1YbaUnPhY2ZuNx)(ML-f+C~Au8NYDu)zX2B?KaI@Q$ndqvCd1^v^jK3UUSEck zHCd;neXi*pyFWzqbZgW*dlWd5q{k?|%1ER9W?_t27SAU)K?~79i)Be1Tp%Jp=~L~# z>7DHB1RwwK1fs%^R{`^I!p65$v(>NehpE!(=D5gS`^GbNa=}6Ig(8a1=EgqtXzO~r z`z^8@7um32rrj6Xu!qS798PA4?{Rjb%5?86R~bq#Oi;S1P3c#mnr{ugB6h}RFR6Yq zpkA3BCR}uXe)#l0fxo+JEznq<;q!Io6zaxhC94bsIOVPNCX|rJROc_h7+BNYWtH8= z1V)0za9iZ;$EGH$lu{G(QLrHK_^=r6h%>vqI2k&Mi>P9u zH@N6PFqykPIk?Jq);s{i$g=+^kA@@>>tQWvHUUB-Xfc0F$m4<)>9S!Wbo8Y`hcI5D7)P$0WGG zH0Kysp`cHHyifAX;>DborpjbgPy(*56kcE=iHu#xQ|>A~fBM!I;NSdxHW0~g7TCJ@ z#)@Cn?S4hXkSeYPpE>B^Dhxbt*vx4ZauM%u7Nk81424k#Ru4teV~a){EMdp_#NXdT z(yMV8q;CqgJI+ql_2KvJ4?%f6ee7Vo(GxKXil;RY9)ro7%}TMiDD(2hz&G|2+#&`H zDd^r+*S#NP($JQEMCCiG@ydP;M+f?elo;hxWujPgKHW6=gd5l`knZ9;l-0p8k#<;S zrc`MA+Tak6I16#^w#;dpBKP31N4Q3J<;r0^$q#%!p0Oh+MfsC?Fp;7{%ECflohsX} zy2|L3io0ZXLVW{Bf}V2R>Jm{EPC$#{Jf!7r2yvL*ahPq#=YL_T!4)gGQ`T>*h_`=Y z@(=o>-d-#FB0fDgd>GXd_uR}=YnyfYar`M4-I9i8?su!Uy4~mbW zw~;B-ua4PAaV-dcf2^kuyp4VCa8(3l(4^5ByBYNBo5t+>-SO-gR_suTy!Y7;)Gpo8 zkI>U4zSS7vmsO99FOKVOzcTH(z-(b&?0kftR1P0VJ>sEzFxqx2g78?O%K4_&P~2MQ zGptYbjAq9sg3?&i+2z*m%}$-c1=xT8|AYTp0SN>CKb>yUigQ`EpzDm=&k EA1h22W&i*H literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 4abd92ab..24f56698 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -72,6 +72,38 @@ 26 + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + Button @@ -126,7 +158,7 @@ Button 40 - 180 + 235 -2,11 360 40 @@ -173,7 +205,7 @@ Button 40 - 225 + 290 -2,11 360 40 @@ -213,6 +245,194 @@ + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + 200 @@ -367,6 +587,36 @@ + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + Button @@ -432,6 +682,71 @@ 1 + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 40 + 190 + -2,11 + 360 + 40 + + 45 + 195 + -2,12 + 30 + 30 + + 365 + 195 + -2,12 + 30 + 30 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 30 + + 280 + + Outline + + Bold + + 1 + CoverTile @@ -671,5 +986,188 @@ + + 970 + 80 + 295 + 460 + -1,00 + 50,00 + CoverTile + CoverTile + StaticColorAlpha + StaticColor + + + 54 + 4 + + -1,01 + + 24 + + 235 + + + StaticColor + + + TextSColor + + Left + + Top + + + + Outline + + %a - %t + + + + + + + 222 + 456 + + -1,01 + + 38 + + 340 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + + + + 222 + 456 + + -1,01 + + 38 + + 340 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + 4 + 2 + -1,00 + 46 + 46 + + + Visible + + + + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 54 + 28 + -1,01 + 235 + 24 + + 54 + 30 + 0,00 + 20 + 20 + + 110 + 30 + 0,00 + 20 + 20 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 24,00 + + 230,00 + + Outline + + Bold + + 1 + + diff --git a/Output/Themes/Ambient/Sing.png b/Output/Themes/Ambient/Sing.png new file mode 100644 index 0000000000000000000000000000000000000000..c7daf961999ad89e32b0f0ddc2f49d627dfc2ad9 GIT binary patch literal 4616 zcmeHKXFD4V7YHS`SKsw24x&qGnsGh!wLuR_s*|Vw9S(Nfotg)efpw zsZl%BYEh~v-ag;oAMk#7&vo7Rxz49^U-xyN4<{D=@IEsmA0q$&U`8Re4gd6ke?d?4 zhqI!rNdN#10Ih3`08#@ZA|kZ4wR?JcAP`7VQIVa!-P+n37z|ELO*J+)o}8S7LZNka zb>80IhlhtuOiT$03A(zv!^6X}va%!+$p!1Ov$Mm`&!3%>ZE0yaKR>UgrqkqewLjvhybT{30buK&9sUdq9!N7U0D$%Bzo079D0Kn=SPD?u zaO3B*yH?D8L><=lfiM#;uoUi7*TrRszeFC#B<8!nAMcsq_>^nf3?Uk#h!W?$IC)kO z$z|^NUr9sfOh)I!$4kJ%Pj)c&aKrUb|C;{egc5Z{CPw+~O_)X0cugRc^`fy~$ z-$75;g)W(EZwFTF6@RlpAkfB=<-8r?qPiw5_b_il9#6E4@WjLYl^_Y-JyfIDLl#SI z7n8yekaGXL6;Qnm4t9AaBhAM(xJ}lkz*j;KjGVN~W6;)2u}e?tsmp>jN*KkFhN4a3 zg=)LGo%qwE03^{ma?Vn}>5I=%xxMt3Gh@xYBN50AqUBQoD1Xx5U@hPJx@Y0{$IE*= zVvu1lk8`0jkAu%SfcdVf4lWjy{%rl}b7qQ2Z;Jmk&TRhFOcUq4u)OtLofMW?WLouP z)9$O?M&F7(^snqRUC9r(FX?`WKUgr^RTGDvD zWLpkCc|YRqtbe`texJLyRsWy+2g2;7wcZjAoB$y zDg&cvJxe&u{kv7e-SZ1OB0& z2@djF1>!Na6TGUFR!%+0TzMkw#8H~_27y?epRC$r80RKt&av8-W`9ae;m}z@)J_y@ zM~Tsd`Cj|Q8&e=a_lDJ{2QyZ?6TIE|R{6(fsE`)tR)3;EXFn5}S-D>bi^M_(K#Ma+ zZqdlugL41LP0WKkPfT%qB4VI)zrol=$7Z+(1%A-9 zR%o==Py@f53rr{ydLGl(+6WDfc)^JE`u9o{*f*S{RQJ@9x|x&gT6)KpPky$mA6%@+ z7KrAVhh7LKHDY4{l~cAt(rnK})0cFp*0>)4t2o!NZrR6+2c1`otx_obtB3C#g8Mcc z417b$1a6^JPhD=S=Cqs{r@V>7mo=f9p(OZJJ_N&#UwilER`rC&Ha7D$E45v8u3B~4 zum-NC5-)71Kg|E5)M4zU-IZ~&D6_l{+cRp4W}$sv`CSDq{ac0Vwxh)cYiv=1w{~+J z|AE(<<7QQIy-~k4AvRk@W|1rOkDDs#V}J4xlf4H9_mzK^IQc^__vE`6XTfRq`c4ClBpsXIbM*m60kfz+$KbphN*yDUnmI zzC{+xdRBVtw>ivsC3Ux^28U5tbkh{~P=?j6mO#~$c5D)3Y(ix0_YElBM|bh6Ln>*T zD;)>x*1U}SYQ7OvAu3Bc^zC%pN~{`p54ZPK0RPTMZ>9%t^*>d4R<7;X5IX75g%t5=yK(ng{I{>_q*V!( zuOgS?2VajlAiV)PCL`X>0UbBr;$N&d9uoEV{>hc00;4QmU!M?*Pgj&abDi1hw-uon zX6`w-o`d=U29$il9WPQKrWlA^sqnye_zUUnizTRey{%bp8ikgIm@#k7SH+E3MJuKa zL%S(nJgtmjgIZN;V__?YOyf<`7|M-cq|tnImwNGpOfxCNk4P!~BW8-W(CX%@)EoJ( zGGa^FrRKJd@7S@bVwU;BR$#h|8$<+ri_`p*Vu`QE;FYk#b_ofktOt3rdlaY7TKjeI z&Faw4cNdJYzkjeVknVMORGkDda1+*|A4$?j>gbd{=}W{d`Hg`&FLls;sIi~1CVRvx zoiMq-b{7e>>aUMX~C?VQkPOlfe$d zUw8dRiid{<9)}0(Rt)>PdCKi&gC_fE zlG0`LFnLaH+f)EQ32IAIyaOEIEAr5{KNTmmnaFP+h|~`uw8wkX(D<9|iiG_uN!mB- z)@|+dHSsm^r}bkDS6@A69m@i`rqR5dNNXb7U7zbFv(Z=^MvN)DI=v;QpH+nyMtR8S zskdw1n7U{XYkp0gVS*qzaL9~hRu+8hdLaGJ1qxzoy)0Ln0g4Y5u0fO*w{HV(8!VkM zq%_8ojaX5=0xMKkB@SWJ?3F>2kFCU#<{PbpSbS=kzI7$qm3 zA0Fcd%DH3|H$ZHPOtzT(uiCe_N_Q%X?r``G#AIU&T63ifpRxlpRK!3&WZ%H=-JrZ* zptHq6k|LzUI??%r^pNw{LK>}VcV#yOjaOkTjzaa#y&^L>a?5^kUa^&f<6Z)#cz*Cv zrne#;x>7%zj2(qLRFdB-;oOK~2qzOaDc0oy<)*SWG z3Uwu{zl$1vl;sBBvLQ%Fd-qKkk~r(ilM&-7!Px^56AR0#+btec9d!gR1`pZbl$MEAGL|DOSyik1`k1wgr$SR+F|?yT)ZyO) zF!zL*A_)oJ0=T=52EcML*4-9bha29$pWZGPU zTze}TLLVg}QVy?x>B5`gwiqFj*ueXVfHr^8V}mo`mx0Y~8gZLw+6^olmE&uwm_1BW&Xx-5LPK<#<^itX2*T zTgn<|9ZigB4jou~6`PZxJ{p5b%Jh^7ScDYg01dJS`ft zH7)~;e=n|{@5u*pW?l^67GdXor#4%Ux{}Yu;mf`1<-5&9Osj}QU@HV|;n0+|hr z++9=0ClFCnae|^qU}Dd;;OStjpC^p39cs$~PAt>rm3M~Im7+YRfNj#L^J>p^rnfAT2uHG%ZmClDMxy9yZC6!V=$s{<4w&U1-qW=g{ z(l0!coxj>p49^_xZY*2q%UTjTaPpiS7TQtGiIi*G+e3+V&#u$w1V}t zLS{jnV{s|j8DRZ89HLTC_aWExIyyUnplWhn{w+jzaf6P#N#iU^qqdOan#x|}mRo`0KInD*M#ibF$V=xt?lq*Bz4 zy6#Hv{)j%c+I|yV8_RMe^Z{ z=^|CXMoH8`wz9wByx-r*?C#o-A0NL>IIUQ`Z=&V6Ui9l6t-BoP2f8X(H>&wx=#uLE Z>fc39b;R*=^?!eD6yl+FmFAPM{{X#!ZRh|1 literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 50a16aa8..3cb2b0db 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -166,6 +166,12 @@ 0,969 1,000 + + 0,675 + 0,890 + 0,969 + 0,500 + 0,675 0,890 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Blue]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 7aefeb34..663faf5c 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,709 + 0,968 + 0,674 + 0,500 + 0,709 0,968 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Green]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index d7f5ecf2..9d3f1f8d 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,968 + 0,674 + 0,674 + 0,500 + 0,968 0,674 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Red]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index d7366abc..fcb4664a 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,968 + 0,956 + 0,674 + 0,500 + 0,968 0,956 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Yellow]BG_Video.mp4 diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index 1303abb5..e78df639 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -1,5 +1,16 @@ ScreenSong +++++++++++ +Version 3: + +Add: +, , +, +, , , , , , +, +and + as a new Screen-Element. For details, look at ScreenSong.xml + ++++++++++ Version 2: diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index a720107a..8ab1dfe5 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -21,6 +21,19 @@ namespace Vocaluxe.Base get { return _Playlists.ToArray(); } } + public static string[] PlaylistNames + { + get + { + List names = new List(); + for (int i = 0; i < _Playlists.Count; i++) + { + names.Add(_Playlists[i].PlaylistName); + } + return names.ToArray(); + } + } + public static int NumPlaylists { get { return _Playlists.Count; } @@ -40,6 +53,7 @@ namespace Vocaluxe.Base foreach (string file in files) { CPlaylist playlist = new CPlaylist(file); + _Playlists.Add(playlist); } SortPlaylistsByName(); @@ -75,6 +89,21 @@ namespace Vocaluxe.Base } } + public static void SavePlaylist(int PlaylistID) + { + if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) + return; + _Playlists[PlaylistID].SavePlaylist(); + } + + public static int NewPlaylist() + { + CPlaylist pl = new CPlaylist(); + pl.PlaylistName = "New Playlist"; + _Playlists.Add(pl); + return (_Playlists.Count - 1); + } + #endregion } } diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index a87ee61a..86e5e320 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -36,17 +36,19 @@ namespace Vocaluxe.Lib.Playlist public string PlaylistName; public string PlaylistFile; - public List Songs; + public List Songs = new List(); public CPlaylist() { Init(); + PlaylistName = string.Empty; + PlaylistFile = string.Empty; } public CPlaylist(string file) { Init(); - PlaylistName = file; + PlaylistFile = file; LoadPlaylist(); } @@ -58,29 +60,32 @@ namespace Vocaluxe.Lib.Playlist } - private void SavePlaylist() + public void SavePlaylist() { - string filename = string.Empty; - foreach (char chr in PlaylistName) + if (PlaylistFile == string.Empty) { - if (char.IsLetter(chr)) - filename += chr.ToString(); - } - - if (filename == String.Empty) - filename = "1"; - - int i = 0; - while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) - { - i++; - if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + string filename = string.Empty; + foreach (char chr in PlaylistName) { - filename += i; + if (char.IsLetter(chr)) + filename += chr.ToString(); } - } - PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + if (filename == String.Empty) + filename = "1"; + + int i = 0; + while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) + { + i++; + if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + { + filename += i; + } + } + + PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + } XmlWriter writer; try @@ -107,7 +112,7 @@ namespace Vocaluxe.Lib.Playlist writer.WriteEndElement(); writer.WriteStartElement("Songs"); - for (i = 0; i < Songs.Count; i++) + for (int i = 0; i < Songs.Count; i++) { CSong song = CSongs.GetSong(Songs[i].SongID); if (song != null) @@ -202,5 +207,26 @@ namespace Vocaluxe.Lib.Playlist } } } + + public void AddSong(int SongID) + { + CPlaylistSong song = new CPlaylistSong(); + song.SongID = SongID; + if (CSongs.GetSong(SongID).IsDuet) + song.GameMode = EGameMode.TR_GAMEMODE_DUET; + else + song.GameMode = EGameMode.TR_GAMEMODE_NORMAL; + + Songs.Add(song); + } + + public void AddSong(int SongID, EGameMode gm) + { + CPlaylistSong song = new CPlaylistSong(); + song.SongID = SongID; + song.GameMode = gm; + + Songs.Add(song); + } } } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 120efbf6..2cb63c36 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; using Vocaluxe.Menu; +using Vocaluxe.GameModes; namespace Vocaluxe.Lib.Song { @@ -148,6 +149,23 @@ namespace Vocaluxe.Lib.Song // Notes public CNotes Notes = new CNotes(); + public EGameMode[] AvailableGameModes + { + get + { + List gms = new List(); + if (IsDuet) + gms.Add(EGameMode.TR_GAMEMODE_DUET); + else + gms.Add(EGameMode.TR_GAMEMODE_NORMAL); + if (Medley.Source != EMedleySource.None) + gms.Add(EGameMode.TR_GAMEMODE_MEDLEY); + gms.Add(EGameMode.TR_GAMEMODE_SHORTSONG); + + return gms.ToArray(); + } + } + public CSong() { } diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 618bc051..8f7afe8d 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -14,7 +14,8 @@ namespace Vocaluxe.Menu TSongMenu, TLyric, TSingNote, - TNameSelection + TNameSelection, + TPlaylist } class CInteraction diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 01432976..e27a7c51 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -36,6 +36,7 @@ namespace Vocaluxe.Menu private List _Lyrics; private List _SingNotes; private List _NameSelections; + private List _Playlists; private Hashtable _htBackgrounds; private Hashtable _htStatics; @@ -46,6 +47,7 @@ namespace Vocaluxe.Menu private Hashtable _htSelectSlides; private Hashtable _htSingNotes; private Hashtable _htNameSelections; + private Hashtable _htPlaylists; private int _PrevMouseX; @@ -67,6 +69,7 @@ namespace Vocaluxe.Menu protected string[] _ThemeSelectSlides; protected string[] _ThemeSingNotes; protected string[] _ThemeNameSelections; + protected string[] _ThemePlaylists; protected SRectF _ScreenArea; @@ -99,6 +102,7 @@ namespace Vocaluxe.Menu _Lyrics = new List(); _SingNotes = new List(); _NameSelections = new List(); + _Playlists = new List(); _htBackgrounds = new Hashtable(); _htStatics = new Hashtable(); @@ -109,6 +113,7 @@ namespace Vocaluxe.Menu _htSelectSlides = new Hashtable(); _htSingNotes = new Hashtable(); _htNameSelections = new Hashtable(); + _htPlaylists = new Hashtable(); _PrevMouseX = 0; _PrevMouseY = 0; @@ -129,6 +134,7 @@ namespace Vocaluxe.Menu _ThemeSelectSlides = null; _ThemeSingNotes = null; _ThemeNameSelections = null; + _ThemePlaylists = null; } #region ThemeHandler @@ -311,6 +317,22 @@ namespace Vocaluxe.Menu } } } + + if (_ThemePlaylists != null) + { + for (int i = 0; i < _ThemePlaylists.Length; i++) + { + CPlaylist pls = new CPlaylist(); + if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], navigator, SkinIndex)) + { + _htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls)); + } + else + { + CLog.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); + } + } + } } else { @@ -386,6 +408,12 @@ namespace Vocaluxe.Menu _NameSelections[i].SaveTheme(writer); } + //Playlists + for (int i = 0; i < _Playlists.Count; i++) + { + _Playlists[i].SaveTheme(writer); + } + writer.WriteEndElement(); // End of File @@ -442,6 +470,11 @@ namespace Vocaluxe.Menu { ns.ReloadTextures(); } + + foreach (CPlaylist pls in _Playlists) + { + pls.ReloadTextures(); + } } public virtual void UnloadTextures() @@ -490,7 +523,10 @@ namespace Vocaluxe.Menu { ns.UnloadTextures(); } - + foreach (CPlaylist pls in _Playlists) + { + pls.UnloadTextures(); + } } @@ -547,6 +583,11 @@ namespace Vocaluxe.Menu { return _NameSelections; } + + public List GetPlaylists() + { + return _Playlists; + } #endregion GetLists #region ElementHandler @@ -622,6 +663,14 @@ namespace Vocaluxe.Menu return _NameSelections.ToArray(); } } + + public CPlaylist[] Playlists + { + get + { + return _Playlists.ToArray(); + } + } #endregion Get Arrays #region Hashtables @@ -741,6 +790,19 @@ namespace Vocaluxe.Menu throw; } } + + public int htPlaylists(string key) + { + try + { + return (int)_htPlaylists[key]; + } + catch (Exception) + { + CLog.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); + throw; + } + } #endregion Hashtables #endregion ElementHandler @@ -999,7 +1061,8 @@ namespace Vocaluxe.Menu _Interactions[i].Type == EType.TStatic || _Interactions[i].Type == EType.TNameSelection || _Interactions[i].Type == EType.TText || - _Interactions[i].Type == EType.TSongMenu)) + _Interactions[i].Type == EType.TSongMenu || + _Interactions[i].Type == EType.TPlaylist)) { ZSort zs = new ZSort(); zs.ID = i; @@ -1085,6 +1148,13 @@ namespace Vocaluxe.Menu _AddInteraction(_NameSelections.Count - 1, EType.TNameSelection); return _NameSelections.Count - 1; } + + public int AddPlaylist(CPlaylist pls) + { + _Playlists.Add(pls); + _AddInteraction(_Playlists.Count - 1, EType.TPlaylist); + return _Playlists.Count - 1; + } #endregion Elements #region InteractionHandling @@ -1233,6 +1303,10 @@ namespace Vocaluxe.Menu if (CHelper.IsInBounds(_NameSelections[interact.Num].Rect, x, y)) return true; break; + case EType.TPlaylist: + if (CHelper.IsInBounds(_Playlists[interact.Num].Rect, x, y)) + return true; + break; } return false; } @@ -1255,6 +1329,8 @@ namespace Vocaluxe.Menu return _Lyrics[interact.Num].Rect.Z; case EType.TNameSelection: return _NameSelections[interact.Num].Rect.Z; + case EType.TPlaylist: + return _Playlists[interact.Num].Rect.Z; } return CSettings.zFar; } @@ -1283,6 +1359,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Rect.Z; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Rect.Z; } return CSettings.zFar; @@ -1605,6 +1684,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].Selected = true; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1633,6 +1715,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].Selected = false; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1664,6 +1749,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: //_NameSelections[_Interactions[selection].Num].Selected = true; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1695,6 +1783,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: //_NameSelections[_Interactions[selection].Num].Selected = false; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1744,6 +1835,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Visible; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Visible; } return false; @@ -1774,6 +1868,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Rect; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Rect; } return Result; @@ -1815,6 +1912,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[interaction].Num].Draw(); break; + + case EType.TPlaylist: + _Playlists[_Interactions[interaction].Num].Draw(); + break; //TODO: //case EType.TLyric: @@ -1859,6 +1960,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].MoveElement(stepX, stepY); break; + + case EType.TPlaylist: + _Playlists[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; } } } @@ -1896,6 +2001,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); break; + + case EType.TPlaylist: + _Playlists[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; } } } diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 099ef2ea..126ec839 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -112,6 +112,14 @@ namespace Vocaluxe.Menu } } + public int NumValues + { + get + { + return _ValueNames.Count; + } + } + private int _NumVisible = -1; public int NumVisible { diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index e4730e8e..dc917994 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -383,10 +383,10 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteElementString("SpaceH", _Theme.songMenuTileBoard.spaceH.ToString("#0.00")); writer.WriteComment(": Number of tiles horizontal in small-mode"); - writer.WriteElementString("NumW", _Theme.songMenuTileBoard.numW.ToString()); + writer.WriteElementString("NumWsmall", _Theme.songMenuTileBoard.numW.ToString()); writer.WriteComment(": Number of tiles vertical in small-mode"); - writer.WriteElementString("NumH", _Theme.songMenuTileBoard.numH.ToString()); + writer.WriteElementString("NumHsmall", _Theme.songMenuTileBoard.numH.ToString()); writer.WriteComment(", , , , : SongMenu position, width and height"); writer.WriteElementString("TileRectX", _Theme.songMenuTileBoard.TileRect.X.ToString("#0")); diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index e520d0ee..9b18ab2f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -25,21 +25,31 @@ namespace Vocaluxe.Screens private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; + private const string TextPlaylistHeader = "TextPlaylistHeader"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; + private const string ButtonPlaylistClose = "ButtonPlaylistClose"; + private const string ButtonPlaylistSing = "ButtonPlaylistSing"; + private const string ButtonPlaylistSave = "ButtonPlaylistSave"; + private const string ButtonPlaylistDelete = "ButtonPlaylistDelete"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; + private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; + private const string StaticPlaylistHeader = "StaticPlaylistHeader"; + private const string StaticPlaylistFooter = "StaticPlaylistFooter"; private const string SongMenu = "SongMenu"; + private const string Playlist = "Playlist"; private string _SearchText = String.Empty; private bool _SearchActive = false; private bool _SongOptionsActive = false; + private int _OpenedPlaylist = -1; private List _AvailableGameModes; public CScreenSong() @@ -55,22 +65,32 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; - _ThemeSelectSlides = new string[] { SelectSlideOptionsMode }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG, StaticPlaylistHeader, StaticPlaylistFooter }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle, TextPlaylistHeader }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonPlaylistClose, ButtonPlaylistSing, ButtonPlaylistSave, ButtonPlaylistDelete }; + _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; _ThemeSongMenus = new string[] { SongMenu }; + _ThemePlaylists = new string[] { Playlist }; } public override void LoadTheme() { base.LoadTheme(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonPlaylistClose)].Visible = false; + Buttons[htButtons(ButtonPlaylistSing)].Visible = false; + Buttons[htButtons(ButtonPlaylistSave)].Visible = false; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; + Statics[htStatics(StaticPlaylistHeader)].Visible = false; + Statics[htStatics(StaticPlaylistFooter)].Visible = false; + Playlists[htPlaylists(Playlist)].Visible = false; } public override bool HandleInput(KeyEvent KeyEvent) @@ -185,14 +205,40 @@ namespace Vocaluxe.Screens { case Keys.Enter: if (Buttons[htButtons(ButtonOptionsClose)].Selected) + { ToggleSongOptions(); + } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { ToggleSongOptions(); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + //Open a playlist and add song + if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + { + _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + if (_OpenedPlaylist < 0) + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Create a new playlist and add song + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + { + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Add song to loaded playlist + else + { + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + } ToggleSongOptions(); + } break; case Keys.Escape: @@ -251,7 +297,31 @@ namespace Vocaluxe.Screens } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { - SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + //Open a playlist and add song + if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + { + _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + if (_OpenedPlaylist < 0) + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Create a new playlist and add song + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + { + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + UpdatePlaylistNames(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].NumValues - 1; + } + //Add song to loaded playlist + else + { + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + } + ToggleSongOptions(); } } if (MouseEvent.RB) @@ -260,6 +330,31 @@ namespace Vocaluxe.Screens } } + if (_OpenedPlaylist > -1) + { + if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + if (Buttons[htButtons(ButtonPlaylistClose)].Selected) + { + ClosePlaylist(); + } + else if (Buttons[htButtons(ButtonPlaylistSing)].Selected) + { + StartPlaylistSongs(); + } + else if (Buttons[htButtons(ButtonPlaylistSave)].Selected) + { + CPlaylists.SavePlaylist(_OpenedPlaylist); + } + else if (Buttons[htButtons(ButtonPlaylistDelete)].Selected) + { + CPlaylists.DeletePlaylist(_OpenedPlaylist); + ClosePlaylist(); + UpdatePlaylistNames(); + } + } + } + return true; } @@ -268,11 +363,16 @@ namespace Vocaluxe.Screens base.OnShow(); CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); + Playlists[htPlaylists(Playlist)].Init(); + if(_OpenedPlaylist != -1) + Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + UpdatePlaylistNames(); } public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); + Playlists[htPlaylists(Playlist)].Visible = SongMenus[htSongMenus(SongMenu)].IsSmallView(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) @@ -368,6 +468,22 @@ namespace Vocaluxe.Screens } } + private void StartPlaylistSongs() + { + CGame.Reset(); + CGame.ClearSongs(); + + if (_OpenedPlaylist > -1 && _OpenedPlaylist < CPlaylists.NumPlaylists) + { + for (int i = 0; i < CPlaylists.Playlists[_OpenedPlaylist].Songs.Count; i++) + { + CGame.AddSong(CPlaylists.Playlists[_OpenedPlaylist].Songs[i].SongID, CPlaylists.Playlists[_OpenedPlaylist].Songs[i].GameMode); + } + if (CGame.GetNumSongs() > 0) + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + private void StartRandomAllSongs() { CGame.Reset(); @@ -498,6 +614,7 @@ namespace Vocaluxe.Screens _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); } SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; Buttons[htButtons(ButtonOptionsSing)].Visible = true; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; @@ -507,6 +624,7 @@ namespace Vocaluxe.Screens else { SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; @@ -514,5 +632,46 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticOptionsBG)].Visible = false; } } + + private void OpenPlaylist(int PlaylistID) + { + if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) + { + _OpenedPlaylist = PlaylistID; + Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + Playlists[htPlaylists(Playlist)].Visible = true; + Statics[htStatics(StaticPlaylistHeader)].Visible = true; + Statics[htStatics(StaticPlaylistFooter)].Visible = true; + Texts[htTexts(TextPlaylistHeader)].Visible = true; + Texts[htTexts(TextPlaylistHeader)].Text = CPlaylists.Playlists[PlaylistID].PlaylistName; + Buttons[htButtons(ButtonPlaylistClose)].Visible = true; + Buttons[htButtons(ButtonPlaylistSing)].Visible = true; + Buttons[htButtons(ButtonPlaylistSave)].Visible = true; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = true; + } + } + + private void ClosePlaylist() + { + _OpenedPlaylist = -1; + SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + Playlists[htPlaylists(Playlist)].Visible = false; + Statics[htStatics(StaticPlaylistHeader)].Visible = false; + Statics[htStatics(StaticPlaylistFooter)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Text = String.Empty; + Buttons[htButtons(ButtonPlaylistClose)].Visible = false; + Buttons[htButtons(ButtonPlaylistSing)].Visible = false; + Buttons[htButtons(ButtonPlaylistSave)].Visible = false; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; + } + + private void UpdatePlaylistNames() + { + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValues(CPlaylists.PlaylistNames); + } } } diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 3b9ff835..8c439bef 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -214,6 +214,7 @@ + From ba04c6babb044f1fbd8c44240a4b2d30a35ea174 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 14:11:09 +0200 Subject: [PATCH 04/67] Forget to upload file. --- Vocaluxe/Menu/CPlaylist.cs | 396 +++++++++++++++++++++++++++++++++++++ 1 file changed, 396 insertions(+) create mode 100644 Vocaluxe/Menu/CPlaylist.cs diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs new file mode 100644 index 00000000..3725196b --- /dev/null +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -0,0 +1,396 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.GameModes; + +namespace Vocaluxe.Menu +{ + + struct SThemePlaylist + { + public string Name; + + public string ColorBackgroundName; + public string SColorBackgroundName; + + public string TextureBackgroundName; + public string STextureBackgroundName; + + public float EntryHeight; + + public string StringText1; + public string StringText2; + public string StringText3; + + public CText Text1; + public CText Text2; + public CText Text3; + + public CStatic StaticCover; + + public CSelectSlide SelectSlideGameMode; + } + + class CPlaylist : IMenuElement + { + struct PlaylistElementContent + { + public EGameMode[] Modes; + public int SongID; + public EGameMode Mode; + } + + struct PlaylistElement + { + public CStatic Cover; + public CStatic Background; + public CText Text1; + public CText Text2; + public CText Text3; + public CSelectSlide SelectSlide; + } + + private SThemePlaylist _Theme; + private bool _ThemeLoaded; + + private List PlaylistElements; + private List PlaylistElementContents; + + public SRectF Rect; + public SColorF BackgroundColor; + public SColorF BackgroundSColor; + + public bool Visible; + + public int ActivePlaylistID = 0; + public int Offset = 0; + + public CPlaylist() + { + _Theme = new SThemePlaylist(); + _Theme.Text1 = new CText(); + _Theme.Text2 = new CText(); + _Theme.Text3 = new CText(); + _Theme.StaticCover = new CStatic(); + _Theme.SelectSlideGameMode = new CSelectSlide(); + + Rect = new SRectF(); + BackgroundColor = new SColorF(); + BackgroundSColor = new SColorF(); + + PlaylistElements = new List(); + PlaylistElementContents = new List(); + + Visible = false; + } + + public void Init() + { + PrepareList(); + } + + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) + { + string item = XmlPath + "/" + ElementName; + _ThemeLoaded = true; + + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/SkinBackground", navigator, ref _Theme.TextureBackgroundName, String.Empty); + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/SkinBackgroundSelected", navigator, ref _Theme.STextureBackgroundName, String.Empty); + + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref Rect.X); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref Rect.Y); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref Rect.Z); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref Rect.W); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref Rect.H); + if (CHelper.GetValueFromXML(item + "/ColorBackground", navigator, ref _Theme.ColorBackgroundName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorBackgroundName, SkinIndex, ref BackgroundColor); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundR", navigator, ref BackgroundColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundG", navigator, ref BackgroundColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundB", navigator, ref BackgroundColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundA", navigator, ref BackgroundColor.A); + } + if (CHelper.GetValueFromXML(item + "/SColorBackground", navigator, ref _Theme.SColorBackgroundName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.SColorBackgroundName, SkinIndex, ref BackgroundSColor); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundR", navigator, ref BackgroundSColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundG", navigator, ref BackgroundSColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundB", navigator, ref BackgroundSColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundA", navigator, ref BackgroundSColor.A); + } + + _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); + _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart2", navigator, SkinIndex); + _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart3", navigator, SkinIndex); + _Theme.StringText1 = _Theme.Text1.Text; + _Theme.StringText2 = _Theme.Text2.Text; + _Theme.StringText3 = _Theme.Text3.Text; + + _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); + _ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", navigator, SkinIndex); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/EntryHeight", navigator, ref _Theme.EntryHeight); + if (_ThemeLoaded) + { + _Theme.Name = ElementName; + LoadTextures(); + } + return _ThemeLoaded; + } + + public bool SaveTheme(XmlWriter writer) + { + if (_ThemeLoaded) + { + writer.WriteStartElement(_Theme.Name); + + writer.WriteComment(", , , , : Playlist position, width and height"); + writer.WriteElementString("X", Rect.X.ToString("#0")); + writer.WriteElementString("Y", Rect.Y.ToString("#0")); + writer.WriteElementString("Z", Rect.Z.ToString("#0.00")); + writer.WriteElementString("W", Rect.W.ToString("#0")); + writer.WriteElementString("H", Rect.H.ToString("#0")); + + writer.WriteElementString("EntryHeight", _Theme.EntryHeight.ToString("#0.00")); + + writer.WriteComment(": Texture name"); + writer.WriteElementString("SkinBackground", _Theme.TextureBackgroundName); + + writer.WriteComment(": Texture name for selected playlist-entry"); + writer.WriteElementString("SkinBackgroundSelected", _Theme.STextureBackgroundName); + + writer.WriteComment(": Button color from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); + if (_Theme.ColorBackgroundName != String.Empty) + { + writer.WriteElementString("BackgroundColor", _Theme.ColorBackgroundName); + } + else + { + writer.WriteElementString("BackgroundR", BackgroundColor.R.ToString("#0.00")); + writer.WriteElementString("BackgroundG", BackgroundColor.G.ToString("#0.00")); + writer.WriteElementString("BackgroundB", BackgroundColor.B.ToString("#0.00")); + writer.WriteElementString("BackgroundA", BackgroundColor.A.ToString("#0.00")); + } + + writer.WriteComment(": Selected paylist-entry color from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); + if (_Theme.SColorBackgroundName != String.Empty) + { + writer.WriteElementString("SColor", _Theme.SColorBackgroundName); + } + else + { + writer.WriteElementString("SR", BackgroundSColor.R.ToString("#0.00")); + writer.WriteElementString("SG", BackgroundSColor.G.ToString("#0.00")); + writer.WriteElementString("SB", BackgroundSColor.B.ToString("#0.00")); + writer.WriteElementString("SA", BackgroundSColor.A.ToString("#0.00")); + } + + writer.WriteComment("Positions of , , , and are relative to playlist-entry!"); + writer.WriteComment("Use placeholders for Text of , and : %t, %a, %l"); + _Theme.Text1.SaveTheme(writer); + _Theme.Text2.SaveTheme(writer); + _Theme.Text3.SaveTheme(writer); + _Theme.StaticCover.SaveTheme(writer); + _Theme.SelectSlideGameMode.SaveTheme(writer); + + writer.WriteEndElement(); + + return true; + } + return false; + } + + public void Draw() + { + Draw(false); + } + + public void ForceDraw() + { + Draw(true); + } + + public void Draw(bool ForceDraw) + { + if (PlaylistElements.Count <= 0) + { + LoadPlaylist(0); + } + if (!Visible && CSettings.GameState != EGameState.EditTheme && !ForceDraw) + return; + + for (int i = 0; i < PlaylistElements.Count; i++ ) + { + PlaylistElements[i].Background.Draw(); + PlaylistElements[i].Cover.Draw(); + PlaylistElements[i].Text1.Draw(); + PlaylistElements[i].Text2.Draw(); + PlaylistElements[i].Text3.Draw(); + PlaylistElements[i].SelectSlide.Draw(); + } + } + + public void UnloadTextures() + { + } + + public void LoadTextures() + { + _Theme.Text1.LoadTextures(); + _Theme.Text2.LoadTextures(); + _Theme.Text3.LoadTextures(); + + if (_Theme.ColorBackgroundName != String.Empty) + BackgroundColor = CTheme.GetColor(_Theme.ColorBackgroundName); + + if (_Theme.SColorBackgroundName != String.Empty) + BackgroundSColor = CTheme.GetColor(_Theme.SColorBackgroundName); + } + + public void ReloadTextures() + { + UnloadTextures(); + LoadTextures(); + } + + private void PrepareList() + { + PlaylistElements.Clear(); + for (int i = 0; i < (Rect.H / _Theme.EntryHeight); i++) + { + PlaylistElement en = new PlaylistElement(); + en.Background = new CStatic(_Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)); + en.Cover = new CStatic(new STexture(), _Theme.StaticCover.Color, new SRectF(Rect.X + _Theme.StaticCover.Rect.X, Rect.Y + _Theme.StaticCover.Rect.Y + (i * _Theme.EntryHeight), _Theme.StaticCover.Rect.W, _Theme.StaticCover.Rect.H, _Theme.StaticCover.Rect.Z)); + en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); + en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); + en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); + en.SelectSlide = new CSelectSlide(); + en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); + en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); + en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); + en.SelectSlide.Color = _Theme.SelectSlideGameMode.Color; + en.SelectSlide.ColorArrow = _Theme.SelectSlideGameMode.ColorArrow; + en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; + en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; + en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; + en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; + en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; + en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; + en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; + en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; + en.SelectSlide.Visible = true; + PlaylistElements.Add(en); + } + } + + public bool LoadPlaylist(int PlaylistID) + { + if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) + { + ActivePlaylistID = PlaylistID; + PlaylistElementContents.Clear(); + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + PlaylistElementContent pec = new PlaylistElementContent(); + pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; + pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; + PlaylistElementContents.Add(pec); + } + Update(); + return true; + } + else + return false; + } + + public void UpdatePlaylist() + { + PlaylistElementContents.Clear(); + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + PlaylistElementContent pec = new PlaylistElementContent(); + pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; + pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; + PlaylistElementContents.Add(pec); + } + Update(); + } + + public void Update() + { + if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) + { + int e = 0 + Offset; + for (int i = 0; i < PlaylistElements.Count; i++ ) + { + if (e < PlaylistElementContents.Count) + { + PlaylistElements[i].Background.Visible = true; + PlaylistElements[i].Cover.Visible = true; + PlaylistElements[i].SelectSlide.Visible = true; + PlaylistElements[i].Text1.Visible = true; + PlaylistElements[i].Text2.Visible = true; + PlaylistElements[i].Text3.Visible = true; + PlaylistElements[i].Cover.Texture = CSongs.GetSong(PlaylistElementContents[e].SongID).CoverTextureSmall; + string t1 = _Theme.Text1.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + string t2 = _Theme.Text2.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + string t3 = _Theme.Text3.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + PlaylistElements[i].Text1.Text = t1; + PlaylistElements[i].Text2.Text = t2; + PlaylistElements[i].Text3.Text = t3; + for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) + { + PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); + if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) + PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); + } + e++; + } + else + { + PlaylistElements[i].Background.Visible = false; + PlaylistElements[i].Cover.Visible = false; + PlaylistElements[i].SelectSlide.Visible = false; + PlaylistElements[i].Text1.Visible = false; + PlaylistElements[i].Text2.Visible = false; + PlaylistElements[i].Text3.Visible = false; + } + } + } + } + + #region ThemeEdit + public void MoveElement(int stepX, int stepY) + { + Rect.X += stepX; + Rect.Y += stepY; + } + + public void ResizeElement(int stepW, int stepH) + { + Rect.W += stepW; + if (Rect.W <= 0) + Rect.W = 1; + + Rect.H += stepH; + if (Rect.H <= 0) + Rect.H = 1; + } + #endregion ThemeEdit + } +} From 2d400469cf7d6fa1902e1770c7d9670b77faede7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 21:38:37 +0200 Subject: [PATCH 05/67] Added first mouse-handling. RB to delete PlaylistEntry. --- Vocaluxe/Lib/Playlist/CPlaylist.cs | 5 ++ Vocaluxe/Menu/CPlaylist.cs | 81 ++++++++++++++++++++++++++++-- Vocaluxe/Screens/CScreenSong.cs | 11 ++++ 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index 86e5e320..dd77d8ff 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -228,5 +228,10 @@ namespace Vocaluxe.Lib.Playlist Songs.Add(song); } + + public void DeleteSong(int SongNr) + { + Songs.RemoveAt(SongNr); + } } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 3725196b..617ad876 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -39,14 +39,14 @@ namespace Vocaluxe.Menu class CPlaylist : IMenuElement { - struct PlaylistElementContent + class PlaylistElementContent { public EGameMode[] Modes; public int SongID; public EGameMode Mode; } - struct PlaylistElement + class PlaylistElement { public CStatic Cover; public CStatic Background; @@ -54,6 +54,7 @@ namespace Vocaluxe.Menu public CText Text2; public CText Text3; public CSelectSlide SelectSlide; + public int Content; } private SThemePlaylist _Theme; @@ -70,6 +71,7 @@ namespace Vocaluxe.Menu public int ActivePlaylistID = 0; public int Offset = 0; + public int ActiveHover = -1; public CPlaylist() { @@ -266,6 +268,76 @@ namespace Vocaluxe.Menu LoadTextures(); } + public bool HandleInput(KeyEvent kevent) + { + switch (kevent.Key) + { + } + return false; + } + + public bool HandleMouse(MouseEvent mevent) + { + if (CHelper.IsInBounds(Rect, mevent)) + { + if (mevent.Wheel > 0) + { + return true; + } + else if (mevent.Wheel < 0) + { + if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + { + Offset = Offset + mevent.Wheel; + return true; + } + if (Offset - mevent.Wheel >= 0) + { + Offset = Offset - mevent.Wheel; + return true; + } + } + + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundSColor; + ActiveHover = i; + } + else + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundColor; + } + //Delete Entry with RB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); + UpdatePlaylist(); + return true; + } + //Change order with holding LB + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1) + { + return true; + } + } + } + else + { + if (ActiveHover != -1) + { + PlaylistElements[ActiveHover].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[ActiveHover].Background.Color = BackgroundColor; + ActiveHover = -1; + } + } + return false; + } + private void PrepareList() { PlaylistElements.Clear(); @@ -292,6 +364,7 @@ namespace Vocaluxe.Menu en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; en.SelectSlide.Visible = true; + en.Content = -1; PlaylistElements.Add(en); } } @@ -340,6 +413,7 @@ namespace Vocaluxe.Menu { if (e < PlaylistElementContents.Count) { + PlaylistElements[i].Content = e; PlaylistElements[i].Background.Visible = true; PlaylistElements[i].Cover.Visible = true; PlaylistElements[i].SelectSlide.Visible = true; @@ -359,7 +433,7 @@ namespace Vocaluxe.Menu if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); } - e++; + e++; } else { @@ -369,6 +443,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text1.Visible = false; PlaylistElements[i].Text2.Visible = false; PlaylistElements[i].Text3.Visible = false; + PlaylistElements[i].Content = -1; } } } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9b18ab2f..55dd2abf 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -97,6 +97,12 @@ namespace Vocaluxe.Screens { base.HandleInput(KeyEvent); + + if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + { + return true; + } + if (!_SongOptionsActive) { @@ -255,6 +261,11 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); + if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + { + return true; + } + if (!_SongOptionsActive) { From 9a3e2653700bb0c0272b2d6db569ddfb964b69a5 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 9 Jul 2012 11:09:05 +0200 Subject: [PATCH 06/67] First keyboard-handling. Still buggy. --- Vocaluxe/Lib/Playlist/CPlaylist.cs | 16 +++++ Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 4 +- Vocaluxe/Menu/CPlaylist.cs | 105 ++++++++++++++++++++++++++++- Vocaluxe/Screens/CScreenSong.cs | 5 +- 5 files changed, 124 insertions(+), 9 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index dd77d8ff..47e59ca6 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -233,5 +233,21 @@ namespace Vocaluxe.Lib.Playlist { Songs.RemoveAt(SongNr); } + + public void SongDown(int SongNr) + { + if (SongNr != 0) + { + Songs.Reverse(SongNr - 1, 2); + } + } + + public void SongUp(int SongNr) + { + if (SongNr + 1 < Songs.Count) + { + Songs.Reverse(SongNr, 2); + } + } } } diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 8f7afe8d..8937df1f 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -43,7 +43,8 @@ namespace Vocaluxe.Menu _Type == EType.TStatic || _Type == EType.TSongMenu || _Type == EType.TLyric || - _Type == EType.TSingNote); + _Type == EType.TSingNote || + _Type == EType.TPlaylist); } } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index e27a7c51..386abe0a 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -1685,7 +1685,7 @@ namespace Vocaluxe.Menu _NameSelections[_Interactions[_Selection].Num].Selected = true; break; case EType.TPlaylist: - //_Playlists[_Interactions[_Selection].Num].Selected = true; + _Playlists[_Interactions[_Selection].Num].Selected = true; break; } } @@ -1716,7 +1716,7 @@ namespace Vocaluxe.Menu _NameSelections[_Interactions[_Selection].Num].Selected = false; break; case EType.TPlaylist: - //_Playlists[_Interactions[_Selection].Num].Selected = true; + _Playlists[_Interactions[_Selection].Num].Selected = false; break; } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 617ad876..fcd641cb 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.XPath; +using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; @@ -68,10 +69,12 @@ namespace Vocaluxe.Menu public SColorF BackgroundSColor; public bool Visible; + public bool Selected; public int ActivePlaylistID = 0; public int Offset = 0; public int ActiveHover = -1; + public int CurrentPlaylistElement = -1; public CPlaylist() { @@ -90,6 +93,7 @@ namespace Vocaluxe.Menu PlaylistElementContents = new List(); Visible = false; + Selected = false; } public void Init() @@ -236,6 +240,16 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++ ) { + if (i == ActiveHover) + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundSColor; + } + else + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundColor; + } PlaylistElements[i].Background.Draw(); PlaylistElements[i].Cover.Draw(); PlaylistElements[i].Text1.Draw(); @@ -270,8 +284,93 @@ namespace Vocaluxe.Menu public bool HandleInput(KeyEvent kevent) { - switch (kevent.Key) + if (Visible) { + switch (kevent.Key) + { + case Keys.Up: + if (CurrentPlaylistElement == -1) + CurrentPlaylistElement = 0; + else if (CurrentPlaylistElement - 1 > 0) + CurrentPlaylistElement--; + else if (CurrentPlaylistElement - 1 == 0) + { + CurrentPlaylistElement--; + if (Offset > 0) + { + Offset--; + Update(); + } + } + ActiveHover = CurrentPlaylistElement; + return true; + + case Keys.Down: + if (CurrentPlaylistElement == -1) + CurrentPlaylistElement = 0; + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) + { + CurrentPlaylistElement++; + } + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + { + if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) + { + Offset++; + Update(); + } + } + ActiveHover = CurrentPlaylistElement; + return true; + + case Keys.Delete: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); + UpdatePlaylist(); + return true; + } + return false; + + case Keys.PageUp: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement+Offset); + if (CurrentPlaylistElement - 1 > -1) + { + CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + } + else if(Offset > 0) + { + Offset--; + } + UpdatePlaylist(); + return true; + } + break; + + case Keys.PageDown: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement+Offset); + if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) + { + Offset++; + } + UpdatePlaylist(); + return true; + } + break; + } } return false; } @@ -306,6 +405,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; + CurrentPlaylistElement = -1; } else { @@ -330,9 +430,8 @@ namespace Vocaluxe.Menu { if (ActiveHover != -1) { - PlaylistElements[ActiveHover].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); - PlaylistElements[ActiveHover].Background.Color = BackgroundColor; ActiveHover = -1; + CurrentPlaylistElement = -1; } } return false; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 55dd2abf..39a8266f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -96,12 +96,11 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { base.HandleInput(KeyEvent); - + if (KeyEvent.Handled) + return true; if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) - { return true; - } if (!_SongOptionsActive) { From ad66fdb07b5f53a3ff5e2e55de777195ad8a2d5d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 10 Jul 2012 17:06:40 +0200 Subject: [PATCH 07/67] Forget to add new color-sheme. --- Output/Themes/Ambient/Skin Blue.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 3cb2b0db..7ddf916d 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -130,6 +130,12 @@ 0,969 1,000 + + 0,675 + 0,890 + 0,969 + 0,500 + 0,675 0,890 From 9b1e2b858032540c84fdc8535af854f43f9f9d5a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 10 Jul 2012 17:48:01 +0200 Subject: [PATCH 08/67] First part of fixing SelectSlide for Playlist. --- Output/Themes/Ambient/Screens/ScreenSong.xml | 6 +++--- Vocaluxe/Menu/CPlaylist.cs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 24f56698..1a140efe 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1127,13 +1127,13 @@ 54 30 - 0,00 + -1,02 20 20 - 110 + 235 30 - 0,00 + -1,02 20 20 diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index fcd641cb..2735f11c 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -457,6 +457,7 @@ namespace Vocaluxe.Menu en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; + en.SelectSlide.NumVisible = _Theme.SelectSlideGameMode.NumVisible; en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; From b007c79d22e427701bdfe5a819eb42e11fe7591a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 12:52:44 +0200 Subject: [PATCH 09/67] More input-handling. Keyboard doesn't work atm. --- Vocaluxe/Menu/CPlaylist.cs | 49 +++++++++++++++++++++------------ Vocaluxe/Menu/CSelectSlide.cs | 7 ++++- Vocaluxe/Screens/CScreenSong.cs | 6 ++-- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 2735f11c..3ddc6320 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -284,7 +284,7 @@ namespace Vocaluxe.Menu public bool HandleInput(KeyEvent kevent) { - if (Visible) + if (Selected) { switch (kevent.Key) { @@ -370,6 +370,22 @@ namespace Vocaluxe.Menu return true; } break; + + case Keys.Left: + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); + return true; + } + return false; + + case Keys.Right: + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); + return true; + } + return false; } } return false; @@ -377,7 +393,7 @@ namespace Vocaluxe.Menu public bool HandleMouse(MouseEvent mevent) { - if (CHelper.IsInBounds(Rect, mevent)) + if (CHelper.IsInBounds(Rect, mevent) && Visible) { if (mevent.Wheel > 0) { @@ -396,6 +412,14 @@ namespace Vocaluxe.Menu return true; } } + if (mevent.LB) + { + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); + return true; + } + } for (int i = 0; i < PlaylistElements.Count; i++) { @@ -405,13 +429,15 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; - CurrentPlaylistElement = -1; + CurrentPlaylistElement = i; } else { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundColor; } + //Hover for SelectSlide-Arrow + PlaylistElements[i].SelectSlide.ProcessMouseMove(mevent.X, mevent.Y); //Delete Entry with RB if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) { @@ -440,7 +466,7 @@ namespace Vocaluxe.Menu private void PrepareList() { PlaylistElements.Clear(); - for (int i = 0; i < (Rect.H / _Theme.EntryHeight); i++) + for (int i = 0; i < Math.Floor(Rect.H / _Theme.EntryHeight); i++) { PlaylistElement en = new PlaylistElement(); en.Background = new CStatic(_Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)); @@ -448,22 +474,10 @@ namespace Vocaluxe.Menu en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); - en.SelectSlide = new CSelectSlide(); + en.SelectSlide = (CSelectSlide)_Theme.SelectSlideGameMode.Clone(); en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); - en.SelectSlide.Color = _Theme.SelectSlideGameMode.Color; - en.SelectSlide.ColorArrow = _Theme.SelectSlideGameMode.ColorArrow; - en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; - en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; - en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; - en.SelectSlide.NumVisible = _Theme.SelectSlideGameMode.NumVisible; - en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; - en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; - en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; - en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; - en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; - en.SelectSlide.Visible = true; en.Content = -1; PlaylistElements.Add(en); } @@ -527,6 +541,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text1.Text = t1; PlaylistElements[i].Text2.Text = t2; PlaylistElements[i].Text3.Text = t3; + PlaylistElements[i].SelectSlide.Clear(); for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) { PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 126ec839..afa321c1 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -38,7 +38,7 @@ namespace Vocaluxe.Menu public EStyle TextStyle; } - class CSelectSlide : IMenuElement + class CSelectSlide : IMenuElement, ICloneable { private SThemeSelectSlide _Theme; private bool _ThemeLoaded; @@ -754,6 +754,11 @@ namespace Vocaluxe.Menu LoadTextures(); } + public object Clone() + { + return base.MemberwiseClone(); + } + #region ThemeEdit public void MoveElement(int stepX, int stepY) { diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 39a8266f..72e52066 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -95,11 +95,11 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - base.HandleInput(KeyEvent); - if (KeyEvent.Handled) + if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) return true; - if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + base.HandleInput(KeyEvent); + if (KeyEvent.Handled) return true; if (!_SongOptionsActive) From f31dd0903f8804fa8e7768a853af838e29c77832 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 13:18:44 +0200 Subject: [PATCH 10/67] First fix for keyboard-handling. --- Vocaluxe/Menu/CInteraction.cs | 3 +-- Vocaluxe/Menu/CPlaylist.cs | 42 ++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 8937df1f..74cfc641 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -43,8 +43,7 @@ namespace Vocaluxe.Menu _Type == EType.TStatic || _Type == EType.TSongMenu || _Type == EType.TLyric || - _Type == EType.TSingNote || - _Type == EType.TPlaylist); + _Type == EType.TSingNote ); } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 3ddc6320..0070f61b 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -71,6 +71,7 @@ namespace Vocaluxe.Menu public bool Visible; public bool Selected; + public bool changeOrder = false; public int ActivePlaylistID = 0; public int Offset = 0; public int ActiveHover = -1; @@ -290,9 +291,17 @@ namespace Vocaluxe.Menu { case Keys.Up: if (CurrentPlaylistElement == -1) + { CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement - 1 > 0) + { CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement - 1 == 0) { CurrentPlaylistElement--; @@ -301,18 +310,25 @@ namespace Vocaluxe.Menu Offset--; Update(); } + ActiveHover = CurrentPlaylistElement; + return true; } - ActiveHover = CurrentPlaylistElement; - return true; + return false; case Keys.Down: if (CurrentPlaylistElement == -1) + { CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) { if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) { CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + return true; } } else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) @@ -321,10 +337,11 @@ namespace Vocaluxe.Menu { Offset++; Update(); + ActiveHover = CurrentPlaylistElement; + return true; } } - ActiveHover = CurrentPlaylistElement; - return true; + return false; case Keys.Delete: if (CurrentPlaylistElement != -1) @@ -446,9 +463,22 @@ namespace Vocaluxe.Menu return true; } //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) { - return true; + changeOrder = true; + CurrentPlaylistElement = i; + } + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) + { + if (PlaylistElements.Count < CurrentPlaylistElement + 1) + { + } + else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + { + } + if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + { + } } } } From f40d250dc30a1ef77602da948a91a36bd37eae13 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 13:30:10 +0200 Subject: [PATCH 11/67] Changing of selectslide-values changes now game-mode. --- Vocaluxe/Menu/CPlaylist.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 0070f61b..abdd604a 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -391,7 +391,10 @@ namespace Vocaluxe.Menu case Keys.Left: if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } return false; @@ -399,7 +402,10 @@ namespace Vocaluxe.Menu case Keys.Right: if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } return false; @@ -433,7 +439,10 @@ namespace Vocaluxe.Menu { if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } } @@ -470,6 +479,7 @@ namespace Vocaluxe.Menu } else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) { + /* if (PlaylistElements.Count < CurrentPlaylistElement + 1) { } @@ -479,6 +489,7 @@ namespace Vocaluxe.Menu if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) { } + */ } } } From 9ddff4d56728514347d24ca8a59e973a69188584 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 14:17:34 +0200 Subject: [PATCH 12/67] Move Playlist-related elements (buttons, texts, statics) to playlist-element. --- Output/Themes/Ambient/Screens/ScreenSong.xml | 500 +++++++++---------- Vocaluxe/Menu/CButton.cs | 5 + Vocaluxe/Menu/CPlaylist.cs | 87 +++- Vocaluxe/Screens/CScreenSong.cs | 142 ++---- 4 files changed, 378 insertions(+), 356 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 1a140efe..6250bf88 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -72,38 +72,6 @@ 26 - - - Menu - - 970 - 40 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - Menu - - 970 - 550 - -1,00 - 295 - 40 - - - StaticColor - - - - Button @@ -245,194 +213,6 @@ - - - CloseIcon - - CloseIcon - - 1215 - 42 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SingIcon - - SingIcon - - 975 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SaveIcon - - SaveIcon - - 1175 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - DeleteIcon - - DeleteIcon - - 1215 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - 200 @@ -587,36 +367,6 @@ - - - 975 - 45 - - -1,01 - - 30 - - 220 - - - StaticColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - Button @@ -1087,6 +837,36 @@ + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + @@ -1103,6 +883,226 @@ + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + Button diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index d4b5d231..9e688fbb 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -262,6 +262,11 @@ namespace Vocaluxe.Menu } } + public void ProzessMouseMove(int x, int y) + { + Selected = CHelper.IsInBounds(Rect, x, y); + } + public void UnloadTextures() { Text.UnloadTextures(); diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index abdd604a..6a3902ee 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -32,8 +32,16 @@ namespace Vocaluxe.Menu public CText Text1; public CText Text2; public CText Text3; + public CText TextPlaylistHeader; public CStatic StaticCover; + public CStatic StaticPlaylistHeader; + public CStatic StaticPlaylistFooter; + + public CButton ButtonPlaylistClose; + public CButton ButtonPlaylistSave; + public CButton ButtonPlaylistDelete; + public CButton ButtonPlaylistSing; public CSelectSlide SelectSlideGameMode; } @@ -72,7 +80,7 @@ namespace Vocaluxe.Menu public bool Selected; public bool changeOrder = false; - public int ActivePlaylistID = 0; + public int ActivePlaylistID = -1; public int Offset = 0; public int ActiveHover = -1; public int CurrentPlaylistElement = -1; @@ -83,7 +91,14 @@ namespace Vocaluxe.Menu _Theme.Text1 = new CText(); _Theme.Text2 = new CText(); _Theme.Text3 = new CText(); + _Theme.TextPlaylistHeader = new CText(); _Theme.StaticCover = new CStatic(); + _Theme.StaticPlaylistFooter = new CStatic(); + _Theme.StaticPlaylistHeader = new CStatic(); + _Theme.ButtonPlaylistClose = new CButton(); + _Theme.ButtonPlaylistDelete = new CButton(); + _Theme.ButtonPlaylistSave = new CButton(); + _Theme.ButtonPlaylistSing = new CButton(); _Theme.SelectSlideGameMode = new CSelectSlide(); Rect = new SRectF(); @@ -141,12 +156,22 @@ namespace Vocaluxe.Menu _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart2", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart3", navigator, SkinIndex); + _ThemeLoaded &= _Theme.TextPlaylistHeader.LoadTheme(item, "TextPlaylistHeader", navigator, SkinIndex); _Theme.StringText1 = _Theme.Text1.Text; _Theme.StringText2 = _Theme.Text2.Text; _Theme.StringText3 = _Theme.Text3.Text; _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", navigator, SkinIndex); + + _ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", navigator, SkinIndex); + _ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", navigator, SkinIndex); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/EntryHeight", navigator, ref _Theme.EntryHeight); if (_ThemeLoaded) { @@ -258,6 +283,13 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text3.Draw(); PlaylistElements[i].SelectSlide.Draw(); } + _Theme.ButtonPlaylistSing.Draw(); + _Theme.ButtonPlaylistSave.Draw(); + _Theme.ButtonPlaylistDelete.Draw(); + _Theme.ButtonPlaylistClose.Draw(); + _Theme.StaticPlaylistHeader.Draw(); + _Theme.StaticPlaylistFooter.Draw(); + _Theme.TextPlaylistHeader.Draw(); } public void UnloadTextures() @@ -501,6 +533,34 @@ namespace Vocaluxe.Menu CurrentPlaylistElement = -1; } } + + if (ActivePlaylistID > -1) + { + _Theme.ButtonPlaylistClose.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSing.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSave.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistDelete.ProzessMouseMove(mevent.X, mevent.Y); + if (mevent.LB) + { + if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) + { + ClosePlaylist(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSing.Rect, mevent)) + { + StartPlaylistSongs(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSave.Rect, mevent)) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistDelete.Rect, mevent)) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + } + } return false; } @@ -528,6 +588,7 @@ namespace Vocaluxe.Menu { if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) { + _Theme.TextPlaylistHeader.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; ActivePlaylistID = PlaylistID; PlaylistElementContents.Clear(); for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) @@ -559,6 +620,30 @@ namespace Vocaluxe.Menu Update(); } + private void StartPlaylistSongs() + { + CGame.Reset(); + CGame.ClearSongs(); + + if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) + { + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + CGame.AddSong(CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID, CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode); + } + if (CGame.GetNumSongs() > 0) + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + + + private void ClosePlaylist() + { + Visible = false; + Selected = false; + ActivePlaylistID = -1; + } + public void Update() { if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 72e52066..de464dfd 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -25,23 +25,16 @@ namespace Vocaluxe.Screens private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; - private const string TextPlaylistHeader = "TextPlaylistHeader"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; - private const string ButtonPlaylistClose = "ButtonPlaylistClose"; - private const string ButtonPlaylistSing = "ButtonPlaylistSing"; - private const string ButtonPlaylistSave = "ButtonPlaylistSave"; - private const string ButtonPlaylistDelete = "ButtonPlaylistDelete"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; - private const string StaticPlaylistHeader = "StaticPlaylistHeader"; - private const string StaticPlaylistFooter = "StaticPlaylistFooter"; private const string SongMenu = "SongMenu"; private const string Playlist = "Playlist"; @@ -49,7 +42,6 @@ namespace Vocaluxe.Screens private bool _SearchActive = false; private bool _SongOptionsActive = false; - private int _OpenedPlaylist = -1; private List _AvailableGameModes; public CScreenSong() @@ -65,9 +57,9 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG, StaticPlaylistHeader, StaticPlaylistFooter }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle, TextPlaylistHeader }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonPlaylistClose, ButtonPlaylistSing, ButtonPlaylistSave, ButtonPlaylistDelete }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; _ThemeSongMenus = new string[] { SongMenu }; _ThemePlaylists = new string[] { Playlist }; @@ -81,15 +73,8 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; } @@ -221,25 +206,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -308,27 +294,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); - UpdatePlaylistNames(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].NumValues - 1; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist - else + else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -340,31 +325,6 @@ namespace Vocaluxe.Screens } } - if (_OpenedPlaylist > -1) - { - if (MouseEvent.LB && IsMouseOver(MouseEvent)) - { - if (Buttons[htButtons(ButtonPlaylistClose)].Selected) - { - ClosePlaylist(); - } - else if (Buttons[htButtons(ButtonPlaylistSing)].Selected) - { - StartPlaylistSongs(); - } - else if (Buttons[htButtons(ButtonPlaylistSave)].Selected) - { - CPlaylists.SavePlaylist(_OpenedPlaylist); - } - else if (Buttons[htButtons(ButtonPlaylistDelete)].Selected) - { - CPlaylists.DeletePlaylist(_OpenedPlaylist); - ClosePlaylist(); - UpdatePlaylistNames(); - } - } - } - return true; } @@ -374,15 +334,16 @@ namespace Vocaluxe.Screens CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); Playlists[htPlaylists(Playlist)].Init(); - if(_OpenedPlaylist != -1) - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) + Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); UpdatePlaylistNames(); } public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); - Playlists[htPlaylists(Playlist)].Visible = SongMenus[htSongMenus(SongMenu)].IsSmallView(); + if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) + CheckPlaylist(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) @@ -478,22 +439,6 @@ namespace Vocaluxe.Screens } } - private void StartPlaylistSongs() - { - CGame.Reset(); - CGame.ClearSongs(); - - if (_OpenedPlaylist > -1 && _OpenedPlaylist < CPlaylists.NumPlaylists) - { - for (int i = 0; i < CPlaylists.Playlists[_OpenedPlaylist].Songs.Count; i++) - { - CGame.AddSong(CPlaylists.Playlists[_OpenedPlaylist].Songs[i].SongID, CPlaylists.Playlists[_OpenedPlaylist].Songs[i].GameMode); - } - if (CGame.GetNumSongs() > 0) - CGraphics.FadeTo(EScreens.ScreenNames); - } - } - private void StartRandomAllSongs() { CGame.Reset(); @@ -643,38 +588,25 @@ namespace Vocaluxe.Screens } } + public void CheckPlaylist() + { + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1) + ClosePlaylist(); + } + private void OpenPlaylist(int PlaylistID) { if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) { - _OpenedPlaylist = PlaylistID; - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].LoadPlaylist(PlaylistID); SongMenus[htSongMenus(SongMenu)].SetSmallView(true); Playlists[htPlaylists(Playlist)].Visible = true; - Statics[htStatics(StaticPlaylistHeader)].Visible = true; - Statics[htStatics(StaticPlaylistFooter)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Text = CPlaylists.Playlists[PlaylistID].PlaylistName; - Buttons[htButtons(ButtonPlaylistClose)].Visible = true; - Buttons[htButtons(ButtonPlaylistSing)].Visible = true; - Buttons[htButtons(ButtonPlaylistSave)].Visible = true; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = true; } } private void ClosePlaylist() { - _OpenedPlaylist = -1; SongMenus[htSongMenus(SongMenu)].SetSmallView(false); - Playlists[htPlaylists(Playlist)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Text = String.Empty; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; } private void UpdatePlaylistNames() From d41fd5059792dc1d25fba1f8b38602ab9f954310 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 14:29:21 +0200 Subject: [PATCH 13/67] Fix loading of playlist. --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index de464dfd..38d0431f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -299,7 +299,7 @@ namespace Vocaluxe.Screens if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } From dbb51574205b4a5da5bbc0aed7cc6dc0d77ee64d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 19:46:23 +0200 Subject: [PATCH 14/67] Try to fix song-bug (don't work yet) --- Vocaluxe/GameModes/CGameMode.cs | 3 ++- Vocaluxe/Lib/Song/CNotes.cs | 8 +++++++- Vocaluxe/Lib/Song/CSong.cs | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 6dfe5ca5..2560e98d 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -247,7 +247,8 @@ namespace Vocaluxe.GameModes { if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { - CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + CSong song = (CSong)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Clone(); + song.Notes = (CNotes)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Notes.Clone(); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index d38dc820..ad33380a 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -6,7 +6,7 @@ using Vocaluxe.Base; namespace Vocaluxe.Lib.Song { - class CNotes + class CNotes : ICloneable { private List _Lines = new List(); @@ -79,6 +79,11 @@ namespace Vocaluxe.Lib.Song lines.SetMedley(StartBeat, EndBeat); } } + + public object Clone() + { + return base.MemberwiseClone(); + } } public enum ENoteType @@ -549,6 +554,7 @@ namespace Vocaluxe.Lib.Song updateMinMaxBeat(note); } } + #endregion Methods } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 2cb63c36..22a24fa0 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -48,7 +48,7 @@ namespace Vocaluxe.Lib.Song } } - class CSong + class CSong : ICloneable { private bool _CoverLoaded = false; private bool _NotesLoaded = false; @@ -980,5 +980,10 @@ namespace Vocaluxe.Lib.Song ShortEnd = stop; } + + public object Clone() + { + return base.MemberwiseClone(); + } } } From 5062eb4b168eb191b351409cad7c71c2fff0bbf6 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 20:00:47 +0200 Subject: [PATCH 15/67] Fixed song-bug. Thx Darkice. --- Vocaluxe/GameModes/CGameMode.cs | 6 ++++-- Vocaluxe/Lib/Song/CNotes.cs | 7 +------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 2560e98d..52355046 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -108,6 +108,7 @@ namespace Vocaluxe.GameModes protected List _SongQueque; protected int _CurrentSong; protected CPoints _Points; + private CSong CopiedSong; #region Implementation public virtual void Init() @@ -228,6 +229,7 @@ namespace Vocaluxe.GameModes _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_MEDLEY, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_SHORTSONG); + CSongs.AllSongs[_CurrentSong] = CopiedSong; } _CurrentSong++; } @@ -247,8 +249,8 @@ namespace Vocaluxe.GameModes { if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { - CSong song = (CSong)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Clone(); - song.Notes = (CNotes)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Notes.Clone(); + CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + CopiedSong = (CSong)song.Clone(); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index ad33380a..d6203ca0 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -6,7 +6,7 @@ using Vocaluxe.Base; namespace Vocaluxe.Lib.Song { - class CNotes : ICloneable + class CNotes { private List _Lines = new List(); @@ -79,11 +79,6 @@ namespace Vocaluxe.Lib.Song lines.SetMedley(StartBeat, EndBeat); } } - - public object Clone() - { - return base.MemberwiseClone(); - } } public enum ENoteType From 435a205f57c2805f245d29be9cddd3d0f8e03985 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 21:08:12 +0200 Subject: [PATCH 16/67] Really fixed song-bug. Thx brunzel! --- Vocaluxe/GameModes/CGameMode.cs | 4 +--- Vocaluxe/Lib/Song/CSong.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 52355046..1cbbb771 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -108,7 +108,6 @@ namespace Vocaluxe.GameModes protected List _SongQueque; protected int _CurrentSong; protected CPoints _Points; - private CSong CopiedSong; #region Implementation public virtual void Init() @@ -229,7 +228,6 @@ namespace Vocaluxe.GameModes _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_MEDLEY, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_SHORTSONG); - CSongs.AllSongs[_CurrentSong] = CopiedSong; } _CurrentSong++; } @@ -250,7 +248,7 @@ namespace Vocaluxe.GameModes if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); - CopiedSong = (CSong)song.Clone(); + song = new CSong(song); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 22a24fa0..34690afd 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -48,7 +48,7 @@ namespace Vocaluxe.Lib.Song } } - class CSong : ICloneable + class CSong { private bool _CoverLoaded = false; private bool _NotesLoaded = false; From bc9d1882cf5794e4f0c33f418d211c3738de32be Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 12 Jul 2012 15:08:32 +0200 Subject: [PATCH 17/67] Added skip-function. Press CTRL + S or go to pause-menu. --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Output/Themes/Ambient/Screens/ScreenSing.xml | 65 +++++++++++++++++-- .../Themes/Changelog/Changelog_ScreenSing.txt | 6 ++ Vocaluxe/Base/CGame.cs | 5 ++ Vocaluxe/Screens/CScreenSing.cs | 27 ++++++-- 6 files changed, 97 insertions(+), 8 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 845b01ae..6a7c86c7 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -135,6 +135,7 @@ Pause Lied beenden Fortfahren + Lied überspringen Auswertung Bewertung diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 1639ea9d..9b61a467 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -135,6 +135,7 @@ Pause Stop singing Continue + Skip this song Scores Rating diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 4d33b2f0..1fa77550 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -1,7 +1,7 @@  - 4 + 5 None @@ -2333,7 +2333,7 @@ Button - 670 + 775 300 -2,11 150 @@ -2390,7 +2390,7 @@ Button - 460 + 355 300 -2,11 150 @@ -2441,6 +2441,63 @@ 26 + + + Button + + Button + + 565 + 300 + -2,11 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSING_BUTTON_SKIP + + + + + + 10 + 26 + + + + + + 10 + 26 + + 637 @@ -2656,4 +2713,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenSing.txt b/Output/Themes/Changelog/Changelog_ScreenSing.txt index 22c5fa99..6b857430 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSing.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSing.txt @@ -1,5 +1,11 @@ ScreenSing +++++++++++ +Version 5: + +Add: + + ++++++++++ Version 4: Added Elements for 6-player-singing! diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 53f1b1c3..8e136d32 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -190,6 +190,11 @@ namespace Vocaluxe.Base return _GameMode.GetPoints(); } + public static int NumRounds + { + get { return _GameMode.GetNumSongs(); } + } + public static int NumPlayer { get { return _NumPlayer; } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 5d9848b2..908f0b92 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -17,7 +17,7 @@ namespace Vocaluxe.Screens class CScreenSing : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 4; + const int ScreenVersion = 5; struct TimeRect { @@ -51,6 +51,7 @@ namespace Vocaluxe.Screens private const string ButtonCancel = "ButtonCancel"; private const string ButtonContinue = "ButtonContinue"; + private const string ButtonSkip = "ButtonSkip"; private const string LyricMain = "LyricMain"; private const string LyricSub = "LyricSub"; @@ -127,6 +128,7 @@ namespace Vocaluxe.Screens List buttons = new List(); buttons.Add(ButtonCancel); buttons.Add(ButtonContinue); + buttons.Add(ButtonSkip); _ThemeButtons = buttons.ToArray(); _ThemeLyrics = new string[] { LyricMain, LyricSub, LyricMainDuet, LyricSubDuet, LyricMainTop, LyricSubTop }; @@ -200,12 +202,21 @@ namespace Vocaluxe.Screens SetVisuability(); break; + case Keys.S: + if(CGame.NumRounds > CGame.RoundNr) + if(KeyEvent.ModCTRL) + LoadNextSong(); + break; + case Keys.Enter: if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) - TogglePause(); - + TogglePause(); if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) - Stop(); + Stop(); + if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + { + LoadNextSong(); + } break; } } @@ -232,6 +243,11 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) Stop(); + if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + { + LoadNextSong(); + TogglePause(); + } } @@ -708,11 +724,14 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; + if (CGame.NumRounds > CGame.RoundNr) + Buttons[htButtons(ButtonSkip)].Visible = true; CSound.Pause(_CurrentStream); }else { Buttons[htButtons(ButtonCancel)].Visible = false; Buttons[htButtons(ButtonContinue)].Visible = false; + Buttons[htButtons(ButtonSkip)].Visible = false; CSound.Play(_CurrentStream); } } From 53ab3fd667eea8c3d2266835b6f8f75c130b725e Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 12 Jul 2012 16:03:09 +0200 Subject: [PATCH 18/67] Added overall score to ScreenScore. --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Vocaluxe/Screens/CScreenScore.cs | 76 ++++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 6a7c86c7..51994228 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -141,6 +141,7 @@ Bewertung Punkte Schwierigkeit + Gesamtpunktzahl Highscore diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 9b61a467..915d5efb 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -141,6 +141,7 @@ Rating Points Difficulty + Overall score Highscore diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index 21b0a92f..af44c2aa 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -117,9 +117,23 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { - SPlayer[] player = new SPlayer[CGame.NumPlayer]; - player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + if (_Round != 0) + player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + else { + for (int i = 0; i < CGame.NumRounds; i++) + { + SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); + for (int p = 0; p < player.Length; p++) + { + player[p].Points += points[p].Points; + } + } + for (int p = 0; p < player.Length; p++) + { + player[p].Points = (int)(player[p].Points/CGame.NumRounds); + } + } for (int p = 0; p < player.Length; p++) { if (StaticPointsBarDrawnPoints[p] < player[p].Points) @@ -244,18 +258,42 @@ namespace Vocaluxe.Screens private void UpdateRatings() { - CSong song = CGame.GetSong(_Round); - if (song == null) - return; - - Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; - if (_Points.NumRounds > 1) - { - Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; - } - SPlayer[] player = new SPlayer[CGame.NumPlayer]; - player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + if (_Round != 0) + { + CSong song = CGame.GetSong(_Round); + if (song == null) + return; + + Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; + if (_Points.NumRounds > 1) + { + Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; + } + player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + } + else + { + Texts[htTexts(TextSong)].Text = "TR_SCREENSCORE_OVERALLSCORE"; + for (int i = 0; i < CGame.NumRounds; i++) + { + SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); + for (int p = 0; p < player.Length; p++) + { + if (i < 1) + { + player[p].ProfileID = points[p].ProfileID; + player[p].Name = points[p].Name; + player[p].Difficulty = points[p].Difficulty; + } + player[p].Points += points[p].Points; + } + } + for (int p = 0; p < player.Length; p++) + { + player[p].Points = (int)(player[p].Points / CGame.NumRounds); + } + } for (int p = 0; p < player.Length; p++) { Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; @@ -315,11 +353,21 @@ namespace Vocaluxe.Screens private void ChangeRound(int Num) { - if ((_Round + Num) <= _Points.NumRounds && (_Round + Num) > 0) + if ((_Round + Num) <= _Points.NumRounds && (_Round + Num) > 0 && _Round != 0) { _Round += Num; UpdateRatings(); } + else if(Num > 0 && _Round != 0 && CGame.NumRounds > 1) + { + _Round = 0; + UpdateRatings(); + } + else if (Num < 0 && _Round == 0) + { + _Round = CGame.NumRounds; + UpdateRatings(); + } } } } \ No newline at end of file From 6aaa308e39d20e5a34c55fcc3ccd568ec088ed81 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 13 Jul 2012 14:14:26 +0200 Subject: [PATCH 19/67] Fix scrolling. --- Vocaluxe/Menu/CPlaylist.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 6a3902ee..f64a5ddf 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -452,18 +452,20 @@ namespace Vocaluxe.Menu { if (mevent.Wheel > 0) { + if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + { + Offset = Offset + mevent.Wheel; + Update(); + return true; + } return true; } else if (mevent.Wheel < 0) { - if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + if (Offset + mevent.Wheel >= 0) { Offset = Offset + mevent.Wheel; - return true; - } - if (Offset - mevent.Wheel >= 0) - { - Offset = Offset - mevent.Wheel; + Update(); return true; } } From ebef44745a9d46e17151e6fd1ff543b6feb32f06 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 20 Jul 2012 11:52:38 +0200 Subject: [PATCH 20/67] Added SText to buttons. --- Vocaluxe/Menu/CButton.cs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index d4b5d231..a43143fd 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -30,7 +30,9 @@ namespace Vocaluxe.Menu public SColorF Color; public SColorF SColor; + public bool SelText; public CText Text; + public CText SText; public bool Reflection; public float ReflectionSpace; @@ -60,7 +62,9 @@ namespace Vocaluxe.Menu Color = new SColorF(); SColor = new SColorF(); + SelText = false; Text = new CText(); + SText = new CText(); Selected = false; Visible = true; @@ -113,6 +117,13 @@ namespace Vocaluxe.Menu _ThemeLoaded &= Text.LoadTheme(item, "Text", navigator, SkinIndex, true); Text.Z = Rect.Z; + if (CHelper.ItemExistsInXML(item + "/SText", navigator)) + { + SelText = true; + _ThemeLoaded &= SText.LoadTheme(item, "SText", navigator, SkinIndex, true); + SText.Z = Rect.Z; + } + //Reflections if (CHelper.ItemExistsInXML(item + "/Reflection", navigator)) @@ -189,6 +200,8 @@ namespace Vocaluxe.Menu } Text.SaveTheme(writer); + if (SelText) + SText.SaveTheme(writer); writer.WriteComment(" If exists:"); writer.WriteComment(" : Reflection Space"); @@ -240,25 +253,34 @@ namespace Vocaluxe.Menu { texture = CTheme.GetSkinTexture(_Theme.TextureName); CDraw.DrawTexture(texture, Rect, Color); + Text.DrawRelative(Rect.X, Rect.Y); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, Color, Rect, ReflectionSpace, ReflectionHeight); + Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); } } - else + else if(!SelText) { texture = CTheme.GetSkinTexture(_Theme.STextureName); CDraw.DrawTexture(texture, Rect, SColor); + Text.DrawRelative(Rect.X, Rect.Y); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight); + Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); } } - - Text.DrawRelative(Rect.X, Rect.Y); - if (Reflection) + else if(SelText) { - Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); + texture = CTheme.GetSkinTexture(_Theme.STextureName); + CDraw.DrawTexture(texture, Rect, SColor); + SText.DrawRelative(Rect.X, Rect.Y); + if (Reflection) + { + CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight); + SText.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); + } } } From 4c07e89904a830ce29e7a06c51c7ebb6e6022b53 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 20 Jul 2012 12:10:32 +0200 Subject: [PATCH 21/67] Fix wrong assignment of keys. --- Output/Readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Output/Readme.txt b/Output/Readme.txt index 38fc134a..1ec5c587 100644 --- a/Output/Readme.txt +++ b/Output/Readme.txt @@ -109,7 +109,8 @@ Vocaluxe.exe -ConfigFile MyConfig.xml -ScoreFile C:\Vocaluxe\Highscores\MyHighsc Songscreen [CTRL] + [R] to select a random song [F3] to open/close the song search menu -[A] to sing all songs from a category +[A] to sing all songs +[SHIFT] + [A] to sing all songs from a category ================================= From 65b76df0f7517e52000908055cc98c0ad5bd9c67 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 12:17:00 +0200 Subject: [PATCH 22/67] Added DrawColorReflection-Method. Buggy with OpenGL - Need some help! --- Vocaluxe/Base/CDraw.cs | 5 ++++ Vocaluxe/Lib/Draw/CDirect3D.cs | 13 +++++++++ Vocaluxe/Lib/Draw/CDrawWinForm.cs | 5 ++++ Vocaluxe/Lib/Draw/COpenGL.cs | 48 +++++++++++++++++++++++++++++++ Vocaluxe/Lib/Draw/IDraw.cs | 1 + 5 files changed, 72 insertions(+) diff --git a/Vocaluxe/Base/CDraw.cs b/Vocaluxe/Base/CDraw.cs index d1743b0a..e468162e 100644 --- a/Vocaluxe/Base/CDraw.cs +++ b/Vocaluxe/Base/CDraw.cs @@ -117,6 +117,11 @@ namespace Vocaluxe.Base _Draw.DrawColor(color, rect); } + public static void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + _Draw.DrawColorReflection(color, rect, space, height); + } + public static void ClearScreen() { _Draw.ClearScreen(); diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 3141d237..492834c9 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -836,6 +836,19 @@ namespace Vocaluxe.Lib.Draw { DrawTexture(_BlankTexture, rect, color); } + + /// + /// Draws reflection of a colored rectangle + /// + /// The color in which the rectangle will be drawn in + /// The coordinates in a SRectF struct + /// The space between the texture and the reflection + /// The height of the reflection + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + DrawTextureReflection(_BlankTexture, rect, color, rect, space, height); + } + #endregion Basic Draw Methods #region Textures #region adding diff --git a/Vocaluxe/Lib/Draw/CDrawWinForm.cs b/Vocaluxe/Lib/Draw/CDrawWinForm.cs index c94f0073..51cc0c4f 100644 --- a/Vocaluxe/Lib/Draw/CDrawWinForm.cs +++ b/Vocaluxe/Lib/Draw/CDrawWinForm.cs @@ -352,6 +352,11 @@ namespace Vocaluxe.Lib.Draw } + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + + } + public STexture AddTexture(Bitmap bmp) { Bitmap bmp2 = new Bitmap(bmp); diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 54ee1fcf..0ae4ad0f 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -661,6 +661,54 @@ namespace Vocaluxe.Lib.Draw GL.Disable(EnableCap.Blend); } + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + float rx1 = rect.X; + float rx2 = rect.X + rect.W; + float ry1 = rect.Y + rect.H + space; + float ry2 = rect.Y + rect.H + space + height; + + if (rx1 < rect.X) + rx1 = rect.X; + + if (rx2 > rect.X + rect.W) + rx2 = rect.X + rect.W; + + if (ry1 < rect.Y + space) + ry1 = rect.Y + space; + + if (ry2 > rect.Y + rect.H + space + height) + ry2 = rect.Y + rect.H + space + height; + + GL.Enable(EnableCap.Blend); + + if (rect.Rotation != 0f) + { + GL.Translate(0.5f, 0.5f, 0); + GL.Rotate(-rect.Rotation, 0f, 0f, 1f); + GL.Translate(-0.5f, -0.5f, 0); + } + + GL.Begin(BeginMode.Quads); + + GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha); + GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, 0f); + GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, 0f); + GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha); + GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset); + + GL.End(); + + GL.Disable(EnableCap.Blend); + + } + #endregion Basic Draw Methods #region Textures diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs index 2f8bbc82..9a7bf1d6 100644 --- a/Vocaluxe/Lib/Draw/IDraw.cs +++ b/Vocaluxe/Lib/Draw/IDraw.cs @@ -125,6 +125,7 @@ namespace Vocaluxe.Lib.Draw // Basic Draw Methods void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2); void DrawColor(SColorF color, SRectF rect); + void DrawColorReflection(SColorF color, SRectF rect, float space, float height); void ClearScreen(); STexture CopyScreen(); From 2484c52e08fb3770da54efc715dc0a79bf3fb6b7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 12:21:39 +0200 Subject: [PATCH 23/67] Move Equalizer-Element to Screen-Files. Still some work left. --- Vocaluxe/Menu/CEqualizer.cs | 324 +++++++++++++++++++++++ Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 102 ++++++- Vocaluxe/Screens/CScreenOptionsRecord.cs | 114 +------- Vocaluxe/Vocaluxe.csproj | 1 + 5 files changed, 440 insertions(+), 104 deletions(-) create mode 100644 Vocaluxe/Menu/CEqualizer.cs diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs new file mode 100644 index 00000000..a33641b4 --- /dev/null +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -0,0 +1,324 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu +{ + enum EEqualizerStyle + { + Bars, + Collums + } + + struct SThemeEqualizer + { + public string Name; + + public string ColorName; + public string MaxColorName; + public string TextureName; + + public int NumBars; + + public EEqualizerStyle Style; + public EOffOn DrawNegative; + } + + class CEqualizer : IMenuElement + { + private SThemeEqualizer _Theme; + private bool _ThemeLoaded; + + public SRectF Rect; + public SColorF Color; + public SColorF MaxColor; + public float Space; + + public bool Reflection; + public float ReflectionSpace; + public float ReflectionHeight; + + public bool Selected; + public bool Visible; + public bool ScreenHandles; + + private float[] _Bars; + + public CEqualizer() + { + _Theme = new SThemeEqualizer(); + _ThemeLoaded = false; + + Rect = new SRectF(); + Color = new SColorF(); + MaxColor = new SColorF(); + + Selected = false; + Visible = true; + ScreenHandles = false; + + Reflection = false; + ReflectionSpace = 0f; + ReflectionHeight = 0f; + } + + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) + { + string item = XmlPath + "/" + ElementName; + _ThemeLoaded = true; + + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/Skin", navigator, ref _Theme.TextureName, String.Empty); + + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref Rect.X); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref Rect.Y); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref Rect.Z); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref Rect.W); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref Rect.H); + + _ThemeLoaded &= CHelper.TryGetIntValueFromXML(item + "/NumBars", navigator, ref _Theme.NumBars); + + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Space", navigator, ref Space); + + _ThemeLoaded &= CHelper.TryGetEnumValueFromXML(item + "/Style", navigator, ref _Theme.Style); + + _ThemeLoaded &= CHelper.TryGetEnumValueFromXML(item + "/DrawNegative", navigator, ref _Theme.DrawNegative); + + if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/R", navigator, ref Color.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/G", navigator, ref Color.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/B", navigator, ref Color.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/A", navigator, ref Color.A); + } + + if (CHelper.GetValueFromXML(item + "/MaxColor", navigator, ref _Theme.MaxColorName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxR", navigator, ref MaxColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxG", navigator, ref MaxColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxB", navigator, ref MaxColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxA", navigator, ref MaxColor.A); + } + + //Reflection + if (CHelper.ItemExistsInXML(item + "/Reflection", navigator)) + { + Reflection = true; + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Reflection/Space", navigator, ref ReflectionSpace); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Reflection/Height", navigator, ref ReflectionHeight); + } + else + Reflection = false; + + if (_ThemeLoaded) + { + _Theme.Name = ElementName; + _Bars = new float[_Theme.NumBars]; + LoadTextures(); + } + return _ThemeLoaded; + } + + public bool SaveTheme(XmlWriter writer) + { + if (_ThemeLoaded) + { + writer.WriteStartElement(_Theme.Name); + + writer.WriteComment(": Texture name"); + writer.WriteElementString("Skin", _Theme.TextureName); + + writer.WriteComment(", , , , : Equalizer position, width and height"); + writer.WriteElementString("X", Rect.X.ToString("#0")); + writer.WriteElementString("Y", Rect.Y.ToString("#0")); + writer.WriteElementString("Z", Rect.Z.ToString("#0.00")); + writer.WriteElementString("W", Rect.W.ToString("#0")); + writer.WriteElementString("H", Rect.H.ToString("#0")); + + writer.WriteComment(": Number of equalizer-elements."); + writer.WriteElementString("NumBars", _Theme.NumBars.ToString("#0")); + writer.WriteComment(": Space between equalizer-elements."); + writer.WriteElementString("Space", Space.ToString("#0.00")); + writer.WriteComment(" + ButtonColor + ButtonSColor + TR_CONFIG_OFF + + + + + 10 + 26 + + + + Invisible + 400 + 400 + 230 + 150 + -1,00 + 10 + 2,00 + + ButtonColor + ButtonSColor + TR_CONFIG_OFF + + + + + 10 + 26 + + - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt b/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt new file mode 100644 index 00000000..89d9465c --- /dev/null +++ b/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt @@ -0,0 +1,9 @@ +ScreenOptionsRecord + +++++++++++ +Version 2: + +Add: + and . +This is a new theme-element. Check ScreenOptionsRecord.xml for style-possibilities. +++++++++++ \ No newline at end of file diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 39c96c94..9cf27630 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -21,7 +21,7 @@ namespace Vocaluxe.Screens class CScreenOptionsRecord : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 1; + const int ScreenVersion = 2; private const float MaxDelayTime = 1f; private const string SelectSlideRecordDevices = "SelectSlideRecordDevices"; From df8f2c10d236e111ab36ae13f7dde95dae440bd2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 14:14:47 +0200 Subject: [PATCH 25/67] Added equalizers to ScreenNames to show mic-input. Should be useful with more than 2 mics... --- Output/Themes/Ambient/Screens/ScreenNames.xml | 166 +++++++++++++++++- .../Changelog/Changelog_ScreenNames.txt | 5 + Vocaluxe/Menu/CEqualizer.cs | 68 +++---- Vocaluxe/Screens/CScreenNames.cs | 27 ++- 4 files changed, 218 insertions(+), 48 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index c1ac532c..6c387b93 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -1,7 +1,7 @@  - 2 + 3 Video @@ -738,5 +738,167 @@ + + + Invisible + + 21 + 152 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player1Dim2 + + + Player1Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 21 + 307 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player2Dim2 + + + Player2Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 21 + 467 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player3Dim2 + + + Player3Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1213 + 152 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player4Dim2 + + + Player4Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1213 + 307 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player5Dim2 + + + Player5Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1213 + 467 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player6Dim2 + + + Player6Dim + + TR_CONFIG_OFF + + + + - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index 47d04016..60cea8b5 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -1,5 +1,10 @@ SceenNames +++++++++++ +Version 3: + + (One Equalizer for each player): Equalizer shows input from assigned mic for this player. + ++++++++++ Version 2: diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index a33641b4..2f82759c 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -127,6 +127,10 @@ namespace Vocaluxe.Menu { _Theme.Name = ElementName; _Bars = new float[_Theme.NumBars]; + for (int i = 0; i < _Bars.Length; i++) + { + _Bars[i] = 0f; + } LoadTextures(); } return _ThemeLoaded; @@ -170,18 +174,18 @@ namespace Vocaluxe.Menu writer.WriteElementString("B", Color.B.ToString("#0.00")); writer.WriteElementString("A", Color.A.ToString("#0.00")); } - writer.WriteComment(": Equalizer color from ColorScheme (high priority)"); - writer.WriteComment("or , , , (lower priority)"); + writer.WriteComment(": Equalizer color for maximal volume from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); if (_Theme.ColorName != String.Empty) { - writer.WriteElementString("Color", _Theme.ColorName); + writer.WriteElementString("MaxColor", _Theme.ColorName); } else { - writer.WriteElementString("R", Color.R.ToString("#0.00")); - writer.WriteElementString("G", Color.G.ToString("#0.00")); - writer.WriteElementString("B", Color.B.ToString("#0.00")); - writer.WriteElementString("A", Color.A.ToString("#0.00")); + writer.WriteElementString("MaxR", Color.R.ToString("#0.00")); + writer.WriteElementString("MaxG", Color.G.ToString("#0.00")); + writer.WriteElementString("MaxB", Color.B.ToString("#0.00")); + writer.WriteElementString("MaxA", Color.A.ToString("#0.00")); } writer.WriteComment(" If exists:"); @@ -207,11 +211,10 @@ namespace Vocaluxe.Menu return; for (int i = 0; i < _Bars.Length; i++) { - if (weights.Length > i){ - _Bars[i] = weights[i]; + _Bars[i] = 1f - weights[i]; if (_Theme.DrawNegative == EOffOn.TR_CONFIG_OFF && weights[i] < 0) - _Bars[i] = 0f; + _Bars[i] = (1f + weights[i]); } else _Bars[i] = 0f; @@ -234,7 +237,7 @@ namespace Vocaluxe.Menu if (_Bars == null) return; - float dx = Rect.W / _Bars.Length + Space; + float dx = (Rect.W ) / _Bars.Length; int max = _Bars.Length - 1; float maxB = _Bars[max]; for (int i = 0; i < _Bars.Length - 1; i++) @@ -246,40 +249,19 @@ namespace Vocaluxe.Menu } } - switch (_Theme.Style){ - case EEqualizerStyle.Collums: - for (int i = 0; i < _Bars.Length; i++) - { - SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); - SColorF color = Color; - if (i == max) - { - color = MaxColor; - } + for (int i = 0; i < _Bars.Length; i++) + { + SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); + SColorF color = Color; + if (i == max) + { + color = MaxColor; + } - CDraw.DrawColor(color, bar); + CDraw.DrawColor(color, bar); - if (Reflection) - CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); - } - break; - - case EEqualizerStyle.Bars: - for (int i = 0; i < _Bars.Length; i++) - { - SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); - SColorF color = Color; - if (i == max) - { - color = MaxColor; - } - - CDraw.DrawColor(color, bar); - - if (Reflection) - CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); - } - break; + if (Reflection) + CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 10258aca..9c8962e4 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -12,7 +12,7 @@ namespace Vocaluxe.Screens class CScreenNames : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 2; + const int ScreenVersion = 3; private CStatic chooseAvatarStatic; private int OldMouseX; @@ -29,6 +29,7 @@ namespace Vocaluxe.Screens private readonly string[] StaticPlayer = new string[] { "StaticPlayer1", "StaticPlayer2", "StaticPlayer3", "StaticPlayer4", "StaticPlayer5", "StaticPlayer6" }; private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" }; private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" }; + private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" }; private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer]; private bool selectingMouseActive = false; @@ -84,6 +85,10 @@ namespace Vocaluxe.Screens texts.Add(NameSelection); _ThemeNameSelections = texts.ToArray(); + texts.Clear(); + texts.AddRange(EqualizerPlayer); + _ThemeEqualizers = texts.ToArray(); + chooseAvatarStatic = new CStatic(); chooseAvatarStatic.Visible = false; } @@ -503,13 +508,18 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { - + for (int i = 1; i <= CGame.NumPlayer; i++) + { + CSound.AnalyzeBuffer((i-1)); + Equalizers[htEqualizer("EqualizerPlayer" + i)].Update(CSound.ToneWeigth((i-1))); + } return true; } public override void OnShow() { base.OnShow(); + CSound.RecordStart(); NameSelections[htNameSelections(NameSelection)].Init(); @@ -531,6 +541,12 @@ namespace Vocaluxe.Screens SetInteractionToButton(Buttons[htButtons(ButtonStart)]); } + public override void OnClose() + { + base.OnClose(); + CSound.RecordStop(); + } + public override bool Draw() { base.Draw(); @@ -539,7 +555,10 @@ namespace Vocaluxe.Screens { chooseAvatarStatic.Draw(); } - + for (int i = 1; i <= CGame.NumPlayer; i++) + { + Equalizers[htEqualizer("EqualizerPlayer" + i)].Draw(); + } return true; } @@ -591,12 +610,14 @@ namespace Vocaluxe.Screens { Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString(); } + Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true; } else { Statics[htStatics("StaticPlayer" + i)].Visible = false; Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; Texts[htTexts("TextPlayer" + i)].Visible = false; + Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; } } CConfig.SaveConfig(); From c40f07c2a1f1ae11c3834d9ed38cdc92e05cf2e7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 17:44:22 +0200 Subject: [PATCH 26/67] Fix DrawColorReflection (thx Darkice) --- Vocaluxe/Lib/Draw/COpenGL.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 0ae4ad0f..06a09e95 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -663,6 +663,10 @@ namespace Vocaluxe.Lib.Draw public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) { + + if (rect.H < height) + height = rect.H; + float rx1 = rect.X; float rx2 = rect.X + rect.W; float ry1 = rect.Y + rect.H + space; @@ -680,6 +684,7 @@ namespace Vocaluxe.Lib.Draw if (ry2 > rect.Y + rect.H + space + height) ry2 = rect.Y + rect.H + space + height; + GL.Enable(EnableCap.Blend); if (rect.Rotation != 0f) From 1cca599a74ea1cda67567f40e035d3025aba2070 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 17:50:50 +0200 Subject: [PATCH 27/67] Equalizers could only used, when they are handled by screen. Later we will give possibility to add "normal" equalizers which shows bg-music. --- Vocaluxe/Menu/CMenu.cs | 3 ++- Vocaluxe/Screens/CScreenNames.cs | 5 +++++ Vocaluxe/Screens/CScreenOptionsRecord.cs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index ed731ad2..3677b369 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -1911,7 +1911,8 @@ namespace Vocaluxe.Menu case EType.TEqualizer: if (!_Equalizers[_Interactions[interaction].Num].ScreenHandles) { - //_Equalizers[_Interactions[interaction].Num].Update(CSound.Get + //TODO: + //Call Update-Method of Equalizer and give infos about bg-sound. //_Equalizers[_Interactions[interaction].Num].Draw(); } break; diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 9c8962e4..e43e2f5b 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -107,6 +107,11 @@ namespace Vocaluxe.Screens { OriginalPlayerAvatarTextures[i] = Statics[htStatics(StaticPlayerAvatar[i])].Texture; } + + for (int i = 1; i <= CSettings.MaxNumPlayer; i++) + { + Equalizers[htEqualizer("EqualizerPlayer" + i)].ScreenHandles = true; + } } public override bool HandleInput(KeyEvent KeyEvent) diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 9cf27630..c4566428 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -109,6 +109,9 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticEnergyChannel[i])].Visible = false; ChannelEnergy[i] = 0f; } + + Equalizers[htEqualizer(EqualizerChannel1)].ScreenHandles = true; + Equalizers[htEqualizer(EqualizerChannel2)].ScreenHandles = true; } public override bool HandleInput(KeyEvent KeyEvent) From f6cbc2687bb62e0a46f4a7895b4bc3d53da7b218 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 18:20:58 +0200 Subject: [PATCH 28/67] Start (un)endless name-selection with "P". "P" for next player, "enter" for select profile, "escape" for stop selecting. --- Vocaluxe/Screens/CScreenNames.cs | 52 +++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index e43e2f5b..b5c0d5df 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -34,6 +34,7 @@ namespace Vocaluxe.Screens private bool selectingMouseActive = false; private bool selectingKeyboardActive = false; + private bool selectingKeyboardUnendless = false; private int selectingKeyboardPlayerNr = 0; private int SelectedPlayerNr; @@ -137,6 +138,22 @@ namespace Vocaluxe.Screens NameSelections[htNameSelections(NameSelection)].UpdateList(); } break; + + case Keys.P: + if (!selectingKeyboardActive) + { + selectingKeyboardPlayerNr = 1; + selectingKeyboardUnendless = true; + } + else + { + if (selectingKeyboardPlayerNr + 1 <= CGame.NumPlayer) + selectingKeyboardPlayerNr++; + else + selectingKeyboardPlayerNr = 1; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + } + break; } //Check if selecting with keyboard is active if (selectingKeyboardActive) @@ -166,10 +183,29 @@ namespace Vocaluxe.Screens NameSelections[htNameSelections(NameSelection)].UpdateList(); SetInteractionToButton(Buttons[htButtons(ButtonStart)]); } - //Reset all values - selectingKeyboardPlayerNr = 0; - selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + //Started selecting with 'P' + if (selectingKeyboardUnendless) + { + if (selectingKeyboardPlayerNr == CGame.NumPlayer) + { + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + } + else + { + selectingKeyboardPlayerNr++; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + } + } + else + { + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + } break; case Keys.D1: @@ -186,6 +222,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 1; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 1); } + selectingKeyboardUnendless = false; break; case Keys.D2: case Keys.NumPad2: @@ -201,6 +238,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 2; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 2); } + selectingKeyboardUnendless = false; break; case Keys.D3: case Keys.NumPad3: @@ -216,6 +254,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 3; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 3); } + selectingKeyboardUnendless = false; break; case Keys.D4: case Keys.NumPad4: @@ -231,6 +270,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 4; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 4); } + selectingKeyboardUnendless = false; break; case Keys.D5: case Keys.NumPad5: @@ -246,6 +286,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 5; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 5); } + selectingKeyboardUnendless = false; break; case Keys.D6: case Keys.NumPad6: @@ -261,11 +302,14 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 6; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 6); } + selectingKeyboardUnendless = false; break; + case Keys.Escape: //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; + selectingKeyboardUnendless = false; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); break; From 4d6bac2e2bb67a3fa555ff5555bc6d88ec44a39d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 28 Jul 2012 12:58:49 +0200 Subject: [PATCH 29/67] Fix equalizer-positions. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 6c387b93..416f5f53 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -823,7 +823,7 @@ Invisible - 1213 + 1153 152 -4,00 108 @@ -850,7 +850,7 @@ Invisible - 1213 + 1153 307 -4,00 108 @@ -877,7 +877,7 @@ Invisible - 1213 + 1153 467 -4,00 108 From 9fda9eb06e0141085d9f4159ba71314b8a1c6919 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 13:55:57 +0200 Subject: [PATCH 30/67] Added possibility to choose duet-part on Name-Selection. Added new tags: #P1 and #P2. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 486 ++++++++++++++++++ Vocaluxe/GameModes/CGameMode.cs | 2 +- Vocaluxe/Lib/Song/CSong.cs | 28 + Vocaluxe/Menu/CSelectSlide.cs | 8 +- Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs | 21 + Vocaluxe/Screens/CScreenNames.cs | 28 +- Vocaluxe/Screens/CScreenSing.cs | 24 +- 7 files changed, 587 insertions(+), 10 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 416f5f53..289409b4 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -29,6 +29,102 @@ + + + SelectSlidePlayer + + 20 + 105 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 20 + 260 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 20 + 415 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 105 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 260 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 415 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + PlayerSelector @@ -695,6 +791,396 @@ 6 + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 105 + -4,00 + 88 + 20 + + 20 + 105 + -4,01 + 20 + 20 + + 20 + 105 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 260 + -4,00 + 88 + 20 + + 20 + 260 + -4,01 + 20 + 20 + + 20 + 260 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 415 + -4,00 + 88 + 20 + + 20 + 415 + -4,01 + 20 + 20 + + 20 + 415 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 105 + -4,00 + 88 + 20 + + 1240 + 105 + -4,01 + 20 + 20 + + 1240 + 105 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 260 + -4,00 + 88 + 20 + + 1240 + 260 + -4,01 + 20 + 20 + + 1240 + 260 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 415 + -4,00 + 88 + 20 + + 1240 + 415 + -4,01 + 20 + 20 + + 1240 + 415 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + 172 diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index aa3304f3..86e0a9c5 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -256,7 +256,7 @@ namespace Vocaluxe.GameModes public virtual CSong GetSong(int Num) { - if (Num - 1 < _SongQueque.Count) + if (Num - 1 < _SongQueque.Count && Num - 1 > -1) return CSongs.GetSong(_SongQueque[Num - 1].SongID); return null; diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index fe098426..f3240472 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -99,6 +99,9 @@ namespace Vocaluxe.Lib.Song public float Gap = 0f; public float VideoGap = 0f; + public string DuetPart1 = String.Empty; + public string DuetPart2 = String.Empty; + public List Comment = new List(); // Sorting @@ -254,6 +257,18 @@ namespace Vocaluxe.Lib.Song this.ArtistSorting = Value; } break; + case "P1": + if (Value != String.Empty) + { + this.DuetPart1 = Value; + } + break; + case "P2": + if (Value != String.Empty) + { + this.DuetPart2 = Value; + } + break; case "MP3": if (File.Exists(Path.Combine(this.Folder, Value))) { @@ -366,6 +381,19 @@ namespace Vocaluxe.Lib.Song this.TitleSorting = this.Title; } + //Check if Duet-Tags are set + if (IsDuet) + { + if (DuetPart1 == String.Empty) + { + DuetPart1 = "Part 1"; + } + if (DuetPart2 == String.Empty) + { + DuetPart2 = "Part 2"; + } + } + return true; } diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 099ef2ea..5b10c514 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -581,14 +581,14 @@ namespace Vocaluxe.Menu public void ProcessMouseMove(int x, int y) { - _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y); - _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y); + _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0; + _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1; } public void ProcessMouseLBClick(int x, int y) { - _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y); - _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y); + _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0; + _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1; if (_ArrowLeftSelected) PrevValue(); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs index c13aff50..7ab6a6af 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs @@ -1,10 +1,31 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Text; +using System.Windows.Forms; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.Lib.Song; namespace Vocaluxe.Menu.SongMenu { class CSongMenuDreidel : CSongMenuFramework { + private SRectF _ScrollRect; + + private CStatic _DuetIcon; + private CStatic _VideoIcon; + + private CText _Artist; + private CText _Title; + private CText _SongLength; + + private int _actualSelection = -1; + + public override int GetActualSelection() + { + return _actualSelection; + } } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index b5c0d5df..626863ea 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -30,6 +30,7 @@ namespace Vocaluxe.Screens private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" }; private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" }; private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" }; + private readonly string[] SelectSlideDuetPlayer = new string[] { "SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6" }; private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer]; private bool selectingMouseActive = false; @@ -65,8 +66,9 @@ namespace Vocaluxe.Screens _ThemeStatics = statics.ToArray(); List texts = new List(); - - _ThemeSelectSlides = new string[] { SelectSlidePlayerNumber }; + texts.Add(SelectSlidePlayerNumber); + texts.AddRange(SelectSlideDuetPlayer); + _ThemeSelectSlides = texts.ToArray(); texts.Clear(); texts.Add(TextWarningMics); @@ -585,6 +587,21 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; } + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + if (i + 1 <= CGame.NumPlayer) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart1); + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart2); + if ((i + 1) % 2 == 0) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(1); + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(0); + } + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; } SetInteractionToButton(Buttons[htButtons(ButtonStart)]); @@ -629,6 +646,10 @@ namespace Vocaluxe.Screens CGame.Player[i].Name = ""; } } + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + CGame.Player[i].LineNr = SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection; + } } CGraphics.FadeTo(EScreens.ScreenSing); @@ -660,6 +681,8 @@ namespace Vocaluxe.Screens Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString(); } Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true; + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = true; } else { @@ -667,6 +690,7 @@ namespace Vocaluxe.Screens Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; Texts[htTexts("TextPlayer" + i)].Visible = false; Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; + SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = false; } } CConfig.SaveConfig(); diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2ddd87dd..fdedcb90 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -523,6 +523,12 @@ namespace Vocaluxe.Screens _FinishTime = song.Finish; _TimeToFirstNote = 0f; _TimeToFirstNoteDuet = 0f; + //Save duet-assignment before resetting + int[] duet_player = new int[CGame.NumPlayer]; + for (int i = 0; i < duet_player.Length; i++) + { + duet_player[i] = CGame.Player[i].LineNr; + } CGame.ResetPlayer(); CDraw.RemoveTexture(ref _CurrentVideoTexture); @@ -542,10 +548,22 @@ namespace Vocaluxe.Screens bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; if (song.IsDuet) - { - for (int i = 1; i <= CGame.NumPlayer; i = i + 2) + { + //More than one song: Player is not assigned to line by user + //Otherwise, this is done by CScreenNames + if (CGame.GetNumSongs() > 1) { - CGame.Player[i].LineNr = 1; + for (int i = 1; i <= CGame.NumPlayer; i = i + 2) + { + CGame.Player[i].LineNr = 1; + } + } + else + { + for (int i = 0; i < CGame.NumPlayer; i++) + { + CGame.Player[i].LineNr = duet_player[i]; + } } Statics[htStatics(StaticLyricsDuet)].Visible = true; Lyrics[htLyrics(LyricMainDuet)].Visible = true; From 01495362e9e8f61760afc9a98bec8bf46a8043d8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 14:19:51 +0200 Subject: [PATCH 31/67] Update Changelog for ScreenNames. --- Output/Themes/Changelog/Changelog_ScreenNames.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index 60cea8b5..221c9331 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -4,6 +4,7 @@ SceenNames Version 3: (One Equalizer for each player): Equalizer shows input from assigned mic for this player. + (One SelectSlide for each player) ++++++++++ Version 2: From a97baab9033df465f594fa49935a9411eade3643 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 14:20:24 +0200 Subject: [PATCH 32/67] Fix fading-bug with duets. --- Vocaluxe/Screens/CScreenSing.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index fdedcb90..3bf27eb1 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -286,15 +286,15 @@ namespace Vocaluxe.Screens SingNotes[htSingNotes(SingBars)].SetAlpha(NoteLines[p], Alpha[CGame.Player[p].LineNr * 2]); if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_INFO || CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) { - Statics[htStatics(StaticAvatars[p,CGame.NumPlayer-1])].Alpha = Alpha[0]; - Texts[htTexts(TextNames[p,CGame.NumPlayer-1])].Alpha = Alpha[0]; + Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; } if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) { - Statics[htStatics(StaticScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; + Statics[htStatics(StaticScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; } } From 34356f351a0ccd346a69f38b20cbf990f92eabe5 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 15:33:33 +0200 Subject: [PATCH 33/67] Show duet-names on sing-screen for better orientation. --- Output/Themes/Ambient/Screens/ScreenSing.xml | 62 +++++++++- .../Themes/Changelog/Changelog_ScreenSing.txt | 6 + Vocaluxe/Screens/CScreenSing.cs | 107 +++++++++++++++++- 3 files changed, 168 insertions(+), 7 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 4d33b2f0..aaeec608 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -1,7 +1,7 @@  - 4 + 5 None @@ -958,6 +958,64 @@ + + + 40 + 80 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + 40 + 585 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + 640 @@ -2656,4 +2714,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenSing.txt b/Output/Themes/Changelog/Changelog_ScreenSing.txt index 22c5fa99..843fb6e9 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSing.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSing.txt @@ -1,5 +1,11 @@ ScreenSing ++++++++++ +Version 5 + +Add: + and (only showed when sining duet) + ++++++++++ Version 4: Added Elements for 6-player-singing! diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 3bf27eb1..e21708f7 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -17,7 +17,7 @@ namespace Vocaluxe.Screens class CScreenSing : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 4; + const int ScreenVersion = 5; struct TimeRect { @@ -25,10 +25,12 @@ namespace Vocaluxe.Screens public float startBeat; public float endBeat; } - + private const string TextSongName = "TextSongName"; private const string TextTime = "TextTime"; private const string TextPause = "TextPause"; + private const string TextDuetName1 = "TextDuetName1"; + private const string TextDuetName2 = "TextDuetName2"; private string[,] TextScores; private string[,] TextNames; @@ -85,6 +87,8 @@ namespace Vocaluxe.Screens private int[] NoteLines = new int[CSettings.MaxNumPlayer]; private Stopwatch _TimerSongText; + private Stopwatch _TimerDuetText1; + private Stopwatch _TimerDuetText2; private bool _Pause; @@ -104,6 +108,8 @@ namespace Vocaluxe.Screens texts.Add(TextSongName); texts.Add(TextTime); texts.Add(TextPause); + texts.Add(TextDuetName1); + texts.Add(TextDuetName2); BuildTextStrings(ref texts); _ThemeTexts = texts.ToArray(); @@ -134,6 +140,8 @@ namespace Vocaluxe.Screens _TimeRects = new List(); _TimerSongText = new Stopwatch(); + _TimerDuetText1 = new Stopwatch(); + _TimerDuetText2 = new Stopwatch(); } public override void LoadTheme() @@ -257,6 +265,7 @@ namespace Vocaluxe.Screens } UpdateSongText(); + UpdateDuetText(); if (_FadeOut) return true; @@ -484,6 +493,8 @@ namespace Vocaluxe.Screens Lyrics[htLyrics(LyricMainTop)].Clear(); Lyrics[htLyrics(LyricSubTop)].Clear(); Texts[htTexts(TextSongName)].Text = String.Empty; + Texts[htTexts(TextDuetName1)].Text = String.Empty; + Texts[htTexts(TextDuetName2)].Text = String.Empty; } private void LoadNextSong() @@ -523,11 +534,14 @@ namespace Vocaluxe.Screens _FinishTime = song.Finish; _TimeToFirstNote = 0f; _TimeToFirstNoteDuet = 0f; - //Save duet-assignment before resetting int[] duet_player = new int[CGame.NumPlayer]; - for (int i = 0; i < duet_player.Length; i++) + if (song.IsDuet) { - duet_player[i] = CGame.Player[i].LineNr; + //Save duet-assignment before resetting + for (int i = 0; i < duet_player.Length; i++) + { + duet_player[i] = CGame.Player[i].LineNr; + } } CGame.ResetPlayer(); @@ -549,6 +563,8 @@ namespace Vocaluxe.Screens bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; if (song.IsDuet) { + Texts[htTexts(TextDuetName1)].Text = song.DuetPart1; + Texts[htTexts(TextDuetName2)].Text = song.DuetPart2; //More than one song: Player is not assigned to line by user //Otherwise, this is done by CScreenNames if (CGame.GetNumSongs() > 1) @@ -604,9 +620,15 @@ namespace Vocaluxe.Screens _TimerSongText.Stop(); _TimerSongText.Reset(); + _TimerDuetText1.Stop(); + _TimerDuetText1.Reset(); + _TimerDuetText2.Stop(); + _TimerDuetText2.Reset(); if (song.Notes.Lines.Length != 2) + { _TimerSongText.Start(); + } StartSong(); } @@ -790,6 +812,8 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticSongText)].Visible = false; Texts[htTexts(TextSongName)].Visible = false; + Texts[htTexts(TextDuetName1)].Visible = false; + Texts[htTexts(TextDuetName2)].Visible = false; for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) { @@ -1060,6 +1084,79 @@ namespace Vocaluxe.Screens } } + private void UpdateDuetText() + { + if (CGame.GetSong() != null) + { + //Timer for first duet-part + if (_TimerDuetText1.IsRunning) + { + float t = _TimerDuetText1.ElapsedMilliseconds / 1000f; + if (t < 10f) + { + Texts[htTexts(TextDuetName1)].Visible = true; + + if (t < 3f) + { + Texts[htTexts(TextDuetName1)].Color.A = (3f - (3f - t)) / 3f; + } + else if (t < 7f) + { + Texts[htTexts(TextDuetName1)].Color.A = 1f; + } + else + { + Texts[htTexts(TextDuetName1)].Color.A = (3f - (t - 7f)) / 3f; + } + } + else + { + Texts[htTexts(TextDuetName1)].Visible = false; + _TimerDuetText1.Stop(); + } + } + else if (!_TimerDuetText1.IsRunning && _TimerDuetText1.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMainDuet)].Alpha > 0 && CGame.GetSong().IsDuet) + _TimerDuetText1.Start(); + else + { + Texts[htTexts(TextDuetName1)].Visible = false; + } + //Timer for second duet-part + if (_TimerDuetText2.IsRunning) + { + float t = _TimerDuetText2.ElapsedMilliseconds / 1000f; + if (t < 10f) + { + Texts[htTexts(TextDuetName2)].Visible = true; + + if (t < 3f) + { + Texts[htTexts(TextDuetName2)].Color.A = (3f - (3f - t)) / 3f; + } + else if (t < 7f) + { + Texts[htTexts(TextDuetName2)].Color.A = 1f; + } + else + { + Texts[htTexts(TextDuetName2)].Color.A = (3f - (t - 7f)) / 3f; + } + } + else + { + Texts[htTexts(TextDuetName2)].Visible = false; + _TimerDuetText2.Stop(); + } + } + else if (!_TimerDuetText2.IsRunning && _TimerDuetText2.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMain)].Alpha > 0 && CGame.GetSong().IsDuet) + _TimerDuetText2.Start(); + else + { + Texts[htTexts(TextDuetName2)].Visible = false; + } + } + } + private void UpdateTimeLine() { CSong song = CGame.GetSong(); From 1ff2182df6420b32184b38dd09229a15fa577d3b Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 15:55:49 +0200 Subject: [PATCH 34/67] Fix error with reading duet-tags. --- Vocaluxe/Lib/Song/CSong.cs | 33 ++++++++++++---------- Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs | 17 +++++++++++ Vocaluxe/Screens/CScreenNames.cs | 1 + 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index f3240472..f325d691 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -371,29 +371,16 @@ namespace Vocaluxe.Lib.Song CheckFiles(); //Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag. - if (this.ArtistSorting == "") + if (this.ArtistSorting == String.Empty) { this.ArtistSorting = this.Artist; } - if (this.TitleSorting == "") + if (this.TitleSorting == String.Empty) { this.TitleSorting = this.Title; } - //Check if Duet-Tags are set - if (IsDuet) - { - if (DuetPart1 == String.Empty) - { - DuetPart1 = "Part 1"; - } - if (DuetPart2 == String.Empty) - { - DuetPart2 = "Part 2"; - } - } - return true; } @@ -534,6 +521,8 @@ namespace Vocaluxe.Lib.Song return false; } _NotesLoaded = true; + if(IsDuet) + CheckDuet(); return true; } @@ -599,5 +588,19 @@ namespace Vocaluxe.Lib.Song } } } + + private void CheckDuet() + { + if (DuetPart1 == String.Empty) + { + DuetPart1 = "Part 1"; + CLog.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + } + if (DuetPart2 == String.Empty) + { + DuetPart2 = "Part 2"; + CLog.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + } + } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs index 7ab6a6af..6a4aae66 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs @@ -13,6 +13,8 @@ namespace Vocaluxe.Menu.SongMenu class CSongMenuDreidel : CSongMenuFramework { private SRectF _ScrollRect; + private CStatic _CoverBig; + private CStatic _TextBG; private CStatic _DuetIcon; private CStatic _VideoIcon; @@ -27,5 +29,20 @@ namespace Vocaluxe.Menu.SongMenu { return _actualSelection; } + + public override void Init() + { + base.Init(); + /** + _CoverBig = _Theme.songMenuDreidel.StaticCoverBig; + _TextBG = _Theme.songMenuDreidel.StaticTextBG; + _DuetIcon = _Theme.songMenuDreidel.StaticDuetIcon; + _VideoIcon = _Theme.songMenuDreidel.StaticVideoIcon; + + _Artist = _Theme.songMenuDreidel.TextArtist; + _Title = _Theme.songMenuDreidel.TextTitle; + _SongLength = _Theme.songMenuDreidel.TextSongLength; + **/ + } } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 626863ea..e9f475cc 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -589,6 +589,7 @@ namespace Vocaluxe.Screens } if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) { + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Clear(); if (i + 1 <= CGame.NumPlayer) SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; else From c9fb10a20bf8b949aa7cb923d8f391924e98c9f2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 20:12:38 +0200 Subject: [PATCH 35/67] Remove some unused statics. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 98 +--------------- Vocaluxe/Menu/Animations/CAnimation.cs | 92 +++++++++++++++ .../Menu/Animations/CAnimationFramework.cs | 95 ++++++++++++++++ Vocaluxe/Menu/Animations/CAnimationResize.cs | 106 ++++++++++++++++++ Vocaluxe/Menu/Animations/IAnimation.cs | 30 +++++ 5 files changed, 324 insertions(+), 97 deletions(-) create mode 100644 Vocaluxe/Menu/Animations/CAnimation.cs create mode 100644 Vocaluxe/Menu/Animations/CAnimationFramework.cs create mode 100644 Vocaluxe/Menu/Animations/CAnimationResize.cs create mode 100644 Vocaluxe/Menu/Animations/IAnimation.cs diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 289409b4..cbc3beb1 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -28,103 +28,7 @@ - - - - SelectSlidePlayer - - 20 - 105 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 20 - 260 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 20 - 415 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 105 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 260 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 415 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - + PlayerSelector diff --git a/Vocaluxe/Menu/Animations/CAnimation.cs b/Vocaluxe/Menu/Animations/CAnimation.cs new file mode 100644 index 00000000..2d062033 --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimation.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public class CAnimation:IAnimation + { + private IAnimation _Animation; + + public CAnimation(EAnimationType Type) + { + setAnimation(Type); + } + + public void Init() + { + _Animation.Init(); + } + + public bool LoadAnimation(string item, XPathNavigator navigator) + { + return _Animation.LoadAnimation(item, navigator); + } + + public bool SaveAnimation(XmlWriter writer) + { + return _Animation.SaveAnimation(writer); + } + + public void StartAnimation() + { + _Animation.StartAnimation(); + } + + public void StopAnimation() + { + _Animation.StopAnimation(); + } + + public void ResetAnimation() + { + _Animation.ResetAnimation(); + } + + public bool AnimationActive() + { + return _Animation.AnimationActive(); + } + + public void Update() + { + _Animation.Update(); + } + + public void setRect(SRectF rect) + { + _Animation.setRect(rect); + } + + public SRectF getRect() + { + return _Animation.getRect(); + } + + public void setColor(SColorF color) + { + _Animation.setColor(color); + } + + public SColorF getColor() + { + return _Animation.getColor(); + } + + public void setAnimation(EAnimationType Type) + { + switch (Type) + { + case EAnimationType.Resize: + _Animation = new CAnimationResize(); + break; + } + } + } +} diff --git a/Vocaluxe/Menu/Animations/CAnimationFramework.cs b/Vocaluxe/Menu/Animations/CAnimationFramework.cs new file mode 100644 index 00000000..3ac3d18c --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimationFramework.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public enum EAnimationType + { + Resize + } + + public enum EAnimationRepeat + { + None, + Reset, + Repeat, + RepeatWithReset + } + + public abstract class CAnimationFramework:IAnimation + { + public bool _AnimationLoaded; + + public EAnimationType Type; + public EAnimationRepeat Repeat; + public float Speed; + + public Stopwatch Timer = new Stopwatch(); + public bool ResetMode = false; + + public abstract void Init(); + + public virtual bool LoadAnimation(string item, XPathNavigator navigator) + { + _AnimationLoaded = true; + + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Speed", navigator, ref Speed); + _AnimationLoaded &= CHelper.TryGetEnumValueFromXML(item + "/Repeat", navigator, ref Repeat); + + return _AnimationLoaded; + } + + public virtual bool SaveAnimation(XmlWriter writer) + { + return false; + } + + public virtual void StartAnimation() + { + Timer.Start(); + } + + public virtual void StopAnimation() + { + Timer.Stop(); + Timer.Reset(); + } + + public virtual void ResetAnimation() + { + ResetMode = !ResetMode; + } + + public virtual bool AnimationActive() + { + return Timer.IsRunning; + } + + public virtual void setRect(SRectF rect) + { + } + + public virtual SRectF getRect() + { + return new SRectF(); + } + + public virtual void setColor(SColorF color) + { + } + + public virtual SColorF getColor() + { + return new SColorF(); + } + + public abstract void Update(); + } +} diff --git a/Vocaluxe/Menu/Animations/CAnimationResize.cs b/Vocaluxe/Menu/Animations/CAnimationResize.cs new file mode 100644 index 00000000..ecc77feb --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimationResize.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public class CAnimationResize : CAnimationFramework + { + public SRectF FinalRect; + public SRectF CurrentRect; + public SRectF OriginalRect; + + public CAnimationResize() + { + } + + public override void Init() + { + Type = EAnimationType.Resize; + } + + public override bool LoadAnimation(string item, XPathNavigator navigator) + { + //Load normal animation-options + _AnimationLoaded &= base.LoadAnimation(item, navigator); + + //Load specific animation-options + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref FinalRect.X); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref FinalRect.Y); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref FinalRect.W); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref FinalRect.H); + + return _AnimationLoaded; + } + + public override void setRect(SRectF rect) + { + OriginalRect = rect; + } + + public override SRectF getRect() + { + return CurrentRect; + } + + public override void StartAnimation() + { + base.StartAnimation(); + + CurrentRect = OriginalRect; + } + + public override void Update() + { + //Update CurrentRect + if (!ResetMode) + { + CLog.LogError((CurrentRect.X + ((FinalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds)).ToString("#.#####")); + CurrentRect.X = CurrentRect.X + ((FinalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.Y = CurrentRect.Y + ((FinalRect.Y - CurrentRect.Y) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.H = CurrentRect.H + ((FinalRect.H - CurrentRect.H) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.W = CurrentRect.W + ((FinalRect.W - CurrentRect.W) / Speed * Timer.ElapsedMilliseconds); + } + else + { + CurrentRect.X = CurrentRect.X + ((OriginalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.Y = CurrentRect.Y + ((OriginalRect.Y - CurrentRect.Y) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.H = CurrentRect.H + ((OriginalRect.H - CurrentRect.H) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.W = CurrentRect.W + ((OriginalRect.W - CurrentRect.W) / Speed * Timer.ElapsedMilliseconds); + } + + if (CurrentRect.X == FinalRect.X && CurrentRect.Y == FinalRect.Y && CurrentRect.H == FinalRect.H && CurrentRect.W == FinalRect.W) + { + switch (Repeat) + { + case EAnimationRepeat.Repeat: + StopAnimation(); + CurrentRect = OriginalRect; + StartAnimation(); + break; + + case EAnimationRepeat.RepeatWithReset: + ResetAnimation(); + break; + + case EAnimationRepeat.Reset: + if (!ResetMode) + ResetAnimation(); + else + StopAnimation(); + break; + + case EAnimationRepeat.None: + StopAnimation(); + break; + } + } + } + } +} diff --git a/Vocaluxe/Menu/Animations/IAnimation.cs b/Vocaluxe/Menu/Animations/IAnimation.cs new file mode 100644 index 00000000..444181c7 --- /dev/null +++ b/Vocaluxe/Menu/Animations/IAnimation.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + interface IAnimation + { + void Init(); + bool LoadAnimation(string item, XPathNavigator navigator); + bool SaveAnimation(XmlWriter writer); + + void setRect(SRectF rect); + SRectF getRect(); + void setColor(SColorF color); + SColorF getColor(); + + void StartAnimation(); + void StopAnimation(); + void ResetAnimation(); + bool AnimationActive(); + void Update(); + } +} From 6f9f90bea7f19a6390e5c817f3810cb8fa746a0f Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 14:27:09 +0200 Subject: [PATCH 36/67] Some clean-up for equalizer. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 12 ++++++------ .../Ambient/Screens/ScreenOptionsRecord.xml | 19 +++++++++++++++++++ Vocaluxe/Menu/CEqualizer.cs | 1 - 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index cbc3beb1..c35f8b0f 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -1141,7 +1141,7 @@ 8 2,00 - + @@ -1168,7 +1168,7 @@ 8 2,00 - + @@ -1195,7 +1195,7 @@ 8 2,00 - + @@ -1222,7 +1222,7 @@ 8 2,00 - + @@ -1249,7 +1249,7 @@ 8 2,00 - + @@ -1274,7 +1274,7 @@ 60 8 - + 2,00 diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index a473d310..7375fd34 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -859,17 +859,26 @@ 5 + Invisible + 50 400 230 150 -1,00 + 10 2,00 + + + ButtonColor + + ButtonSColor + TR_CONFIG_OFF @@ -880,17 +889,27 @@ + Invisible + 400 400 230 150 -1,00 + 10 + 2,00 + + + ButtonColor + + ButtonSColor + TR_CONFIG_OFF diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index 2f82759c..a3c6767d 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -12,7 +12,6 @@ namespace Vocaluxe.Menu { enum EEqualizerStyle { - Bars, Collums } From 5abd428462179a1b33b69292dbe05df780ce9f52 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 14:50:42 +0200 Subject: [PATCH 37/67] Equalizer-Interaction is ThemeEditorOnly now. --- Vocaluxe/Menu/CInteraction.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 79a67b8c..de15e592 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -43,7 +43,8 @@ namespace Vocaluxe.Menu _Type == EType.TStatic || _Type == EType.TSongMenu || _Type == EType.TLyric || - _Type == EType.TSingNote); + _Type == EType.TSingNote || + _Type == EType.TEqualizer); } } From adb8ee7478e5591b427179e28a3ab32968178705 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 15:20:21 +0200 Subject: [PATCH 38/67] Toggle between duet-part with F10 after selecting player with [1...6] --- Vocaluxe/Screens/CScreenNames.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index e9f475cc..51fe1850 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -335,6 +335,22 @@ namespace Vocaluxe.Screens //Update Tiles-List NameSelections[htNameSelections(NameSelection)].UpdateList(); break; + + case Keys.F10: + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + if (SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection == 0) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].SetSelectionByValueIndex(1); + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].SetSelectionByValueIndex(0); + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + selectingKeyboardUnendless = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + SetInteractionToButton(Buttons[htButtons(ButtonStart)]); + } + break; } } From 94b4fd462b87442c666de4d296206db6c2ae34e2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 15:51:09 +0200 Subject: [PATCH 39/67] Equalizers are "nulled" now. --- Vocaluxe/Base/CSound.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Vocaluxe/Base/CSound.cs b/Vocaluxe/Base/CSound.cs index 85112fd3..986476e9 100644 --- a/Vocaluxe/Base/CSound.cs +++ b/Vocaluxe/Base/CSound.cs @@ -315,6 +315,10 @@ namespace Vocaluxe.Base public CBuffer() { _ToneWeigth = new float[_NumHalfTones]; + for (int i = 0; i < _ToneWeigth.Length; i++) + { + _ToneWeigth[i] = 0.99f; + } _Stream = new MemoryStream(); _NewSamples = false; } From bb2ccb713dd02515f5f2b69834273b23ed6d044d Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 14:43:03 +0200 Subject: [PATCH 40/67] fixed typo --- Vocaluxe/Menu/CInteraction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index c8b26c9b..03e0eb64 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -15,7 +15,7 @@ namespace Vocaluxe.Menu TLyric, TSingNote, TNameSelection, - TEqualizer + TEqualizer, TPlaylist } From 25988a645c4a093c89e5ad8ff0b7b89c95525826 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 15:09:18 +0200 Subject: [PATCH 41/67] added missing text translation --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Output/Languages/French.xml | 1 + Output/Languages/Spanish.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 51994228..70908b0c 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -122,6 +122,7 @@ Lied singen Zur Playlist hinzufügen Schließen + Neue Playlist Lied-Optionen Suche: Ohne Sprache diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 915d5efb..56fce85b 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -122,6 +122,7 @@ Sing Add to playlist Close + New Playlist Song Options Search: No Language diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml index f60e82a3..6da3296d 100644 --- a/Output/Languages/French.xml +++ b/Output/Languages/French.xml @@ -117,6 +117,7 @@ Rechercher: Pas de Langue Pas d'Année + TODO: New Playlist Pas de Genre Pas d'Edition Toutes les chansons diff --git a/Output/Languages/Spanish.xml b/Output/Languages/Spanish.xml index 483e30a3..2c4a8456 100644 --- a/Output/Languages/Spanish.xml +++ b/Output/Languages/Spanish.xml @@ -116,6 +116,7 @@ Selección de Canciones Buscar: Sin Idioma + TODO: New Playlist Sin Año Sin Género Sin Edición From bd936175668fcd3f47c79f4f3ba554eccba54168 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 15:39:33 +0200 Subject: [PATCH 42/67] fixed crashing when adding songs to playlist by key --- Vocaluxe/Screens/CScreenSong.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 38d0431f..a8c0481c 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -80,7 +80,8 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + KeyEvent.Handled = Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); + if (KeyEvent.Handled) return true; base.HandleInput(KeyEvent); @@ -89,7 +90,6 @@ namespace Vocaluxe.Screens if (!_SongOptionsActive) { - if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) { if (_SearchActive) @@ -211,7 +211,7 @@ namespace Vocaluxe.Screens if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } From d63fb099a404feef68b6b47d3869423eb6f7d837 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 16:53:34 +0200 Subject: [PATCH 43/67] modified songmenu playlist handling --- Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 68 +++++++++++++++----- Vocaluxe/Menu/CPlaylist.cs | 21 ++++-- Vocaluxe/Menu/SongMenu/CSongMenu.cs | 10 +++ Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 12 ++++ Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 7 +- Vocaluxe/Menu/SongMenu/ISongMenu.cs | 3 + Vocaluxe/Screens/CScreenSong.cs | 49 ++++++++++++-- 8 files changed, 144 insertions(+), 29 deletions(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 03e0eb64..a95e450b 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -45,7 +45,8 @@ namespace Vocaluxe.Menu _Type == EType.TSongMenu || _Type == EType.TLyric || _Type == EType.TSingNote || - _Type == EType.TEqualizer); + _Type == EType.TEqualizer || + _Type == EType.TPlaylist); } } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 2f70b117..ffbd6281 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -878,22 +878,24 @@ namespace Vocaluxe.Menu if (KeyEvent.Key == Keys.Left) { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) - PrevElement(); - else - _NextInteraction(KeyEvent); + KeyEvent.Handled = PrevElement(); + + if (!KeyEvent.Handled) + KeyEvent.Handled = _NextInteraction(KeyEvent); } if (KeyEvent.Key == Keys.Right) { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) - NextElement(); - else - _NextInteraction(KeyEvent); + KeyEvent.Handled = NextElement(); + + if (!KeyEvent.Handled) + KeyEvent.Handled = _NextInteraction(KeyEvent); } if (KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down) { - _NextInteraction(KeyEvent); + KeyEvent.Handled = _NextInteraction(KeyEvent); } } else @@ -1242,16 +1244,28 @@ namespace Vocaluxe.Menu _PrevInteraction(); } - public void NextElement() + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool NextElement() { if (_Interactions.Count > 0) - _NextElement(); + return _NextElement(); + + return false; } - public void PrevElement() + /// + /// Selects the previous element in a menu interaction. + /// + /// True if the previous element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool PrevElement() { if (_Interactions.Count > 0) - _PrevElement(); + return _PrevElement(); + + return false; } public bool SetInteractionToButton(CButton button) @@ -1502,7 +1516,12 @@ namespace Vocaluxe.Menu _SetSelected(); } - private void _NextInteraction(KeyEvent Key) + /// + /// Selects the next best interaction in a menu. + /// + /// + /// + private bool _NextInteraction(KeyEvent Key) { KeyEvent[] Directions = new KeyEvent[4]; float[] Distances = new float[4]; @@ -1568,8 +1587,11 @@ namespace Vocaluxe.Menu _Selection = element; _SetSelected(); _SetHighlighted(_Selection); + + return true; } } + return false; } private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage) @@ -1728,16 +1750,30 @@ namespace Vocaluxe.Menu return distance; } - private void _NextElement() + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + private bool _NextElement() { if (_Interactions[_Selection].Type == EType.TSelectSlide) - _SelectSlides[_Interactions[_Selection].Num].NextValue(); + return _SelectSlides[_Interactions[_Selection].Num].NextValue(); + + return false; } - private void _PrevElement() + /// + /// Selects the previous element in a menu interaction. + /// + /// + /// True if the previous element is selected. False if either there is no previous element or the interaction does not provide such a method. + /// + private bool _PrevElement() { if (_Interactions[_Selection].Type == EType.TSelectSlide) - _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + return _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + + return false; } private void _SetSelected() diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f64a5ddf..9d3fd36a 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -77,7 +77,21 @@ namespace Vocaluxe.Menu public SColorF BackgroundSColor; public bool Visible; - public bool Selected; + + private bool _Selected; + public bool Selected + { + get { return _Selected; } + set + { + _Selected = value; + if (CurrentPlaylistElement == -1 && _Selected) + { + CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + } + } + } public bool changeOrder = false; public int ActivePlaylistID = -1; @@ -266,7 +280,7 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (i == ActiveHover) + if (i == ActiveHover && _Selected) { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; @@ -484,7 +498,7 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++) { //Hover for playlist-element - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; @@ -638,7 +652,6 @@ namespace Vocaluxe.Menu } } - private void ClosePlaylist() { Visible = false; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index 57ef11b6..48fdf61f 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -73,6 +73,16 @@ namespace Vocaluxe.Menu.SongMenu _SongMenu.Draw(); } + public bool IsActive() + { + return _SongMenu.IsActive(); + } + + public void SetActive(bool Active) + { + _SongMenu.SetActive(Active); + } + public int GetSelectedSong() { return _SongMenu.GetSelectedSong(); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index dc917994..b32037ee 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -115,6 +115,7 @@ namespace Vocaluxe.Menu.SongMenu protected long _PendingTime = 500L; private int _LockedInternal = -1; + protected bool _Active = false; protected int _PreviewSelected //for preview only { @@ -217,6 +218,7 @@ namespace Vocaluxe.Menu.SongMenu public void SetSelected(bool Selected) { _Selected = Selected; + SetActive(Selected); } public bool IsVisible() @@ -516,6 +518,16 @@ namespace Vocaluxe.Menu.SongMenu } + public virtual bool IsActive() + { + return _Active; + } + + public virtual void SetActive(bool Active) + { + _Active = Active; + } + public virtual int GetSelectedSong() { return -1; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index cb000ad1..9dafa1bb 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -148,6 +148,11 @@ namespace Vocaluxe.Menu.SongMenu } else { + if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down || + KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter || + KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp)) + return; + bool sel = false; foreach (CStatic tile in _Tiles) { @@ -400,7 +405,7 @@ namespace Vocaluxe.Menu.SongMenu { foreach (CStatic tile in _Tiles) { - if (tile.Selected) + if (tile.Selected && _Active) tile.Draw(1.2f, tile.Rect.Z - 0.1f, true, false); else { diff --git a/Vocaluxe/Menu/SongMenu/ISongMenu.cs b/Vocaluxe/Menu/SongMenu/ISongMenu.cs index a7e20542..a859e84b 100644 --- a/Vocaluxe/Menu/SongMenu/ISongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/ISongMenu.cs @@ -20,6 +20,9 @@ namespace Vocaluxe.Menu.SongMenu int GetSelectedSong(); void SetSelectedSong(int VisibleSongNr); + bool IsActive(); + void SetActive(bool Active); + int GetSelectedCategory(); int GetActualSelection(); diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index a8c0481c..83988d94 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -42,6 +42,7 @@ namespace Vocaluxe.Screens private bool _SearchActive = false; private bool _SongOptionsActive = false; + private bool _PlaylistActive = false; private List _AvailableGameModes; public CScreenSong() @@ -80,14 +81,24 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - KeyEvent.Handled = Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); - if (KeyEvent.Handled) - return true; - base.HandleInput(KeyEvent); if (KeyEvent.Handled) return true; + if (_PlaylistActive) + { + if (!KeyEvent.KeyPressed && KeyEvent.Key == Keys.Tab) + { + _PlaylistActive = !_PlaylistActive; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + return true; + } + + Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); + return true; + } + if (!_SongOptionsActive) { if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) @@ -104,7 +115,6 @@ namespace Vocaluxe.Screens else { SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent); - if (KeyEvent.Handled) return true; @@ -123,6 +133,15 @@ namespace Vocaluxe.Screens } break; + case Keys.Tab: + if (Playlists[htPlaylists(Playlist)].Visible) + { + _PlaylistActive = !_PlaylistActive; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + } + break; + case Keys.Back: if (_SearchText.Length > 0) { @@ -147,6 +166,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Move that to the new menu and delete it! case Keys.A: if (!_SearchActive && KeyEvent.Mod == Modifier.None) { @@ -158,6 +178,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Delete that from here and from wiki! case Keys.F: if (KeyEvent.Mod == Modifier.Ctrl) { @@ -174,6 +195,7 @@ namespace Vocaluxe.Screens } break; + //TODO: We need another key for random! case Keys.R: if (CSongs.Category != -1 && KeyEvent.Mod == Modifier.Ctrl) { @@ -181,6 +203,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Delete that! case Keys.S: if (CSongs.NumVisibleSongs > 0) StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); @@ -246,11 +269,22 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + if (CHelper.IsInBounds(Playlists[htPlaylists(Playlist)].Rect, MouseEvent.X, MouseEvent.Y)) { - return true; + _PlaylistActive = true; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + } + else if (CHelper.IsInBounds(SongMenus[htSongMenus(SongMenu)].Rect, MouseEvent.X, MouseEvent.Y)) + { + _PlaylistActive = false; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); } + if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + return true; + if (!_SongOptionsActive) { @@ -333,6 +367,7 @@ namespace Vocaluxe.Screens base.OnShow(); CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); Playlists[htPlaylists(Playlist)].Init(); if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); From 6e1a28052e139a440f97cdb2e1d00c8ef3db99c3 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 17:17:38 +0200 Subject: [PATCH 44/67] some more bugfixes and additions to songmenu playlist handling --- Vocaluxe/Menu/CPlaylist.cs | 19 ++++++++++++++++--- Vocaluxe/Screens/CScreenSong.cs | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 9d3fd36a..f5a664ed 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -85,7 +85,7 @@ namespace Vocaluxe.Menu set { _Selected = value; - if (CurrentPlaylistElement == -1 && _Selected) + if (CurrentPlaylistElement == -1 && _Selected && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -336,7 +336,7 @@ namespace Vocaluxe.Menu switch (kevent.Key) { case Keys.Up: - if (CurrentPlaylistElement == -1) + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -362,7 +362,7 @@ namespace Vocaluxe.Menu return false; case Keys.Down: - if (CurrentPlaylistElement == -1) + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -398,6 +398,14 @@ namespace Vocaluxe.Menu } return false; + case Keys.Back: + ClosePlaylist(); + break; + + case Keys.Enter: + StartPlaylistSongs(); + break; + case Keys.PageUp: if (CurrentPlaylistElement != -1) { @@ -634,6 +642,11 @@ namespace Vocaluxe.Menu PlaylistElementContents.Add(pec); } Update(); + if (PlaylistElementContents.Count - 1 < ActiveHover || PlaylistElementContents.Count - 1 < CurrentPlaylistElement) + { + ActiveHover = PlaylistElementContents.Count - 1; + CurrentPlaylistElement = PlaylistElementContents.Count - 1; + } } private void StartPlaylistSongs() diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 83988d94..33e66de9 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -642,6 +642,9 @@ namespace Vocaluxe.Screens private void ClosePlaylist() { SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + _PlaylistActive = false; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); } private void UpdatePlaylistNames() From 8cbc0a1ae64af5b9db115d856d0e24384024c245 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 17:21:05 +0200 Subject: [PATCH 45/67] fixed typo --- Vocaluxe/Lib/Sound/COpenALPlay.cs | 2 +- Vocaluxe/Menu/CButton.cs | 2 +- Vocaluxe/Menu/CPlaylist.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Lib/Sound/COpenALPlay.cs b/Vocaluxe/Lib/Sound/COpenALPlay.cs index 99215d7a..85e17cd4 100644 --- a/Vocaluxe/Lib/Sound/COpenALPlay.cs +++ b/Vocaluxe/Lib/Sound/COpenALPlay.cs @@ -804,7 +804,7 @@ namespace Vocaluxe.Lib.Sound { AL.GetSource(_source, ALGetSourcei.BuffersProcessed, out processed_count); doit = false; - Console.WriteLine("Buffers Prozessed on Stream " + _source.ToString() + " = " + processed_count.ToString()); + Console.WriteLine("Buffers Processed on Stream " + _source.ToString() + " = " + processed_count.ToString()); if (processed_count < 1) return; } diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index e03992c6..49e27c7c 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -284,7 +284,7 @@ namespace Vocaluxe.Menu } } - public void ProzessMouseMove(int x, int y) + public void ProcessMouseMove(int x, int y) { Selected = CHelper.IsInBounds(Rect, x, y); } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f5a664ed..d4d270f7 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -560,10 +560,10 @@ namespace Vocaluxe.Menu if (ActivePlaylistID > -1) { - _Theme.ButtonPlaylistClose.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSing.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSave.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistDelete.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistClose.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSing.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSave.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistDelete.ProcessMouseMove(mevent.X, mevent.Y); if (mevent.LB) { if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) From 6f2fe5f1a70f88465fa050c35c750234b9527d4e Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 22:55:50 +0200 Subject: [PATCH 46/67] new interaction handling for playlist (there are still some minor bugs) --- Output/Themes/Ambient/Screens/ScreenSong.xml | 2 +- Vocaluxe/Base/CPlaylists.cs | 12 +- .../{CPlaylist.cs => CPlaylistFile.cs} | 6 +- Vocaluxe/Menu/CBackground.cs | 5 + Vocaluxe/Menu/CButton.cs | 5 + Vocaluxe/Menu/CEqualizer.cs | 5 + Vocaluxe/Menu/CLyric.cs | 5 + Vocaluxe/Menu/CMenu.cs | 6 +- Vocaluxe/Menu/CNameSelection.cs | 5 + Vocaluxe/Menu/CPlaylist.cs | 322 +++++++++++++----- Vocaluxe/Menu/CSelectSlide.cs | 55 +++ Vocaluxe/Menu/CStatic.cs | 5 + Vocaluxe/Menu/CText.cs | 6 + Vocaluxe/Menu/IMenuElement.cs | 1 + Vocaluxe/Menu/SingNotes/CSingNotes.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenu.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 2 + Vocaluxe/Screens/CScreenSong.cs | 4 +- Vocaluxe/Vocaluxe.csproj | 3 +- 20 files changed, 360 insertions(+), 104 deletions(-) rename Vocaluxe/Lib/Playlist/{CPlaylist.cs => CPlaylistFile.cs} (98%) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 6250bf88..aff97838 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -741,7 +741,7 @@ 80 295 460 - -1,00 + -0,90 50,00 CoverTile CoverTile diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index 8ab1dfe5..c9babd16 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -13,10 +13,10 @@ namespace Vocaluxe.Base static class CPlaylists { - private static List _Playlists; + private static List _Playlists; private static CHelper Helper = new CHelper(); - public static CPlaylist[] Playlists + public static CPlaylistFile[] Playlists { get { return _Playlists.ToArray(); } } @@ -46,13 +46,13 @@ namespace Vocaluxe.Base public static void LoadPlaylists() { - _Playlists = new List(); + _Playlists = new List(); List files = new List(); files.AddRange(Helper.ListFiles(CSettings.sFolderPlaylists, "*.xml", true, true)); foreach (string file in files) { - CPlaylist playlist = new CPlaylist(file); + CPlaylistFile playlist = new CPlaylistFile(file); _Playlists.Add(playlist); } @@ -66,7 +66,7 @@ namespace Vocaluxe.Base _Playlists.Sort(CompareByPlaylistName); } - private static int CompareByPlaylistName(CPlaylist a, CPlaylist b) + private static int CompareByPlaylistName(CPlaylistFile a, CPlaylistFile b) { return String.Compare(a.PlaylistName, b.PlaylistName); } @@ -98,7 +98,7 @@ namespace Vocaluxe.Base public static int NewPlaylist() { - CPlaylist pl = new CPlaylist(); + CPlaylistFile pl = new CPlaylistFile(); pl.PlaylistName = "New Playlist"; _Playlists.Add(pl); return (_Playlists.Count - 1); diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs similarity index 98% rename from Vocaluxe/Lib/Playlist/CPlaylist.cs rename to Vocaluxe/Lib/Playlist/CPlaylistFile.cs index 47e59ca6..0bef3b65 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs @@ -29,7 +29,7 @@ namespace Vocaluxe.Lib.Playlist } } - public class CPlaylist + public class CPlaylistFile { private static XmlWriterSettings _settings = new XmlWriterSettings(); private static CHelper Helper = new CHelper(); @@ -38,14 +38,14 @@ namespace Vocaluxe.Lib.Playlist public string PlaylistFile; public List Songs = new List(); - public CPlaylist() + public CPlaylistFile() { Init(); PlaylistName = string.Empty; PlaylistFile = string.Empty; } - public CPlaylist(string file) + public CPlaylistFile(string file) { Init(); PlaylistFile = file; diff --git a/Vocaluxe/Menu/CBackground.cs b/Vocaluxe/Menu/CBackground.cs index cedc4eb5..1b6b0b83 100644 --- a/Vocaluxe/Menu/CBackground.cs +++ b/Vocaluxe/Menu/CBackground.cs @@ -38,6 +38,11 @@ namespace Vocaluxe.Menu public SColorF Color; + public string GetThemeName() + { + return _Theme.Name; + } + #region Constructors public CBackground() { diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index 49e27c7c..b25c6482 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -55,6 +55,11 @@ namespace Vocaluxe.Menu } public bool Visible; + public string GetThemeName() + { + return _Theme.Name; + } + public CButton() { _Theme = new SThemeButton(); diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index a3c6767d..89fe35c3 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -47,6 +47,11 @@ namespace Vocaluxe.Menu public bool Visible; public bool ScreenHandles; + public string GetThemeName() + { + return _Theme.Name; + } + private float[] _Bars; public CEqualizer() diff --git a/Vocaluxe/Menu/CLyric.cs b/Vocaluxe/Menu/CLyric.cs index bc4bbbab..21929681 100644 --- a/Vocaluxe/Menu/CLyric.cs +++ b/Vocaluxe/Menu/CLyric.cs @@ -47,6 +47,11 @@ namespace Vocaluxe.Menu private float _Alpha = 1f; + public string GetThemeName() + { + return _Theme.Name; + } + public SRectF Rect { get { return new SRectF(_X, _Y, _MaxW, _H, _Z); } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index ffbd6281..7089747f 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -879,8 +879,7 @@ namespace Vocaluxe.Menu { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) KeyEvent.Handled = PrevElement(); - - if (!KeyEvent.Handled) + else KeyEvent.Handled = _NextInteraction(KeyEvent); } @@ -888,8 +887,7 @@ namespace Vocaluxe.Menu { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) KeyEvent.Handled = NextElement(); - - if (!KeyEvent.Handled) + else KeyEvent.Handled = _NextInteraction(KeyEvent); } diff --git a/Vocaluxe/Menu/CNameSelection.cs b/Vocaluxe/Menu/CNameSelection.cs index 5a539c7c..5d426a89 100644 --- a/Vocaluxe/Menu/CNameSelection.cs +++ b/Vocaluxe/Menu/CNameSelection.cs @@ -49,6 +49,11 @@ namespace Vocaluxe.Menu private SThemeNameSelection _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + public bool Selected = false; public bool Visible = true; diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index d4d270f7..ecd01d59 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; +using Vocaluxe.Lib.Song; using Vocaluxe.GameModes; namespace Vocaluxe.Menu @@ -69,6 +70,13 @@ namespace Vocaluxe.Menu private SThemePlaylist _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + + private CObjectInteractions _Interactions; + private List PlaylistElements; private List PlaylistElementContents; @@ -85,6 +93,7 @@ namespace Vocaluxe.Menu set { _Selected = value; + _Interactions.Active = value; if (CurrentPlaylistElement == -1 && _Selected && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; @@ -122,13 +131,26 @@ namespace Vocaluxe.Menu PlaylistElements = new List(); PlaylistElementContents = new List(); + _Interactions = new CObjectInteractions(); + Visible = false; - Selected = false; + Selected = false; } public void Init() { PrepareList(); + _Interactions.AddText(_Theme.Text1); + _Interactions.AddText(_Theme.Text2); + _Interactions.AddText(_Theme.Text3); + _Interactions.AddText(_Theme.TextPlaylistHeader); + _Interactions.AddStatic(_Theme.StaticCover); + _Interactions.AddStatic(_Theme.StaticPlaylistFooter); + _Interactions.AddStatic(_Theme.StaticPlaylistHeader); + _Interactions.AddButton(_Theme.ButtonPlaylistClose); + _Interactions.AddButton(_Theme.ButtonPlaylistDelete); + _Interactions.AddButton(_Theme.ButtonPlaylistSave); + _Interactions.AddButton(_Theme.ButtonPlaylistSing); } public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) @@ -290,20 +312,14 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundColor; } - PlaylistElements[i].Background.Draw(); - PlaylistElements[i].Cover.Draw(); - PlaylistElements[i].Text1.Draw(); - PlaylistElements[i].Text2.Draw(); - PlaylistElements[i].Text3.Draw(); - PlaylistElements[i].SelectSlide.Draw(); } - _Theme.ButtonPlaylistSing.Draw(); - _Theme.ButtonPlaylistSave.Draw(); - _Theme.ButtonPlaylistDelete.Draw(); - _Theme.ButtonPlaylistClose.Draw(); - _Theme.StaticPlaylistHeader.Draw(); - _Theme.StaticPlaylistFooter.Draw(); - _Theme.TextPlaylistHeader.Draw(); + + _Interactions.Draw(); + } + + public bool IsMouseOver(MouseEvent MouseEvent) + { + return CHelper.IsInBounds(Rect, MouseEvent.X, MouseEvent.Y) || _Interactions.IsMouseOver(MouseEvent); } public void UnloadTextures() @@ -329,34 +345,77 @@ namespace Vocaluxe.Menu LoadTextures(); } - public bool HandleInput(KeyEvent kevent) + public bool HandleInput(KeyEvent KeyEvent) { if (Selected) { - switch (kevent.Key) + int PrevPlaylistElement = CurrentPlaylistElement; + int CurrPlaylistElement = -1; + //_Interactions.HandleInput(KeyEvent); + + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (PlaylistElementContents.Count - 1 >= i && PlaylistElements[i].SelectSlide.Selected) + CurrPlaylistElement = i; + } + + switch (KeyEvent.Key) { case Keys.Up: if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = 0; + _Interactions.HandleInput(KeyEvent); + SetSelectionToLastEntry(); + return true; + } + else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } return true; } else if (CurrentPlaylistElement - 1 > 0) { - CurrentPlaylistElement--; - ActiveHover = CurrentPlaylistElement; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } return true; } else if (CurrentPlaylistElement - 1 == 0) { - CurrentPlaylistElement--; if (Offset > 0) { Offset--; Update(); } - ActiveHover = CurrentPlaylistElement; + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; } return false; @@ -364,28 +423,63 @@ namespace Vocaluxe.Menu case Keys.Down: if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = 0; - ActiveHover = CurrentPlaylistElement; + _Interactions.HandleInput(KeyEvent); + SetSelectionToFirstEntry(); return true; } - else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + else if (CurrentPlaylistElement == PlaylistElements.Count -1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) { - if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) + CurrentPlaylistElement = -1; + ActiveHover = CurrentPlaylistElement; + + int sel = PlaylistElementContents.Count - 1; + if (sel > PlaylistElements.Count - 1) + sel = PlaylistElements.Count - 1; + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) { - CurrentPlaylistElement++; + CurrentPlaylistElement = selection; ActiveHover = CurrentPlaylistElement; - return true; } + return true; } - else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) + { + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) { if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) { Offset++; - Update(); - ActiveHover = CurrentPlaylistElement; - return true; + Update(); } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; } return false; @@ -394,6 +488,8 @@ namespace Vocaluxe.Menu { CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); UpdatePlaylist(); + if (CurrentPlaylistElement != -1) + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } return false; @@ -420,6 +516,7 @@ namespace Vocaluxe.Menu Offset--; } UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } break; @@ -438,28 +535,27 @@ namespace Vocaluxe.Menu Offset++; } UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } break; case Keys.Left: + _Interactions.HandleInput(KeyEvent); if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } return false; case Keys.Right: + _Interactions.HandleInput(KeyEvent); if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } return false; @@ -468,72 +564,117 @@ namespace Vocaluxe.Menu return false; } - public bool HandleMouse(MouseEvent mevent) + private void SetSelectionToLastEntry() { - if (CHelper.IsInBounds(Rect, mevent) && Visible) + if (PlaylistElementContents.Count == 0) + return; + + int selection = GetSelectedSelectionNr(); + if (selection == -1) + return; + + int off = PlaylistElementContents.Count - PlaylistElements.Count; + if (off >= 0) { - if (mevent.Wheel > 0) + Offset = off; + Update(); + } + + if (PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + } + + private void SetSelectionToFirstEntry() + { + if (PlaylistElementContents.Count == 0) + return; + + int selection = GetSelectedSelectionNr(); + if (selection == -1) + return; + + Offset = 0; + Update(); + + if (PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + } + + private int GetSelectedSelectionNr() + { + for (int i = 0; i < PlaylistElements.Count; i++) + { + if (PlaylistElements[i].SelectSlide.Selected) + return i; + } + return -1; + } + + public bool HandleMouse(MouseEvent MouseEvent) + { + _Interactions.HandleMouse(MouseEvent); + + if (CHelper.IsInBounds(Rect, MouseEvent) && Visible) + { + if (MouseEvent.Wheel > 0) { - if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) { - Offset = Offset + mevent.Wheel; + Offset += MouseEvent.Wheel; Update(); return true; } return true; } - else if (mevent.Wheel < 0) + else if (MouseEvent.Wheel < 0) { - if (Offset + mevent.Wheel >= 0) + if (Offset + MouseEvent.Wheel >= 0) { - Offset = Offset + mevent.Wheel; + Offset += MouseEvent.Wheel; Update(); return true; } } - if (mevent.LB) + + if (MouseEvent.LB) { if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } } for (int i = 0; i < PlaylistElements.Count; i++) - { + { //Hover for playlist-element - if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) { - PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); - PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; CurrentPlaylistElement = i; } - else - { - PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); - PlaylistElements[i].Background.Color = BackgroundColor; - } - //Hover for SelectSlide-Arrow - PlaylistElements[i].SelectSlide.ProcessMouseMove(mevent.X, mevent.Y); + //Delete Entry with RB - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) { CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); UpdatePlaylist(); return true; } //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) { changeOrder = true; CurrentPlaylistElement = i; } - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && changeOrder) { /* if (PlaylistElements.Count < CurrentPlaylistElement + 1) @@ -560,25 +701,21 @@ namespace Vocaluxe.Menu if (ActivePlaylistID > -1) { - _Theme.ButtonPlaylistClose.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSing.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSave.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistDelete.ProcessMouseMove(mevent.X, mevent.Y); - if (mevent.LB) + if (MouseEvent.LB) { - if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) + if (_Theme.ButtonPlaylistClose.Selected) { ClosePlaylist(); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSing.Rect, mevent)) + else if (_Theme.ButtonPlaylistSing.Selected) { StartPlaylistSongs(); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSave.Rect, mevent)) + else if (_Theme.ButtonPlaylistSave.Selected) { CPlaylists.SavePlaylist(ActivePlaylistID); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistDelete.Rect, mevent)) + else if (_Theme.ButtonPlaylistDelete.Selected) { CPlaylists.DeletePlaylist(ActivePlaylistID); ClosePlaylist(); @@ -599,12 +736,20 @@ namespace Vocaluxe.Menu en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); - en.SelectSlide = (CSelectSlide)_Theme.SelectSlideGameMode.Clone(); + + + en.SelectSlide = new CSelectSlide(_Theme.SelectSlideGameMode); en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); en.Content = -1; PlaylistElements.Add(en); + _Interactions.AddSelectSlide(en.SelectSlide); + _Interactions.AddText(en.Text1); + _Interactions.AddText(en.Text2); + _Interactions.AddText(en.Text3); + _Interactions.AddStatic(en.Background); + _Interactions.AddStatic(en.Cover); } } @@ -637,7 +782,7 @@ namespace Vocaluxe.Menu { PlaylistElementContent pec = new PlaylistElementContent(); pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; - pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Modes = CSongs.AllSongs[pec.SongID].AvailableGameModes; pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; PlaylistElementContents.Add(pec); } @@ -679,30 +824,31 @@ namespace Vocaluxe.Menu int e = 0 + Offset; for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (e < PlaylistElementContents.Count) + if (e + i < PlaylistElementContents.Count) { - PlaylistElements[i].Content = e; + PlaylistElements[i].Content = e+i; PlaylistElements[i].Background.Visible = true; PlaylistElements[i].Cover.Visible = true; PlaylistElements[i].SelectSlide.Visible = true; PlaylistElements[i].Text1.Visible = true; PlaylistElements[i].Text2.Visible = true; PlaylistElements[i].Text3.Visible = true; - PlaylistElements[i].Cover.Texture = CSongs.GetSong(PlaylistElementContents[e].SongID).CoverTextureSmall; - string t1 = _Theme.Text1.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); - string t2 = _Theme.Text2.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); - string t3 = _Theme.Text3.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + PlaylistElementContent pec = PlaylistElementContents[e + i]; + CSong song = CSongs.GetSong(pec.SongID); + PlaylistElements[i].Cover.Texture = song.CoverTextureSmall; + string t1 = _Theme.Text1.Text.Replace("%a", song.Artist).Replace("%t", song.Title); + string t2 = _Theme.Text2.Text.Replace("%a", song.Artist).Replace("%t", song.Title); + string t3 = _Theme.Text3.Text.Replace("%a", song.Artist).Replace("%t", song.Title); PlaylistElements[i].Text1.Text = t1; PlaylistElements[i].Text2.Text = t2; PlaylistElements[i].Text3.Text = t3; PlaylistElements[i].SelectSlide.Clear(); - for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) + for (int g = 0; g < pec.Modes.Length; g++) { - PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); - if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) + PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), pec.Modes[g])); + if (pec.Modes[g] == pec.Mode) PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); - } - e++; + } } else { diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 76893d78..28fb9493 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -43,6 +43,11 @@ namespace Vocaluxe.Menu private SThemeSelectSlide _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + public SRectF Rect; public SRectF RectArrowLeft; public SRectF RectArrowRight; @@ -159,6 +164,56 @@ namespace Vocaluxe.Menu _ValueNames = new List(); } + public CSelectSlide(CSelectSlide slide) + { + _Theme = new SThemeSelectSlide(); + + _Theme.TextureArrowLeftName = slide._Theme.TextureArrowLeftName; + _Theme.TextureArrowRightName = slide._Theme.TextureArrowRightName; + + _Theme.STextureName = slide._Theme.STextureName; + _Theme.STextureArrowLeftName = slide._Theme.STextureArrowLeftName; + _Theme.STextureArrowRightName = slide._Theme.STextureArrowRightName; + + _Theme.HTextureName = slide._Theme.HTextureName; + + _Theme.ColorName = slide._Theme.ColorName; + _Theme.SColorName = slide._Theme.SColorName; + _Theme.HColorName = slide._Theme.HColorName; + + _Theme.ArrowColorName = slide._Theme.ArrowColorName; + _Theme.SArrowColorName = slide._Theme.SArrowColorName; + + _Theme.TextColorName = slide._Theme.TextColorName; + _Theme.STextColorName = slide._Theme.STextColorName; + + _Theme.TextFont = slide._Theme.TextFont; + _Theme.TextStyle = slide._Theme.TextStyle; + + _ThemeLoaded = false; + + Rect = new SRectF(slide.Rect); + RectArrowLeft = new SRectF(slide.RectArrowLeft); + RectArrowRight = new SRectF(slide.RectArrowRight); + + Color = new SColorF(slide.Color); + SColor = new SColorF(slide.SColor); + + ColorArrow = new SColorF(slide.ColorArrow); + SColorArrow = new SColorF(slide.SColorArrow); + + TextColor = new SColorF(slide.TextColor); + STextColor = new SColorF(slide.STextColor); + TextH = slide.TextH; + MaxW = slide.MaxW; + + _Selected = false; + _Textures = new List(); + _ValueIndexes = new List(); + _ValueNames = new List(); + _NumVisible = slide._NumVisible; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/CStatic.cs b/Vocaluxe/Menu/CStatic.cs index 98e4e9f4..37d29d04 100644 --- a/Vocaluxe/Menu/CStatic.cs +++ b/Vocaluxe/Menu/CStatic.cs @@ -22,6 +22,11 @@ namespace Vocaluxe.Menu private SThemeStatic _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + private STexture _Texture; public STexture Texture { diff --git a/Vocaluxe/Menu/CText.cs b/Vocaluxe/Menu/CText.cs index 012709dc..df5ccf23 100644 --- a/Vocaluxe/Menu/CText.cs +++ b/Vocaluxe/Menu/CText.cs @@ -41,6 +41,12 @@ namespace Vocaluxe.Menu { private SThemeText _Theme; private bool _ThemeLoaded; + + public string GetThemeName() + { + return _Theme.Name; + } + private bool _ButtonText; private bool _PositionNeedsUpdate = true; diff --git a/Vocaluxe/Menu/IMenuElement.cs b/Vocaluxe/Menu/IMenuElement.cs index 25e56c50..152e4ec1 100644 --- a/Vocaluxe/Menu/IMenuElement.cs +++ b/Vocaluxe/Menu/IMenuElement.cs @@ -8,6 +8,7 @@ namespace Vocaluxe.Menu { interface IMenuElement { + string GetThemeName(); bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex); bool SaveTheme(XmlWriter writer); diff --git a/Vocaluxe/Menu/SingNotes/CSingNotes.cs b/Vocaluxe/Menu/SingNotes/CSingNotes.cs index fef6da24..244d380b 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotes.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotes.cs @@ -75,6 +75,11 @@ namespace Vocaluxe.Menu.SingNotes _ActID = 0; } + public string GetThemeName() + { + return _Theme.Name; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index 48fdf61f..7f437ab0 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -141,6 +141,11 @@ namespace Vocaluxe.Menu.SongMenu #endregion ISongMenu #region IMenuElement + public string GetThemeName() + { + return _SongMenu.GetThemeName(); + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { return _SongMenu.LoadTheme(XmlPath, ElementName, navigator, SkinIndex); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index b32037ee..6f59fa36 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -249,6 +249,11 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded = false; } + public string GetThemeName() + { + return _Theme.Name; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 9dafa1bb..64104010 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -692,6 +692,7 @@ namespace Vocaluxe.Menu.SongMenu } } + _Rect = _Theme.songMenuTileBoard.TileRectSmall; _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRectSmall.Z); } else @@ -717,6 +718,7 @@ namespace Vocaluxe.Menu.SongMenu } } + _Rect = _Theme.songMenuTileBoard.TileRect; _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z); } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 33e66de9..bbc0f021 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -269,7 +269,7 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if (CHelper.IsInBounds(Playlists[htPlaylists(Playlist)].Rect, MouseEvent.X, MouseEvent.Y)) + if (Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) { _PlaylistActive = true; Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; @@ -377,8 +377,10 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); + if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) CheckPlaylist(); + Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 212abf5a..156dd856 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -189,7 +189,7 @@ Form - + @@ -215,6 +215,7 @@ + From f079d458c657f60bae750c2a507c68329d1d8092 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Mon, 13 Aug 2012 07:27:05 +0200 Subject: [PATCH 47/67] added missing file --- Vocaluxe/Menu/CObjectInteractions.cs | 1091 ++++++++++++++++++++++++++ 1 file changed, 1091 insertions(+) create mode 100644 Vocaluxe/Menu/CObjectInteractions.cs diff --git a/Vocaluxe/Menu/CObjectInteractions.cs b/Vocaluxe/Menu/CObjectInteractions.cs new file mode 100644 index 00000000..30dd279c --- /dev/null +++ b/Vocaluxe/Menu/CObjectInteractions.cs @@ -0,0 +1,1091 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; +using Vocaluxe.Menu.SingNotes; +using Vocaluxe.Menu.SongMenu; + +namespace Vocaluxe.Menu +{ + class CObjectInteractions + { + private List _Interactions; + private int _Selection = 0; + + private List _Statics; + private List _Texts; + private List _Buttons; + private List _SelectSlides; + + private int _PrevMouseX; + private int _PrevMouseY; + + protected int _MouseDX; + protected int _MouseDY; + + public bool Active; + + protected SRectF _ScreenArea; + + public SRectF ScreenArea + { + get { return _ScreenArea; } + } + + public CObjectInteractions() + { + Init(); + } + + protected virtual void Init() + { + _Interactions = new List(); + _Selection = 0; + + _Statics = new List(); + _Texts = new List(); + _Buttons = new List(); + _SelectSlides = new List(); + + _PrevMouseX = 0; + _PrevMouseY = 0; + + _MouseDX = 0; + _MouseDY = 0; + + Active = false; + _ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f); + } + #region GetLists + public List GetButtons() + { + return _Buttons; + } + + public List GetSelectSlides() + { + return _SelectSlides; + } + #endregion GetLists + + #region ElementHandler + #region Get Arrays + public CButton[] Buttons + { + get + { + return _Buttons.ToArray(); + } + } + + public CSelectSlide[] SelectSlides + { + get + { + return _SelectSlides.ToArray(); + } + } + #endregion Get Arrays + #endregion ElementHandler + + #region MenuHandler + public bool HandleInput(KeyEvent KeyEvent) + { + if (!CSettings.TabNavigation) + { + if (KeyEvent.Key == Keys.Left) + { + if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) + KeyEvent.Handled = PrevElement(); + else + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + + if (KeyEvent.Key == Keys.Right) + { + if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) + KeyEvent.Handled = NextElement(); + else + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + + if (KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down) + { + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + } + else + { + if (KeyEvent.Key == Keys.Tab) + { + if (KeyEvent.Mod == Modifier.Shift) + PrevInteraction(); + else + NextInteraction(); + } + + if (KeyEvent.Key == Keys.Left) + PrevElement(); + + if (KeyEvent.Key == Keys.Right) + NextElement(); + } + + return true; + } + + public bool HandleMouse(MouseEvent MouseEvent) + { + int selection = _Selection; + ProcessMouseMove(MouseEvent.X, MouseEvent.Y); + if (selection != _Selection) + { + _UnsetHighlighted(selection); + _SetHighlighted(_Selection); + } + + if (MouseEvent.LB) + ProcessMouseClick(MouseEvent.X, MouseEvent.Y); + + _PrevMouseX = MouseEvent.X; + _PrevMouseY = MouseEvent.Y; + + return true; + } + + public bool HandleInputThemeEditor(KeyEvent KeyEvent) + { + _UnsetHighlighted(_Selection); + if (KeyEvent.KeyPressed) + { + + } + else + { + switch (KeyEvent.Key) + { + case Keys.S: + CGraphics.SaveTheme(); + break; + + case Keys.Up: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(0, -1); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(0, 1); + + break; + case Keys.Down: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(0, 1); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(0, -1); + + break; + + case Keys.Right: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(1, 0); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(1, 0); + + if (KeyEvent.Mod == Modifier.None) + NextInteraction(); + break; + case Keys.Left: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(-1, 0); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(-1, 0); + + if (KeyEvent.Mod == Modifier.None) + PrevInteraction(); + break; + } + } + return true; + } + + public bool HandleMouseThemeEditor(MouseEvent MouseEvent) + { + _UnsetHighlighted(_Selection); + _MouseDX = MouseEvent.X - _PrevMouseX; + _MouseDY = MouseEvent.Y - _PrevMouseY; + + int stepX = 0; + int stepY = 0; + + if ((MouseEvent.Mod & Modifier.Ctrl) == Modifier.Ctrl) + { + _PrevMouseX = MouseEvent.X; + _PrevMouseY = MouseEvent.Y; + } + else + { + while (Math.Abs(MouseEvent.X - _PrevMouseX) >= 5) + { + if (MouseEvent.X - _PrevMouseX >= 5) + stepX += 5; + + if (MouseEvent.X - _PrevMouseX <= -5) + stepX -= 5; + + _PrevMouseX = MouseEvent.X - (_MouseDX - stepX); + } + + while (Math.Abs(MouseEvent.Y - _PrevMouseY) >= 5) + { + if (MouseEvent.Y - _PrevMouseY >= 5) + stepY += 5; + + if (MouseEvent.Y - _PrevMouseY <= -5) + stepY -= 5; + + _PrevMouseY = MouseEvent.Y - (_MouseDY - stepY); + } + } + + if (MouseEvent.LBH) + { + //if (IsMouseOver(MouseEvent.X, _PrevMouseY)) + //{ + if (MouseEvent.Mod == Modifier.None) + MoveElement(stepX, stepY); + + if (MouseEvent.Mod == Modifier.Ctrl) + MoveElement(_MouseDX, _MouseDY); + + if (MouseEvent.Mod == Modifier.Shift) + ResizeElement(stepX, stepY); + + if (MouseEvent.Mod == (Modifier.Shift | Modifier.Ctrl)) + ResizeElement(_MouseDX, _MouseDY); + //} + } + else + ProcessMouseMove(MouseEvent.X, MouseEvent.Y); + + return true; + } + #endregion MenuHandler + + #region Drawing + public void Draw() + { + if (_Interactions.Count <= 0) + return; + + List items = new List(); + + for (int i = 0; i < _Interactions.Count; i++) + { + if (_IsVisible(i) && ( + _Interactions[i].Type == EType.TButton || + _Interactions[i].Type == EType.TSelectSlide || + _Interactions[i].Type == EType.TStatic || + _Interactions[i].Type == EType.TNameSelection || + _Interactions[i].Type == EType.TText || + _Interactions[i].Type == EType.TSongMenu || + _Interactions[i].Type == EType.TEqualizer)) + { + ZSort zs = new ZSort(); + zs.ID = i; + zs.z = _GetZValue(i); + items.Add(zs); + } + } + + if (items.Count <= 0) + return; + + + items.Sort(delegate(ZSort s1, ZSort s2) { return (s2.z.CompareTo(s1.z)); }); + + for (int i = 0; i < items.Count; i++) + { + _DrawInteraction(items[i].ID); + } + + } + #endregion Drawing + + #region Elements + public int AddStatic(CStatic stat) + { + _Statics.Add(stat); + _AddInteraction(_Statics.Count - 1, EType.TStatic); + return _Statics.Count - 1; + } + + public int AddText(CText text) + { + _Texts.Add(text); + _AddInteraction(_Texts.Count - 1, EType.TText); + return _Texts.Count - 1; + } + + public int AddButton(CButton button) + { + _Buttons.Add(button); + _AddInteraction(_Buttons.Count - 1, EType.TButton); + return _Buttons.Count - 1; + } + + public int AddSelectSlide(CSelectSlide slide) + { + _SelectSlides.Add(slide); + _AddInteraction(_SelectSlides.Count - 1, EType.TSelectSlide); + return _SelectSlides.Count - 1; + } + #endregion Elements + + #region InteractionHandling + public void NextInteraction() + { + if (_Interactions.Count > 0) + _NextInteraction(); + } + + public void PrevInteraction() + { + if (_Interactions.Count > 0) + _PrevInteraction(); + } + + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool NextElement() + { + if (_Interactions.Count > 0) + return _NextElement(); + + return false; + } + + /// + /// Selects the previous element in a menu interaction. + /// + /// True if the previous element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool PrevElement() + { + if (_Interactions.Count > 0) + return _PrevElement(); + + return false; + } + + public bool SetInteractionToButton(CButton button) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (_Interactions[i].Type == EType.TButton) + { + if (_Buttons[_Interactions[i].Num].Visible && _Buttons[_Interactions[i].Num] == button) + { + _UnsetSelected(); + _UnsetHighlighted(_Selection); + _Selection = i; + _SetSelected(); + return true; + } + } + } + return false; + } + + public bool SetInteractionToSelectSlide(CSelectSlide slide) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (_Interactions[i].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[i].Num].Visible && _SelectSlides[_Interactions[i].Num] == slide) + { + _UnsetSelected(); + _UnsetHighlighted(_Selection); + _Selection = i; + _SetSelected(); + return true; + } + } + } + return false; + } + + public void ProcessMouseClick(int x, int y) + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[_Selection].Num].Visible) + { + _SelectSlides[_Interactions[_Selection].Num].ProcessMouseLBClick(x, y); + } + } + } + + public void ProcessMouseMove(int x, int y) + { + SelectByMouse(x, y); + + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[_Selection].Num].Visible) + { + _SelectSlides[_Interactions[_Selection].Num].ProcessMouseMove(x, y); + } + } + } + + public void SelectByMouse(int x, int y) + { + float z = CSettings.zFar; + for (int i = 0; i < _Interactions.Count; i++) + { + if ((CSettings.GameState == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i))) + { + if (_IsMouseOver(x, y, _Interactions[i])) + { + if (_GetZValue(_Interactions[i]) <= z) + { + z = _GetZValue(_Interactions[i]); + _UnsetSelected(); + _Selection = i; + _SetSelected(); + } + } + } + } + } + + public bool IsMouseOver(MouseEvent MouseEvent) + { + return IsMouseOver(MouseEvent.X, MouseEvent.Y); + } + + public bool IsMouseOver(int x, int y) + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return false; + + if (_Interactions.Count > 0) + return _IsMouseOver(x, y, _Interactions[_Selection]); + else + return false; + } + + private bool _IsMouseOver(int x, int y, CInteraction interact) + { + switch (interact.Type) + { + case EType.TButton: + if (CHelper.IsInBounds(_Buttons[interact.Num].Rect, x, y)) + return true; + break; + case EType.TSelectSlide: + if (CHelper.IsInBounds(_SelectSlides[interact.Num].Rect, x, y) || + CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowLeft, x, y) || + CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowRight, x, y)) + return true; + break; + } + return false; + } + + private float _GetZValue(CInteraction interact) + { + switch (interact.Type) + { + case EType.TStatic: + return _Statics[interact.Num].Rect.Z; + case EType.TText: + return _Texts[interact.Num].Z; + case EType.TButton: + return _Buttons[interact.Num].Rect.Z; + case EType.TSelectSlide: + return _SelectSlides[interact.Num].Rect.Z; + } + return CSettings.zFar; + } + + private float _GetZValue(int interaction) + { + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + return _Statics[_Interactions[interaction].Num].Rect.Z; + case EType.TText: + return _Texts[_Interactions[interaction].Num].Z; + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Rect.Z; + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Rect.Z; + } + + return CSettings.zFar; + } + + private void _NextInteraction() + { + _UnsetSelected(); + if (CSettings.GameState != EGameState.EditTheme) + { + bool found = false; + int start = _Selection; + do + { + start++; + if (start > _Interactions.Count - 1) + start = 0; + + if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start))) + found = true; + } while (!found); + _Selection = start; + } + else + { + _Selection++; + if (_Selection > _Interactions.Count - 1) + _Selection = 0; + } + _SetSelected(); + } + + private void _PrevInteraction() + { + _UnsetSelected(); + if (CSettings.GameState != EGameState.EditTheme) + { + bool found = false; + int start = _Selection; + do + { + start--; + if (start < 0) + start = _Interactions.Count - 1; + + if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start))) + found = true; + } while (!found); + _Selection = start; + } + else + { + _Selection--; + if (_Selection < 0) + _Selection = _Interactions.Count - 1; + } + _SetSelected(); + } + + /// + /// Selects the next best interaction in a menu. + /// + /// + /// + private bool _NextInteraction(KeyEvent Key) + { + KeyEvent[] Directions = new KeyEvent[4]; + float[] Distances = new float[4]; + int[] stages = new int[4]; + int[] elements = new int[4]; + + for (int i = 0; i < 4; i++) + { + Directions[i] = new KeyEvent(); + } + + Directions[0].Key = Keys.Up; + Directions[1].Key = Keys.Right; + Directions[2].Key = Keys.Down; + Directions[3].Key = Keys.Left; + + for (int i = 0; i < 4; i++) + { + elements[i] = _GetNextElement(Directions[i], out Distances[i], out stages[i]); + } + + int element = _Selection; + int stage = int.MaxValue; + float distance = float.MaxValue; + int direction = -1; + + int mute = -1; + switch (Key.Key) + { + case Keys.Up: + mute = 2; + break; + case Keys.Right: + mute = 3; + break; + case Keys.Down: + mute = 0; + break; + case Keys.Left: + mute = 1; + break; + } + + for (int i = 0; i < 4; i++) + { + if (i != mute && elements[i] != _Selection && (stages[i] < stage || (stages[i] == stage && Directions[i].Key == Key.Key))) + { + stage = stages[i]; + element = elements[i]; + distance = Distances[i]; + direction = i; + } + } + + if (direction != -1) + { + // select the new element + if (Directions[direction].Key == Key.Key) + { + _UnsetHighlighted(_Selection); + _UnsetSelected(); + + _Selection = element; + _SetSelected(); + _SetHighlighted(_Selection); + + return true; + } + } + return false; + } + + private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage) + { + Distance = float.MaxValue; + int min = _Selection; + SRectF actualRect = _GetRect(_Selection); + Stage = int.MaxValue; + + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistanceDirect(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 10; + } + } + } + + if (min == _Selection) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistance180(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 20; + } + } + } + } + + if (min == _Selection) + { + switch (Key.Key) + { + case Keys.Up: + actualRect = new SRectF(actualRect.X, CSettings.iRenderH, 1, 1, actualRect.Z); + break; + case Keys.Down: + actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z); + break; + case Keys.Left: + actualRect = new SRectF(CSettings.iRenderW, actualRect.Y, 1, 1, actualRect.Z); + break; + case Keys.Right: + actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z); + break; + default: + break; + } + + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistance180(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 30; + } + } + } + } + return min; + } + + private float _GetDistanceDirect(KeyEvent Key, SRectF actualRect, SRectF targetRect) + { + PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f); + PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f); + + PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y); + float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y); + bool inDirection = false; + switch (Key.Key) + { + case Keys.Up: + if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + inDirection = true; + break; + + case Keys.Down: + if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + inDirection = true; + break; + + case Keys.Left: + if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + inDirection = true; + break; + + case Keys.Right: + if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + inDirection = true; + break; + + default: + break; + } + if (!inDirection) + return float.MaxValue; + else + return distance; + } + + private float _GetDistance180(KeyEvent Key, SRectF actualRect, SRectF targetRect) + { + PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f); + PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f); + + PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y); + float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y); + bool inDirection = false; + switch (Key.Key) + { + case Keys.Up: + if (vector.Y < 0f) + inDirection = true; + break; + + case Keys.Down: + if (vector.Y > 0f) + inDirection = true; + break; + + case Keys.Left: + if (vector.X < 0f) + inDirection = true; + break; + + case Keys.Right: + if (vector.X > 0f) + inDirection = true; + break; + + default: + break; + } + if (!inDirection) + return float.MaxValue; + else + return distance; + } + + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + private bool _NextElement() + { + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].NextValue(); + + return false; + } + + /// + /// Selects the previous element in a menu interaction. + /// + /// + /// True if the previous element is selected. False if either there is no previous element or the interaction does not provide such a method. + /// + private bool _PrevElement() + { + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + + return false; + } + + private void _SetSelected() + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].Selected = true; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _UnsetSelected() + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].Selected = false; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].Selected = false; + break; + } + } + + private void _SetHighlighted(int selection) + { + if (selection >= _Interactions.Count || selection < 0) + return; + + switch (_Interactions[selection].Type) + { + case EType.TButton: + //_Buttons[_Interactions[selection].Num].Selected = true; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[selection].Num].Highlighted = true; + break; + case EType.TStatic: + //_Statics[_Interactions[selection].Num].Selected = true; + break; + case EType.TText: + //_Texts[_Interactions[selection].Num].Selected = true; + break; + case EType.TSongMenu: + //_SongMenus[_Interactions[selection].Num].Selected = true; + break; + case EType.TLyric: + //_Lyrics[_Interactions[selection].Num].Selected = true; + break; + case EType.TNameSelection: + //_NameSelections[_Interactions[selection].Num].Selected = true; + break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _UnsetHighlighted(int selection) + { + if (selection >= _Interactions.Count || selection < 0) + return; + + switch (_Interactions[selection].Type) + { + case EType.TButton: + //_Buttons[_Interactions[selection].Num].Selected = false; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[selection].Num].Highlighted = false; + break; + case EType.TStatic: + //_Statics[_Interactions[selection].Num].Selected = false; + break; + case EType.TText: + //_Texts[_Interactions[selection].Num].Selected = false; + break; + case EType.TSongMenu: + //_SongMenus[_Interactions[selection].Num].Selected = false; + break; + case EType.TLyric: + //_Lyrics[_Interactions[selection].Num].Selected = false; + break; + case EType.TNameSelection: + //_NameSelections[_Interactions[selection].Num].Selected = false; + break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _ToggleHighlighted() + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + _SelectSlides[_Interactions[_Selection].Num].Highlighted = !_SelectSlides[_Interactions[_Selection].Num].Highlighted; + } + } + + private bool _IsHighlighted() + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return false; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].Highlighted; + + return false; + } + + private bool _IsVisible(int interaction) + { + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + return _Statics[_Interactions[interaction].Num].Visible; + + case EType.TText: + return _Texts[_Interactions[interaction].Num].Visible; + + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Visible; + + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Visible; + } + + return false; + } + + private SRectF _GetRect(int interaction) + { + SRectF Result = new SRectF(); + switch (_Interactions[interaction].Type) + { + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Rect; + + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Rect; + } + + return Result; + } + + private void _AddInteraction(int num, EType type) + { + _Interactions.Add(new CInteraction(num, type)); + if (!_Interactions[_Selection].ThemeEditorOnly) + _SetSelected(); + else + _NextInteraction(); + } + + private void _DrawInteraction(int interaction) + { + bool sel = false; + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + _Statics[_Interactions[interaction].Num].Draw(); + break; + + case EType.TText: + _Texts[_Interactions[interaction].Num].Draw(); + break; + + case EType.TButton: + sel = _Buttons[_Interactions[interaction].Num].Selected; + if (!Active) + _Buttons[_Interactions[interaction].Num].Selected = false; + _Buttons[_Interactions[interaction].Num].Draw(); + _Buttons[_Interactions[interaction].Num].Selected = sel; + break; + + case EType.TSelectSlide: + sel = _SelectSlides[_Interactions[interaction].Num].Selected; + if (!Active) + _SelectSlides[_Interactions[interaction].Num].Selected = false; + _SelectSlides[_Interactions[interaction].Num].Draw(); + _SelectSlides[_Interactions[interaction].Num].Selected = sel; + break; + } + } + + #endregion InteractionHandling + + #region Theme Handling + private void MoveElement(int stepX, int stepY) + { + if (_Interactions.Count > 0) + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; + + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; + } + } + } + + private void ResizeElement(int stepW, int stepH) + { + if (_Interactions.Count > 0) + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; + + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; + } + } + } + #endregion Theme Handling + } +} From 4e42b47b5c8ef065829e8172d4ca651d4b825c38 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Mon, 13 Aug 2012 21:51:42 +0200 Subject: [PATCH 48/67] fixed theme saving for equalizer, playlist, text and songmenu --- .../Screens/PopupScreenPlayerControl.xml | 18 +- .../Ambient/Screens/ScreenHighscore.xml | 86 +- Output/Themes/Ambient/Screens/ScreenLoad.xml | 6 +- Output/Themes/Ambient/Screens/ScreenMain.xml | 8 +- Output/Themes/Ambient/Screens/ScreenNames.xml | 266 ++-- .../Themes/Ambient/Screens/ScreenOptions.xml | 14 +- .../Ambient/Screens/ScreenOptionsGame.xml | 16 +- .../Ambient/Screens/ScreenOptionsLyrics.xml | 8 +- .../Ambient/Screens/ScreenOptionsRecord.xml | 123 +- .../Ambient/Screens/ScreenOptionsSound.xml | 10 +- .../Ambient/Screens/ScreenOptionsTheme.xml | 20 +- .../Ambient/Screens/ScreenOptionsVideo.xml | 12 +- .../Themes/Ambient/Screens/ScreenProfiles.xml | 22 +- Output/Themes/Ambient/Screens/ScreenScore.xml | 172 +-- Output/Themes/Ambient/Screens/ScreenSing.xml | 214 +-- Output/Themes/Ambient/Screens/ScreenSong.xml | 1167 ++++++++--------- Output/Themes/Ambient/Skin Blue.xml | 34 +- Output/Themes/Ambient/Skin Green.xml | 32 +- Output/Themes/Ambient/Skin Red.xml | 34 +- Output/Themes/Ambient/Skin Yellow.xml | 34 +- Vocaluxe/Menu/CEqualizer.cs | 2 +- Vocaluxe/Menu/CPlaylist.cs | 58 +- Vocaluxe/Menu/CText.cs | 2 +- Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 17 +- Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 2 + 25 files changed, 1149 insertions(+), 1228 deletions(-) diff --git a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml index c8330637..bc07248e 100644 --- a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml +++ b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml @@ -58,7 +58,7 @@ Outline - + @@ -103,7 +103,7 @@ Normal - + @@ -152,7 +152,7 @@ Normal - + @@ -201,7 +201,7 @@ Normal - + @@ -250,7 +250,7 @@ Normal - + @@ -299,7 +299,7 @@ Normal - + @@ -348,7 +348,7 @@ Normal - + @@ -397,7 +397,7 @@ Normal - + @@ -446,7 +446,7 @@ Normal - + diff --git a/Output/Themes/Ambient/Screens/ScreenHighscore.xml b/Output/Themes/Ambient/Screens/ScreenHighscore.xml index caf13c13..b036b823 100644 --- a/Output/Themes/Ambient/Screens/ScreenHighscore.xml +++ b/Output/Themes/Ambient/Screens/ScreenHighscore.xml @@ -68,7 +68,7 @@ Outline - + TR_SCREENHIGHSCORE_HIGHSCORE @@ -97,7 +97,7 @@ Outline - + @@ -126,7 +126,7 @@ Outline - + @@ -155,7 +155,7 @@ Outline - + @@ -184,7 +184,7 @@ Outline - + @@ -213,7 +213,7 @@ Outline - + @@ -242,7 +242,7 @@ Outline - + @@ -271,7 +271,7 @@ Outline - + @@ -300,7 +300,7 @@ Outline - + @@ -329,7 +329,7 @@ Outline - + @@ -358,7 +358,7 @@ Outline - + @@ -387,7 +387,7 @@ Outline - + @@ -416,7 +416,7 @@ Outline - + @@ -445,7 +445,7 @@ Outline - + @@ -474,7 +474,7 @@ Outline - + @@ -503,7 +503,7 @@ Outline - + @@ -532,7 +532,7 @@ Outline - + @@ -561,7 +561,7 @@ Outline - + @@ -590,7 +590,7 @@ Outline - + @@ -619,7 +619,7 @@ Outline - + @@ -648,7 +648,7 @@ Outline - + @@ -677,7 +677,7 @@ Outline - + @@ -706,7 +706,7 @@ Outline - + @@ -735,7 +735,7 @@ Outline - + @@ -764,7 +764,7 @@ Outline - + @@ -793,7 +793,7 @@ Outline - + @@ -822,7 +822,7 @@ Outline - + @@ -851,7 +851,7 @@ Outline - + @@ -880,7 +880,7 @@ Outline - + @@ -909,7 +909,7 @@ Outline - + @@ -938,7 +938,7 @@ Outline - + @@ -967,7 +967,7 @@ Outline - + @@ -996,7 +996,7 @@ Outline - + @@ -1025,7 +1025,7 @@ Outline - + @@ -1054,7 +1054,7 @@ Outline - + @@ -1083,7 +1083,7 @@ Outline - + @@ -1112,7 +1112,7 @@ Outline - + @@ -1141,7 +1141,7 @@ Outline - + @@ -1170,7 +1170,7 @@ Outline - + @@ -1199,7 +1199,7 @@ Outline - + @@ -1228,7 +1228,7 @@ Outline - + @@ -1257,7 +1257,7 @@ Outline - + @@ -1286,7 +1286,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenLoad.xml b/Output/Themes/Ambient/Screens/ScreenLoad.xml index a4030b21..6f78787d 100644 --- a/Output/Themes/Ambient/Screens/ScreenLoad.xml +++ b/Output/Themes/Ambient/Screens/ScreenLoad.xml @@ -52,7 +52,7 @@ Outline - + TR_PROGRAM_NAME @@ -81,7 +81,7 @@ Outline - + TR_SCREENLOAD_LOADING @@ -110,7 +110,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenMain.xml b/Output/Themes/Ambient/Screens/ScreenMain.xml index 6c195ea0..71116b93 100644 --- a/Output/Themes/Ambient/Screens/ScreenMain.xml +++ b/Output/Themes/Ambient/Screens/ScreenMain.xml @@ -68,7 +68,7 @@ Outline - + TR_SCREENMAIN_BUTTON_SING @@ -125,7 +125,7 @@ Outline - + TR_SCREENMAIN_BUTTON_OPTIONS @@ -182,7 +182,7 @@ Outline - + TR_SCREENMAIN_BUTTON_PROFILES @@ -239,7 +239,7 @@ Outline - + TR_BUTTON_EXIT diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index c35f8b0f..86d907e3 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -28,7 +28,7 @@ - + PlayerSelector @@ -276,7 +276,7 @@ Outline - + TR_SCREENNAMES_MENU @@ -306,7 +306,7 @@ Outline - + @@ -336,7 +336,7 @@ Outline - + @@ -365,7 +365,7 @@ Outline - + @@ -394,7 +394,7 @@ Outline - + @@ -423,7 +423,7 @@ Outline - + @@ -452,7 +452,7 @@ Outline - + @@ -481,7 +481,7 @@ Outline - + @@ -510,7 +510,7 @@ Outline - + @@ -555,7 +555,7 @@ Outline - + TR_BUTTON_BACK @@ -612,7 +612,7 @@ Outline - + TR_BUTTON_START @@ -1128,167 +1128,167 @@ - - - Invisible - + + + Invisible + 21 152 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player1Dim2 - - - Player1Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player1Dim2 + + + Player1Dim2 - - - - Invisible - + + + + Invisible + 21 307 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player2Dim2 - - - Player2Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player2Dim2 + + + Player2Dim2 - - - - Invisible - + + + + Invisible + 21 467 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player3Dim2 - - - Player3Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player3Dim2 + + + Player3Dim2 - - - - Invisible - + + + + Invisible + 1153 152 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player4Dim2 - - - Player4Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player4Dim2 + + + Player4Dim2 - - - - Invisible - + + + + Invisible + 1153 307 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player5Dim2 - - - Player5Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player5Dim2 + + + Player5Dim2 - - - - Invisible - + + + + Invisible + 1153 467 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player6Dim2 - - - Player6Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player6Dim2 + + + Player6Dim2 - + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenOptions.xml b/Output/Themes/Ambient/Screens/ScreenOptions.xml index 5ce06914..808f1d29 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptions.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptions.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENO_OPTIONS @@ -97,7 +97,7 @@ Outline - + TR_SCREENO_BUTTON_GAME @@ -154,7 +154,7 @@ Outline - + TR_SCRENNO_BUTTON_SOUND @@ -211,7 +211,7 @@ Outline - + TR_SCREENO_BUTTON_RECORD @@ -268,7 +268,7 @@ Outline - + TR_SCREENO_BUTTON_VIDEO @@ -325,7 +325,7 @@ Outline - + TR_SCREENO_BUTTON_LYRICS @@ -382,7 +382,7 @@ Outline - + TR_SCREENO_BUTTON_THEME diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml index 28e4b3d2..bdd2f750 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml @@ -148,7 +148,7 @@ Outline - + TR_SCREENOGAME_OPTIONS @@ -177,7 +177,7 @@ Outline - + TR_SCREENOGAME_LANGUAGE @@ -206,7 +206,7 @@ Outline - + TR_SCREENOGAME_DEBUGLEVEL @@ -235,7 +235,7 @@ Outline - + TR_SCREENOGAME_SONGMENU @@ -264,7 +264,7 @@ Outline - + TR_SCREENOGAME_SONGSORTING @@ -293,7 +293,7 @@ Outline - + TR_SCREENOGAME_TABS @@ -322,7 +322,7 @@ Outline - + TR_SCREENOGAME_TIMERMODE @@ -367,7 +367,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml index 521fd578..d544a49f 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENOLYRICS_OPTIONS @@ -81,7 +81,7 @@ Outline - + TR_SCREENOLYRICS_STYLE @@ -110,7 +110,7 @@ Outline - + TR_SCREENOLYRICS_ONTOP @@ -155,7 +155,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index 7375fd34..2100c33e 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -180,7 +180,7 @@ Outline - + TR_SCREENORECORD_OPTIONS @@ -209,7 +209,7 @@ Outline - + TR_SCREENORECORD_DEVICE @@ -238,7 +238,7 @@ Outline - + TR_SCREENORECORD_INPUT @@ -267,7 +267,7 @@ Outline - + TR_SCREENORECORD_CHANNEL_1 @@ -296,7 +296,7 @@ Outline - + TR_SCREENORECORD_CHANNEL_2 @@ -325,7 +325,7 @@ Outline - + TR_SCREENORECORD_MIC_DELAY @@ -355,7 +355,7 @@ Outline - + TR_SCREENORECORD_MIC_WARNING @@ -384,7 +384,7 @@ Outline - + @@ -413,7 +413,7 @@ Outline - + @@ -458,7 +458,7 @@ Outline - + TR_BUTTON_BACK @@ -515,7 +515,7 @@ Outline - + TR_SCREENORECORD_BUTTON_DELAYTEST @@ -858,66 +858,67 @@ 5 - - - Invisible - - 50 - 400 - 230 - 150 - -1,00 - - 10 - 2,00 - - - - - ButtonColor - - - ButtonSColor - - TR_CONFIG_OFF + + + Invisible + + 50 + 400 + -1,00 + 230 + 150 + + 10 + + 2,00 + + + + TR_CONFIG_OFF + + + ButtonColor + + + ButtonColor 10 26 - - - - - Invisible - - 400 - 400 - 230 - 150 - -1,00 - - 10 - - 2,00 - - - - - ButtonColor - - - ButtonSColor - - TR_CONFIG_OFF + + + + + Invisible + + 400 + 400 + -1,00 + 230 + 150 + + 10 + + 2,00 + + + + TR_CONFIG_OFF + + + ButtonColor + + + ButtonColor 10 26 - - + + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml index 597e24f4..3f23d55c 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENOSOUND_OPTIONS @@ -81,7 +81,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSIC @@ -110,7 +110,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME @@ -139,7 +139,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE @@ -184,7 +184,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml index fbb7f91c..15c6492b 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml @@ -180,7 +180,7 @@ Outline - + TR_SCREENOTHEME_OPTIONS @@ -209,7 +209,7 @@ Outline - + TR_SCREENOTHEME_THEME @@ -238,7 +238,7 @@ Outline - + TR_SCREENOTHEME_SKIN @@ -267,7 +267,7 @@ Outline - + TR_SCREENOTHEME_COVERTHEME @@ -296,7 +296,7 @@ Outline - + TR_SCREENOTHEME_NOTELINES @@ -325,7 +325,7 @@ Outline - + TR_SCREENOTHEME_TONEHELPER @@ -354,7 +354,7 @@ Outline - + TR_SCREENOTHEME_TIMERLOOK @@ -383,7 +383,7 @@ Outline - + TR_SCREENOTHEME_FADEINFO @@ -412,7 +412,7 @@ Outline - + TR_SCREENOTHEME_COVERLOADING @@ -457,7 +457,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml index 0bacb58b..74d6bfac 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml @@ -100,7 +100,7 @@ Outline - + TR_SCREENOVIDEO_OPTIONS @@ -129,7 +129,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOBACKGROUNDS @@ -158,7 +158,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOPREVIEW @@ -187,7 +187,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOINSONGS @@ -216,7 +216,7 @@ Normal - + TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND @@ -261,7 +261,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenProfiles.xml b/Output/Themes/Ambient/Screens/ScreenProfiles.xml index 128a373b..7bd59c6b 100644 --- a/Output/Themes/Ambient/Screens/ScreenProfiles.xml +++ b/Output/Themes/Ambient/Screens/ScreenProfiles.xml @@ -148,7 +148,7 @@ Outline - + TR_SCREENPROFILES_PROFILES @@ -177,7 +177,7 @@ Outline - + TR_SCREENPROFILES_PLAYERNAME @@ -206,7 +206,7 @@ Outline - + TR_SCREENPROFILES_GAMEDIFFICULTY @@ -235,7 +235,7 @@ Outline - + TR_SCREENPROFILES_AVATAR @@ -264,7 +264,7 @@ Outline - + TR_SCREENPROFILES_GUESTPROFILE @@ -293,7 +293,7 @@ Outline - + TR_SCREENPROFILES_ACTIVE @@ -338,7 +338,7 @@ Outline - + @@ -387,7 +387,7 @@ Outline - + TR_BUTTON_BACK @@ -444,7 +444,7 @@ Outline - + TR_BUTTON_SAVE @@ -501,7 +501,7 @@ Outline - + TR_SCREENPROFILES_BUTTON_NEW @@ -558,7 +558,7 @@ Outline - + TR_SCREENPROFILES_BUTTON_DELETE diff --git a/Output/Themes/Ambient/Screens/ScreenScore.xml b/Output/Themes/Ambient/Screens/ScreenScore.xml index cccaaae3..814efcfe 100644 --- a/Output/Themes/Ambient/Screens/ScreenScore.xml +++ b/Output/Themes/Ambient/Screens/ScreenScore.xml @@ -1226,7 +1226,7 @@ Outline - + TR_SCREENSCORE_SCORES @@ -1255,7 +1255,7 @@ Outline - + @@ -1284,7 +1284,7 @@ Outline - + @@ -1313,7 +1313,7 @@ Outline - + @@ -1342,7 +1342,7 @@ Outline - + @@ -1371,7 +1371,7 @@ Outline - + @@ -1400,7 +1400,7 @@ Outline - + @@ -1429,7 +1429,7 @@ Outline - + @@ -1458,7 +1458,7 @@ Outline - + @@ -1487,7 +1487,7 @@ Outline - + @@ -1516,7 +1516,7 @@ Outline - + @@ -1545,7 +1545,7 @@ Outline - + @@ -1574,7 +1574,7 @@ Outline - + @@ -1603,7 +1603,7 @@ Outline - + @@ -1632,7 +1632,7 @@ Outline - + @@ -1661,7 +1661,7 @@ Outline - + @@ -1690,7 +1690,7 @@ Outline - + @@ -1719,7 +1719,7 @@ Outline - + @@ -1748,7 +1748,7 @@ Outline - + @@ -1777,7 +1777,7 @@ Outline - + @@ -1806,7 +1806,7 @@ Outline - + @@ -1835,7 +1835,7 @@ Outline - + @@ -1864,7 +1864,7 @@ Outline - + @@ -1893,7 +1893,7 @@ Outline - + @@ -1922,7 +1922,7 @@ Outline - + @@ -1951,7 +1951,7 @@ Outline - + @@ -1980,7 +1980,7 @@ Outline - + @@ -2009,7 +2009,7 @@ Outline - + @@ -2039,7 +2039,7 @@ Outline - + @@ -2068,7 +2068,7 @@ Outline - + @@ -2097,7 +2097,7 @@ Outline - + @@ -2126,7 +2126,7 @@ Outline - + @@ -2156,7 +2156,7 @@ Outline - + @@ -2185,7 +2185,7 @@ Outline - + @@ -2214,7 +2214,7 @@ Outline - + @@ -2243,7 +2243,7 @@ Outline - + @@ -2273,7 +2273,7 @@ Outline - + @@ -2302,7 +2302,7 @@ Outline - + @@ -2331,7 +2331,7 @@ Outline - + @@ -2360,7 +2360,7 @@ Outline - + @@ -2390,7 +2390,7 @@ Outline - + @@ -2419,7 +2419,7 @@ Outline - + @@ -2449,7 +2449,7 @@ Outline - + @@ -2479,7 +2479,7 @@ Outline - + @@ -2509,7 +2509,7 @@ Outline - + @@ -2539,7 +2539,7 @@ Outline - + @@ -2569,7 +2569,7 @@ Outline - + @@ -2599,7 +2599,7 @@ Outline - + @@ -2629,7 +2629,7 @@ Outline - + @@ -2659,7 +2659,7 @@ Outline - + @@ -2689,7 +2689,7 @@ Outline - + @@ -2719,7 +2719,7 @@ Outline - + @@ -2749,7 +2749,7 @@ Outline - + @@ -2779,7 +2779,7 @@ Outline - + @@ -2809,7 +2809,7 @@ Outline - + @@ -2839,7 +2839,7 @@ Outline - + @@ -2869,7 +2869,7 @@ Outline - + @@ -2899,7 +2899,7 @@ Outline - + @@ -2929,7 +2929,7 @@ Outline - + @@ -2959,7 +2959,7 @@ Outline - + @@ -2989,7 +2989,7 @@ Outline - + @@ -3019,7 +3019,7 @@ Outline - + @@ -3049,7 +3049,7 @@ Outline - + @@ -3079,7 +3079,7 @@ Outline - + @@ -3109,7 +3109,7 @@ Outline - + @@ -3139,7 +3139,7 @@ Outline - + @@ -3169,7 +3169,7 @@ Outline - + @@ -3199,7 +3199,7 @@ Outline - + @@ -3229,7 +3229,7 @@ Outline - + @@ -3259,7 +3259,7 @@ Outline - + @@ -3289,7 +3289,7 @@ Outline - + @@ -3319,7 +3319,7 @@ Outline - + @@ -3349,7 +3349,7 @@ Outline - + @@ -3379,7 +3379,7 @@ Outline - + @@ -3409,7 +3409,7 @@ Outline - + @@ -3439,7 +3439,7 @@ Outline - + @@ -3469,7 +3469,7 @@ Outline - + @@ -3499,7 +3499,7 @@ Outline - + @@ -3529,7 +3529,7 @@ Outline - + @@ -3559,7 +3559,7 @@ Outline - + @@ -3589,7 +3589,7 @@ Outline - + @@ -3619,7 +3619,7 @@ Outline - + @@ -3649,7 +3649,7 @@ Outline - + @@ -3679,7 +3679,7 @@ Outline - + @@ -3709,7 +3709,7 @@ Outline - + @@ -3739,7 +3739,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 7f0ab682..21d12061 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -958,64 +958,6 @@ - - - 40 - 80 - - -1,00 - - 35 - - - - TextSColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - - - - 40 - 585 - - -1,00 - - 35 - - - - TextSColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - 640 @@ -1040,7 +982,7 @@ Normal - + @@ -1069,7 +1011,7 @@ Normal - + @@ -1098,12 +1040,70 @@ Normal - + TR_SCREENSING_PAUSE + + + 40 + 80 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + 40 + 585 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + 1240 @@ -1127,7 +1127,7 @@ Normal - + @@ -1159,7 +1159,7 @@ Outline - + @@ -1188,7 +1188,7 @@ Normal - + @@ -1220,7 +1220,7 @@ Outline - + @@ -1249,7 +1249,7 @@ Normal - + @@ -1281,7 +1281,7 @@ Outline - + @@ -1310,7 +1310,7 @@ Normal - + @@ -1342,7 +1342,7 @@ Outline - + @@ -1371,7 +1371,7 @@ Normal - + @@ -1403,7 +1403,7 @@ Outline - + @@ -1432,7 +1432,7 @@ Normal - + @@ -1464,7 +1464,7 @@ Outline - + @@ -1493,7 +1493,7 @@ Normal - + @@ -1525,7 +1525,7 @@ Outline - + @@ -1554,7 +1554,7 @@ Normal - + @@ -1586,7 +1586,7 @@ Outline - + @@ -1615,7 +1615,7 @@ Normal - + @@ -1647,7 +1647,7 @@ Outline - + @@ -1676,7 +1676,7 @@ Normal - + @@ -1708,7 +1708,7 @@ Outline - + @@ -1737,7 +1737,7 @@ Normal - + @@ -1769,7 +1769,7 @@ Outline - + @@ -1798,7 +1798,7 @@ Normal - + @@ -1830,7 +1830,7 @@ Outline - + @@ -1859,7 +1859,7 @@ Normal - + @@ -1891,7 +1891,7 @@ Outline - + @@ -1920,7 +1920,7 @@ Normal - + @@ -1952,7 +1952,7 @@ Outline - + @@ -1981,7 +1981,7 @@ Normal - + @@ -2013,7 +2013,7 @@ Outline - + @@ -2042,7 +2042,7 @@ Normal - + @@ -2074,7 +2074,7 @@ Outline - + @@ -2103,7 +2103,7 @@ Normal - + @@ -2135,7 +2135,7 @@ Outline - + @@ -2164,7 +2164,7 @@ Normal - + @@ -2196,7 +2196,7 @@ Outline - + @@ -2225,7 +2225,7 @@ Normal - + @@ -2257,7 +2257,7 @@ Outline - + @@ -2286,7 +2286,7 @@ Normal - + @@ -2318,7 +2318,7 @@ Outline - + @@ -2347,7 +2347,7 @@ Normal - + @@ -2379,7 +2379,7 @@ Outline - + @@ -2424,7 +2424,7 @@ Outline - + TR_SCREENSING_BUTTON_CANCEL @@ -2481,7 +2481,7 @@ Outline - + TR_SCREENSING_BUTTON_CONTINUE @@ -2538,7 +2538,7 @@ Outline - + TR_SCREENSING_BUTTON_SKIP @@ -2771,4 +2771,4 @@ - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index aff97838..acf1b0c5 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -33,25 +33,6 @@ 26 - - - SongMenuBG - - 40 - 40 - -2,10 - 360 - 360 - - - 1 - 1 - 1 - 1 - - - - Menu @@ -72,175 +53,25 @@ 26 - + - Button - - Button - + SongMenuBG + 40 - 90 - -2,11 + 40 + -2,10 360 - 40 - + 360 + - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_SING - + 1,00 + 1,00 + 1,00 + 1,00 - - - - - - - Button - - Button - - 40 - 235 - -2,11 - 360 - 40 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_PLAYLIST - - - - - - - - - - - Button - - Button - - 40 - 290 - -2,11 - 360 - 40 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_CANCEL - - - - - - - - - - - 200 - 45 - - -2,11 - - 40 - - 350 - - - StaticColor - - - TextSColor - - Center - - - - Outline - - TR_SCREENSONG_SONGOPTIONS - - - - + 220 @@ -265,7 +96,7 @@ Outline - + @@ -299,7 +130,7 @@ Outline - + @@ -332,7 +163,7 @@ Outline - + TR_SCREENSONG_SEARCH @@ -361,12 +192,189 @@ Outline - + + + + 200 + 45 + + -2,11 + + 40 + + 350 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_SONGOPTIONS + + + + + + + Button + + Button + + 40 + 290 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_CANCEL + + + + + + + + + + + Button + + Button + + 40 + 235 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_PLAYLIST + + + + + + + + + + + Button + + Button + + 40 + 90 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SING + + + + + + + + Button @@ -422,16 +430,16 @@ TextSColor - 30 + 30,00 - 280 + 280,00 Outline Bold 1 - + Button @@ -487,16 +495,16 @@ TextSColor - 30 + 30,00 - 280 + 280,00 Outline Bold 1 - + CoverTile @@ -510,12 +518,6 @@ MedleyCalcIcon MedleyTagIcon - - 40 - 100 - -1,00 - 1200 - 530 1,00 @@ -528,21 +530,21 @@ 6 4 - - 4 - - 4 10,00 10,00 + + 4 + + 4 410 40 -1,00 830 550 - + 410 40 -1,00 @@ -572,7 +574,7 @@ Outline - + @@ -602,7 +604,7 @@ Outline - + @@ -632,7 +634,7 @@ Outline - + @@ -737,62 +739,229 @@ - 970 - 80 - 295 - 460 - -0,90 - 50,00 - CoverTile - CoverTile - StaticColorAlpha - StaticColor - + + 970 + 80 + -0,90 + 295 + 460 + 50,00 + + CoverTile + + CoverTile + + + StaticColorAlpha + + + StaticColor + + + + + 54 + 4 + + -1,01 + + 24 + + 235 + + + StaticColor + + + TextSColor + + Left + + Top + + + + Outline + + + + + + + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + + + 4 + 2 + -1,00 + 46 + 46 + + + Visible + + + + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 54 + 28 + -1,01 + 235 + 24 + + 54 + 30 + -1,02 + 20 + 20 + + 235 + 30 + -1,02 + 20 + 20 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 24,00 + + 230,00 + + Outline + + Bold + + 1 + + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + - 54 - 4 - - -1,01 + 180 + 5 - 24 + 30 - 235 + 350 - StaticColor + ButtonTextColor - TextSColor - - Left - - Top - - - - Outline - - %a - %t - - - - - - - 222 - 456 - - -1,01 - - 38 - - 340 - - - StaticColor - - - TextSColor + ButtonTextSColor Center @@ -801,28 +970,47 @@ Outline - + - - - - - + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + - 222 - 456 - - -1,01 + 180 + 5 - 38 + 30 - 340 + 350 - StaticColor + ButtonTextColor - TextSColor + ButtonTextSColor Center @@ -831,343 +1019,114 @@ Outline - + - - - - - - - 975 - 45 - - -1,01 - - 30 - - 220 - - - StaticColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - - - - - - 4 - 2 - -1,00 - 46 - 46 - + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + - Visible - - - - - - - Menu - - 970 - 40 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - Menu - - 970 - 550 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - CloseIcon - - CloseIcon - - 1215 - 42 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SingIcon - - SingIcon - - 975 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SaveIcon - - SaveIcon - - 1175 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - DeleteIcon - - DeleteIcon - - 1215 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - Button - - SelectSlideArrowLeft - - SelectSlideArrowRight - - SelectSlide - - SelectSlideArrowLeft - - SelectSlideArrowRight - - SelectSlide - - 54 - 28 - -1,01 - 235 - 24 - - 54 - 30 - -1,02 - 20 - 20 - - 235 - 30 - -1,02 - 20 - 20 - - - ButtonColor - - - ButtonSColor - - - SelectSlideHColor - - - ArrowColor - - - ArrowSColor - - - TextColor - - - TextSColor - - 24,00 - - 230,00 - - Outline - - Bold - - 1 - + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 7ddf916d..64b055f6 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,000 0,000 @@ -263,11 +263,11 @@ 1,000 - 0,00 - 0,00 - 1,00 - 0,50 - + 0,000 + 0,000 + 1,000 + 0,500 + 0,800 0,950 @@ -321,16 +321,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Blue]BG_Video.mp4 @@ -338,4 +338,4 @@ [Blue]IntroMid.mp4 [Blue]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 663faf5c..20c3ebe3 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,000 0,750 @@ -257,10 +257,10 @@ 1,000 - 0,00 - 1,00 - 0,00 - 0,50 + 0,000 + 1,000 + 0,000 + 0,500 0,800 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Green]BG_Video.mp4 @@ -332,4 +332,4 @@ [Green]IntroMid.mp4 [Green]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index 9d3f1f8d..3a187e67 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,750 0,000 @@ -257,11 +257,11 @@ 1,000 - 1,00 - 0,00 - 0,00 - 0,50 - + 1,000 + 0,000 + 0,000 + 0,500 + 1,000 0,800 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Red]BG_Video.mp4 @@ -332,4 +332,4 @@ [Red]IntroMid.mp4 [Red]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index fcb4664a..9735075b 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,750 0,750 @@ -257,11 +257,11 @@ 1,000 - 1,00 - 1,00 - 0,00 - 0,50 - + 1,000 + 1,000 + 0,000 + 0,500 + 0,949 1,000 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Yellow]BG_Video.mp4 @@ -332,4 +332,4 @@ [Yellow]IntroMid.mp4 [Yellow]IntroOut.mp4 - + \ No newline at end of file diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index 89fe35c3..4b8c3997 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -163,7 +163,7 @@ namespace Vocaluxe.Menu writer.WriteComment(" - - Outline - - - - - - Menu @@ -931,6 +901,55 @@ 1 + + + Invisible + + Invisible + + 975 + 45 + -1,01 + 220 + 30 + + + ButtonColor + + + ButtonSColor + + + 0 + 0 + + 30 + + 220 + + + ButtonTextColor + + + ButtonTextSColor + + Left + + Center + + + + Outline + + + + + + + + + + CloseIcon @@ -1129,4 +1148,4 @@ - \ No newline at end of file + diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f00d7663..96d90907 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -13,6 +13,12 @@ using Vocaluxe.GameModes; namespace Vocaluxe.Menu { + enum EEditMode + { + None, + PlaylistName, + ChangeOrder + } struct SThemePlaylist { @@ -27,12 +33,12 @@ namespace Vocaluxe.Menu public float EntryHeight; public CText Text1; - public CText TextPlaylistHeader; public CStatic StaticCover; public CStatic StaticPlaylistHeader; public CStatic StaticPlaylistFooter; + public CButton ButtonPlaylistName; public CButton ButtonPlaylistClose; public CButton ButtonPlaylistSave; public CButton ButtonPlaylistDelete; @@ -72,6 +78,7 @@ namespace Vocaluxe.Menu private List PlaylistElements; private List PlaylistElementContents; + public SRectF CompleteRect; public SRectF Rect; public SColorF BackgroundColor; public SColorF BackgroundSColor; @@ -94,7 +101,7 @@ namespace Vocaluxe.Menu } } - public bool changeOrder = false; + public EEditMode _EditMode; public int ActivePlaylistID = -1; public int Offset = 0; public int ActiveHover = -1; @@ -104,16 +111,17 @@ namespace Vocaluxe.Menu { _Theme = new SThemePlaylist(); _Theme.Text1 = new CText(); - _Theme.TextPlaylistHeader = new CText(); _Theme.StaticCover = new CStatic(); _Theme.StaticPlaylistFooter = new CStatic(); _Theme.StaticPlaylistHeader = new CStatic(); + _Theme.ButtonPlaylistName = new CButton(); _Theme.ButtonPlaylistClose = new CButton(); _Theme.ButtonPlaylistDelete = new CButton(); _Theme.ButtonPlaylistSave = new CButton(); _Theme.ButtonPlaylistSing = new CButton(); _Theme.SelectSlideGameMode = new CSelectSlide(); + CompleteRect = new SRectF(); Rect = new SRectF(); BackgroundColor = new SColorF(); BackgroundSColor = new SColorF(); @@ -131,10 +139,10 @@ namespace Vocaluxe.Menu { _Interactions.Clear(); PrepareList(); - _Interactions.AddText(_Theme.TextPlaylistHeader); _Interactions.AddStatic(_Theme.StaticCover); _Interactions.AddStatic(_Theme.StaticPlaylistFooter); _Interactions.AddStatic(_Theme.StaticPlaylistHeader); + _Interactions.AddButton(_Theme.ButtonPlaylistName); _Interactions.AddButton(_Theme.ButtonPlaylistClose); _Interactions.AddButton(_Theme.ButtonPlaylistDelete); _Interactions.AddButton(_Theme.ButtonPlaylistSave); @@ -178,12 +186,12 @@ namespace Vocaluxe.Menu } _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); - _ThemeLoaded &= _Theme.TextPlaylistHeader.LoadTheme(item, "TextPlaylistHeader", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistName.LoadTheme(item, "ButtonPlaylistName", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", navigator, SkinIndex); @@ -195,6 +203,53 @@ namespace Vocaluxe.Menu if (_ThemeLoaded) { _Theme.Name = ElementName; + //Check for highest x/y-coords + CompleteRect = Rect; + //ButtonPlaylistClose + if (_Theme.ButtonPlaylistClose.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistClose.Rect.X; + if (_Theme.ButtonPlaylistClose.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistClose.Rect.Y; + if (_Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistClose.Rect.Y + _Theme.ButtonPlaylistClose.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistClose.Rect.H + _Theme.ButtonPlaylistClose.Rect.Y - CompleteRect.Y; + //ButtonPlaylistName + if (_Theme.ButtonPlaylistName.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistName.Rect.X; + if (_Theme.ButtonPlaylistName.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistName.Rect.Y; + if (_Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistName.Rect.Y + _Theme.ButtonPlaylistName.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistName.Rect.H + _Theme.ButtonPlaylistName.Rect.Y - CompleteRect.Y; + //ButtonPlaylistSing + if (_Theme.ButtonPlaylistSing.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistSing.Rect.X; + if (_Theme.ButtonPlaylistSing.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistSing.Rect.Y; + if (_Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistSing.Rect.Y + _Theme.ButtonPlaylistSing.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistSing.Rect.H + _Theme.ButtonPlaylistSing.Rect.Y - CompleteRect.Y; + //ButtonPlaylistSave + if (_Theme.ButtonPlaylistSave.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistSave.Rect.X; + if (_Theme.ButtonPlaylistSave.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistSave.Rect.Y; + if (_Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistSave.Rect.Y + _Theme.ButtonPlaylistSave.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistSave.Rect.H + _Theme.ButtonPlaylistSave.Rect.Y - CompleteRect.Y; + //ButtonPlaylistDelete + if (_Theme.ButtonPlaylistDelete.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistDelete.Rect.X; + if (_Theme.ButtonPlaylistDelete.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistDelete.Rect.Y; + if (_Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistDelete.Rect.Y + _Theme.ButtonPlaylistDelete.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistDelete.Rect.H + _Theme.ButtonPlaylistDelete.Rect.Y - CompleteRect.Y; LoadTextures(); } return _ThemeLoaded; @@ -252,11 +307,11 @@ namespace Vocaluxe.Menu writer.WriteComment("Positions of , , , and are relative to playlist-entry!"); writer.WriteComment("Use placeholders for Text of , and : %t, %a, %l"); _Theme.Text1.SaveTheme(writer); - _Theme.TextPlaylistHeader.SaveTheme(writer); _Theme.StaticPlaylistFooter.SaveTheme(writer); _Theme.StaticPlaylistHeader.SaveTheme(writer); _Theme.StaticCover.SaveTheme(writer); _Theme.SelectSlideGameMode.SaveTheme(writer); + _Theme.ButtonPlaylistName.SaveTheme(writer); _Theme.ButtonPlaylistClose.SaveTheme(writer); _Theme.ButtonPlaylistDelete.SaveTheme(writer); _Theme.ButtonPlaylistSave.SaveTheme(writer); @@ -346,205 +401,261 @@ namespace Vocaluxe.Menu CurrPlaylistElement = i; } - switch (KeyEvent.Key) + //Active EditMode ignores other input! + if (_EditMode == EEditMode.PlaylistName) { - case Keys.Up: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToLastEntry(); - return true; - } - else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); - _Interactions.HandleInput(KeyEvent); + if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) + { + _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text + KeyEvent.Unicode; + } + else if (KeyEvent.Key == Keys.Enter) + { + CPlaylists.Playlists[ActivePlaylistID].PlaylistName = _Theme.ButtonPlaylistName.Text.Text; + CPlaylists.Playlists[ActivePlaylistID].SavePlaylist(); + _EditMode = EEditMode.None; + } + else if (KeyEvent.Key == Keys.Escape) + { + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _EditMode = EEditMode.None; + } + else if (KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Delete) + { + if (_Theme.ButtonPlaylistName.Text.Text.Length > 0) + _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1); + } - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) + } + else + { + switch (KeyEvent.Key) + { + case Keys.Up: + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = selection; + _Interactions.HandleInput(KeyEvent); + SetSelectionToLastEntry(); + return true; + } + else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement - 1 > 0) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement - 1 > 0) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement - 1 == 0) - { - if (Offset > 0) - { - Offset--; - Update(); - } - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - - return true; - } - return false; - - case Keys.Down: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToFirstEntry(); - return true; - } - else if (CurrentPlaylistElement == PlaylistElements.Count -1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - - int sel = PlaylistElementContents.Count - 1; - if (sel > PlaylistElements.Count - 1) - sel = PlaylistElements.Count - 1; - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) - { - if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) - { - Offset++; - Update(); - } - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - - return true; - } - return false; - - case Keys.Delete: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); - UpdatePlaylist(); - if (CurrentPlaylistElement != -1) _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - return false; + _Interactions.HandleInput(KeyEvent); - case Keys.Back: - ClosePlaylist(); - break; + int selection = GetSelectedSelectionNr(); - case Keys.Enter: - StartPlaylistSongs(); - break; - - case Keys.PageUp: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement+Offset); - if (CurrentPlaylistElement - 1 > -1) + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement - 1 == 0) { - CurrentPlaylistElement--; + if (Offset > 0) + { + Offset--; + Update(); + } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; + } + return false; + + case Keys.Down: + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) + { + _Interactions.HandleInput(KeyEvent); + SetSelectionToFirstEntry(); + return true; + } + else if (CurrentPlaylistElement == PlaylistElements.Count - 1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; - } - else if(Offset > 0) - { - Offset--; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; - case Keys.PageDown: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement+Offset); - if (CurrentPlaylistElement + 1 < PlaylistElements.Count) - { - CurrentPlaylistElement++; - ActiveHover = CurrentPlaylistElement; - } - else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) - { - Offset++; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; + int sel = PlaylistElementContents.Count - 1; + if (sel > PlaylistElements.Count - 1) + sel = PlaylistElements.Count - 1; - case Keys.Left: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); + _Interactions.HandleInput(KeyEvent); - case Keys.Right: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) + { + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + { + if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) + { + Offset++; + Update(); + } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; + } + return false; + + case Keys.Delete: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); + UpdatePlaylist(); + if (CurrentPlaylistElement != -1) + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + return false; + + case Keys.Back: + ClosePlaylist(); + break; + + case Keys.Enter: + if (KeyEvent.ModSHIFT) + StartPlaylistSongs(); + else + { + if (_Theme.ButtonPlaylistClose.Selected) + { + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistSing.Selected) + { + StartPlaylistSongs(); + } + else if (_Theme.ButtonPlaylistSave.Selected) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (_Theme.ButtonPlaylistDelete.Selected) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistName.Selected) + { + if (_EditMode != EEditMode.PlaylistName) + _EditMode = EEditMode.PlaylistName; + else + _EditMode = EEditMode.None; + } + } + break; + + case Keys.PageUp: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement + Offset); + if (CurrentPlaylistElement - 1 > -1) + { + CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset > 0) + { + Offset--; + } + UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + break; + + case Keys.PageDown: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement + Offset); + if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) + { + Offset++; + } + UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + break; + + case Keys.Left: + _Interactions.HandleInput(KeyEvent); + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + return true; + } + return false; + + case Keys.Right: + _Interactions.HandleInput(KeyEvent); + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + return true; + } + return false; + } } } return false; @@ -606,106 +717,145 @@ namespace Vocaluxe.Menu { _Interactions.HandleMouse(MouseEvent); - if (CHelper.IsInBounds(Rect, MouseEvent) && Visible) + if (CHelper.IsInBounds(CompleteRect, MouseEvent) && Visible) { - if (MouseEvent.Wheel > 0) + switch (_EditMode) { - if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) - { - Offset += MouseEvent.Wheel; - Update(); - return true; - } - return true; - } - else if (MouseEvent.Wheel < 0) - { - if (Offset + MouseEvent.Wheel >= 0) - { - Offset += MouseEvent.Wheel; - Update(); - return true; - } - } - - if (MouseEvent.LB) - { - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - } - - for (int i = 0; i < PlaylistElements.Count; i++) - { - //Hover for playlist-element - if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) - { - ActiveHover = i; - CurrentPlaylistElement = i; - } - - //Delete Entry with RB - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) - { - CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); - UpdatePlaylist(); - return true; - } - //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) - { - changeOrder = true; - CurrentPlaylistElement = i; - } - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && changeOrder) - { - /* - if (PlaylistElements.Count < CurrentPlaylistElement + 1) + //Normal mode + case EEditMode.None: + //Scroll + if (MouseEvent.Wheel > 0) { + if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) + { + Offset += MouseEvent.Wheel; + Update(); + return true; + } + return true; } - else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + else if (MouseEvent.Wheel < 0) { + if (Offset + MouseEvent.Wheel >= 0) + { + Offset += MouseEvent.Wheel; + Update(); + return true; + } } - if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + //LB actions + if (MouseEvent.LB) { + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + } + if (_Theme.ButtonPlaylistClose.Selected) + { + ClosePlaylist(); + return true; + } + else if (_Theme.ButtonPlaylistSing.Selected) + { + StartPlaylistSongs(); + return true; + } + else if (_Theme.ButtonPlaylistSave.Selected) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + return true; + } + else if (_Theme.ButtonPlaylistDelete.Selected) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + return true; + } + else if (_Theme.ButtonPlaylistName.Selected) + { + _EditMode = EEditMode.PlaylistName; + return true; + } } - */ - } - } - } - else - { - if (ActiveHover != -1) - { - ActiveHover = -1; - CurrentPlaylistElement = -1; - } - } + //Actions according to playlist-element + bool hover_set = false; + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) + { + hover_set = true; + ActiveHover = i; + CurrentPlaylistElement = i; + } - if (ActivePlaylistID > -1) - { - if (MouseEvent.LB) - { - if (_Theme.ButtonPlaylistClose.Selected) - { - ClosePlaylist(); - } - else if (_Theme.ButtonPlaylistSing.Selected) - { - StartPlaylistSongs(); - } - else if (_Theme.ButtonPlaylistSave.Selected) - { - CPlaylists.SavePlaylist(ActivePlaylistID); - } - else if (_Theme.ButtonPlaylistDelete.Selected) - { - CPlaylists.DeletePlaylist(ActivePlaylistID); - ClosePlaylist(); - } + //Delete Entry with RB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); + UpdatePlaylist(); + return true; + } + } + if(!hover_set) + { + ActiveHover = -1; + CurrentPlaylistElement = -1; + } + break; + + case EEditMode.PlaylistName: + _Interactions.SetInteractionToButton(_Theme.ButtonPlaylistName); + ActiveHover = -1; + CurrentPlaylistElement = -1; + if (MouseEvent.LB) + { + if (_Theme.ButtonPlaylistName.Selected) + { + CPlaylists.Playlists[ActivePlaylistID].PlaylistName = _Theme.ButtonPlaylistName.Text.Text; + CPlaylists.Playlists[ActivePlaylistID].SavePlaylist(); + _EditMode = EEditMode.None; + return true; + } + } + else if (MouseEvent.RB) + { + if (_Theme.ButtonPlaylistName.Selected) + { + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _EditMode = EEditMode.None; + return true; + } + } + break; + + case EEditMode.ChangeOrder: + //Actions according to playlist-element + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Change order with holding LB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && _EditMode != EEditMode.ChangeOrder) + { + _EditMode = EEditMode.ChangeOrder; + CurrentPlaylistElement = i; + } + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && _EditMode == EEditMode.ChangeOrder) + { + /* + if (PlaylistElements.Count < CurrentPlaylistElement + 1) + { + } + else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + { + } + if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + { + } + */ + } + } + break; } } return false; @@ -738,7 +888,7 @@ namespace Vocaluxe.Menu { if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) { - _Theme.TextPlaylistHeader.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; ActivePlaylistID = PlaylistID; PlaylistElementContents.Clear(); for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) From d3f0fbac0ab57c2dfdd10869772d66cc2d5e4b4f Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:23:43 +0200 Subject: [PATCH 51/67] Use selected game-mode for new song in playlist. --- Vocaluxe/Screens/CScreenSong.cs | 72 ++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index bbc0f021..687cf9e4 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -231,24 +231,57 @@ namespace Vocaluxe.Screens //Open a playlist and add song if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if Playlist really exists if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -330,24 +363,51 @@ namespace Vocaluxe.Screens //Open a playlist and add song if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); From d3159b9c83a0d4c1d5ad868269ba252180224ad8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:37:37 +0200 Subject: [PATCH 52/67] Save last game-mode selection. --- Vocaluxe/Screens/CScreenSong.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 687cf9e4..3ef04745 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -372,11 +372,14 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if playlist really exists if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song @@ -391,8 +394,11 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist @@ -407,6 +413,7 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } @@ -645,6 +652,9 @@ namespace Vocaluxe.Screens _SongOptionsActive = !_SongOptionsActive; if (_SongOptionsActive) { + EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; + if (_AvailableGameModes.Count > 0) + LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); _AvailableGameModes.Clear(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); @@ -665,6 +675,12 @@ namespace Vocaluxe.Screens SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY)); _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); } + //Set SelectSlide-Selection to last selected game-mode if possible + for (int i = 0; i < _AvailableGameModes.Count; i++) + { + if (_AvailableGameModes[i] == LastMode) + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); + } SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; From fa26226701b8862f3fd3099b97ab1a3b4f73d42c Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:46:11 +0200 Subject: [PATCH 53/67] Scroll through scores on ScoreScreen with MouseWheel. --- Vocaluxe/Screens/CScreenScore.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index af44c2aa..17f7b158 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -92,6 +92,11 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); + if (MouseEvent.Wheel != 0) + { + ChangeRound(MouseEvent.Wheel); + } + if (MouseEvent.LB) { CGraphics.FadeTo(EScreens.ScreenHighscore); From 11f58a1ca4c803ad2ae3fadd160f25d6246e18df Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 15:06:34 +0200 Subject: [PATCH 54/67] Fix switching through songs on highscore-screen. Use Left/Right or MiddleButton. --- Vocaluxe/Base/CGame.cs | 5 ++ Vocaluxe/GameModes/CGameMode.cs | 8 ++ Vocaluxe/GameModes/IGameMode.cs | 1 + Vocaluxe/Screens/CScreenHighscore.cs | 126 +++++++++++++++------------ Vocaluxe/Screens/CScreenSing.cs | 4 +- 5 files changed, 86 insertions(+), 58 deletions(-) diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 8e136d32..a6323536 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -180,6 +180,11 @@ namespace Vocaluxe.Base return _GameMode.GetSong(Num); } + public static EGameMode GetGameMode(int Num) + { + return _GameMode.GetGameMode(Num); + } + public static int GetNumSongs() { return _GameMode.GetNumSongs(); diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 8b24af9d..b58ca133 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -290,6 +290,14 @@ namespace Vocaluxe.GameModes return null; } + public virtual EGameMode GetGameMode(int Num) + { + if(Num - 1 < _SongQueque.Count && Num > -1) + return _SongQueque[Num].GameMode; + + return EGameMode.TR_GAMEMODE_NORMAL; + } + public virtual CPoints GetPoints() { return _Points; diff --git a/Vocaluxe/GameModes/IGameMode.cs b/Vocaluxe/GameModes/IGameMode.cs index 4d83391f..79a8fefc 100644 --- a/Vocaluxe/GameModes/IGameMode.cs +++ b/Vocaluxe/GameModes/IGameMode.cs @@ -38,5 +38,6 @@ namespace Vocaluxe.GameModes int GetNumSongs(); CSong GetSong(); CSong GetSong(int Num); + EGameMode GetGameMode(int Num); } } diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index 39882a0a..5704ce63 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -23,7 +23,7 @@ namespace Vocaluxe.Screens private string[] TextScore; private string[] TextDate; - private List _Scores; + private List[] _Scores; private List _NewEntryIDs; private int _Round; private int _Pos; @@ -135,6 +135,17 @@ namespace Vocaluxe.Screens CGraphics.FadeTo(EScreens.ScreenSong); } + if (MouseEvent.MB) + { + int LastRound = _Round; + ChangeRound(1); + if (LastRound == _Round) + { + _Round = 0; + UpdateRound(); + } + } + ChangePos(MouseEvent.Wheel); return true; } @@ -143,7 +154,7 @@ namespace Vocaluxe.Screens { for (int p = 0; p < NumEntrys; p++) { - if (_Pos + p < _Scores.Count) + if (_Pos + p < _Scores[_Round].Count) { Texts[htTexts(TextNumber[p])].Visible = true; Texts[htTexts(TextName[p])].Visible = true; @@ -152,16 +163,16 @@ namespace Vocaluxe.Screens Texts[htTexts(TextNumber[p])].Text = (_Pos + p + 1).ToString(); - string name = _Scores[_Pos + p].Name; - name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Pos + p].Difficulty)) + "]"; + string name = _Scores[_Round][_Pos + p].Name; + name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Round][_Pos + p].Difficulty)) + "]"; if (_IsDuet) - name += " (P" + (_Scores[_Pos + p].LineNr + 1).ToString() + ")"; + name += " (P" + (_Scores[_Round][_Pos + p].LineNr + 1).ToString() + ")"; Texts[htTexts(TextName[p])].Text = name; - Texts[htTexts(TextScore[p])].Text = _Scores[_Pos + p].Score.ToString("00000"); - Texts[htTexts(TextDate[p])].Text = _Scores[_Pos + p].Date; + Texts[htTexts(TextScore[p])].Text = _Scores[_Round][_Pos + p].Score.ToString("00000"); + Texts[htTexts(TextDate[p])].Text = _Scores[_Round][_Pos + p].Date; - if (isNewEntry(_Scores[_Pos + p].ID) == true) + if (isNewEntry(_Scores[_Round][_Pos + p].ID) == true) { Texts[htTexts(TextNumber[p])].Style = EStyle.BoldItalic; Texts[htTexts(TextName[p])].Style = EStyle.BoldItalic; @@ -185,10 +196,16 @@ namespace Vocaluxe.Screens base.OnShow(); _Round = 0; _Pos = 0; - _Scores = new List(); + CPoints _Points = CGame.GetPoints(); + _Scores = new List[_Points.NumRounds]; + for (int i = 0; i < _Scores.Length; i++) + { + _Scores[i] = new List(); + } _NewEntryIDs.Clear(); AddScoresToDB(); LoadScores(); + UpdateRound(); UpdateGame(); } @@ -239,39 +256,47 @@ namespace Vocaluxe.Screens for (int round = 0; round < points.NumRounds; round++) { SPlayer player = points.GetPlayer(round, CGame.NumPlayer)[0]; - CDataBase.LoadScore(ref _Scores, player); + CDataBase.LoadScore(ref _Scores[round], player); + } + } - if (round == _Round) - { - _IsDuet = false; + private void UpdateRound() + { + _IsDuet = false; + CPoints points = CGame.GetPoints(); + SPlayer player = points.GetPlayer(_Round, CGame.NumPlayer)[0]; + CSong song = CGame.GetSong(_Round+1); + if (song == null) + return; - CSong song = CSongs.GetSong(player.SongID); - Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; + Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; + if (points.NumRounds > 1) + { + Texts[htTexts(TextSongName)].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")"; + } - switch (CGame.GameMode) - { - case EGameMode.TR_GAMEMODE_NORMAL: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; - break; + switch (CGame.GetGameMode(_Round)) + { + case EGameMode.TR_GAMEMODE_NORMAL: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + break; - case EGameMode.TR_GAMEMODE_MEDLEY: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; - break; + case EGameMode.TR_GAMEMODE_MEDLEY: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; + break; - case EGameMode.TR_GAMEMODE_DUET: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; - _IsDuet = true; - break; + case EGameMode.TR_GAMEMODE_DUET: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; + _IsDuet = true; + break; - case EGameMode.TR_GAMEMODE_SHORTSONG: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; - break; + case EGameMode.TR_GAMEMODE_SHORTSONG: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; + break; - default: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; - break; - } - } + default: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + break; } } @@ -279,7 +304,7 @@ namespace Vocaluxe.Screens { if (Num > 0) { - if (_Pos + Num + NumEntrys < _Scores.Count) + if (_Pos + Num + NumEntrys < _Scores[_Round].Count) _Pos += Num; } if (Num < 0) @@ -292,27 +317,14 @@ namespace Vocaluxe.Screens private void ChangeRound(int Num) { - CPoints points = CGame.GetPoints(); - if (points.NumRounds < 2) - return; - - _Round += Num; - - if (Num > 0) - { - if (_Round >= points.NumRounds) - _Round = 0; - - LoadScores(); - } - - if (Num < 0) - { - if (_Round < 0) - _Round = points.NumRounds - 1; - - LoadScores(); - } + CPoints _Points = CGame.GetPoints(); + if (_Round + Num < _Points.NumRounds && _Round + Num > -1) + _Round += Num; + else if (_Round + Num >= _Points.NumRounds) + _Round = _Points.NumRounds - 1; + else if (_Round + Num < 0) + _Round = 0; + UpdateRound(); } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 1843757d..0eee0001 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -658,7 +658,9 @@ namespace Vocaluxe.Screens private void Stop() { - CGame.NextRound(); + //Need this to set other songs to points-var + while(!CGame.IsFinished()) + CGame.NextRound(); CGraphics.FadeTo(EScreens.ScreenScore); _FadeOut = true; From 9907c56909f69bb1e627bc5cbd2a69d670cfcb05 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 15:35:34 +0200 Subject: [PATCH 55/67] Fix visibility of skip-button in pause-menu. --- Vocaluxe/Screens/CScreenSing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 0eee0001..76fbbdff 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -766,7 +766,7 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; - if (CGame.NumRounds > CGame.RoundNr) + if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds != 1) Buttons[htButtons(ButtonSkip)].Visible = true; CSound.Pause(_CurrentStream); }else From 41a9118c27629982859cf1c1c9cd9e7f08ea0340 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 29 Sep 2012 13:31:59 +0200 Subject: [PATCH 56/67] Fix equalizer-saving. --- Vocaluxe/Menu/CEqualizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index a3c6767d..8f0a8ab3 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -158,7 +158,7 @@ namespace Vocaluxe.Menu writer.WriteComment(" + + Outline + + TR_SCREENSONG_BUTTON_SINGALL + + + + + + + + + + + Button + + Button + + 40 + 180 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SINGALLVISIBLE + + + + + + + + + + + Button + + Button + + 40 + 90 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_RANDOM + + + + + + + + + + + Button + + Button + + 40 + 275 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_OPENPLAYLIST + + + + + + + + + + + Invisible + + Invisible + + 40 + 40 + -1,01 + 360 + 360 + + + Invisible + + + Invisible + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + Button @@ -440,7 +685,7 @@ 1 - + Button @@ -504,7 +749,72 @@ Bold 1 - + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 40 + 230 + -2,11 + 360 + 40 + + 45 + 235 + -2,12 + 30 + 30 + + 365 + 235 + -2,12 + 30 + 30 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 30,00 + + 280,00 + + Outline + + Bold + + 1 + CoverTile diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9b36d03d..d50d391d 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -17,6 +17,13 @@ namespace Vocaluxe.Screens { class CScreenSong : CMenu { + enum ESongOptionsView + { + None, + Song, + General + } + // Version number for theme files. Increment it, if you've changed something on the theme files! const int ScreenVersion = 3; @@ -26,12 +33,18 @@ namespace Vocaluxe.Screens private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; + private const string ButtonOpenOptions = "ButtonOpenOptions"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; + private const string ButtonOptionsRandom = "ButtonOptionsRandom"; + private const string ButtonOptionsSingAll = "ButtonOptionsSingAll"; + private const string ButtonOptionsSingAllVisible = "ButtonOptionsSingAllVisible"; + private const string ButtonOptionsOpenPlaylist = "ButtonOptionsOpenPlaylist"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; - private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; + private const string SelectSlideOptionsPlaylistAdd = "SelectSlideOptionsPlaylistAdd"; + private const string SelectSlideOptionsPlaylistOpen = "SelectSlideOptionsPlaylistOpen"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; @@ -60,8 +73,8 @@ namespace Vocaluxe.Screens _ScreenVersion = ScreenVersion; _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; - _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonOptionsRandom, ButtonOptionsSingAll, ButtonOptionsSingAllVisible, ButtonOptionsOpenPlaylist, ButtonOpenOptions }; + _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylistAdd, SelectSlideOptionsPlaylistOpen }; _ThemeSongMenus = new string[] { SongMenu }; _ThemePlaylists = new string[] { Playlist }; } @@ -70,10 +83,15 @@ namespace Vocaluxe.Screens { base.LoadTheme(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonOptionsRandom)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; @@ -129,7 +147,7 @@ namespace Vocaluxe.Screens if (CSongs.NumVisibleSongs > 0) { if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); } break; @@ -153,6 +171,10 @@ namespace Vocaluxe.Screens break; + case Keys.Space: + ToggleSongOptions(ESongOptionsView.General); + break; + case Keys.F3: if (_SearchActive) { @@ -166,7 +188,7 @@ namespace Vocaluxe.Screens } break; - //TODO: Move that to the new menu and delete it! + //TODO: Delete it! ??? Shouldn't we keep this as shortcut? case Keys.A: if (!_SearchActive && KeyEvent.Mod == Modifier.None) { @@ -219,14 +241,33 @@ namespace Vocaluxe.Screens case Keys.Enter: if (Buttons[htButtons(ButtonOptionsClose)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + OpenAndAddPlaylistAction(); + } + else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + { + if (CSongs.Category != -1) + { + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + } + else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + { + StartRandomAllSongs(); + } + else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + { + StartRandomVisibleSongs(); + } + else if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) { OpenPlaylistAction(); } @@ -234,7 +275,8 @@ namespace Vocaluxe.Screens case Keys.Escape: case Keys.Back: - ToggleSongOptions(); + case Keys.Space: + ToggleSongOptions(ESongOptionsView.None); break; } } @@ -270,7 +312,7 @@ namespace Vocaluxe.Screens CGraphics.FadeTo(EScreens.ScreenMain); } else if (MouseEvent.RB && _SongOptionsActive) - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); if (MouseEvent.MB && CSongs.Category != -1) { @@ -284,7 +326,14 @@ namespace Vocaluxe.Screens { if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); + } + } + else if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + if (Buttons[htButtons(ButtonOpenOptions)].Selected) + { + ToggleSongOptions(ESongOptionsView.General); } } } @@ -295,21 +344,42 @@ namespace Vocaluxe.Screens { if (Buttons[htButtons(ButtonOptionsClose)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + OpenAndAddPlaylistAction(); + } + else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + { + if (CSongs.Category != -1) + { + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + } + else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + { + ToggleSongOptions(ESongOptionsView.None); + StartRandomAllSongs(); + } + else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + { + ToggleSongOptions(ESongOptionsView.None); + StartRandomVisibleSongs(); + } + else if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) { OpenPlaylistAction(); } } if (MouseEvent.RB) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } } @@ -534,55 +604,71 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].OnShow(); } - private void ToggleSongOptions() + private void ToggleSongOptions(ESongOptionsView view) { _SongOptionsActive = !_SongOptionsActive; if (_SongOptionsActive) { - EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; - if (_AvailableGameModes.Count > 0) - LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); - _AvailableGameModes.Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); - if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + if (view == ESongOptionsView.Song) { - 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); + EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; + if (_AvailableGameModes.Count > 0) + LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); + _AvailableGameModes.Clear(); + 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); + } + 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); + } + 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); + } + //Set SelectSlide-Selection to last selected game-mode if possible + for (int i = 0; i < _AvailableGameModes.Count; i++) + { + if (_AvailableGameModes[i] == LastMode) + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); + } + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true; + Buttons[htButtons(ButtonOptionsSing)].Visible = true; + Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; } - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + else if (view == ESongOptionsView.General) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_DUET)); - _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_DUET); + Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = true; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; } - 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); - } - //Set SelectSlide-Selection to last selected game-mode if possible - for (int i = 0; i < _AvailableGameModes.Count; i++) - { - if (_AvailableGameModes[i] == LastMode) - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); - } - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; - Buttons[htButtons(ButtonOptionsSing)].Visible = true; - Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true; Statics[htStatics(StaticOptionsBG)].Visible = true; } else { SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonOptionsRandom)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; } @@ -614,15 +700,29 @@ namespace Vocaluxe.Screens private void UpdatePlaylistNames() { - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValues(CPlaylists.PlaylistNames); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValues(CPlaylists.PlaylistNames); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValues(CPlaylists.PlaylistNames); } private void OpenPlaylistAction() + { + //Open a playlist + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection)) + { + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection; + //Open playlist + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + } + ToggleSongOptions(ESongOptionsView.None); + } + + private void OpenAndAddPlaylistAction() { //Open a playlist and add song - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1)) { //Check selected game-mode EGameMode gm; @@ -634,17 +734,17 @@ namespace Vocaluxe.Screens else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; //Check if Playlist really exists - if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1; //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song - else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) == -1) { //Check selected game-mode EGameMode gm; @@ -662,7 +762,7 @@ namespace Vocaluxe.Screens //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); //Add new playlist to select-slide - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); } //Add song to loaded playlist @@ -680,7 +780,7 @@ namespace Vocaluxe.Screens CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); } } } From 754a4acf57f318e8e7dfe231d6be6ca9850435a4 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 16:33:00 +0100 Subject: [PATCH 65/67] Update screensong-changelog. --- Output/Themes/Changelog/Changelog_ScreenSong.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index e78df639..c1402b34 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -4,10 +4,10 @@ ScreenSong Version 3: Add: -, , -, -, , , , , , -, + + +, , , , , , , +, , and as a new Screen-Element. For details, look at ScreenSong.xml From 3e8f34569d8c31c0a897ca9767e405950b3e9449 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 16:56:54 +0100 Subject: [PATCH 66/67] Fix crashing when start singing of background-music-song. --- Vocaluxe/Screens/CPopupScreenPlayerControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index e3d614d8..8e7d8ad9 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -218,7 +218,7 @@ namespace Vocaluxe.Screens CGame.ClearSongs(); EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; - if (CSongs.VisibleSongs[SongNr].IsDuet) + if (CSongs.AllSongs[SongNr].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; CGame.AddSong(SongNr, gm); From ade608e1bd91ce42ecd711fce3e9b9bab7f16424 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 2 Nov 2012 11:54:06 +0100 Subject: [PATCH 67/67] Fix singig all visible songs. --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index d50d391d..75b66d10 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -543,7 +543,7 @@ namespace Vocaluxe.Screens int SongNr = IDs[CGame.Rand.Next(IDs.Count)]; EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; - if (CSongs.VisibleSongs[SongNr].IsDuet) + if (CSongs.AllSongs[SongNr].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; CGame.AddSong(SongNr, gm);