Skip to content

Commit 08ad80b

Browse files
committed
Merge branch 'master' of https://github.com/Commanderk3/musicblocks into midi
2 parents 83733c7 + f0d652a commit 08ad80b

File tree

1 file changed

+164
-127
lines changed

1 file changed

+164
-127
lines changed

js/turtledefs.js

Lines changed: 164 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
RHYTHMPALETTEICON, RUNBUTTON, SAVEBUTTON, SCROLLUNLOCKBUTTON,
2121
SHORTCUTSBUTTON, SLOWBUTTON, SMALLERBUTTON, STATSBUTTON,
2222
STEPBUTTON, STOPTURTLEBUTTON, WRAPTURTLEBUTTON, _THIS_IS_TURTLE_BLOCKS_,
23-
_THIS_IS_MUSIC_BLOCKS_, MOUSEPALETTEICON, FULLSCREENBUTTON, RECORDBUTTON
23+
_THIS_IS_MUSIC_BLOCKS_, MOUSEPALETTEICON, FULLSCREENBUTTON, RECORDBUTTON,
24+
PLUGINSBUTTON, OPENMERGEBUTTON, PITCHPREVIEWBUTTON, JAVASCRIPTBUTTON,
25+
RECORDHELPBUTTON, DARKMODEBUTTON, SELECTHELPBUTTON, BLOCKMENUBUTTON,
26+
CANVASMENUBUTTON, RHYTHMPALETTEHELPICON, PITCHPREVIEWHELPBUTTON
2427
*/
2528

