Skip to content

Commit

Permalink
change_to_next_shape 유지 하도록 블록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorkim committed Feb 3, 2016
1 parent cb5fb74 commit 8e9af33
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 42 deletions.
16 changes: 2 additions & 14 deletions dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3041,27 +3041,15 @@ Entry.block.change_to_nth_shape = function(a, b) {
return b.callReturn();
};
Blockly.Blocks.change_to_next_shape = {init:function() {
this.setColour("#EC4466");
this.appendDummyInput().appendField(Lang.Blocks.LOOKS_change_to_next_shape).appendField(new Blockly.FieldIcon(Entry.mediaFilePath + "block_icon/looks_03.png", "*"));
this.setInputsInline(!0);
this.setPreviousStatement(!0);
this.setNextStatement(!0);
}};
Entry.block.change_to_next_shape = function(a, b) {
var c = a.parent.getNextPicture(a.picture.id);
a.setImage(c);
return b.callReturn();
};
Blockly.Blocks.change_to_near_shape = {init:function() {
this.setColour("#EC4466");
this.appendDummyInput().appendField(Lang.Blocks.LOOKS_change_to_near_shape_1).appendField(new Blockly.FieldDropdown([[Lang.Blocks.LOOKS_change_shape_next, "next"], [Lang.Blocks.LOOKS_change_shape_prev, "prev"]]), "DRIECTION").appendField(Lang.Blocks.LOOKS_change_to_near_shape_2).appendField(new Blockly.FieldIcon(Entry.mediaFilePath + "block_icon/looks_03.png", "*"));
this.setInputsInline(!0);
this.setPreviousStatement(!0);
this.setNextStatement(!0);
}};
Entry.block.change_to_near_shape = function(a, b) {
Entry.block.change_to_next_shape = function(a, b) {
var c;
c = "next" === b.getStringField("DRIECTION") ? a.parent.getNextPicture(a.picture.id) : a.parent.getPrevPicture(a.picture.id);
c = "prev" !== b.getStringField("DRIECTION") ? a.parent.getNextPicture(a.picture.id) : a.parent.getPrevPicture(a.picture.id);
a.setImage(c);
return b.callReturn();
};
Expand Down
7 changes: 3 additions & 4 deletions dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions extern/util/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ EntryStatic.getAllBlocks = function() {
"dialog",
"remove_dialog",
"change_to_some_shape",
"change_to_near_shape",
"change_to_next_shape",
"add_effect_amount",
"change_effect_amount",
"erase_all_effects",
Expand Down Expand Up @@ -625,8 +625,8 @@ EntryStatic.blockInfo = {
"isNotFor": ["textBox"],
"usage": ["shape"]
},
"change_to_near_shape": {
"xml": "<block type='change_to_near_shape'></block>",
"change_to_next_shape": {
"xml": "<block type='change_to_next_shape'></block>",
"class": "shape",
"isNotFor": ["textBox"],
"usage": ["shape"]
Expand Down
23 changes: 2 additions & 21 deletions src/blocks/block_looks.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,6 @@ Entry.block.change_to_nth_shape = function (sprite, script) {

// 다음 모양으로 바꾸기
Blockly.Blocks.change_to_next_shape = {
init: function() {
this.setColour("#EC4466");
this.appendDummyInput()
.appendField(Lang.Blocks.LOOKS_change_to_next_shape)
.appendField(new Blockly.FieldIcon(Entry.mediaFilePath + 'block_icon/looks_03.png', '*'));
this.setInputsInline(true);
this.setPreviousStatement(true);
this.setNextStatement(true);
}
};

Entry.block.change_to_next_shape = function (sprite, script) {
var picture = sprite.parent.getNextPicture(sprite.picture.id);
sprite.setImage(picture);
return script.callReturn();
};

// 이전/다음 모양으로 바꾸기
Blockly.Blocks.change_to_near_shape = {
init: function() {
this.setColour("#EC4466");
this.appendDummyInput()
Expand All @@ -200,9 +181,9 @@ Blockly.Blocks.change_to_near_shape = {
}
};

Entry.block.change_to_near_shape = function (sprite, script) {
Entry.block.change_to_next_shape = function (sprite, script) {
var picture;
if(script.getStringField("DRIECTION") === 'next') {
if(script.getStringField("DRIECTION") !== 'prev') {
picture = sprite.parent.getNextPicture(sprite.picture.id);
} else {
picture = sprite.parent.getPrevPicture(sprite.picture.id);
Expand Down

0 comments on commit 8e9af33

Please sign in to comment.