Skip to content

Commit 4ae471c

Browse files
committed
Fix dropdown menus in motion blocks
1 parent 83d96fc commit 4ae471c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/blocks/motionblocks.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ void MotionBlocks::compilePointTowards(Compiler *compiler)
107107
{
108108
Input *input = compiler->input(TOWARDS);
109109

110-
if (input->type() != Input::Type::ObscuredShadow) {
111-
assert(input->pointsToDropdownMenu());
110+
if (input->pointsToDropdownMenu()) {
112111
std::string value = input->selectedMenuItem();
113112

114113
if (value == "_mouse_")
@@ -137,8 +136,7 @@ void MotionBlocks::compileGoTo(Compiler *compiler)
137136
{
138137
Input *input = compiler->input(TO);
139138

140-
if (input->type() != Input::Type::ObscuredShadow) {
141-
assert(input->pointsToDropdownMenu());
139+
if (input->pointsToDropdownMenu()) {
142140
std::string value = input->selectedMenuItem();
143141

144142
if (value == "_mouse_")
@@ -171,8 +169,7 @@ void MotionBlocks::compileGlideTo(Compiler *compiler)
171169

172170
Input *input = compiler->input(TO);
173171

174-
if (input->type() != Input::Type::ObscuredShadow) {
175-
assert(input->pointsToDropdownMenu());
172+
if (input->pointsToDropdownMenu()) {
176173
std::string value = input->selectedMenuItem();
177174

178175
if (value == "_mouse_")

test/blocks/motion_blocks_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class MotionBlocksTest : public testing::Test
7474
else {
7575
auto input = addNullInput(block, name, id);
7676
auto menu = createMotionBlock(block->id() + "_menu", block->opcode() + "_menu");
77+
menu->setShadow(true);
7778
input->setValueBlock(menu);
7879
addDropdownField(menu, name, static_cast<MotionBlocks::Fields>(-1), selectedValue, static_cast<MotionBlocks::FieldValues>(-1));
7980
}

0 commit comments

Comments
 (0)