From d4a646e105fe7ea39add9bd6a530bb2876cf38e3 Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Thu, 30 Sep 2021 22:05:32 +0200 Subject: [PATCH] Some love for homeactions (icons) --- public/img/homeActions/catchFish.png | Bin 0 -> 1864 bytes public/img/homeActions/getShark.png | Bin 0 -> 786 bytes src/components/Tabs/Home.svelte | 47 +++++++++++++++++++++++---- src/components/Wrapper.svelte | 25 ++++++++++---- src/shark/Settings.ts | 9 ++++- src/shark/SharkGame.ts | 5 +++ src/shark/data/HomeActions.ts | 7 ++-- 7 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 public/img/homeActions/catchFish.png create mode 100644 public/img/homeActions/getShark.png diff --git a/public/img/homeActions/catchFish.png b/public/img/homeActions/catchFish.png new file mode 100644 index 0000000000000000000000000000000000000000..fd8f8b0b01f303cbf687f16bad01f87120a5a917 GIT binary patch literal 1864 zcmV-O2e4;7MyzoPN%_e+{>1&(d-K3yB9VA2zDAR?H75YC$}TGcVF{{|gOa z{GakjF+ZSS5#w>|=AW1drW#(m;TpMcp|7dKaU?+1A|it8ppbcJiKqul8A^g8E#FVCO0{S)x<*V zbfID730LrfU=kaCfH9fWI5tEhF1AktpsI+h?GvX93nFDt04O11GKhGoF|3P7VftAW zF;!tPiK=aAt$VKW`XD!js$xtAYfGuIY=B29Td0PJ7!G#7x|&O*Ru@r7<)*OVJjVE_ zT8v4bgPJB%@kR`05>3!XF@MsoAQ4PD5?(8=W73AbT5ap{NF2*SE{6>l8al~paYL*N zpX#Ib(YgG~Aci0}iM30q089kAWx4=R)Rxvt6l+>j zEs9Hz4tV7h1rdX)rQT@z{_LNz8e_D}bfH*V!gyN}E9q+1WN5i%6G1L&yW<#lWZr%I zSLG)Q`9X^Lvt<%1b>YI!^L!3;4K*F=>&jZzE|k4dW2%h3^BamY=N#ZD?CR+PK*V6J z<70S0O)$ppFg8J64O@B@lnrZZ^o}P-R)_R;*o0T@)J%t?{c*>(-s$ zxt(o$aw}@x6`**Lko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% zF}S7bX1V{s;fgdQ3QKkQ;iL~WSJm>%_FU^p3vvj#f><4htGgAs@afr^%i243e0DeX z#cFl8!pZ5$*23cNZu{+y1FEQo*orB!QcH%2<%qA8PI20TQl(0jD)ry%ACj$|AAFj; QmjD0&07*qoM6N<$g35GYJ^%m! literal 0 HcmV?d00001 diff --git a/src/components/Tabs/Home.svelte b/src/components/Tabs/Home.svelte index 2cafdee..c451fd0 100644 --- a/src/components/Tabs/Home.svelte +++ b/src/components/Tabs/Home.svelte @@ -1,11 +1,14 @@
- {#each Object.entries(HomeActions.getActionTable()) as [homeActionId, homeAction]} - + {#each Object.entries(homeActions) as [homeActionId, homeAction]} + {#each Array(50).fill(homeAction) as homeActionClone} + + {/each} {/each}
@@ -39,5 +53,24 @@ div { display: flex; flex-direction: row; + flex-wrap: wrap; + + > button { + display: flex; + flex-direction: column; + + align-items: center; + justify-content: center; + + font-size: 1em; + width: 8em; + + &:not(.no-icons) { + height: 6em; + } + &.no-icons { + height: calc(6em - 50px); + } + } } diff --git a/src/components/Wrapper.svelte b/src/components/Wrapper.svelte index 6df2dd4..fff5f33 100644 --- a/src/components/Wrapper.svelte +++ b/src/components/Wrapper.svelte @@ -20,8 +20,10 @@ } let logLength: number; + let showIcons: boolean; game.Settings.settings.subscribe((settings) => { logLength = settings.layout.logLength.current; + showIcons = settings.appearance.showIcons.current; }); @@ -50,12 +52,23 @@
- + {#if game.TabHandler.currentTab === game.TabHandler.AllTabs.Home} + + {:else if game.TabHandler.currentTab === game.TabHandler.AllTabs.Lab} + + {:else} + + {/if}
diff --git a/src/shark/Settings.ts b/src/shark/Settings.ts index 22f8b9d..f9be57d 100644 --- a/src/shark/Settings.ts +++ b/src/shark/Settings.ts @@ -28,7 +28,14 @@ export class Settings extends StaticClass { default: "marine" as const, name: "Currently enabled theme" as const, description: "Only applied if planet-dependent styles are enabled" as const, - options: ["abandoned", "chaotic", "frigid", "haven", "marine", "shrouded", "tempestuous", "violent"], + options: ["abandoned", "chaotic", "frigid", "haven", "marine", "shrouded", "tempestuous", "violent"] as const, + }, + showIcons: { + current: true, + default: true as const, + name: "Show icons" as const, + description: "Whether to show decorative icons in various places" as const, + options: [true, false] as const, }, }, }; diff --git a/src/shark/SharkGame.ts b/src/shark/SharkGame.ts index 3d3b49f..6a383d4 100644 --- a/src/shark/SharkGame.ts +++ b/src/shark/SharkGame.ts @@ -5,6 +5,8 @@ import { Settings } from "./Settings"; import { StaticClass } from "./StaticClass"; import { TabHandler } from "./TabHandler"; +import { HomeActions } from "./data/HomeActions"; + export class SharkGame extends StaticClass { static readonly #GAME_NAMES = [ "Five Seconds A Shark", @@ -61,6 +63,9 @@ export class SharkGame extends StaticClass { static readonly Resources = Resources; static readonly TabHandler = TabHandler; static readonly SaveHandler = SaveHandler; + static readonly Data = Object.seal({ + HomeActions, + }); static init(): void { Log.init(); diff --git a/src/shark/data/HomeActions.ts b/src/shark/data/HomeActions.ts index 3de13ba..7670b85 100644 --- a/src/shark/data/HomeActions.ts +++ b/src/shark/data/HomeActions.ts @@ -7,6 +7,7 @@ export type HomeAction = { }; outcomes: string[]; multiOutcomes?: string[]; + image?: string; }; export class HomeActions extends StaticClass { @@ -16,7 +17,8 @@ export class HomeActions extends StaticClass { static readonly actionTable = Object.seal({ catchFish: { - name: "Catch fish", + image: "catchFish.png", + name: "Steal fish", effect: { resource: { fish: 1, @@ -66,7 +68,8 @@ export class HomeActions extends StaticClass { ], }, catchShark: { - name: "Catch shark", + image: "getShark.png", + name: "Kidnap shark", effect: { resource: { shark: 1,