Skip to content

Commit 65704ad

Browse files
committed
Fix dropdown menus in looks blocks
1 parent 9afa021 commit 65704ad

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/blocks/looksblocks.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ void LooksBlocks::compileSwitchCostumeTo(Compiler *compiler)
349349

350350
Input *input = compiler->input(COSTUME);
351351

352-
if (input->type() != Input::Type::ObscuredShadow) {
353-
assert(input->pointsToDropdownMenu());
352+
if (input->pointsToDropdownMenu()) {
354353
std::string value = input->selectedMenuItem();
355354
int index = target->findCostume(value);
356355

@@ -394,8 +393,7 @@ void LooksBlocks::compileSwitchBackdropTo(Compiler *compiler)
394393

395394
Input *input = compiler->input(BACKDROP);
396395

397-
if (input->type() != Input::Type::ObscuredShadow) {
398-
assert(input->pointsToDropdownMenu());
396+
if (input->pointsToDropdownMenu()) {
399397
std::string value = input->selectedMenuItem();
400398
int index = stage->findCostume(value);
401399

@@ -436,8 +434,7 @@ void LooksBlocks::compileSwitchBackdropToAndWait(Compiler *compiler)
436434

437435
Input *input = compiler->input(BACKDROP);
438436

439-
if (input->type() != Input::Type::ObscuredShadow) {
440-
assert(input->pointsToDropdownMenu());
437+
if (input->pointsToDropdownMenu()) {
441438
std::string value = input->selectedMenuItem();
442439
int index = stage->findCostume(value);
443440

test/blocks/looks_blocks_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class LooksBlocksTest : public testing::Test
7575
else {
7676
auto input = addNullInput(block, name, id);
7777
auto menu = createLooksBlock(block->id() + "_menu", block->opcode() + "_menu");
78+
menu->setShadow(true);
7879
input->setValueBlock(menu);
7980
addDropdownField(menu, name, static_cast<LooksBlocks::Fields>(-1), selectedValue, static_cast<LooksBlocks::FieldValues>(-1));
8081
}

0 commit comments

Comments
 (0)