Skip to content

Commit affe877

Browse files
committed
added day and date properties
1 parent 0828a19 commit affe877

File tree

2 files changed

+301
-17
lines changed

2 files changed

+301
-17
lines changed

index.js

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ window.onload = function () {
5656
ui_message_scale: 1,
5757
ui_message_positionX: 0,
5858
ui_message_positionY: 0,
59+
ui_day_day: "0",
60+
ui_day_orientation: "0",
61+
ui_day_scale: 1,
62+
ui_day_positionX: 0,
63+
ui_day_positionY: 0,
64+
ui_date_date: "0",
65+
ui_date_orientation: "0",
66+
ui_date_delimiter: "0",
67+
ui_date_scale: 1,
68+
ui_date_positionX: 0,
69+
ui_date_positionY: 0,
5970
Share() {
6071
copyToClipboard(paramsToUrl({ preset: btoa(JSON.stringify(gui.save())) }, {}, []));
6172
Log("Copied Preset URL to clipboard.");
@@ -141,29 +152,46 @@ window.onload = function () {
141152
logoPositionFolder.add(options, "ui_logo_positionX").min(-2500).max(2500).step(1).name("X").onChange(updateLogo);
142153
logoPositionFolder.add(options, "ui_logo_positionY").min(-2500).max(2500).step(1).name("Y").onChange(updateLogo);
143154

144-
const clockfolder = gui.addFolder("Clock");
145-
clockfolder.add(options, "ui_clock_clock", optionsToDict(config.general.properties.ui_clock_clock.options)).name("Clock").onChange(updateMask);
146-
clockfolder.add(options, "ui_clock_24HourFormat").name("24 Hour format").onChange(() => {
155+
const clockFolder = gui.addFolder("Clock");
156+
clockFolder.add(options, "ui_clock_clock", optionsToDict(config.general.properties.ui_clock_clock.options)).name("Clock").onChange(updateMask);
157+
clockFolder.add(options, "ui_clock_24HourFormat").name("24 Hour format").onChange(() => {
147158
updateTime();
148159
updateMask();
149160
});
150-
clockfolder.add(options, "ui_clock_dayLightSaving").min(-1).max(1).step(1).name("Day-light Saving").onChange(() => {
161+
clockFolder.add(options, "ui_clock_dayLightSaving").min(-1).max(1).step(1).name("Day-light Saving").onChange(() => {
151162
updateTime();
152163
updateMask();
153164
});
154-
clockfolder.add(options, "ui_clock_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
155-
const clockPositionFolder = clockfolder.addFolder("Position");
165+
clockFolder.add(options, "ui_clock_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
166+
const clockPositionFolder = clockFolder.addFolder("Position");
156167
clockPositionFolder.add(options, "ui_clock_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
157168
clockPositionFolder.add(options, "ui_clock_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
158169

159-
const messagefolder = gui.addFolder("Message");
160-
messagefolder.add(options, "ui_message_message").name("Message").onChange(updateMask);
161-
messagefolder.add(options, "ui_message_text").name("Message Text").onChange(updateMask);
162-
messagefolder.add(options, "ui_message_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
163-
const messagePositionFolder = messagefolder.addFolder("Position");
170+
const messageFolder = gui.addFolder("Message");
171+
messageFolder.add(options, "ui_message_message").name("Message").onChange(updateMask);
172+
messageFolder.add(options, "ui_message_text").name("Message Text").onChange(updateMask);
173+
messageFolder.add(options, "ui_message_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
174+
const messagePositionFolder = messageFolder.addFolder("Position");
164175
messagePositionFolder.add(options, "ui_message_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
165176
messagePositionFolder.add(options, "ui_message_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
166177

178+
const dayFolder = gui.addFolder("Day");
179+
dayFolder.add(options, "ui_day_day", optionsToDict(config.general.properties.ui_day_day.options)).name("Day").onChange(updateMask);
180+
dayFolder.add(options, "ui_day_orientation", optionsToDict(config.general.properties.ui_day_orientation.options)).name("Orientation").onChange(updateMask);
181+
dayFolder.add(options, "ui_day_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
182+
const dayPositionFolder = dayFolder.addFolder("Position");
183+
dayPositionFolder.add(options, "ui_day_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
184+
dayPositionFolder.add(options, "ui_day_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
185+
186+
const dateFolder = gui.addFolder("Date");
187+
dateFolder.add(options, "ui_date_date", optionsToDict(config.general.properties.ui_date_date.options)).name("Day").onChange(updateMask);
188+
dateFolder.add(options, "ui_date_orientation", optionsToDict(config.general.properties.ui_date_orientation.options)).name("Orientation").onChange(updateMask);
189+
dateFolder.add(options, "ui_date_delimiter", optionsToDict(config.general.properties.ui_date_delimiter.options)).name("Delimiter").onChange(updateMask);
190+
dateFolder.add(options, "ui_date_scale").min(0).max(10).step(1).name("Scale").onChange(updateMask);
191+
const datePositionFolder = dateFolder.addFolder("Position");
192+
datePositionFolder.add(options, "ui_date_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
193+
datePositionFolder.add(options, "ui_date_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
194+
167195
const otherFolder = gui.addFolder("Other");
168196
otherFolder.add(options, 'ui_other_codesCommaSeparated').name('Codes (Comma separated)').onChange(() => {
169197
options.codes = makeCodes(options.ui_other_codesCommaSeparated);
@@ -282,6 +310,34 @@ window.onload = function () {
282310
if (properties.ui_message_message || properties.ui_message_text || properties.ui_message_scale || properties.ui_message_positionx || properties.ui_message_positiony)
283311
updateMask();
284312

313+
if (properties.ui_day_day)
314+
options.ui_day_day = properties.ui_day_day.value;
315+
if (properties.ui_day_orientation)
316+
options.ui_day_orientation = properties.ui_day_orientation.value;
317+
if (properties.ui_day_scale)
318+
options.ui_day_scale = properties.ui_day_scale.value;
319+
if (properties.ui_day_positionx)
320+
options.ui_day_positionX = properties.ui_day_positionx.value;
321+
if (properties.ui_day_positiony)
322+
options.ui_day_positionY = properties.ui_day_positiony.value;
323+
if (properties.ui_day_day || properties.ui_day_orientation || properties.ui_day_scale || properties.ui_day_positionx || properties.ui_day_positiony)
324+
updateMask();
325+
326+
if (properties.ui_date_date)
327+
options.ui_date_date = properties.ui_date_date.value;
328+
if (properties.ui_date_orientation)
329+
options.ui_date_orientation = properties.ui_date_orientation.value;
330+
if (properties.ui_date_delimiter)
331+
options.ui_date_delimiter = properties.ui_date_delimiter.value;
332+
if (properties.ui_date_scale)
333+
options.ui_date_scale = properties.ui_date_scale.value;
334+
if (properties.ui_date_positionx)
335+
options.ui_date_positionX = properties.ui_date_positionx.value;
336+
if (properties.ui_date_positiony)
337+
options.ui_date_positionY = properties.ui_date_positiony.value;
338+
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)
339+
updateMask();
340+
285341
if (properties.ui_other_codescommaseparated) {
286342
options.codes = makeCodes(properties.ui_other_codescommaseparated.value);
287343
initialAnimation();
@@ -422,7 +478,7 @@ window.onload = function () {
422478
case "2": {
423479
if (options.ui_clock_scale > 0) {
424480
let center = [Math.floor((columns - 7 * options.ui_clock_scale) / 2), Math.floor((rows - 11 * options.ui_clock_scale) / 2)];
425-
drawTextOnMask(hour + "\\n" + minute, center[0] + options.ui_clock_positionX, center[1] + options.ui_clock_positionY , options.ui_clock_scale);
481+
drawTextOnMask(hour + "\\n" + minute, center[0] + options.ui_clock_positionX, center[1] + options.ui_clock_positionY, options.ui_clock_scale);
426482
} else {
427483
let center = [Math.floor((columns - 2) / 2), Math.floor((rows - 2) / 2)];
428484
drawTextOnMatrix(hour + "\\n" + minute, center[0] + options.ui_clock_positionX, center[1] + options.ui_clock_positionY);

project.json

Lines changed: 233 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,24 @@
5454
"text" : "<h4>Message</h4>",
5555
"type" : "text"
5656
},
57+
"folder_day" :
58+
{
59+
"index" : 43,
60+
"order" : 143,
61+
"text" : "<h4>Day</h4>",
62+
"type" : "text"
63+
},
64+
"folder_date" :
65+
{
66+
"index" : 49,
67+
"order" : 149,
68+
"text" : "<h4>Date</h4>",
69+
"type" : "text"
70+
},
5771
"folder_other" :
5872
{
59-
"index" : 42,
60-
"order" : 142,
73+
"index" : 56,
74+
"order" : 156,
6175
"text" : "<h4>Other</h4>",
6276
"type" : "text"
6377
},
@@ -238,7 +252,7 @@
238252
},
239253
"ui_clock_scale" :
240254
{
241-
"condition" : "ui_clock_clock.value == 1 || ui_clock_clock.value == 2",
255+
"condition" : "ui_clock_clock.value != 0",
242256
"fraction" : false,
243257
"index" : 33,
244258
"max" : 10,
@@ -575,8 +589,8 @@
575589
},
576590
"ui_other_codescommaseparated" :
577591
{
578-
"index" : 43,
579-
"order" : 143,
592+
"index" : 57,
593+
"order" : 157,
580594
"text" : "Codes (comma separated)",
581595
"type" : "textinput",
582596
"value" : "IP.AF,THE MATRIX"
@@ -638,6 +652,220 @@
638652
"text" : "Trail Length",
639653
"type" : "slider",
640654
"value" : 0.86
655+
},
656+
"ui_day_day" :
657+
{
658+
"index" : 44,
659+
"options" :
660+
[
661+
{
662+
"label" : "None",
663+
"value" : "0"
664+
},
665+
{
666+
"label" : "Friday",
667+
"value" : "1"
668+
},
669+
{
670+
"label" : "FRIDAY",
671+
"value" : "2"
672+
},
673+
{
674+
"label" : "FRI",
675+
"value" : "3"
676+
},
677+
{
678+
"label" : "Fri",
679+
"value" : "4"
680+
},
681+
{
682+
"label" : "7",
683+
"value" : "5"
684+
}
685+
],
686+
"order" : 144,
687+
"text" : "Day",
688+
"type" : "combo",
689+
"value" : "0"
690+
},
691+
"ui_day_positionx" :
692+
{
693+
"condition" : "ui_day_day.value != 0",
694+
"fraction" : false,
695+
"index" : 47,
696+
"max" : 100,
697+
"min" : -100,
698+
"order" : 147,
699+
"text" : "Day Position X",
700+
"type" : "slider",
701+
"value" : 0
702+
},
703+
"ui_day_positiony" :
704+
{
705+
"condition" : "ui_day_day.value != 0",
706+
"fraction" : false,
707+
"index" : 48,
708+
"max" : 100,
709+
"min" : -100,
710+
"order" : 148,
711+
"text" : "Day Position Y",
712+
"type" : "slider",
713+
"value" : 0
714+
},
715+
"ui_day_scale" :
716+
{
717+
"condition" : "ui_day_day.value != 0",
718+
"fraction" : false,
719+
"index" : 46,
720+
"max" : 10,
721+
"min" : 0,
722+
"order" : 146,
723+
"text" : "Day Scale",
724+
"type" : "slider",
725+
"value" : 1
726+
},
727+
"ui_day_orientation" :
728+
{
729+
"condition" : "ui_day_day.value != 0",
730+
"index" : 45,
731+
"options" :
732+
[
733+
{
734+
"label" : "Horizontal",
735+
"value" : "0"
736+
},
737+
{
738+
"label" : "Vertical",
739+
"value" : "1"
740+
}
741+
],
742+
"order" : 145,
743+
"text" : "Day Orientation",
744+
"type" : "combo",
745+
"value" : "0"
746+
},
747+
"ui_date_date" :
748+
{
749+
"index" : 50,
750+
"options" :
751+
[
752+
{
753+
"label" : "None",
754+
"value" : "0"
755+
},
756+
{
757+
"label" : "YYYY/MM/DD",
758+
"value" : "1"
759+
},
760+
{
761+
"label" : "YYYY/DD/MM",
762+
"value" : "1"
763+
},
764+
{
765+
"label" : "YY/DD/MM",
766+
"value" : "1"
767+
},
768+
{
769+
"label" : "YY/MM/DD",
770+
"value" : "1"
771+
},
772+
{
773+
"label" : "MM/DD",
774+
"value" : "2"
775+
},
776+
{
777+
"label" : "DD/MM",
778+
"value" : "2"
779+
}
780+
],
781+
"order" : 150,
782+
"text" : "Date",
783+
"type" : "combo",
784+
"value" : "0"
785+
},
786+
"ui_date_delimiter" :
787+
{
788+
"index" : 52,
789+
"condition" : "ui_date_orientation.value == 0",
790+
"options" :
791+
[
792+
{
793+
"label" : "None",
794+
"value" : "0"
795+
},
796+
{
797+
"label" : "Space",
798+
"value" : "1"
799+
},
800+
{
801+
"label" : "-",
802+
"value" : "2"
803+
},
804+
{
805+
"label" : "/",
806+
"value" : "3"
807+
}
808+
],
809+
"order" : 152,
810+
"text" : "Date Delimiter",
811+
"type" : "combo",
812+
"value" : "0"
813+
},
814+
"ui_date_positionx" :
815+
{
816+
"condition" : "ui_date_date.value != 0",
817+
"fraction" : false,
818+
"index" : 54,
819+
"max" : 100,
820+
"min" : -100,
821+
"order" : 154,
822+
"text" : "Date Position X",
823+
"type" : "slider",
824+
"value" : 0
825+
},
826+
"ui_date_positiony" :
827+
{
828+
"condition" : "ui_date_date.value != 0",
829+
"fraction" : false,
830+
"index" : 55,
831+
"max" : 100,
832+
"min" : -100,
833+
"order" : 155,
834+
"text" : "Date Position Y",
835+
"type" : "slider",
836+
"value" : 0
837+
},
838+
"ui_date_scale" :
839+
{
840+
"condition" : "ui_date_date.value != 0",
841+
"fraction" : false,
842+
"index" : 53,
843+
"max" : 10,
844+
"min" : 0,
845+
"order" : 153,
846+
"text" : "Date Scale",
847+
"type" : "slider",
848+
"value" : 1
849+
},
850+
"ui_date_orientation" :
851+
{
852+
"condition" : "ui_date_date.value != 0",
853+
"index" : 51,
854+
"options" :
855+
[
856+
{
857+
"label" : "Horizontal",
858+
"value" : "0"
859+
},
860+
{
861+
"label" : "Vertical",
862+
"value" : "1"
863+
}
864+
],
865+
"order" : 151,
866+
"text" : "Date Orientation",
867+
"type" : "combo",
868+
"value" : "0"
641869
}
642870
},
643871
"supportsaudioprocessing" : true

0 commit comments

Comments
 (0)