diff --git a/README.md b/README.md index 59c99ea..3b0687e 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ To work this launcher requires | Name | Description | | --- | --- | | webkit2gtk | To run Neutralino apps | +| libappindicator-gtk3 | To run Neutralino apps | | unzip | To unpack zip archives (DXVKs / wines) | | tar | To unpack tar archives (DXVKs / wines) | | git | To check for new versions of the launcher | diff --git a/src/assets/images/discord/baal1.jpg b/src/assets/images/discord/baal1.jpg deleted file mode 100644 index be9b0be..0000000 Binary files a/src/assets/images/discord/baal1.jpg and /dev/null differ diff --git a/src/assets/images/discord/baal1.webp b/src/assets/images/discord/baal1.webp new file mode 100644 index 0000000..d9522bd Binary files /dev/null and b/src/assets/images/discord/baal1.webp differ diff --git a/src/assets/images/discord/yaemiko1.jpg b/src/assets/images/discord/yaemiko1.jpg deleted file mode 100644 index 118c738..0000000 Binary files a/src/assets/images/discord/yaemiko1.jpg and /dev/null differ diff --git a/src/assets/images/discord/yaemiko1.webp b/src/assets/images/discord/yaemiko1.webp new file mode 100644 index 0000000..5e76ed5 Binary files /dev/null and b/src/assets/images/discord/yaemiko1.webp differ diff --git a/src/components/DiscordSettings.svelte b/src/components/DiscordSettings.svelte index 0c0577a..804ca7f 100644 --- a/src/components/DiscordSettings.svelte +++ b/src/components/DiscordSettings.svelte @@ -10,76 +10,46 @@ import Checkbox from './Checkbox.svelte'; + // TODO: maybe somehow encode these icons names + // Discord RPC icons imports - // It's better to do it manually so Vite - // will be able to pack them automatically - import LauncherIcon from '../../public/icons/256x256.png'; - import GameOriginalIcon from '../assets/images/discord/gi-icon.jpg'; - import GameIcon from '../assets/images/discord/game.jpg'; - - import ArtGame1Icon from '../assets/images/discord/artgame.jpg'; - import ArtGame2Icon from '../assets/images/discord/artgame2.jpg'; - import ArtGame3Icon from '../assets/images/discord/artgame3.jpg'; - - // Beidou - import BeidouGameIcon from '../assets/images/discord/beidougame.jpg'; - - // Klee - import KleeGameIcon from '../assets/images/discord/kleegame.jpg'; - import KleeGame2Icon from '../assets/images/discord/kleegame2.jpg'; - - // Baal - import Baal1Icon from '../assets/images/discord/baal1.jpg'; - - // Yae Miko - import YaeMiko1Icon from '../assets/images/discord/yaemiko1.jpg'; - import YaeMiko2Icon from '../assets/images/discord/yaemiko2.jpg'; - - // Liyue - import LiyueGameIcon from '../assets/images/discord/liyuegame.jpg'; - - // Inazuma - import Inazuma1Icon from '../assets/images/discord/inazuma1.jpg'; - import Inazuma2Icon from '../assets/images/discord/inazuma2.jpg'; - import Inazuma3Icon from '../assets/images/discord/inazuma3.jpg'; - import Inazuma4Icon from '../assets/images/discord/inazuma4.jpg'; - import Inazuma5Icon from '../assets/images/discord/inazuma5.jpg'; - + // We must import them manually because otherwise + // neutralino won't be able to load them because of its restrictions const icons = { - 'launcher': LauncherIcon, - 'gi-icon': GameOriginalIcon, - 'game': GameIcon, + 'launcher': import('../../public/icons/256x256.png'), + 'gi-icon': import('../assets/images/discord/gi-icon.jpg'), + 'game': import('../assets/images/discord/game.jpg'), - 'artgame': ArtGame1Icon, - 'artgame2': ArtGame2Icon, - 'artgame3': ArtGame3Icon, + 'artgame': import('../assets/images/discord/artgame.jpg'), + 'artgame2': import('../assets/images/discord/artgame2.jpg'), + 'artgame3': import('../assets/images/discord/artgame3.jpg'), // Beidou - 'beidougame': BeidouGameIcon, + 'beidougame': import('../assets/images/discord/beidougame.jpg'), // Klee - 'kleegame': KleeGameIcon, - 'kleegame2': KleeGame2Icon, + 'kleegame': import('../assets/images/discord/kleegame.jpg'), + 'kleegame2': import('../assets/images/discord/kleegame2.jpg'), // Baal - 'baal1': Baal1Icon, + 'baal1': import('../assets/images/discord/baal1.webp'), // Yae Miko - 'yaemiko1': YaeMiko1Icon, - 'yaemiko2': YaeMiko2Icon, + 'yaemiko1': import('../assets/images/discord/yaemiko1.webp'), + 'yaemiko2': import('../assets/images/discord/yaemiko2.jpg'), // Liyue - 'liyuegame': LiyueGameIcon, + 'liyuegame': import('../assets/images/discord/liyuegame.jpg'), // Inazuma - 'inazuma1': Inazuma1Icon, - 'inazuma2': Inazuma2Icon, - 'inazuma3': Inazuma3Icon, - 'inazuma4': Inazuma4Icon, - 'inazuma5': Inazuma5Icon + 'inazuma1': import('../assets/images/discord/inazuma1.jpg'), + 'inazuma2': import('../assets/images/discord/inazuma2.jpg'), + 'inazuma3': import('../assets/images/discord/inazuma3.jpg'), + 'inazuma4': import('../assets/images/discord/inazuma4.jpg'), + 'inazuma5': import('../assets/images/discord/inazuma5.jpg') }; - let iconSelector: 'in-game'|'in-launcher'|null = null; + let iconSelector: 'in-game' | 'in-launcher' | null = null; let states = { 'in-game': { @@ -147,7 +117,9 @@ - iconSelector = iconSelector ? null : 'in-launcher'} /> + {#await icons[states['in-launcher']['icon']] then iconUri} + iconSelector = iconSelector ? null : 'in-launcher'} /> + {/await} @@ -158,7 +130,9 @@ - iconSelector = iconSelector ? null : 'in-game'} /> + {#await icons[states['in-game']['icon']] then iconUri} + iconSelector = iconSelector ? null : 'in-game'} /> + {/await} @@ -168,7 +142,9 @@
{#each Object.keys(icons) as icon} - selectIcon(icon)} /> + {#await icons[icon] then iconUri} + selectIcon(icon)} /> + {/await} {/each}