@@ -57,12 +57,13 @@ window.onload = function () {
5757 ui_message_positionX : 0 ,
5858 ui_message_positionY : 0 ,
5959 ui_day_day : "0" ,
60- ui_day_orientation : "0" ,
60+ ui_day_allCaps : false ,
61+ ui_day_orientation : false ,
6162 ui_day_scale : 1 ,
6263 ui_day_positionX : 0 ,
6364 ui_day_positionY : 0 ,
6465 ui_date_date : "0" ,
65- ui_date_orientation : "0" ,
66+ ui_date_orientation : false ,
6667 ui_date_delimiter : "0" ,
6768 ui_date_scale : 1 ,
6869 ui_date_positionX : 0 ,
@@ -173,18 +174,10 @@ window.onload = function () {
173174 clockPositionFolder . add ( options , "ui_clock_positionY" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "Y" ) . onChange ( updateMask ) ;
174175 clockFolder . close ( ) ;
175176
176- const messageFolder = gui . addFolder ( "Message" ) ;
177- messageFolder . add ( options , "ui_message_message" ) . name ( "Message" ) . onChange ( updateMask ) ;
178- messageFolder . add ( options , "ui_message_text" ) . name ( "Message Text" ) . onChange ( updateMask ) ;
179- messageFolder . add ( options , "ui_message_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
180- const messagePositionFolder = messageFolder . addFolder ( "Position" ) ;
181- messagePositionFolder . add ( options , "ui_message_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
182- messagePositionFolder . add ( options , "ui_message_positionY" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "Y" ) . onChange ( updateMask ) ;
183- messageFolder . close ( ) ;
184-
185177 const dayFolder = gui . addFolder ( "Day" ) ;
186178 dayFolder . add ( options , "ui_day_day" , optionsToDict ( config . general . properties . ui_day_day . options ) ) . name ( "Day" ) . onChange ( updateMask ) ;
187- dayFolder . add ( options , "ui_day_orientation" , optionsToDict ( config . general . properties . ui_day_orientation . options ) ) . name ( "Orientation" ) . onChange ( updateMask ) ;
179+ dayFolder . add ( options , "ui_day_allCaps" ) . name ( "All CAPS" ) . onChange ( updateMask ) ;
180+ dayFolder . add ( options , "ui_day_orientation" ) . name ( "Vertical Orientation" ) . onChange ( updateMask ) ;
188181 dayFolder . add ( options , "ui_day_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
189182 const dayPositionFolder = dayFolder . addFolder ( "Position" ) ;
190183 dayPositionFolder . add ( options , "ui_day_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
@@ -193,14 +186,23 @@ window.onload = function () {
193186
194187 const dateFolder = gui . addFolder ( "Date" ) ;
195188 dateFolder . add ( options , "ui_date_date" , optionsToDict ( config . general . properties . ui_date_date . options ) ) . name ( "Day" ) . onChange ( updateMask ) ;
196- dateFolder . add ( options , "ui_date_orientation" , optionsToDict ( config . general . properties . ui_date_orientation . options ) ) . name ( "Orientation" ) . onChange ( updateMask ) ;
189+ dateFolder . add ( options , "ui_date_orientation" ) . name ( "Vertical Orientation" ) . onChange ( updateMask ) ;
197190 dateFolder . add ( options , "ui_date_delimiter" , optionsToDict ( config . general . properties . ui_date_delimiter . options ) ) . name ( "Delimiter" ) . onChange ( updateMask ) ;
198191 dateFolder . add ( options , "ui_date_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
199192 const datePositionFolder = dateFolder . addFolder ( "Position" ) ;
200193 datePositionFolder . add ( options , "ui_date_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
201194 datePositionFolder . add ( options , "ui_date_positionY" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "Y" ) . onChange ( updateMask ) ;
202195 dateFolder . close ( ) ;
203196
197+ const messageFolder = gui . addFolder ( "Message" ) ;
198+ messageFolder . add ( options , "ui_message_message" ) . name ( "Message" ) . onChange ( updateMask ) ;
199+ messageFolder . add ( options , "ui_message_text" ) . name ( "Message Text" ) . onChange ( updateMask ) ;
200+ messageFolder . add ( options , "ui_message_scale" ) . min ( 0 ) . max ( 10 ) . step ( 1 ) . name ( "Scale" ) . onChange ( updateMask ) ;
201+ const messagePositionFolder = messageFolder . addFolder ( "Position" ) ;
202+ messagePositionFolder . add ( options , "ui_message_positionX" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "X" ) . onChange ( updateMask ) ;
203+ messagePositionFolder . add ( options , "ui_message_positionY" ) . min ( - 100 ) . max ( 100 ) . step ( 1 ) . name ( "Y" ) . onChange ( updateMask ) ;
204+ messageFolder . close ( ) ;
205+
204206 const otherFolder = gui . addFolder ( "Other" ) ;
205207 otherFolder . add ( options , 'ui_other_codesCommaSeparated' ) . name ( 'Codes (Comma separated)' ) . onChange ( ( ) => {
206208 options . codes = makeCodes ( options . ui_other_codesCommaSeparated ) ;
@@ -307,21 +309,10 @@ window.onload = function () {
307309 if ( properties . ui_clock_clock || properties . ui_clock_24hourformat || properties . ui_clock_daylightsaving || properties . ui_clock_scale || properties . ui_clock_positionx || properties . ui_clock_positiony )
308310 updateMask ( ) ;
309311
310- if ( properties . ui_message_message )
311- options . ui_message_message = properties . ui_message_message . value ;
312- if ( properties . ui_message_text )
313- options . ui_message_text = properties . ui_message_text . value ;
314- if ( properties . ui_message_scale )
315- options . ui_message_scale = properties . ui_message_scale . value ;
316- if ( properties . ui_message_positionx )
317- options . ui_message_positionX = properties . ui_message_positionx . value ;
318- if ( properties . ui_message_positiony )
319- options . ui_message_positionY = properties . ui_message_positiony . value ;
320- if ( properties . ui_message_message || properties . ui_message_text || properties . ui_message_scale || properties . ui_message_positionx || properties . ui_message_positiony )
321- updateMask ( ) ;
322-
323312 if ( properties . ui_day_day )
324313 options . ui_day_day = properties . ui_day_day . value ;
314+ if ( properties . ui_day_allcaps )
315+ options . ui_day_allCaps = properties . ui_day_allcaps . value ;
325316 if ( properties . ui_day_orientation )
326317 options . ui_day_orientation = properties . ui_day_orientation . value ;
327318 if ( properties . ui_day_scale )
@@ -330,7 +321,7 @@ window.onload = function () {
330321 options . ui_day_positionX = properties . ui_day_positionx . value ;
331322 if ( properties . ui_day_positiony )
332323 options . ui_day_positionY = properties . ui_day_positiony . value ;
333- if ( properties . ui_day_day || properties . ui_day_orientation || properties . ui_day_scale || properties . ui_day_positionx || properties . ui_day_positiony )
324+ if ( properties . ui_day_day || properties . ui_day_allcaps || properties . ui_day_orientation || properties . ui_day_scale || properties . ui_day_positionx || properties . ui_day_positiony )
334325 updateMask ( ) ;
335326
336327 if ( properties . ui_date_date )
@@ -348,6 +339,19 @@ window.onload = function () {
348339 if ( properties . ui_date_date || properties . ui_date_orientation || properties . ui_date_delimiter || properties . ui_date_scale || properties . ui_date_positionx || properties . ui_date_positiony )
349340 updateMask ( ) ;
350341
342+ if ( properties . ui_message_message )
343+ options . ui_message_message = properties . ui_message_message . value ;
344+ if ( properties . ui_message_text )
345+ options . ui_message_text = properties . ui_message_text . value ;
346+ if ( properties . ui_message_scale )
347+ options . ui_message_scale = properties . ui_message_scale . value ;
348+ if ( properties . ui_message_positionx )
349+ options . ui_message_positionX = properties . ui_message_positionx . value ;
350+ if ( properties . ui_message_positiony )
351+ options . ui_message_positionY = properties . ui_message_positiony . value ;
352+ if ( properties . ui_message_message || properties . ui_message_text || properties . ui_message_scale || properties . ui_message_positionx || properties . ui_message_positiony )
353+ updateMask ( ) ;
354+
351355 if ( properties . ui_other_codescommaseparated ) {
352356 options . codes = makeCodes ( properties . ui_other_codescommaseparated . value ) ;
353357 initialAnimation ( ) ;
@@ -364,8 +368,9 @@ window.onload = function () {
364368 } , false ) ;
365369
366370 //MARK: Variables
367- var fonts = [ "monospace" , "consolas" , "courier-bold" , "neo-matrix" ] ;
368- var charsets = [
371+ let days = [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" ] ;
372+ let fonts = [ "monospace" , "consolas" , "courier-bold" , "neo-matrix" ] ;
373+ let charsets = [
369374 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ,
370375 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" ,
371376 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ()._,-=+*/\\:;\'\"<>?!@#$%&^[]{}" ,
@@ -501,6 +506,40 @@ window.onload = function () {
501506 }
502507 }
503508
509+ if ( options . ui_day_day != "0" ) {
510+ var dayText = options . ui_day_allCaps ? days [ day ] . toUpperCase ( ) : days [ day ] ;
511+ if ( options . ui_day_day == "2" )
512+ dayText = dayText . substring ( 0 , 3 ) ;
513+ if ( options . ui_day_orientation )
514+ dayText = dayText . split ( "" ) . join ( "\\n" ) ;
515+ if ( options . ui_day_scale > 0 ) {
516+ let bb = getTextBoundingBox ( dayText , options . ui_day_scale ) ;
517+ let center = [ Math . floor ( ( columns - bb [ 0 ] ) / 2 ) , Math . floor ( ( rows - bb [ 1 ] ) / 2 ) ] ;
518+ drawTextOnMask ( dayText , center [ 0 ] + options . ui_day_positionX , center [ 1 ] + options . ui_day_positionY , options . ui_day_scale ) ;
519+ } else {
520+ let cc = getCharsCount ( dayText ) ;
521+ let center = [ Math . floor ( ( columns - cc [ 0 ] ) / 2 ) , Math . floor ( ( rows - cc [ 1 ] ) / 2 ) ] ;
522+ drawTextOnMatrix ( dayText , center [ 0 ] + options . ui_day_positionX , center [ 1 ] + options . ui_day_positionY ) ;
523+ }
524+ }
525+
526+ // if (options.ui_date_date != "0") {
527+ // var dayText = options.ui_day_allCaps ? days[day].toUpperCase() : days[day];
528+ // if (options.ui_day_day == "2")
529+ // dayText = dayText.substring(0, 3);
530+ // if (options.ui_day_orientation)
531+ // dayText = dayText.split("").join("\\n");
532+ // if (options.ui_day_scale > 0) {
533+ // let bb = getTextBoundingBox(dayText, options.ui_day_scale);
534+ // let center = [Math.floor((columns - bb[0]) / 2), Math.floor((rows - bb[1]) / 2)];
535+ // drawTextOnMask(dayText, center[0] + options.ui_day_positionX, center[1] + options.ui_date_positionY, options.ui_day_scale);
536+ // } else {
537+ // let cc = getCharsCount(dayText);
538+ // let center = [Math.floor((columns - cc[0]) / 2), Math.floor((rows - cc[1]) / 2)];
539+ // drawTextOnMatrix(dayText, center[0] + options.ui_day_positionX, center[1] + options.ui_date_positionY);
540+ // }
541+ // }
542+
504543 if ( options . ui_message_message ) {
505544 if ( options . ui_message_scale > 0 ) {
506545 let bb = getTextBoundingBox ( options . ui_message_text , options . ui_message_scale ) ;
0 commit comments