Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
74890bd2
Commit
74890bd2
authored
7 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Add block chunking
parent
c99d9fef
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/make-toolbox-xml.js
+45
-3
45 additions, 3 deletions
src/lib/make-toolbox-xml.js
with
45 additions
and
3 deletions
src/lib/make-toolbox-xml.js
+
45
−
3
View file @
74890bd2
const
separator
=
'
<sep gap="45"/>
'
;
const
categorySeparator
=
'
<sep gap="36"/>
'
;
const
blockSeparator
=
'
<sep gap="36"/>
'
;
// At default scale, about 28px
const
motion
=
`
<category name="Motion" colour="#4C97FF" secondaryColour="#3373CC">
...
...
@@ -23,6 +25,7 @@ const motion = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="motion_pointindirection">
<value name="DIRECTION">
<shadow type="math_angle">
...
...
@@ -36,6 +39,7 @@ const motion = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="motion_gotoxy">
<value name="X">
<shadow id="movex" type="math_number">
...
...
@@ -82,6 +86,7 @@ const motion = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="motion_changexby">
<value name="DX">
<shadow type="math_number">
...
...
@@ -110,11 +115,15 @@ const motion = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="motion_ifonedgebounce"/>
${
blockSeparator
}
<block type="motion_setrotationstyle"/>
${
blockSeparator
}
<block id="xposition" type="motion_xposition"/>
<block id="yposition" type="motion_yposition"/>
<block id="direction" type="motion_direction"/>
${
categorySeparator
}
</category>
`
;
...
...
@@ -158,8 +167,10 @@ const looks = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="looks_show"/>
<block type="looks_hide"/>
${
blockSeparator
}
<block type="looks_switchcostumeto">
<value name="COSTUME">
<shadow type="looks_costume"/>
...
...
@@ -177,6 +188,7 @@ const looks = `
<shadow type="looks_backdrops"/>
</value>
</block>
${
blockSeparator
}
<block type="looks_changeeffectby">
<value name="CHANGE">
<shadow type="math_number">
...
...
@@ -192,6 +204,7 @@ const looks = `
</value>
</block>
<block type="looks_cleargraphiceffects"/>
${
blockSeparator
}
<block type="looks_changesizeby">
<value name="CHANGE">
<shadow type="math_number">
...
...
@@ -206,6 +219,7 @@ const looks = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="looks_gotofront"/>
<block type="looks_gobacklayers">
<value name="NUM">
...
...
@@ -214,10 +228,12 @@ const looks = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block id="costumeorder" type="looks_costumeorder"/>
<block id="backdroporder" type="looks_backdroporder"/>
<block id="backdropname" type="looks_backdropname"/>
<block id="size" type="looks_size"/>
${
categorySeparator
}
</category>
`
;
...
...
@@ -234,6 +250,7 @@ const sound = `
</value>
</block>
<block type="sound_stopallsounds"/>
${
blockSeparator
}
<block type="sound_playdrumforbeats">
<value name="DRUM">
<shadow type="sound_drums_menu"/>
...
...
@@ -251,6 +268,7 @@ const sound = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="sound_playnoteforbeats">
<value name="NOTE">
<shadow type="math_number">
...
...
@@ -268,6 +286,7 @@ const sound = `
<shadow type="sound_instruments_menu"/>
</value>
</block>
${
blockSeparator
}
<block type="sound_changeeffectby">
<value name="VALUE">
<shadow type="math_number">
...
...
@@ -283,6 +302,7 @@ const sound = `
</value>
</block>
<block type="sound_cleareffects"/>
${
blockSeparator
}
<block type="sound_changevolumeby">
<value name="VOLUME">
<shadow type="math_number">
...
...
@@ -298,6 +318,7 @@ const sound = `
</value>
</block>
<block id="volume" type="sound_volume"/>
${
blockSeparator
}
<block type="sound_changetempoby">
<value name="TEMPO">
<shadow type="math_number">
...
...
@@ -313,6 +334,7 @@ const sound = `
</value>
</block>
<block id="tempo" type="sound_tempo"/>
${
categorySeparator
}
</category>
`
;
...
...
@@ -324,6 +346,7 @@ const events = `
<block type="event_whenthisspriteclicked"/>
<block type="event_whenbackdropswitchesto">
</block>
${
blockSeparator
}
<block type="event_whengreaterthan">
<value name="VALUE">
<shadow type="math_number">
...
...
@@ -331,6 +354,7 @@ const events = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="event_whenbroadcastreceived">
</block>
<block type="event_broadcast">
...
...
@@ -343,6 +367,7 @@ const events = `
<shadow type="event_broadcast_menu"/>
</value>
</block>
${
categorySeparator
}
</category>
`
;
...
...
@@ -355,6 +380,7 @@ const control = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="control_repeat">
<value name="TIMES">
<shadow type="math_whole_number">
...
...
@@ -363,11 +389,14 @@ const control = `
</value>
</block>
<block type="control_forever"/>
${
blockSeparator
}
<block type="control_if"/>
<block type="control_if_else"/>
<block type="control_wait_until"/>
<block type="control_repeat_until"/>
${
blockSeparator
}
<block type="control_stop"/>
${
blockSeparator
}
<block type="control_start_as_clone"/>
<block type="control_create_clone_of">
<value name="CLONE_OPTION">
...
...
@@ -375,6 +404,7 @@ const control = `
</value>
</block>
<block type="control_delete_this_clone"/>
${
categorySeparator
}
</category>
`
;
...
...
@@ -403,6 +433,7 @@ const sensing = `
<shadow type="sensing_distancetomenu"/>
</value>
</block>
${
blockSeparator
}
<block type="sensing_keypressed">
<value name="KEY_OPTION">
<shadow type="sensing_keyoptions"/>
...
...
@@ -411,9 +442,12 @@ const sensing = `
<block type="sensing_mousedown"/>
<block type="sensing_mousex"/>
<block type="sensing_mousey"/>
${
blockSeparator
}
<block id="loudness" type="sensing_loudness"/>
${
blockSeparator
}
<block id="timer" type="sensing_timer"/>
<block type="sensing_resettimer"/>
${
blockSeparator
}
<block id="of" type="sensing_of">
<value name="PROPERTY">
<shadow type="sensing_of_property_menu"/>
...
...
@@ -422,12 +456,14 @@ const sensing = `
<shadow type="sensing_of_object_menu"/>
</value>
</block>
${
blockSeparator
}
<block id="current" type="sensing_current">
<value name="CURRENTMENU">
<shadow type="sensing_currentmenu"/>
</value>
</block>
<block type="sensing_dayssince2000"/>
${
categorySeparator
}
</category>
`
;
...
...
@@ -481,6 +517,7 @@ const operators = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="operator_random">
<value name="FROM">
<shadow type="math_number">
...
...
@@ -493,6 +530,7 @@ const operators = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="operator_lt">
<value name="OPERAND1">
<shadow type="text">
...
...
@@ -529,9 +567,11 @@ const operators = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="operator_and"/>
<block type="operator_or"/>
<block type="operator_not"/>
${
blockSeparator
}
<block type="operator_join">
<value name="STRING1">
<shadow type="text">
...
...
@@ -563,6 +603,7 @@ const operators = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="operator_mod">
<value name="NUM1">
<shadow type="math_number">
...
...
@@ -582,6 +623,7 @@ const operators = `
</shadow>
</value>
</block>
${
blockSeparator
}
<block type="operator_mathop">
<value name="NUM">
<shadow type="math_number">
...
...
@@ -589,6 +631,7 @@ const operators = `
</shadow>
</value>
</block>
${
categorySeparator
}
</category>
`
;
...
...
@@ -605,7 +648,7 @@ const xmlClose = '</xml>';
* @returns {string} - a ScratchBlocks-style XML document for the contents of the toolbox.
*/
const
makeToolboxXML
=
function
(
categoriesXML
)
{
const
gap
=
[
s
eparator
];
const
gap
=
[
categoryS
eparator
];
const
everything
=
[
xmlOpen
,
...
...
@@ -624,7 +667,6 @@ const makeToolboxXML = function (categoriesXML) {
}
everything
.
push
(
xmlClose
);
return
everything
.
join
(
'
\n
'
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment