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
676b3d84
Commit
676b3d84
authored
8 years ago
by
Ray Schamp
Browse files
Options
Downloads
Patches
Plain Diff
Add sprite selection skeleton component
parent
e43653a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/gui.js
+2
-0
2 additions, 0 deletions
src/components/gui.js
src/components/sprite-selector.js
+42
-0
42 additions, 0 deletions
src/components/sprite-selector.js
with
44 additions
and
0 deletions
src/components/gui.js
+
2
−
0
View file @
676b3d84
...
...
@@ -2,6 +2,7 @@ const React = require('react');
const
Blocks
=
require
(
'
./blocks
'
);
const
Renderer
=
require
(
'
scratch-render
'
);
const
SpriteSelector
=
require
(
'
./sprite-selector
'
);
const
Stage
=
require
(
'
./stage
'
);
const
Toolbox
=
require
(
'
./toolbox
'
);
const
VM
=
require
(
'
scratch-vm
'
);
...
...
@@ -38,6 +39,7 @@ class GUI extends React.Component {
return
(
<
div
className
=
"
scratch-gui
"
>
<
Stage
stageRef
=
{
stage
=>
this
.
stage
=
stage
}
/
>
<
SpriteSelector
vm
=
{
this
.
props
.
vm
}
/
>
<
Toolbox
toolboxRef
=
{
toolbox
=>
this
.
toolbox
=
toolbox
}
/
>
<
Blocks
options
=
{{
...
...
This diff is collapsed.
Click to expand it.
src/components/sprite-selector.js
0 → 100644
+
42
−
0
View file @
676b3d84
const
React
=
require
(
'
react
'
);
class
SpriteSelector
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
targets
:
{
targetList
:
[]
}
};
this
.
targetsUpdate
=
this
.
targetsUpdate
.
bind
(
this
);
this
.
onChange
=
this
.
onChange
.
bind
(
this
);
}
componentDidMount
()
{
this
.
props
.
vm
.
on
(
'
targetsUpdate
'
,
this
.
targetsUpdate
);
}
onChange
(
event
)
{
this
.
props
.
vm
.
setEditingTarget
(
event
.
target
.
value
);
}
targetsUpdate
(
data
)
{
this
.
setState
({
targets
:
data
});
}
render
()
{
return
(
<
select
multiple
value
=
{[
this
.
state
.
targets
.
editingTarget
]}
onChange
=
{
this
.
onChange
}
>
{
this
.
state
.
targets
.
targetList
.
map
(
target
=>
<
option
value
=
{
target
[
0
]}
key
=
{
target
[
0
]}
>
{
target
[
1
]}
<
/option
>
)}
<
/select
>
);
}
}
SpriteSelector
.
propTypes
=
{
vm
:
React
.
PropTypes
.
object
.
isRequired
};
module
.
exports
=
SpriteSelector
;
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