From 45bcab02fb4b7da2ad403c148dfb74e73fca9770 Mon Sep 17 00:00:00 2001 From: DD Date: Wed, 21 Feb 2018 19:54:51 -0500 Subject: [PATCH] Update gui to use getter for target costumes --- src/containers/costume-tab.jsx | 2 +- src/lib/blocks.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index be4c554fe..bb48f1b5d 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -77,7 +77,7 @@ class CostumeTab extends React.Component { } handleNewCostume () { if (!this.props.vm.editingTarget) return; - const costumes = this.props.vm.editingTarget.sprite.costumes || []; + const costumes = this.props.vm.editingTarget.getCostumes() || []; this.setState({selectedCostumeIndex: Math.max(costumes.length - 1, 0)}); } handleNewBlankCostume () { diff --git a/src/lib/blocks.js b/src/lib/blocks.js index af15abc87..06c9a459c 100644 --- a/src/lib/blocks.js +++ b/src/lib/blocks.js @@ -36,15 +36,15 @@ export default function (vm) { }; const costumesMenu = function () { - if (vm.editingTarget && vm.editingTarget.sprite.costumes.length > 0) { - return vm.editingTarget.sprite.costumes.map(costume => [costume.name, costume.name]); + if (vm.editingTarget && vm.editingTarget.getCostumes().length > 0) { + return vm.editingTarget.getCostumes().map(costume => [costume.name, costume.name]); } return [['', '']]; }; const backdropsMenu = function () { - if (vm.runtime.targets[0] && vm.runtime.targets[0].sprite.costumes.length > 0) { - return vm.runtime.targets[0].sprite.costumes.map(costume => [costume.name, costume.name]) + if (vm.runtime.targets[0] && vm.runtime.targets[0].getCostumes().length > 0) { + return vm.runtime.targets[0].getCostumes().map(costume => [costume.name, costume.name]) .concat([['next backdrop', 'next backdrop'], ['previous backdrop', 'previous backdrop']]); } return [['', '']];