Skip to content

Commit 7863ce4

Browse files
feat(stage-tamagotchi,i18n): option to not show FadeOnHover again (#821)
1 parent 15a5dae commit 7863ce4

14 files changed

Lines changed: 54 additions & 39 deletions

File tree

apps/stage-tamagotchi/src/renderer/components/StageIslands/ControlsIsland/ControlsIslandFadeOnHover.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ async function handleToggle() {
2222
return
2323
}
2424
25+
if (uiStore.dontShowItAgainNoticeFadeOnHover) {
26+
uiStore.enableFadeOnHover()
27+
return
28+
}
29+
2530
try {
2631
const acknowledged = await requestNotice({
2732
id: NOTICE_WINDOW_ID,

apps/stage-tamagotchi/src/renderer/pages/notice/fade-on-hover.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
2-
import { Button, TransitionVertical } from '@proj-airi/ui'
2+
import { Button, Checkbox, TransitionVertical } from '@proj-airi/ui'
33
import { refDebounced, useDark, useMouseInElement } from '@vueuse/core'
4+
import { storeToRefs } from 'pinia'
45
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
56
import { useI18n } from 'vue-i18n'
67
import { useRoute } from 'vue-router'
@@ -10,6 +11,7 @@ import VideoTutorialFadeOnHoverLight from '../../assets/videos/tutorial/tutorial
1011
1112
import { noticeWindowEventa } from '../../../shared/eventa'
1213
import { useElectronEventaContext, useElectronEventaInvoke } from '../../composables/electron-vueuse'
14+
import { useControlsIslandStore } from '../../stores/controls-island'
1315
1416
const context = useElectronEventaContext()
1517
const sendAction = useElectronEventaInvoke(noticeWindowEventa.windowAction, context.value)
@@ -18,6 +20,10 @@ const notifyUnmounted = useElectronEventaInvoke(noticeWindowEventa.pageUnmounted
1820
const route = useRoute()
1921
const { t } = useI18n()
2022
23+
const controlsIslandStore = useControlsIslandStore()
24+
const dontShowItAgainNoticeFadeOnHoverPending = ref(false)
25+
const { dontShowItAgainNoticeFadeOnHover } = storeToRefs(controlsIslandStore)
26+
2127
const descriptionContainerRef = ref<HTMLDivElement>()
2228
const { isOutside } = useMouseInElement(descriptionContainerRef)
2329
const descriptionOpenImmediate = computed(() => !isOutside.value)
@@ -61,6 +67,8 @@ async function handleAction(action: 'confirm' | 'cancel' | 'close') {
6167
}
6268
6369
try {
70+
if (action === 'confirm')
71+
dontShowItAgainNoticeFadeOnHover.value = dontShowItAgainNoticeFadeOnHoverPending.value
6472
await sendAction({ id, action })
6573
}
6674
catch (error) {
@@ -213,6 +221,12 @@ async function handleAction(action: 'confirm' | 'cancel' | 'close') {
213221
:loading="waitingForRequest"
214222
@click="handleAction('confirm')"
215223
/>
224+
<div class="flex items-center gap-2 whitespace-nowrap px-2">
225+
<Checkbox v-model="dontShowItAgainNoticeFadeOnHoverPending" />
226+
<div class="whitespace-nowrap text-sm">
227+
{{ t('tamagotchi.stage.notice.fade-on-hover.dont-show-again') }}
228+
</div>
229+
</div>
216230
</div>
217231
</div>
218232
</TransitionVertical>

apps/stage-tamagotchi/src/renderer/stores/controls-island.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { defineStore } from 'pinia'
44
export const useControlsIslandStore = defineStore('controls-island', () => {
55
// Persist fade-on-hover preference per user
66
const fadeOnHoverEnabled = useLocalStorage<boolean>('controls-island/fade-on-hover-enabled', false)
7+
const dontShowItAgainNoticeFadeOnHover = useLocalStorage<boolean>('preferences/dont-show-it-again/notice/fade-on-hover', false)
78

89
function enableFadeOnHover() {
910
fadeOnHoverEnabled.value = true
@@ -15,6 +16,7 @@ export const useControlsIslandStore = defineStore('controls-island', () => {
1516

1617
return {
1718
fadeOnHoverEnabled,
19+
dontShowItAgainNoticeFadeOnHover,
1820
enableFadeOnHover,
1921
disableFadeOnHover,
2022
}

packages/i18n/src/locales/en/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Character and UI
2525
confirm: Got it
26+
dont-show-again: Don’t show again
2627
preparing: Preparing…
2728
read-more: Read more
2829
preview-title: What is it?

packages/i18n/src/locales/es/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Personaje y UI
2525
confirm: Entendido
26+
dont-show-again: No volver a mostrar
2627
preparing: Preparando…
2728
read-more: Leer más
2829
preview-title: '¿Qué es esto?'

packages/i18n/src/locales/fr/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Personnage et UI
2525
confirm: Compris
26+
dont-show-again: Ne plus afficher
2627
preparing: Préparation…
2728
read-more: En savoir plus
2829
preview-title: C’est quoi ?

packages/i18n/src/locales/ja/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: キャラクターとUI
2525
confirm: 了解
26+
dont-show-again: 次回から表示しない
2627
preparing: 準備中…
2728
read-more: 続きを読む
2829
preview-title: これは何?

packages/i18n/src/locales/ko/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Character and UI
2525
confirm: Got it
26+
dont-show-again: Don’t show again
2627
preparing: Preparing…
2728
read-more: Read more
2829
preview-title: What is it?

packages/i18n/src/locales/ru/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Персонажа и интерфейса
2525
confirm: Понятно
26+
dont-show-again: Больше не показывать
2627
preparing: Подготавливаем…
2728
read-more: Подробнее
2829
preview-title: Что это?

packages/i18n/src/locales/vi/tamagotchi/stage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ notice:
2323
value: '0'
2424
targets: Nhân vật và giao diện
2525
confirm: Đã hiểu
26+
dont-show-again: Đừng hiển thị lại
2627
preparing: Đang chuẩn bị…
2728
read-more: Xem thêm
2829
preview-title: Đây là gì?

0 commit comments

Comments
 (0)