Skip to content

Commit 52b41af

Browse files
authored
Merge pull request #340 from scratchcpp/fix_set_rotation_style_block
Fix #338: Fix set rotation style block
2 parents 13d6cd6 + 3a01fd9 commit 52b41af

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/blocks/motionblocks.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ void MotionBlocks::registerBlocks(IEngine *engine)
5959

6060
// Fields
6161
engine->addField(this, "STYLE", STYLE);
62+
63+
// Field values
64+
engine->addFieldValue(this, "left-right", LeftRight);
65+
engine->addFieldValue(this, "don't rotate", DoNotRotate);
66+
engine->addFieldValue(this, "all around", AllAround);
6267
}
6368

6469
void MotionBlocks::compileMoveSteps(Compiler *compiler)

src/blocks/motionblocks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class MotionBlocks : public IBlockSection
4040
enum FieldValues
4141
{
4242
LeftRight,
43-
AllAround,
44-
DoNotRotate
43+
DoNotRotate,
44+
AllAround
4545
};
4646

4747
std::string name() const override;

test/blocks/motion_blocks_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ TEST_F(MotionBlocksTest, RegisterBlocks)
140140
// Fields
141141
EXPECT_CALL(m_engineMock, addField(m_section.get(), "STYLE", MotionBlocks::STYLE));
142142

143+
// Field values
144+
EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "left-right", MotionBlocks::LeftRight));
145+
EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "don't rotate", MotionBlocks::DoNotRotate));
146+
EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "all around", MotionBlocks::AllAround));
147+
143148
m_section->registerBlocks(&m_engineMock);
144149
}
145150

0 commit comments

Comments
 (0)