From 147692d72214fd292aa4d353cf031dea29f4b85f Mon Sep 17 00:00:00 2001 From: Vassyli Date: Fri, 29 Jan 2021 19:31:49 +0100 Subject: [PATCH] Removes the ability of attachments to add actions. This should be done by modules via scene templates instead. --- src/AttachmentInterface.php | 5 ----- src/Game.php | 5 ----- tests/Models/SceneAttachmentTest.php | 2 -- 3 files changed, 12 deletions(-) diff --git a/src/AttachmentInterface.php b/src/AttachmentInterface.php index 7af4fbb..246970f 100644 --- a/src/AttachmentInterface.php +++ b/src/AttachmentInterface.php @@ -21,9 +21,4 @@ interface AttachmentInterface * @return array */ public function getData(): array; - - /** - * @return Action[] - */ - public function getActions(): array; } \ No newline at end of file diff --git a/src/Game.php b/src/Game.php index 5ab276a..6987870 100644 --- a/src/Game.php +++ b/src/Game.php @@ -353,11 +353,6 @@ class Game $attachment = new ($sceneAttachment->getClass())($this, $scene); $viewpoint->addAttachment($attachment); - // Add attachment actions to the hidden group. - foreach ($attachment->getActions() as $action) { - $actionGroups[ActionGroup::HiddenGroup]->addAction($action); - } - $this->getLogger()->debug("Adding attachment {$attachment}"); } diff --git a/tests/Models/SceneAttachmentTest.php b/tests/Models/SceneAttachmentTest.php index b842800..f9c98f7 100644 --- a/tests/Models/SceneAttachmentTest.php +++ b/tests/Models/SceneAttachmentTest.php @@ -184,7 +184,5 @@ class SceneAttachmentTest extends CoreModelTestCase $this->assertCount(1, $newViewpoint->getAttachments()); $this->assertSame(TestAttachmentWithActions::$attachmentId, $newViewpoint->getAttachments()[0]->getId()); - $this->assertCount(1, $newViewpoint->getActionGroups()[1]->getActions()); - $this->assertSame(TestAttachmentWithActions::$actionId, $newViewpoint->getActionGroups()[1]->getActions()[0]->getId()); } }