File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
22import Key from " ./Key.svelte" ;
3- type Props = { name: string ; key: string ; count : number };
4- const { name, count , key }: Props = $props ();
3+ type Props = { name: string ; key: string ; enabled : boolean };
4+ const { name, enabled , key }: Props = $props ();
55 </script >
6- <span style ="margin-right: 1rem; display: flex; align-items: end; color: {count > 0 ? " black" : " gray" };" >
7- <Key withCtrl key ={key } enabled ={count > 0 } />
6+ <span style ="margin-right: 1rem; display: flex; align-items: end; color: {enabled ? " black" : " gray" };" >
7+ <Key withCtrl key ={key } enabled ={enabled } />
88 <span style ="margin-left:0.5rem; margin-right: 0.5rem;" >{name }</span >
9- {#if isFinite (count )}
10- <span style =" margin-right: 0.5rem; " >x</span >
11- <span style ="" >{count }</span >
12- {/if }
139</span >
Original file line number Diff line number Diff line change @@ -101,21 +101,25 @@ onDestroy(() => bindings.destroy());
101101 />
102102 {/if }
103103 </div >
104- {#if ! uiContext .inventoryIsInfinite }
105- <span style =" " >x</span >
106- <span style =" " >1</span >
107- {/if }
104+ <span style =" margin-right: 0.5rem;" >x</span >
105+ <span style ="" >{uiContext .inventoryIsInfinite ? " Inf" : " 1" }</span >
108106 </div >
109107 <div
110108 class =" uiBackground"
111109 style =" position: fixed; left: 0; bottom: 0; right: 0; display: flex; align-items: end;"
112110 >
113111 <span style =" margin-right: 1rem;" >Abilities:</span >
114- <Ability key ="C" name ="Copy" count ={uiContext .copy } />
115- <Ability key ="X" name ="Cut" count ={uiContext .cut } />
116- <Ability key ="V" name ="Paste" count ={uiContext .paste } />
117- <Ability key ="Z" name ="Undo" count ={uiContext .undo } />
118- <Ability key ="Y" name ="Redo" count ={uiContext .redo } />
112+ {#if uiContext .copy }
113+ <Ability key =" C" name =" Copy" enabled />
114+ {/if }
115+ {#if uiContext .cut }
116+ <Ability key =" X" name =" Cut" enabled />
117+ {/if }
118+ {#if uiContext .paste }
119+ <Ability key =" V" name =" Paste" enabled />
120+ {/if }
121+ <Ability key ="Z" name ="Undo" enabled ={uiContext .undo > 0 } />
122+ <Ability key ="Y" name ="Redo" enabled ={uiContext .redo > 0 } />
119123 </div >
120124</div >
121125
You can’t perform that action at this time.
0 commit comments