Skip to content

Commit

Permalink
add implant icons (#679)
Browse files Browse the repository at this point in the history
* add implant icons

* add hover with id (for now)

* remove hover

* map IDs to texts

* Fix StyleCI issues

* update for fewer reads
  • Loading branch information
zmsMarc authored May 25, 2024
1 parent f68b26e commit 76dab3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Http/Controllers/Character/SheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace Seat\Web\Http\Controllers\Character;

use Seat\Eveapi\Models\Character\CharacterInfo;
use Seat\Eveapi\Models\Sde\InvType;
use Seat\Web\Http\Controllers\Controller;

/**
Expand All @@ -38,6 +39,17 @@ class SheetController extends Controller
*/
public function show(CharacterInfo $character)
{
return view('web::character.sheet', compact('character'));
//create key/value pairs for implant IDs and texts
$jumpclone_implant_ids = collect($character->jump_clones)
->pluck('implants')
->flatten()
->unique();

$jumpclone_implants = InvType::whereIn('typeID', $jumpclone_implant_ids)
->get()
->pluck('typeName', 'typeID')
->toArray();

return view('web::character.sheet', compact('character', 'jumpclone_implants'));
}
}
9 changes: 9 additions & 0 deletions src/resources/views/character/sheet.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@
@else
Location is unknown
@endif

@if(! empty($clone->implants))
</br>&nbsp&nbsp
@foreach($clone->implants as $implant_id)
<i data-toggle="tooltip" title="{{ $jumpclone_implants[$implant_id] }}">
{!! img('types', 'icon', $implant_id, 32, ['class' => 'img-circle eve-icon small-icon'], false) !!}
</i>
@endforeach
@endif
</li>
@endforeach

Expand Down

0 comments on commit 76dab3a

Please sign in to comment.