2629
/* exported
@@ -501,12 +504,14 @@ const createHelpContent = (activity) => {
501504
]
502505
];
503506
}
504-
HELPCONTENT.push([
505-
_("Record"),
506-
_("Record your project as video."),
507-
"data:image/svg+xml;base64," +
508-
window.btoa(base64Encode(RECORDBUTTON))
509-
]);
507+
if (!activity.beginnerMode) {
508+
HELPCONTENT.push([
509+
_("Record"),
510+
_("Record your project as video."),
511+
"data:image/svg+xml;base64," +
512+
window.btoa(base64Encode(RECORDHELPBUTTON))
513+
]);
514+
}
510515
HELPCONTENT.push([
511516
_("Toggle Fullscreen"),
512517
_("Toggle Fullscreen mode."),
@@ -525,28 +530,12 @@ const createHelpContent = (activity) => {
525530
"data:image/svg+xml;base64," +
526531
window.btoa(base64Encode(LOADBUTTON))
527532
]);
528-
HELPCONTENT.push([
529-
_("Delete"),
530-
_("To delete a block, just right-click on it, then you will be able to see the delete option"),
531-
"data:image/svg+xml;base64," +
532-
window.btoa(base64Encode(EMPTYTRASHCONFIRMBUTTON))
533-
]);
534-
HELPCONTENT.push([
535-
_("Copy"),
536-
_("To copy a block, just right-click on it, then you will be able to see the copy option"),
537-
"data:image/svg+xml;base64," +
538-
window.btoa(base64Encode(COPYBUTTON))
539-
]);
540-
HELPCONTENT.push([
541-
_("Extract"),
542-
_("To extract a block, just right-click on it, then you will be able to see the extract option"),
543-
"data:image/svg+xml;base64," +
544-
window.btoa(base64Encode(EXTRACTBUTTON))
545-
]);
546533
if (activity.beginnerMode) {
547534
HELPCONTENT.push([
548535
_("Save project"),
549-
_("Save your project to a file."),
536+
_("Save project as HTML") +
537+
"<br/>" +
538+
_("Save mouse artwork as PNG"),
550539
"data:image/svg+xml;base64," +
551540
window.btoa(base64Encode(SAVEBUTTON))
552541
]);
@@ -574,38 +563,14 @@ const createHelpContent = (activity) => {
574563
]);
575564
} else {
576565
HELPCONTENT.push([
577-
_("Save"),
578-
_("Save project") +
579-
": " +
580-
_("Save your project to a file.") +
581-
"<br/><br/>" +
582-
_("Save mouse artwork as SVG") +
583-
": " +
584-
_("Save graphics from your project to as SVG.") +
585-
"<br/><br/>" +
586-
_("Save mouse artwork as PNG") +
587-
": " +
588-
_("Save graphics from your project as PNG.") +
589-
"<br/><br/>" +
590-
_("Save music as WAV") +
591-
": " +
592-
_("Save audio from your project as WAV.") +
593-
"<br/><br/>" +
594-
_("Save music as MIDI") +
595-
": " +
596-
_("Save your project in MIDI format.") +
597-
"<br/><br/>" +
598-
_("Save sheet music as ABC") +
599-
": " +
600-
_("Save your project to as an ABC file.") +
601-
"<br/><br/>" +
602-
_("Save sheet music as Lilypond") +
603-
": " +
604-
_("Save your project to as a Lilypond file.") +
605-
"<br/><br/>" +
606-
_("Save block artwork as SVG") +
607-
": " +
608-
_("Save block artwork as an SVG file."),
566+
_("Save project"),
567+
_("Save project as HTML") +
568+
"<br/>" +
569+
_("Save music as WAV") +
570+
"<br/>" +
571+
_("Save sheet music as ABC, Lilypond or MusicXML") +
572+
"<br/>" +
573+
_("Save block artwork as SVG or PNG"),
609574
"data:image/svg+xml;base64," +
610575
window.btoa(base64Encode(SAVEBUTTON))
611576
]);
@@ -616,72 +581,18 @@ const createHelpContent = (activity) => {
616581
_("This button opens a viewer for loading example projects."),
617582
"data:image/svg+xml;base64," +
618583
window.btoa(base64Encode(PLANETBUTTON))
619-
]);
620-
if (_THIS_IS_MUSIC_BLOCKS_) {
621-
HELPCONTENT.push([
622-
_("Palette buttons"),
623-
_("This toolbar contains the palette buttons including Rhythm Pitch Tone Action and more.") +
624-
" " +
625-
_("Click to show the palettes of blocks and drag blocks from the palettes onto the canvas to use them."),
626-
"data:image/svg+xml;base64," +
627-
window.btoa(base64Encode(RHYTHMPALETTEICON))
628-
]);
629-
}
630-
HELPCONTENT.push([
631-
_("Cartesian/Polar"),
632-
_("Show or hide a coordinate grid."),
633-
"data:image/svg+xml;base64," +
634-
window.btoa(base64Encode(CARTESIANBUTTON))
635-
]);
636-
HELPCONTENT.push([
637-
_("Clear"),
638-
_("Clear the screen and return the mice to their initial positions."),
639-
"data:image/svg+xml;base64," +
640-
window.btoa(base64Encode(CLEARBUTTON))
641-
]);
642-
HELPCONTENT.push([
643-
_("Collapse"),
644-
_("Collapse the graphics window."),
645-
"data:image/svg+xml;base64," +
646-
window.btoa(base64Encode(COLLAPSEBUTTON))
647-
]);
648-
HELPCONTENT.push([
649-
_("Home"),
650-
_("Return all blocks to the center of the screen."),
651-
"data:image/svg+xml;base64," +
652-
window.btoa(base64Encode(GOHOMEBUTTON))
653-
]);
654-
HELPCONTENT.push([
655-
_("Show/hide blocks"),
656-
_("Hide or show the blocks and the palettes."),
657-
"data:image/svg+xml;base64," +
658-
window.btoa(base64Encode(HIDEBLOCKSBUTTON))
659-
]);
660-
HELPCONTENT.push([
661-
_("Expand/collapse collapsable blocks"),
662-
_("Expand or collapse start and action stacks."),
663-
"data:image/svg+xml;base64," +
664-
window.btoa(
665-
base64Encode(COLLAPSEBLOCKSBUTTON))
666-
667-
]);
668-
HELPCONTENT.push([
669-
_("Decrease block size"),
670-
_("Decrease the size of the blocks."),
671-
"data:image/svg+xml;base64," +
672-
window.btoa(base64Encode(SMALLERBUTTON))
673-
]);
674-
HELPCONTENT.push([
675-
_("Increase block size"),
676-
_("Increase the size of the blocks."),
677-
"data:image/svg+xml;base64," +
678-
window.btoa(base64Encode(BIGGERBUTTON))
679-
]);
584+
]);
680585
HELPCONTENT.push([
681586
_("Expand/collapse option toolbar"),
682587
_("Click this button to expand or collapse the auxillary toolbar."),
683588
"data:image/svg+xml;base64," +
684589
window.btoa(base64Encode(MENUBUTTON))
590+
]);
591+
HELPCONTENT.push([
592+
_("Help"),
593+
_("Displays help messages for the main and auxiliary toolbar, right-click contextual menu for blocks and canvas, and palettes."),
594+
"data:image/svg+xml;base64," +
595+
window.btoa(base64Encode(HELPBUTTON))
685596
]);
686597
HELPCONTENT.push([
687598
_("Run slowly"),
@@ -702,7 +613,14 @@ const createHelpContent = (activity) => {
702613
"data:image/svg+xml;base64," +
703614
window.btoa(base64Encode(STATSBUTTON))
704615
]);
705-
// TODO: add plugin
616+
HELPCONTENT.push([
617+
_("Load plugin"),
618+
_("Load a selected plugin."),
619+
"data:image/svg+xml;base64," +
620+
window.btoa(
621+
base64Encode(PLUGINSBUTTON))
622+
623+
]);
706624
HELPCONTENT.push([
707625
_("Delete plugin"),
708626
_("Delete a selected plugin."),
@@ -720,7 +638,18 @@ const createHelpContent = (activity) => {
720638

721639
]);
722640
}
723-
// TODO: Add merge
641+
HELPCONTENT.push([
642+
_("Change theme"),
643+
_("Switch between dark and light mode."),
644+
"data:image/svg+xml;base64," +
645+
window.btoa(base64Encode(DARKMODEBUTTON))
646+
]);
647+
HELPCONTENT.push([
648+
_("Merge with current project"),
649+
_(" Click to add another project into the current one."),
650+
"data:image/svg+xml;base64," +
651+
window.btoa(base64Encode(OPENMERGEBUTTON))
652+
]);
724653
HELPCONTENT.push([
725654
_("Wrap Turtle"),
726655
_("Turn Turtle wrapping On or Off."),
@@ -729,8 +658,20 @@ const createHelpContent = (activity) => {
729658
base64Encode(WRAPTURTLEBUTTON))
730659

731660
]);
732-
// TODO: Music Blocks: set pitch preview
733-
// TODO: toggle JS editor
661+
HELPCONTENT.push([
662+
_("Set Pitch Preview"),
663+
_("Click to set the current pitch."),
664+
"data:image/svg+xml;base64," +
665+
window.btoa(base64Encode(PITCHPREVIEWHELPBUTTON))
666+
]);
667+
if (!activity.beginnerMode) {
668+
HELPCONTENT.push([
669+
_("JavaScript Editor"),
670+
_("Converts Music Block programs to JavaScript."),
671+
"data:image/svg+xml;base64," +
672+
window.btoa(base64Encode(JAVASCRIPTBUTTON))
673+
]);
674+
}
734675
HELPCONTENT.push([
735676
_("Restore"),
736677
_("Restore blocks from the trash."),
@@ -750,6 +691,30 @@ const createHelpContent = (activity) => {
750691
_("Select your language preference."),
751692
"data:image/svg+xml;base64," +
752693
window.btoa(base64Encode(LANGUAGEBUTTON))
694+
]);
695+
HELPCONTENT.push([
696+
_("Contextual Menu for Blocks"),
697+
_("Right-click a block to access common actions and manage blocks in the workspace."),
698+
"data:image/svg+xml;base64," +
699+
window.btoa(base64Encode(BLOCKMENUBUTTON))
700+
]);
701+
HELPCONTENT.push([
702+
_("Delete"),
703+
_("To delete a block, just right-click on it, then you will be able to see the delete option"),
704+
"data:image/svg+xml;base64," +
705+
window.btoa(base64Encode(EMPTYTRASHCONFIRMBUTTON))
706+
]);
707+
HELPCONTENT.push([
708+
_("Copy"),
709+
_("To copy a block, just right-click on it, then you will be able to see the copy option"),
710+
"data:image/svg+xml;base64," +
711+
window.btoa(base64Encode(COPYBUTTON))
712+
]);
713+
HELPCONTENT.push([
714+
_("Extract"),
715+
_("To extract a block, just right-click on it, then you will be able to see the extract option"),
716+
"data:image/svg+xml;base64," +
717+
window.btoa(base64Encode(EXTRACTBUTTON))
753718
]);
754719
if (_THIS_IS_MUSIC_BLOCKS_) {
755720
HELPCONTENT.push([
@@ -759,12 +724,84 @@ const createHelpContent = (activity) => {
759724
window.btoa(base64Encode(SHORTCUTSBUTTON))
760725
]);
761726
}
727+
if (!activity.beginnerMode) {
728+
HELPCONTENT.push([
729+
_("Contextual Menu for Canvas"),
730+
_("Right-click on the canvas to perform additional canvas-related tasks."),
731+
"data:image/svg+xml;base64," +
732+
window.btoa(base64Encode(CANVASMENUBUTTON))
733+
]);
734+
}
762735
HELPCONTENT.push([
763-
_("Help"),
764-
_("Show these messages."),
736+
_("Grid"),
737+
_("Turn on/off lines for cartesian or polar grids.") +
738+
"<br/>" +
739+
_("Turn on/off music staffs."),
765740
"data:image/svg+xml;base64," +
766-
window.btoa(base64Encode(HELPBUTTON))
741+
window.btoa(base64Encode(CARTESIANBUTTON))
742+
]);
743+
HELPCONTENT.push([
744+
_("Clear"),
745+
_("Clear the screen and return the mice to their initial positions."),
746+
"data:image/svg+xml;base64," +
747+
window.btoa(base64Encode(CLEARBUTTON))
748+
]);
749+
HELPCONTENT.push([
750+
_("Collapse"),
751+
_("Collapse the graphics window."),
752+
"data:image/svg+xml;base64," +
753+
window.btoa(base64Encode(COLLAPSEBUTTON))
754+
]);
755+
HELPCONTENT.push([
756+
_("Home"),
757+
_("Return all blocks to the center of the screen."),
758+
"data:image/svg+xml;base64," +
759+
window.btoa(base64Encode(GOHOMEBUTTON))
760+
]);
761+
HELPCONTENT.push([
762+
_("Show/hide blocks"),
763+
_("Hide or show the blocks and the palettes."),
764+
"data:image/svg+xml;base64," +
765+
window.btoa(base64Encode(HIDEBLOCKSBUTTON))
766+
]);
767+
HELPCONTENT.push([
768+
_("Expand/collapse blocks"),
769+
_("Expand or collapse start and action stacks."),
770+
"data:image/svg+xml;base64," +
771+
window.btoa(
772+
base64Encode(COLLAPSEBLOCKSBUTTON))
773+
767774
]);
775+
HELPCONTENT.push([
776+
_("Decrease block size"),
777+
_("Decrease the size of the blocks."),
778+
"data:image/svg+xml;base64," +
779+
window.btoa(base64Encode(SMALLERBUTTON))
780+
]);
781+
HELPCONTENT.push([
782+
_("Increase block size"),
783+
_("Increase the size of the blocks."),
784+
"data:image/svg+xml;base64," +
785+
window.btoa(base64Encode(BIGGERBUTTON))
786+
]);
787+
if (!activity.beginnerMode) {
788+
HELPCONTENT.push([
789+
_("Select"),
790+
_("Left-click and drag on workspace to select multiple blocks."),
791+
"data:image/svg+xml;base64," +
792+
window.btoa(base64Encode(SELECTHELPBUTTON))
793+
]);
794+
}
795+
if (_THIS_IS_MUSIC_BLOCKS_) {
796+
HELPCONTENT.push([
797+
_("Palette buttons"),
798+
_("This toolbar contains the palette buttons including Rhythm Pitch Tone Action and more.") +
799+
" " +
800+
_("Click to show the palettes of blocks and drag blocks from the palettes onto the canvas to use them."),
801+
"data:image/svg+xml;base64," +
802+
window.btoa(base64Encode(RHYTHMPALETTEHELPICON))
803+
]);
804+
}
768805
if (_THIS_IS_TURTLE_BLOCKS_) {
769806
HELPCONTENT.push([
770807
_("Guide"),
@@ -814,7 +851,7 @@ const createHelpContent = (activity) => {
814851
_("Music Blocks GitHub repository")
815852
]);
816853
HELPCONTENT.push([
817-
_("Congratulations."),
854+
_("Congratulations!"),
818855
_("You have finished the tour. Please enjoy Music Blocks!"),
819856
"data:image/svg+xml;base64," +
820857
window.btoa(base64Encode(LOGO))

0 commit comments

Comments
 (0)