diff --git a/locales/en.json b/locales/en.json index 2f2ed53..6ffb965 100644 --- a/locales/en.json +++ b/locales/en.json @@ -379,6 +379,11 @@ "level": "Level: ", "time": "Time: ", "exit": "leave Game" + }, + "mascotDialog": { + "title": "Play !", + "message": "Play.", + "button": "Yes !" } }, "debug": { diff --git a/locales/fr.json b/locales/fr.json index 8811518..121fbf5 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -378,6 +378,11 @@ "level": "Niveau: ", "time": "Temps: ", "exit": "Quitter" + }, + "mascotDialog": { + "title": "Jeu !", + "message": "Jouer.", + "button": "Oui !" } }, "debug": { diff --git a/src/managers/AsyncStorageManager.js b/src/managers/AsyncStorageManager.js index f084c39..242d839 100644 --- a/src/managers/AsyncStorageManager.js +++ b/src/managers/AsyncStorageManager.js @@ -100,6 +100,11 @@ export default class AsyncStorageManager { default: '1', current: '', }, + gameStartShowBanner: { + key: 'gameStartShowBanner', + default: '1', + current: '', + }, proxiwashWatchedMachines: { key: 'proxiwashWatchedMachines', default: '[]', diff --git a/src/screens/Game/screens/GameStartScreen.js b/src/screens/Game/screens/GameStartScreen.js index 1ed78e0..80e4390 100644 --- a/src/screens/Game/screens/GameStartScreen.js +++ b/src/screens/Game/screens/GameStartScreen.js @@ -5,6 +5,10 @@ import {StackNavigationProp} from "@react-navigation/stack"; import type {CustomTheme} from "../../../managers/ThemeManager"; import {Button, Headline, withTheme} from "react-native-paper"; import {View} from "react-native"; +import i18n from "i18n-js"; +import {MASCOT_STYLE} from "../../../components/Mascot/Mascot"; +import MascotPopup from "../../../components/Mascot/MascotPopup"; +import AsyncStorageManager from "../../../managers/AsyncStorageManager"; type Props = { navigation: StackNavigationProp, @@ -12,11 +16,23 @@ type Props = { } type State = { - + mascotDialogVisible: boolean, } class GameStartScreen extends React.Component { + state = { + mascotDialogVisible: AsyncStorageManager.getInstance().preferences.gameStartShowBanner.current === "1", + } + + hideMascotDialog = () => { + AsyncStorageManager.getInstance().savePref( + AsyncStorageManager.getInstance().preferences.gameStartShowBanner.key, + '0' + ); + this.setState({mascotDialogVisible: false}) + }; + render() { return ( @@ -27,6 +43,21 @@ class GameStartScreen extends React.Component { > PLAY + ); }