Skip to content

Commit 83d96fc

Browse files
committed
Fix dropdown menus in looks blocks
1 parent 834a1dd commit 83d96fc

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
@@ -340,8 +340,7 @@ void LooksBlocks::compileSwitchCostumeTo(Compiler *compiler)
340340

341341
Input *input = compiler->input(COSTUME);
342342

343-
if (input->type() != Input::Type::ObscuredShadow) {
344-
assert(input->pointsToDropdownMenu());
343+
if (input->pointsToDropdownMenu()) {
345344
std::string value = input->selectedMenuItem();
346345
int index = target->findCostume(value);
347346

@@ -385,8 +384,7 @@ void LooksBlocks::compileSwitchBackdropTo(Compiler *compiler)
385384

386385
Input *input = compiler->input(BACKDROP);
387386

388-
if (input->type() != Input::Type::ObscuredShadow) {
389-
assert(input->pointsToDropdownMenu());
387+
if (input->pointsToDropdownMenu()) {
390388
std::string value = input->selectedMenuItem();
391389
int index = stage->findCostume(value);
392390

@@ -427,8 +425,7 @@ void LooksBlocks::compileSwitchBackdropToAndWait(Compiler *compiler)
427425

428426
Input *input = compiler->input(BACKDROP);
429427

430-
if (input->type() != Input::Type::ObscuredShadow) {
431-
assert(input->pointsToDropdownMenu());
428+
if (input->pointsToDropdownMenu()) {
432429
std::string value = input->selectedMenuItem();
433430
int index = stage->findCostume(value);
434431

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)