Skip to content

Commit

Permalink
add color to events
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Apr 2, 2024
1 parent 852d324 commit 02384f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions web/src/lib/actions/utils/faction-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export function getFactionIcon(color: Color): string {
let src = '/game-assets/blue.png';

switch (color) {
case 0:
src = '/game-assets/withdrawal.png';
break;
case 1:
src = '/game-assets/blue.png';
break;
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/ui/events/EventInfo.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import {getFactionIcon} from '$lib/actions/utils/faction-icons';
import ImgBlockie from '$utils/ethereum/ImgBlockie.svelte';
import {url} from '$utils/path';
import type {CellPlacements} from 'stratagems-indexer';
Expand All @@ -16,7 +17,7 @@
{/each}
{:else}
{@const player = event.players[0]}

<img src={url(getFactionIcon(event.players[0].color))} alt="color used" />
<span class="blockie-wrapper">
<ImgBlockie style="object-fit: cover;height: 100%;width: 100%;" address={player.address} />
</span>
Expand Down
3 changes: 3 additions & 0 deletions web/static/game-assets/withdrawal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02384f3

Please sign in to comment.