@@ -63,7 +63,7 @@ window.onload = function () {
6363 ui_day_positionX : 0 ,
6464 ui_day_positionY : 0 ,
6565 ui_date_date : "0" ,
66- ui_date_orientation : false ,
66+ ui_date_style : "0" ,
6767 ui_date_year : "2" ,
6868 ui_date_order : "0" ,
6969 ui_date_monthName : false ,
@@ -202,7 +202,7 @@ window.onload = function () {
202202 dateFolder . add ( options , "ui_date_monthName" ) . name ( "Month Name" ) . onChange ( updateMask ) ;
203203 dateFolder . add ( options , "ui_date_allCaps" ) . name ( "All CAPS" ) . onChange ( updateMask ) ;
204204 dateFolder . add ( options , "ui_date_delimiter" , optionsToDict ( config . general . properties . ui_date_delimiter . options ) ) . name ( "Delimiter" ) . onChange ( updateMask ) ;
205- dateFolder . add ( options , "ui_date_orientation" ) . name ( "Vertical Orientation " ) . onChange ( updateMask ) ;
205+ dateFolder . add ( options , "ui_date_style" , optionsToDict ( config . general . properties . ui_date_style . options ) ) . name ( "Style " ) . onChange ( updateMask ) ;
206206 dateFolder . add ( options , "ui_date_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
207207 const datePositionFolder = dateFolder . addFolder ( "Position" ) ;
208208 datePositionFolder . add ( options , "ui_date_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
@@ -346,8 +346,8 @@ window.onload = function () {
346346 options . ui_date_date = properties . ui_date_date . value ;
347347 updateTime ( ) ;
348348 }
349- if ( properties . ui_date_orientation )
350- options . ui_date_orientation = properties . ui_date_orientation . value ;
349+ if ( properties . ui_date_style )
350+ options . ui_date_style = properties . ui_date_style . value ;
351351 if ( properties . ui_date_year )
352352 options . ui_date_year = properties . ui_date_year . value ;
353353 if ( properties . ui_date_order )
@@ -364,7 +364,7 @@ window.onload = function () {
364364 options . ui_date_positionX = properties . ui_date_positionx . value ;
365365 if ( properties . ui_date_positiony )
366366 options . ui_date_positionY = properties . ui_date_positiony . value ;
367- if ( properties . ui_date_date || properties . ui_date_orientation || properties . ui_date_year ||
367+ if ( properties . ui_date_date || properties . ui_date_style || properties . ui_date_year ||
368368 properties . ui_date_order || properties . ui_date_monthname || properties . ui_date_allcaps ||
369369 properties . ui_date_delimiter || properties . ui_date_scale || properties . ui_date_positionx
370370 || properties . ui_date_positiony )
@@ -541,8 +541,8 @@ window.onload = function () {
541541 updateTime ( ) ;
542542 updateMask ( ) ;
543543 break ;
544- case "ui_date_orientation " :
545- options . ui_date_orientation = val . value ;
544+ case "ui_date_style " :
545+ options . ui_date_style = val . value ;
546546 updateMask ( ) ;
547547 break ;
548548 case "ui_date_year" :
@@ -725,6 +725,9 @@ window.onload = function () {
725725 hour = "0" + hour ;
726726 if ( minute < 10 )
727727 minute = "0" + minute ;
728+
729+ hour = hour . toString ( ) ;
730+ minute = minute . toString ( ) ;
728731 }
729732
730733 //MARK: Mask
@@ -750,22 +753,36 @@ window.onload = function () {
750753
751754 switch ( options . ui_clock_clock ) {
752755 case "1" : {
756+ let clock = hour + ":" + minute ;
753757 if ( options . ui_clock_scale > 0 ) {
754758 let center = [ Math . floor ( ( columns - 17 * options . ui_clock_scale ) / 2 ) , Math . floor ( ( rows - 5 * options . ui_clock_scale ) / 2 ) ] ;
755- drawTextOnMask ( hour + ":" + minute , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY , options . ui_clock_scale ) ;
759+ drawTextOnMask ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY , options . ui_clock_scale ) ;
756760 } else {
757761 let center = [ Math . floor ( ( columns - 5 ) / 2 ) , Math . floor ( ( rows - 1 ) / 2 ) ] ;
758- drawTextOnMatrix ( hour + ":" + minute , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY ) ;
762+ drawTextOnMatrix ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY ) ;
759763 }
760764 break ;
761765 }
762766 case "2" : {
767+ let clock = hour + "\\n" + minute ;
763768 if ( options . ui_clock_scale > 0 ) {
764769 let center = [ Math . floor ( ( columns - 7 * options . ui_clock_scale ) / 2 ) , Math . floor ( ( rows - 11 * options . ui_clock_scale ) / 2 ) ] ;
765- drawTextOnMask ( hour + "\\n" + minute , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY , options . ui_clock_scale ) ;
770+ drawTextOnMask ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY , options . ui_clock_scale ) ;
766771 } else {
767772 let center = [ Math . floor ( ( columns - 2 ) / 2 ) , Math . floor ( ( rows - 2 ) / 2 ) ] ;
768- drawTextOnMatrix ( hour + "\\n" + minute , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY ) ;
773+ drawTextOnMatrix ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY ) ;
774+ }
775+ break ;
776+ }
777+ case "3" : {
778+ let h = hour . split ( "" ) . join ( "\\n" ) , m = minute . split ( "" ) . join ( "\\n" ) ;
779+ let clock = h + "\\n" + m ;
780+ if ( options . ui_clock_scale > 0 ) {
781+ let center = [ Math . floor ( ( columns - 3 * options . ui_clock_scale ) / 2 ) , Math . floor ( ( rows - 23 * options . ui_clock_scale ) / 2 ) ] ;
782+ drawTextOnMask ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY , options . ui_clock_scale ) ;
783+ } else {
784+ let center = [ Math . floor ( ( columns - 1 ) / 2 ) , Math . floor ( ( rows - 4 ) / 2 ) ] ;
785+ drawTextOnMatrix ( clock , center [ 0 ] + options . ui_clock_positionX , center [ 1 ] + options . ui_clock_positionY ) ;
769786 }
770787 break ;
771788 }
@@ -789,33 +806,48 @@ window.onload = function () {
789806 }
790807
791808 if ( options . ui_date_date != "0" ) {
792- var dateText = date . toString ( ) , monthText , yearText = "" , completeDate ;
793- if ( dateText . length < 2 )
794- dateText = "0" + dateText ;
809+ var text3 = date . toString ( ) , text2 , text1 = "" , completeDate ;
810+ if ( text3 . length < 2 )
811+ text3 = "0" + text3 ;
795812 if ( options . ui_date_monthName ) {
796- monthText = months [ parseInt ( options . ui_date_date ) - 1 ] [ month - 1 ] ;
813+ text2 = months [ parseInt ( options . ui_date_date ) - 1 ] [ month - 1 ] ;
797814 if ( options . ui_date_allCaps )
798- monthText = monthText . toUpperCase ( ) ;
815+ text2 = text2 . toUpperCase ( ) ;
799816 } else {
800- monthText = month . toString ( ) ;
801- if ( monthText . length < 2 )
802- monthText = "0" + monthText ;
817+ text2 = month . toString ( ) ;
818+ if ( text2 . length < 2 )
819+ text2 = "0" + text2 ;
803820 }
804821 switch ( options . ui_date_year ) {
805822 case "1" : {
806- yearText = year . toString ( ) . substring ( 2 , 4 ) ;
823+ text1 = year . toString ( ) . substring ( 2 , 4 ) ;
807824 break ;
808825 }
809826 case "2" : {
810- yearText = year . toString ( ) ;
827+ text1 = year . toString ( ) ;
811828 break ;
812829 }
813830 }
814831
815- let delimiter = options . ui_date_orientation ? "" : dateDelimiters [ parseInt ( options . ui_date_delimiter ) ] ;
816- completeDate = yearText + ( yearText . length > 0 ? delimiter : "" ) + ( options . ui_date_order == "0" ? monthText + delimiter + dateText : dateText + delimiter + monthText ) ;
817- if ( options . ui_date_orientation )
818- completeDate = completeDate . split ( "" ) . join ( "\\n" ) ;
832+ if ( options . ui_date_order == 1 ) {
833+ let tmp = text2 ;
834+ text2 = text3 ;
835+ text3 = tmp ;
836+ }
837+
838+ let delimiter = dateDelimiters [ parseInt ( options . ui_date_delimiter ) ] ;
839+
840+ switch ( options . ui_date_style ) {
841+ case "0" :
842+ completeDate = ( text1 . length > 0 ? [ text1 , text2 , text3 ] : [ text2 , text3 ] ) . join ( delimiter ) ;
843+ break ;
844+ case "1" :
845+ completeDate = ( text1 . length > 0 ? [ text1 , text2 , text3 ] : [ text2 , text3 ] ) . join ( "\\n" ) ;
846+ break ;
847+ case "2" :
848+ completeDate = ( text1 + text2 + text3 ) . split ( "" ) . join ( "\\n" ) ;
849+ break ;
850+ }
819851
820852 if ( options . ui_date_scale > 0 ) {
821853 let bb = getTextBoundingBox ( completeDate , options . ui_date_scale ) ;
0 commit comments