From 7089153d9925c772a85badd7656ce1400a3b29f3 Mon Sep 17 00:00:00 2001 From: MattFalahe <47831385+MattFalahe@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:48:31 +0100 Subject: [PATCH 1/5] Update StructureFuelAlert.php Added information name of the structure that is running low on fuel. --- .../Structures/Discord/StructureFuelAlert.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Notifications/Structures/Discord/StructureFuelAlert.php b/src/Notifications/Structures/Discord/StructureFuelAlert.php index cfdf2d6..cb4e4fe 100644 --- a/src/Notifications/Structures/Discord/StructureFuelAlert.php +++ b/src/Notifications/Structures/Discord/StructureFuelAlert.php @@ -71,8 +71,14 @@ public function populateMessage(DiscordMessage $message, $notifiable): void $embed->field(function (DiscordEmbedField $field) { $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; - $field->name('Structure') + if (! is_null($structure)) { + $title = $structure->name; + } + + $field->name($title) ->value($type->typeName); }); }) From 192be95f035f776ed867528f35ea26b5d006304e Mon Sep 17 00:00:00 2001 From: MattFalahe <47831385+MattFalahe@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:12:58 +0100 Subject: [PATCH 2/5] StructureLostShields.php Added message with structure name --- .../Structures/Discord/StructureLostShields.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Notifications/Structures/Discord/StructureLostShields.php b/src/Notifications/Structures/Discord/StructureLostShields.php index 87bd072..f0a3f7b 100644 --- a/src/Notifications/Structures/Discord/StructureLostShields.php +++ b/src/Notifications/Structures/Discord/StructureLostShields.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }) ->warning(); From b2e4da46cfafe585466825974c88b3e0445439d4 Mon Sep 17 00:00:00 2001 From: MattFalahe <47831385+MattFalahe@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:14:01 +0100 Subject: [PATCH 3/5] StructureLostArmor.php Added information with structure name --- .../Structures/Discord/StructureLostArmor.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Notifications/Structures/Discord/StructureLostArmor.php b/src/Notifications/Structures/Discord/StructureLostArmor.php index 2a5ab4d..bae9d11 100644 --- a/src/Notifications/Structures/Discord/StructureLostArmor.php +++ b/src/Notifications/Structures/Discord/StructureLostArmor.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }) ->warning(); From 4ee9b649fc13f52f66445194937150a2deeccdd8 Mon Sep 17 00:00:00 2001 From: MattFalahe <47831385+MattFalahe@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:14:52 +0100 Subject: [PATCH 4/5] StructureWentHighPower.php Added information with structure name --- .../Structures/Discord/StructureWentHighPower.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Notifications/Structures/Discord/StructureWentHighPower.php b/src/Notifications/Structures/Discord/StructureWentHighPower.php index 1777366..da2564b 100644 --- a/src/Notifications/Structures/Discord/StructureWentHighPower.php +++ b/src/Notifications/Structures/Discord/StructureWentHighPower.php @@ -74,13 +74,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }); } From aae75c35202da8f5566e95fea965b82f7661f98f Mon Sep 17 00:00:00 2001 From: MattFalahe <47831385+MattFalahe@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:17:55 +0100 Subject: [PATCH 5/5] Update StructureWentLowPower.php Added information with structure name --- .../Structures/Discord/StructureWentLowPower.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Notifications/Structures/Discord/StructureWentLowPower.php b/src/Notifications/Structures/Discord/StructureWentLowPower.php index 04e3437..84f2fca 100644 --- a/src/Notifications/Structures/Discord/StructureWentLowPower.php +++ b/src/Notifications/Structures/Discord/StructureWentLowPower.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }); }