Skip to content

Commit

Permalink
Fixed #488 Added animations off indicator on stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Jun 29, 2024
1 parent 30d15b4 commit 909ddd1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:
- Correct typos in tutorial.
- [#503](https://github.com/wordplaydev/wordplay/issues/503). Prevent infinite loops in parser.
- [#504](https://github.com/wordplaydev/wordplay/issues/504). Account for non-fixed-width characters in caret positioning.
- [#488](https://github.com/wordplaydev/wordplay/issues/488). Added animations off indicator on stage.

## 0.10.1 2024-06-22

Expand Down
20 changes: 20 additions & 0 deletions src/components/project/ProjectView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
blocks,
localized,
Creators,
animationFactor,
} from '../../db/Database';
import Arrangement from '../../db/Arrangement';
import type Value from '../../values/Value';
Expand Down Expand Up @@ -121,6 +122,7 @@
import Glyphs from '../../lore/Glyphs';
import Speech from '@components/lore/Speech.svelte';
import Translate from './Translate.svelte';
import { AnimationFactorIcons } from '@db/AnimationFactorSetting';
export let project: Project;
export let original: Project | undefined = undefined;
Expand Down Expand Up @@ -1334,6 +1336,24 @@
)}>⨉</ConfirmButton
>
{/if}
{:else if tile.kind === TileKind.Output}
<span
title={$locales.get(
(l) =>
l.ui.dialog.settings.mode
.animate,
).modes[$animationFactor]}
><Emoji
>{AnimationFactorIcons[
$animationFactor
]}</Emoji
>
{#if $animationFactor === 0}{$locales.get(
(l) =>
l.ui.dialog.settings.mode
.animate,
).modes[0]}{/if}</span
>
{/if}
</svelte:fragment>
<svelte:fragment slot="extra">
Expand Down
23 changes: 11 additions & 12 deletions src/components/settings/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import CreatorView from '../app/CreatorView.svelte';
import Beta from '../../routes/Beta.svelte';
import { Creator } from '../../db/CreatorDatabase';
import { AnimationFactorIcons } from '@db/AnimationFactorSetting';
let user = getUser();
Expand Down Expand Up @@ -115,7 +116,7 @@
)}
choice={$animationFactor}
select={(choice) => Settings.setAnimationFactor(choice)}
modes={['🧘🏽‍♀️', '🏃‍♀️', '½', '', '¼']}
modes={AnimationFactorIcons}
/></p
>
<!-- <p
Expand Down Expand Up @@ -210,18 +211,16 @@
/>
</p>
<p
><Mode
descriptions={$locales.get(
(l) => l.ui.dialog.settings.mode.space,
)}
choice={$spaceIndicator === false ? 1 : 0}
select={(choice) =>
Settings.setSpace(
choice === 0 ? true : false,
><Mode
descriptions={$locales.get(
(l) => l.ui.dialog.settings.mode.space,
)}
modes={['', '']}
/>
</p>
choice={$spaceIndicator === false ? 1 : 0}
select={(choice) =>
Settings.setSpace(choice === 0 ? true : false)}
modes={['', '']}
/>
</p>
</Dialog>
</div>

Expand Down
4 changes: 3 additions & 1 deletion src/db/AnimationFactorSetting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Setting from './Setting';

export const AnimationFactorIcons = ['🧘🏽‍♀️', '🏃‍♀️', '½', '⅓', '¼'];

export const AnimationFactorSetting = new Setting<number>(
'animationFactor',
false,
1,
(value) => (typeof value === 'number' && value >= 1 ? value : undefined),
(current, value) => current === value
(current, value) => current === value,
);
4 changes: 2 additions & 2 deletions src/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4259,8 +4259,8 @@
"animate": {
"label": "animations",
"modes": [
"off",
"on",
"animations off",
"normal speed",
"half speed",
"third speed",
"quarter speed"
Expand Down

0 comments on commit 909ddd1

Please sign in to comment.