react-native-monflowts 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -3
- package/android/build.gradle +1 -0
- package/android/src/main/java/com/monflowts/MonflowtsNavigationModule.kt +43 -0
- package/android/src/main/java/com/monflowts/MonflowtsPackage.kt +10 -1
- package/android/src/main/java/com/monflowts/MonflowtsStackView.kt +443 -0
- package/android/src/main/java/com/monflowts/MonflowtsStackViewManager.kt +70 -0
- package/ios/MonflowtsNavigationBridge.m +10 -0
- package/ios/MonflowtsNavigationModule.swift +28 -0
- package/ios/MonflowtsStackBridge.m +17 -0
- package/ios/MonflowtsStackUIView.swift +409 -0
- package/ios/MonflowtsStackViewManager.swift +14 -0
- package/lib/module/HubContent.js +259 -219
- package/lib/module/HubContent.js.map +1 -1
- package/lib/module/MonflowtsHub.js +42 -3
- package/lib/module/MonflowtsHub.js.map +1 -1
- package/lib/module/api/mutations.js +4 -0
- package/lib/module/api/mutations.js.map +1 -1
- package/lib/module/api/queries.js +9 -3
- package/lib/module/api/queries.js.map +1 -1
- package/lib/module/components/AbandonPolicyNotice.js +3 -2
- package/lib/module/components/AbandonPolicyNotice.js.map +1 -1
- package/lib/module/components/CoinFlyOverlay.js +27 -20
- package/lib/module/components/CoinFlyOverlay.js.map +1 -1
- package/lib/module/components/GameRulesModal.js +8 -6
- package/lib/module/components/GameRulesModal.js.map +1 -1
- package/lib/module/components/HypeCallout.js +5 -5
- package/lib/module/components/HypeCallout.js.map +1 -1
- package/lib/module/components/InsufficientFundsOverlay.js +2 -1
- package/lib/module/components/InsufficientFundsOverlay.js.map +1 -1
- package/lib/module/components/JackpotNearMiss.js +3 -2
- package/lib/module/components/JackpotNearMiss.js.map +1 -1
- package/lib/module/components/JackpotTeaser.js +2 -1
- package/lib/module/components/JackpotTeaser.js.map +1 -1
- package/lib/module/components/QuitConfirmModal.js +3 -2
- package/lib/module/components/QuitConfirmModal.js.map +1 -1
- package/lib/module/components/SessionTimer.js +3 -2
- package/lib/module/components/SessionTimer.js.map +1 -1
- package/lib/module/components/ShopArtView.js +105 -0
- package/lib/module/components/ShopArtView.js.map +1 -0
- package/lib/module/components/SideDemoTab.js +20 -2
- package/lib/module/components/SideDemoTab.js.map +1 -1
- package/lib/module/components/StakeInput.js +3 -2
- package/lib/module/components/StakeInput.js.map +1 -1
- package/lib/module/content.js.map +1 -1
- package/lib/module/hooks/useAvailableGames.js +7 -2
- package/lib/module/hooks/useAvailableGames.js.map +1 -1
- package/lib/module/hooks/useLeaderboard.js.map +1 -1
- package/lib/module/hooks/usePlayGame.js +11 -5
- package/lib/module/hooks/usePlayGame.js.map +1 -1
- package/lib/module/hooks/useRaffleDrawState.js +4 -1
- package/lib/module/hooks/useRaffleDrawState.js.map +1 -1
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/NativeStackView.js +5 -0
- package/lib/module/navigation/NativeStackView.js.map +1 -0
- package/lib/module/navigation/Navigator.js +250 -0
- package/lib/module/navigation/Navigator.js.map +1 -0
- package/lib/module/navigation/engine.js +466 -0
- package/lib/module/navigation/engine.js.map +1 -0
- package/lib/module/navigation/hooks.js +29 -0
- package/lib/module/navigation/hooks.js.map +1 -0
- package/lib/module/navigation/index.js +7 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/routes.js +111 -0
- package/lib/module/navigation/routes.js.map +1 -0
- package/lib/module/theme.js +2 -2
- package/lib/module/theme.js.map +1 -1
- package/lib/module/utils/scale.js +35 -0
- package/lib/module/utils/scale.js.map +1 -0
- package/lib/module/views/DepositSelect.js +3 -2
- package/lib/module/views/DepositSelect.js.map +1 -1
- package/lib/module/views/DiceBattle.js +207 -125
- package/lib/module/views/DiceBattle.js.map +1 -1
- package/lib/module/views/DiceLobby.js +97 -30
- package/lib/module/views/DiceLobby.js.map +1 -1
- package/lib/module/views/FortuneWheel.js +417 -271
- package/lib/module/views/FortuneWheel.js.map +1 -1
- package/lib/module/views/Freefall.js +147 -88
- package/lib/module/views/Freefall.js.map +1 -1
- package/lib/module/views/History.js +3 -2
- package/lib/module/views/History.js.map +1 -1
- package/lib/module/views/Home.js +1026 -401
- package/lib/module/views/Home.js.map +1 -1
- package/lib/module/views/Jetstream.js +43 -19
- package/lib/module/views/Jetstream.js.map +1 -1
- package/lib/module/views/Leaderboard.js +98 -89
- package/lib/module/views/Leaderboard.js.map +1 -1
- package/lib/module/views/MillionaireHunter.js +743 -569
- package/lib/module/views/MillionaireHunter.js.map +1 -1
- package/lib/module/views/Minefield.js +40 -18
- package/lib/module/views/Minefield.js.map +1 -1
- package/lib/module/views/PaymentWebView.js +4 -3
- package/lib/module/views/PaymentWebView.js.map +1 -1
- package/lib/module/views/PlayerCard.js +3 -2
- package/lib/module/views/PlayerCard.js.map +1 -1
- package/lib/module/views/Profile.js +3 -2
- package/lib/module/views/Profile.js.map +1 -1
- package/lib/module/views/RaffleDraw.js +16 -6
- package/lib/module/views/RaffleDraw.js.map +1 -1
- package/lib/module/views/RevealWin.js +152 -25
- package/lib/module/views/RevealWin.js.map +1 -1
- package/lib/module/views/Splash.js +3 -2
- package/lib/module/views/Splash.js.map +1 -1
- package/lib/module/views/Success.js +5 -2
- package/lib/module/views/Success.js.map +1 -1
- package/lib/module/views/TicketShop.js +1067 -236
- package/lib/module/views/TicketShop.js.map +1 -1
- package/lib/module/views/TriviaLobby.js +43 -6
- package/lib/module/views/TriviaLobby.js.map +1 -1
- package/lib/module/views/TriviaMaster.js +23 -18
- package/lib/module/views/TriviaMaster.js.map +1 -1
- package/lib/module/views/Wallet.js +2 -1
- package/lib/module/views/Wallet.js.map +1 -1
- package/lib/module/views/WithdrawFlow.js +3 -2
- package/lib/module/views/WithdrawFlow.js.map +1 -1
- package/lib/module/views/diceDuel.js +44 -0
- package/lib/module/views/diceDuel.js.map +1 -0
- package/lib/module/views/freefallDrop.js +66 -0
- package/lib/module/views/freefallDrop.js.map +1 -0
- package/lib/module/views/homeLayout.js +47 -0
- package/lib/module/views/homeLayout.js.map +1 -0
- package/lib/module/views/launchFeatured.js +43 -0
- package/lib/module/views/launchFeatured.js.map +1 -0
- package/lib/module/views/leaderboardPhase.js +52 -0
- package/lib/module/views/leaderboardPhase.js.map +1 -0
- package/lib/module/views/lobbyKit.js +224 -0
- package/lib/module/views/lobbyKit.js.map +1 -0
- package/lib/module/views/raffleContent.js +11 -0
- package/lib/module/views/raffleContent.js.map +1 -0
- package/lib/module/views/rafflePhase.js +15 -0
- package/lib/module/views/rafflePhase.js.map +1 -0
- package/lib/module/views/revealWinHelpers.js +19 -0
- package/lib/module/views/revealWinHelpers.js.map +1 -1
- package/lib/module/views/shopArtMotion.js +25 -0
- package/lib/module/views/shopArtMotion.js.map +1 -0
- package/lib/module/views/ticketBundlePresets.js +15 -12
- package/lib/module/views/ticketBundlePresets.js.map +1 -1
- package/lib/module/views/ticketShopArt.js +391 -0
- package/lib/module/views/ticketShopArt.js.map +1 -0
- package/lib/module/views/treasureHunt.js +81 -0
- package/lib/module/views/treasureHunt.js.map +1 -0
- package/lib/module/views/wheelLayout.js +47 -0
- package/lib/module/views/wheelLayout.js.map +1 -0
- package/lib/typescript/src/HubContent.d.ts.map +1 -1
- package/lib/typescript/src/MonflowtsHub.d.ts.map +1 -1
- package/lib/typescript/src/api/gameTypes.d.ts +18 -2
- package/lib/typescript/src/api/gameTypes.d.ts.map +1 -1
- package/lib/typescript/src/api/mutations.d.ts.map +1 -1
- package/lib/typescript/src/api/queries.d.ts.map +1 -1
- package/lib/typescript/src/api/sdkTypes.d.ts +3 -0
- package/lib/typescript/src/api/sdkTypes.d.ts.map +1 -1
- package/lib/typescript/src/components/AbandonPolicyNotice.d.ts.map +1 -1
- package/lib/typescript/src/components/CoinFlyOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/GameRulesModal.d.ts +1 -0
- package/lib/typescript/src/components/GameRulesModal.d.ts.map +1 -1
- package/lib/typescript/src/components/HypeCallout.d.ts.map +1 -1
- package/lib/typescript/src/components/InsufficientFundsOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/JackpotNearMiss.d.ts.map +1 -1
- package/lib/typescript/src/components/JackpotTeaser.d.ts.map +1 -1
- package/lib/typescript/src/components/QuitConfirmModal.d.ts.map +1 -1
- package/lib/typescript/src/components/SessionTimer.d.ts.map +1 -1
- package/lib/typescript/src/components/ShopArtView.d.ts +11 -0
- package/lib/typescript/src/components/ShopArtView.d.ts.map +1 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts +1 -0
- package/lib/typescript/src/components/SideDemoTab.d.ts.map +1 -1
- package/lib/typescript/src/components/StakeInput.d.ts.map +1 -1
- package/lib/typescript/src/content.d.ts +1 -0
- package/lib/typescript/src/content.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useAvailableGames.d.ts +3 -0
- package/lib/typescript/src/hooks/useAvailableGames.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLeaderboard.d.ts +4 -0
- package/lib/typescript/src/hooks/useLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePlayGame.d.ts +1 -1
- package/lib/typescript/src/hooks/usePlayGame.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useRaffleDrawState.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/NativeStackView.d.ts +41 -0
- package/lib/typescript/src/navigation/NativeStackView.d.ts.map +1 -0
- package/lib/typescript/src/navigation/Navigator.d.ts +13 -0
- package/lib/typescript/src/navigation/Navigator.d.ts.map +1 -0
- package/lib/typescript/src/navigation/engine.d.ts +69 -0
- package/lib/typescript/src/navigation/engine.d.ts.map +1 -0
- package/lib/typescript/src/navigation/hooks.d.ts +6 -0
- package/lib/typescript/src/navigation/hooks.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +7 -0
- package/lib/typescript/src/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/routes.d.ts +80 -0
- package/lib/typescript/src/navigation/routes.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +0 -9
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/scale.d.ts +12 -0
- package/lib/typescript/src/utils/scale.d.ts.map +1 -0
- package/lib/typescript/src/views/DiceBattle.d.ts.map +1 -1
- package/lib/typescript/src/views/DiceLobby.d.ts.map +1 -1
- package/lib/typescript/src/views/FortuneWheel.d.ts.map +1 -1
- package/lib/typescript/src/views/Freefall.d.ts.map +1 -1
- package/lib/typescript/src/views/History.d.ts.map +1 -1
- package/lib/typescript/src/views/Home.d.ts +2 -2
- package/lib/typescript/src/views/Home.d.ts.map +1 -1
- package/lib/typescript/src/views/Jetstream.d.ts.map +1 -1
- package/lib/typescript/src/views/Leaderboard.d.ts.map +1 -1
- package/lib/typescript/src/views/MillionaireHunter.d.ts.map +1 -1
- package/lib/typescript/src/views/Minefield.d.ts.map +1 -1
- package/lib/typescript/src/views/PlayerCard.d.ts.map +1 -1
- package/lib/typescript/src/views/Profile.d.ts.map +1 -1
- package/lib/typescript/src/views/RaffleDraw.d.ts +2 -1
- package/lib/typescript/src/views/RaffleDraw.d.ts.map +1 -1
- package/lib/typescript/src/views/RevealWin.d.ts.map +1 -1
- package/lib/typescript/src/views/Splash.d.ts.map +1 -1
- package/lib/typescript/src/views/Success.d.ts.map +1 -1
- package/lib/typescript/src/views/TicketShop.d.ts +1 -0
- package/lib/typescript/src/views/TicketShop.d.ts.map +1 -1
- package/lib/typescript/src/views/TriviaLobby.d.ts.map +1 -1
- package/lib/typescript/src/views/TriviaMaster.d.ts.map +1 -1
- package/lib/typescript/src/views/Wallet.d.ts.map +1 -1
- package/lib/typescript/src/views/diceDuel.d.ts +22 -0
- package/lib/typescript/src/views/diceDuel.d.ts.map +1 -0
- package/lib/typescript/src/views/freefallDrop.d.ts +19 -0
- package/lib/typescript/src/views/freefallDrop.d.ts.map +1 -0
- package/lib/typescript/src/views/homeLayout.d.ts +15 -0
- package/lib/typescript/src/views/homeLayout.d.ts.map +1 -0
- package/lib/typescript/src/views/launchFeatured.d.ts +2 -0
- package/lib/typescript/src/views/launchFeatured.d.ts.map +1 -0
- package/lib/typescript/src/views/leaderboardPhase.d.ts +6 -0
- package/lib/typescript/src/views/leaderboardPhase.d.ts.map +1 -0
- package/lib/typescript/src/views/lobbyKit.d.ts +45 -0
- package/lib/typescript/src/views/lobbyKit.d.ts.map +1 -0
- package/lib/typescript/src/views/raffleContent.d.ts +3 -0
- package/lib/typescript/src/views/raffleContent.d.ts.map +1 -0
- package/lib/typescript/src/views/rafflePhase.d.ts +9 -0
- package/lib/typescript/src/views/rafflePhase.d.ts.map +1 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts +9 -0
- package/lib/typescript/src/views/revealWinHelpers.d.ts.map +1 -1
- package/lib/typescript/src/views/shopArtMotion.d.ts +13 -0
- package/lib/typescript/src/views/shopArtMotion.d.ts.map +1 -0
- package/lib/typescript/src/views/ticketBundlePresets.d.ts +3 -17
- package/lib/typescript/src/views/ticketBundlePresets.d.ts.map +1 -1
- package/lib/typescript/src/views/ticketShopArt.d.ts +27 -0
- package/lib/typescript/src/views/ticketShopArt.d.ts.map +1 -0
- package/lib/typescript/src/views/treasureHunt.d.ts +29 -0
- package/lib/typescript/src/views/treasureHunt.d.ts.map +1 -0
- package/lib/typescript/src/views/wheelLayout.d.ts +30 -0
- package/lib/typescript/src/views/wheelLayout.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
|
4
|
-
import { View, Text, StyleSheet, Alert, Animated, KeyboardAvoidingView, Platform, ScrollView
|
|
4
|
+
import { View, Text, StyleSheet, Alert, Animated, Easing, KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
|
|
5
|
+
import { scaledStyles } from "../utils/scale.js";
|
|
5
6
|
import CoinFlyOverlay from "../components/CoinFlyOverlay.js";
|
|
6
7
|
import MonflowtsPressable from "../components/MonflowtsPressable.js";
|
|
7
8
|
import MonflowtsWheelView from "../NativeWheelView.js";
|
|
@@ -10,6 +11,7 @@ import QuitConfirmModal from "../components/QuitConfirmModal.js";
|
|
|
10
11
|
import SideDemoTab from "../components/SideDemoTab.js";
|
|
11
12
|
import SvgIcon from "../Icons.js";
|
|
12
13
|
import { sounds } from "../SoundManager.js";
|
|
14
|
+
import { useBackGuard } from "../navigation/hooks.js";
|
|
13
15
|
import HypeCallout from "../components/HypeCallout.js";
|
|
14
16
|
import { HYPE_PHRASES, pickPhrase } from "../effects/hypePhrases.js";
|
|
15
17
|
import MonflowtsButton from "../components/MonflowtsButton.js";
|
|
@@ -19,7 +21,7 @@ import AbandonPolicyNotice from "../components/AbandonPolicyNotice.js";
|
|
|
19
21
|
import InsufficientFundsOverlay from "../components/InsufficientFundsOverlay.js";
|
|
20
22
|
import StakeInput from "../components/StakeInput.js";
|
|
21
23
|
import GameRulesModal from "../components/GameRulesModal.js";
|
|
22
|
-
import
|
|
24
|
+
import { nativeWheelSegments, wheelLayout, wheelOddsRows, wheelReturnToPlayer } from "./wheelLayout.js";
|
|
23
25
|
import { usePlayGame, useInitPlay } from "../hooks/usePlayGame.js";
|
|
24
26
|
import { useCurrency } from "../hooks/useCurrency.js";
|
|
25
27
|
import { useResponsive } from "../hooks/useResponsive.js";
|
|
@@ -27,7 +29,6 @@ import { useGameStore } from "../stores/gameStore.js";
|
|
|
27
29
|
import { gameContent, gameRules, randomMessageKey } from "../content.js";
|
|
28
30
|
import { t, formatNumber, errorText } from "../i18n.js";
|
|
29
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
|
-
const WHEEL_MAX_SIZE = 460;
|
|
31
32
|
const FortuneWheel = ({
|
|
32
33
|
onBack,
|
|
33
34
|
balance,
|
|
@@ -39,19 +40,35 @@ const FortuneWheel = ({
|
|
|
39
40
|
// ── Derive segments from server game config ──
|
|
40
41
|
const currency = useCurrency();
|
|
41
42
|
const {
|
|
42
|
-
columnWidth
|
|
43
|
+
columnWidth,
|
|
44
|
+
height: windowHeight
|
|
43
45
|
} = useResponsive();
|
|
46
|
+
const [box, setBox] = useState({
|
|
47
|
+
width: columnWidth,
|
|
48
|
+
height: windowHeight
|
|
49
|
+
});
|
|
50
|
+
const layout = useMemo(() => wheelLayout(box.width, box.height), [box.width, box.height]);
|
|
51
|
+
const onContainerLayout = useCallback(e => {
|
|
52
|
+
const {
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
55
|
+
} = e.nativeEvent.layout;
|
|
56
|
+
setBox(prev => prev.width === width && prev.height === height ? prev : {
|
|
57
|
+
width,
|
|
58
|
+
height
|
|
59
|
+
});
|
|
60
|
+
}, []);
|
|
44
61
|
const demoMode = useGameStore(s => s.demoMode);
|
|
62
|
+
const creditDemoBalance = useGameStore(s => s.creditDemoBalance);
|
|
45
63
|
const toggleDemoMode = useGameStore(s => s.toggleDemoMode);
|
|
46
64
|
const segments = useMemo(() => {
|
|
47
65
|
const content = gameContent('SPIN_WHEEL');
|
|
48
66
|
const source = game?.gameplayRules?.segments?.length ? game.gameplayRules.segments : content.rules?.segments ?? [];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}));
|
|
67
|
+
return nativeWheelSegments(source, content.segmentColors ?? []);
|
|
68
|
+
}, [game]);
|
|
69
|
+
const multipliers = useMemo(() => {
|
|
70
|
+
const source = game?.gameplayRules?.segments ?? [];
|
|
71
|
+
return source.length && source.every(seg => typeof seg.multiplier === 'number') ? source.map(seg => seg.multiplier) : null;
|
|
55
72
|
}, [game]);
|
|
56
73
|
|
|
57
74
|
// Derive actual play cost from game config (kobo → VG)
|
|
@@ -65,8 +82,10 @@ const FortuneWheel = ({
|
|
|
65
82
|
}, [game?.playCost]);
|
|
66
83
|
const hasStakeOptions = !!game?.gameplayRules?.stakeOptions?.length;
|
|
67
84
|
const stakeOptions = (hasStakeOptions ? game.gameplayRules.stakeOptions : gameRules('SPIN_WHEEL').stakeOptions ?? []).map(s => Math.round(s / 100));
|
|
68
|
-
const [activeStake, setActiveStake] = useState(hasStakeOptions ? stakeOptions[
|
|
85
|
+
const [activeStake, setActiveStake] = useState(hasStakeOptions ? stakeOptions[0] ?? 100 : actualCostVG || (stakeOptions[0] ?? 100));
|
|
69
86
|
const effectiveCostVG = hasStakeOptions ? activeStake : actualCostVG || activeStake;
|
|
87
|
+
const oddsRows = useMemo(() => multipliers ? wheelOddsRows(multipliers, effectiveCostVG) : [], [multipliers, effectiveCostVG]);
|
|
88
|
+
const rtpPercent = multipliers ? (wheelReturnToPlayer(multipliers) * 100).toFixed(1) : null;
|
|
70
89
|
|
|
71
90
|
// Multi-play session support
|
|
72
91
|
const stakeCountOptions = game?.gameplayRules?.stakeCountOptions ?? [];
|
|
@@ -75,6 +94,8 @@ const FortuneWheel = ({
|
|
|
75
94
|
const isMultiRound = selectedStakeCount > 1;
|
|
76
95
|
const totalCostVG = effectiveCostVG * selectedStakeCount;
|
|
77
96
|
const [roundNum, setRoundNum] = useState(0);
|
|
97
|
+
const roundRef = useRef(0);
|
|
98
|
+
const [lastSpin, setLastSpin] = useState(null);
|
|
78
99
|
const [sessionWins, setSessionWins] = useState(0);
|
|
79
100
|
const [sessionTotalWon, setSessionTotalWon] = useState(0);
|
|
80
101
|
const [sessionComplete, setSessionComplete] = useState(false);
|
|
@@ -90,19 +111,17 @@ const FortuneWheel = ({
|
|
|
90
111
|
}
|
|
91
112
|
setQuitVisible(true);
|
|
92
113
|
}, [wheelLive, onBack]);
|
|
93
|
-
|
|
94
|
-
const sub = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
95
|
-
handleBack();
|
|
96
|
-
return true;
|
|
97
|
-
});
|
|
98
|
-
return () => sub.remove();
|
|
99
|
-
}, [handleBack]);
|
|
114
|
+
useBackGuard(wheelLive, handleBack);
|
|
100
115
|
const [lastAmountWon, setLastAmountWon] = useState(0);
|
|
101
116
|
const [rulesVisible, setRulesVisible] = useState(false);
|
|
102
|
-
const
|
|
117
|
+
const spinAngle = useRef(new Animated.Value(0)).current;
|
|
118
|
+
const spinRotate = useMemo(() => spinAngle.interpolate({
|
|
119
|
+
inputRange: [0, 360],
|
|
120
|
+
outputRange: ['0deg', '360deg'],
|
|
121
|
+
extrapolate: 'extend'
|
|
122
|
+
}), [spinAngle]);
|
|
103
123
|
const rotationRef = useRef(0);
|
|
104
124
|
const lastTickSegment = useRef(0);
|
|
105
|
-
const animFrameRef = useRef(null);
|
|
106
125
|
const {
|
|
107
126
|
play
|
|
108
127
|
} = usePlayGame();
|
|
@@ -139,6 +158,7 @@ const FortuneWheel = ({
|
|
|
139
158
|
sounds.resume();
|
|
140
159
|
setIsSpinning(true);
|
|
141
160
|
setRoundNum(r => r + 1);
|
|
161
|
+
roundRef.current += 1;
|
|
142
162
|
|
|
143
163
|
// ── Call server to determine outcome ──
|
|
144
164
|
const gameInputPayload = isMultiRound ? {
|
|
@@ -160,6 +180,8 @@ const FortuneWheel = ({
|
|
|
160
180
|
} else {
|
|
161
181
|
Alert.alert(t('wheel.playError'), errorText(e, 'wheel.somethingWentWrong'));
|
|
162
182
|
}
|
|
183
|
+
roundRef.current -= 1;
|
|
184
|
+
setRoundNum(r => Math.max(0, r - 1));
|
|
163
185
|
setIsSpinning(false);
|
|
164
186
|
return;
|
|
165
187
|
}
|
|
@@ -207,92 +229,92 @@ const FortuneWheel = ({
|
|
|
207
229
|
|
|
208
230
|
// Honor the admin-configured spin duration; fall back to 6s if unset.
|
|
209
231
|
const duration = game?.gameplayRules?.spinDurationMs ?? gameRules('SPIN_WHEEL').spinDurationMs ?? 0;
|
|
210
|
-
const
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
// Quartic ease out
|
|
217
|
-
const easedProgress = 1 - Math.pow(1 - progress, 4);
|
|
218
|
-
const currentRot = startRotation + (totalNewRotation - startRotation) * easedProgress;
|
|
219
|
-
setRotation(currentRot);
|
|
220
|
-
rotationRef.current = currentRot;
|
|
221
|
-
|
|
222
|
-
// Segment-crossing tick sound
|
|
223
|
-
const segSize = 360 / segments.length;
|
|
224
|
-
const currentSegment = Math.floor((currentRot + segSize / 2) % 360 / segSize);
|
|
232
|
+
const segSize = 360 / segments.length;
|
|
233
|
+
const tickListener = spinAngle.addListener(({
|
|
234
|
+
value
|
|
235
|
+
}) => {
|
|
236
|
+
const currentSegment = Math.floor((value + segSize / 2) % 360 / segSize);
|
|
225
237
|
if (currentSegment !== lastTickSegment.current) {
|
|
226
238
|
sounds.playRollTick();
|
|
227
239
|
lastTickSegment.current = currentSegment;
|
|
228
240
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
setShowResultOverlay(true);
|
|
241
|
+
});
|
|
242
|
+
Animated.timing(spinAngle, {
|
|
243
|
+
toValue: totalNewRotation,
|
|
244
|
+
duration,
|
|
245
|
+
easing: Easing.out(Easing.poly(4)),
|
|
246
|
+
useNativeDriver: true
|
|
247
|
+
}).start(() => {
|
|
248
|
+
spinAngle.removeListener(tickListener);
|
|
249
|
+
rotationRef.current = totalNewRotation;
|
|
250
|
+
setIsSpinning(false);
|
|
251
|
+
const amountWon = (serverResult?.amountWonKobo ?? 0) / 100;
|
|
252
|
+
const session = gameResult?.session;
|
|
253
|
+
const isLastRound = session?.isLastRound ?? roundRef.current >= selectedStakeCount;
|
|
254
|
+
setLastSpin({
|
|
255
|
+
label: segments[serverSegmentIndex]?.label ?? '',
|
|
256
|
+
multiplier: typeof gameResult?.multiplier === 'number' ? gameResult.multiplier : null,
|
|
257
|
+
nonce: typeof gameResult?.nonce === 'number' ? gameResult.nonce : null,
|
|
258
|
+
hash: typeof gameResult?.serverSeedHash === 'string' && gameResult.serverSeedHash !== 'demo' ? gameResult.serverSeedHash : null
|
|
259
|
+
});
|
|
260
|
+
if (isMultiRound) {
|
|
261
|
+
if (amountWon > 0) {
|
|
262
|
+
setSessionWins(w => w + 1);
|
|
263
|
+
setSessionTotalWon(t => t + amountWon);
|
|
264
|
+
sounds.playWinChime();
|
|
265
|
+
hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
|
|
266
|
+
if (!demoMode) {
|
|
267
|
+
coinFlyRef.current?.measureTarget();
|
|
268
|
+
wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
|
|
269
|
+
coinFlyRef.current?.fly(x + w / 2, y + h / 2);
|
|
270
|
+
});
|
|
260
271
|
}
|
|
261
272
|
} else {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
|
|
270
|
-
coinFlyRef.current?.fly(x + w / 2, y + h / 2);
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
} else {
|
|
274
|
-
sounds.playDrawSound();
|
|
275
|
-
hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
|
|
276
|
-
}
|
|
273
|
+
sounds.playDrawSound();
|
|
274
|
+
hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
|
|
275
|
+
}
|
|
276
|
+
if (isLastRound) {
|
|
277
|
+
setSessionComplete(true);
|
|
278
|
+
const totalWon = sessionTotalWon + amountWon;
|
|
279
|
+
setLastAmountWon(totalWon);
|
|
277
280
|
setShowResultOverlay(true);
|
|
278
281
|
}
|
|
282
|
+
} else {
|
|
283
|
+
// Single round: show result overlay
|
|
284
|
+
setLastAmountWon(amountWon);
|
|
285
|
+
if (amountWon > 0) {
|
|
286
|
+
sounds.playWinChime();
|
|
287
|
+
hypeRef.current?.show(pickPhrase(amountWon >= 5000 ? HYPE_PHRASES.wheel.bigWin : HYPE_PHRASES.wheel.win), amountWon >= 5000 ? 'boost' : 'win');
|
|
288
|
+
if (!demoMode) {
|
|
289
|
+
coinFlyRef.current?.measureTarget();
|
|
290
|
+
wheelAreaRef.current?.measureInWindow?.((x, y, w, h) => {
|
|
291
|
+
coinFlyRef.current?.fly(x + w / 2, y + h / 2);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
} else {
|
|
295
|
+
sounds.playDrawSound();
|
|
296
|
+
hypeRef.current?.show(pickPhrase(HYPE_PHRASES.wheel.loss), 'loss');
|
|
297
|
+
}
|
|
298
|
+
setShowResultOverlay(true);
|
|
279
299
|
}
|
|
280
|
-
};
|
|
281
|
-
animFrameRef.current = requestAnimationFrame(animate);
|
|
300
|
+
});
|
|
282
301
|
}, [isSpinning, balance, effectiveCostVG, game, segments, play, onWin, onLose, initPlay, isMultiRound, selectedStakeCount, sessionTotalWon, sessionComplete]);
|
|
283
|
-
const
|
|
284
|
-
|
|
302
|
+
const {
|
|
303
|
+
wheelSize
|
|
304
|
+
} = layout;
|
|
285
305
|
const resultMsgKey = useMemo(() => randomMessageKey(lastAmountWon > 0 ? 'wheel.win' : 'wheel.loss'), [showResultOverlay] // eslint-disable-line react-hooks/exhaustive-deps
|
|
286
306
|
);
|
|
287
307
|
const handleResultPlayAgain = useCallback(() => {
|
|
308
|
+
if (demoMode && lastAmountWon > 0) creditDemoBalance(lastAmountWon);
|
|
288
309
|
setShowResultOverlay(false);
|
|
289
310
|
setSessionComplete(false);
|
|
290
311
|
setRoundNum(0);
|
|
312
|
+
roundRef.current = 0;
|
|
291
313
|
setSessionWins(0);
|
|
292
314
|
setSessionTotalWon(0);
|
|
293
315
|
setLastAmountWon(0);
|
|
294
316
|
if (initPlay.enabled) initPlay.reset();
|
|
295
|
-
}, [initPlay]);
|
|
317
|
+
}, [initPlay, demoMode, lastAmountWon, creditDemoBalance]);
|
|
296
318
|
const handleResultExit = useCallback(() => {
|
|
297
319
|
if (lastAmountWon > 0) {
|
|
298
320
|
onWin(lastAmountWon);
|
|
@@ -300,40 +322,50 @@ const FortuneWheel = ({
|
|
|
300
322
|
onLose?.();
|
|
301
323
|
}
|
|
302
324
|
}, [lastAmountWon, onWin, onLose]);
|
|
303
|
-
|
|
325
|
+
const paytablePanel = oddsRows.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
326
|
+
style: styles.paytable,
|
|
327
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
328
|
+
style: styles.stakeLabel,
|
|
329
|
+
children: t('hunter.paytable')
|
|
330
|
+
}), oddsRows.map(row => /*#__PURE__*/_jsxs(View, {
|
|
331
|
+
style: styles.paytableRow,
|
|
332
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
333
|
+
style: [styles.paytableCell, styles.paytableMultiplier],
|
|
334
|
+
children: [row.multiplier, "x"]
|
|
335
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
336
|
+
style: [styles.paytableCell, styles.paytableValue],
|
|
337
|
+
children: formatNumber(row.payout)
|
|
338
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
339
|
+
style: [styles.paytableCell, styles.paytableOdds],
|
|
340
|
+
children: t('hunter.oneIn', {
|
|
341
|
+
odds: 1 / row.probability < 10 ? (1 / row.probability).toFixed(1) : Math.round(1 / row.probability).toLocaleString('en-US')
|
|
342
|
+
})
|
|
343
|
+
})]
|
|
344
|
+
}, row.multiplier)), rtpPercent && /*#__PURE__*/_jsx(Text, {
|
|
345
|
+
style: styles.paytableNote,
|
|
346
|
+
children: t('hunter.rtp', {
|
|
347
|
+
percent: rtpPercent
|
|
348
|
+
})
|
|
349
|
+
})]
|
|
350
|
+
});
|
|
351
|
+
return /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
304
352
|
style: {
|
|
305
353
|
flex: 1
|
|
306
354
|
},
|
|
307
355
|
behavior: Platform.OS === 'ios' ? 'padding' : undefined,
|
|
308
|
-
children:
|
|
309
|
-
ref: hypeRef,
|
|
310
|
-
style: {
|
|
311
|
-
top: 240
|
|
312
|
-
}
|
|
313
|
-
}), /*#__PURE__*/_jsx(SideDemoTab, {
|
|
314
|
-
enabled: !!game?.demoConfig?.enabled
|
|
315
|
-
}), /*#__PURE__*/_jsxs(ScrollView, {
|
|
356
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
316
357
|
style: styles.container,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
358
|
+
onLayout: onContainerLayout,
|
|
359
|
+
children: [/*#__PURE__*/_jsx(HypeCallout, {
|
|
360
|
+
ref: hypeRef,
|
|
361
|
+
style: {
|
|
362
|
+
top: layout.landscape ? 80 : 240
|
|
363
|
+
}
|
|
364
|
+
}), /*#__PURE__*/_jsx(SideDemoTab, {
|
|
365
|
+
enabled: !!game?.demoConfig?.enabled
|
|
366
|
+
}), initPlay.enabled && initPlay.session && /*#__PURE__*/_jsx(SessionTimer, {
|
|
323
367
|
secondsLeft: initPlay.secondsLeft,
|
|
324
368
|
isExpired: initPlay.isExpired
|
|
325
|
-
}), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
|
|
326
|
-
style: styles.expiredOverlay,
|
|
327
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
328
|
-
style: styles.expiredTitle,
|
|
329
|
-
children: t('wheel.timesUp')
|
|
330
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
331
|
-
style: styles.expiredText,
|
|
332
|
-
children: t('wheel.stakeForfeited')
|
|
333
|
-
}), /*#__PURE__*/_jsx(MonflowtsButton, {
|
|
334
|
-
title: t('wheel.goBack'),
|
|
335
|
-
onPress: onBack
|
|
336
|
-
})]
|
|
337
369
|
}), /*#__PURE__*/_jsxs(View, {
|
|
338
370
|
style: styles.header,
|
|
339
371
|
children: [/*#__PURE__*/_jsx(QuitConfirmModal, {
|
|
@@ -407,162 +439,193 @@ const FortuneWheel = ({
|
|
|
407
439
|
})
|
|
408
440
|
})]
|
|
409
441
|
})]
|
|
410
|
-
}), /*#__PURE__*/
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
443
|
+
style: [styles.body, layout.landscape && styles.bodyLandscape],
|
|
444
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
445
|
+
style: layout.landscape ? [styles.wheelPaneLandscape, {
|
|
446
|
+
width: layout.wheelPaneWidth
|
|
447
|
+
}] : styles.wheelPanePortrait,
|
|
448
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
449
|
+
ref: wheelAreaRef,
|
|
450
|
+
style: styles.wheelArea,
|
|
451
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
452
|
+
style: [styles.wheelContainer, {
|
|
453
|
+
width: wheelSize,
|
|
454
|
+
height: wheelSize
|
|
455
|
+
}],
|
|
456
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
457
|
+
style: styles.pointer,
|
|
458
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
459
|
+
style: styles.pointerText,
|
|
460
|
+
children: "\u25BC"
|
|
461
|
+
})
|
|
462
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
463
|
+
renderToHardwareTextureAndroid: isSpinning,
|
|
464
|
+
style: [{
|
|
465
|
+
width: wheelSize,
|
|
466
|
+
height: wheelSize
|
|
467
|
+
}, {
|
|
468
|
+
transform: [{
|
|
469
|
+
rotate: spinRotate
|
|
470
|
+
}]
|
|
471
|
+
}],
|
|
472
|
+
children: /*#__PURE__*/_jsx(MonflowtsWheelView, {
|
|
473
|
+
segments: segments,
|
|
474
|
+
style: {
|
|
475
|
+
width: wheelSize,
|
|
476
|
+
height: wheelSize
|
|
477
|
+
}
|
|
478
|
+
})
|
|
479
|
+
})]
|
|
445
480
|
})
|
|
481
|
+
})
|
|
482
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
483
|
+
style: styles.sidePane,
|
|
484
|
+
children: [/*#__PURE__*/_jsxs(ScrollView, {
|
|
485
|
+
contentContainerStyle: layout.landscape ? styles.sideScroll : undefined,
|
|
486
|
+
keyboardShouldPersistTaps: "handled",
|
|
487
|
+
bounces: false,
|
|
488
|
+
children: [/*#__PURE__*/_jsx(AbandonPolicyNotice, {
|
|
489
|
+
abandonPolicy: abandonPolicy
|
|
490
|
+
}), initPlay.enabled && initPlay.error && !initPlay.session && /*#__PURE__*/_jsxs(View, {
|
|
491
|
+
style: {
|
|
492
|
+
padding: 12,
|
|
493
|
+
backgroundColor: '#fef2f2',
|
|
494
|
+
borderRadius: 8,
|
|
495
|
+
margin: 8,
|
|
496
|
+
alignItems: 'center'
|
|
497
|
+
},
|
|
498
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
499
|
+
style: {
|
|
500
|
+
color: '#b91c1c',
|
|
501
|
+
fontSize: 13,
|
|
502
|
+
marginBottom: 8,
|
|
503
|
+
textAlign: 'center'
|
|
504
|
+
},
|
|
505
|
+
children: initPlay.error
|
|
506
|
+
}), /*#__PURE__*/_jsx(MonflowtsButton, {
|
|
507
|
+
title: t('wheel.retry'),
|
|
508
|
+
onPress: () => initPlay.reset()
|
|
509
|
+
})]
|
|
510
|
+
}), paytablePanel, (hasStakeOptions || !actualCostVG) && /*#__PURE__*/_jsxs(View, {
|
|
511
|
+
style: styles.stakeSection,
|
|
512
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
513
|
+
style: styles.stakeLabel,
|
|
514
|
+
children: t('wheel.selectBet')
|
|
515
|
+
}), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
|
|
516
|
+
options: stakeOptions,
|
|
517
|
+
selectedValue: activeStake,
|
|
518
|
+
onSelect: stake => {
|
|
519
|
+
sounds.playSelect();
|
|
520
|
+
setActiveStake(stake);
|
|
521
|
+
},
|
|
522
|
+
containerStyle: styles.stakeRow
|
|
523
|
+
}), !hasStakeOptions && /*#__PURE__*/_jsx(StakeInput, {
|
|
524
|
+
value: activeStake,
|
|
525
|
+
min: stakeOptions[0] ?? 100,
|
|
526
|
+
onConfirm: stake => setActiveStake(stake),
|
|
527
|
+
disabled: isSpinning
|
|
528
|
+
})]
|
|
529
|
+
}), hasStakeCount && /*#__PURE__*/_jsxs(View, {
|
|
530
|
+
style: styles.stakeSection,
|
|
531
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
532
|
+
style: styles.stakeLabel,
|
|
533
|
+
children: t('wheel.spinsPerSession')
|
|
534
|
+
}), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
|
|
535
|
+
options: stakeCountOptions,
|
|
536
|
+
selectedValue: selectedStakeCount,
|
|
537
|
+
onSelect: count => {
|
|
538
|
+
sounds.playSelect();
|
|
539
|
+
setSelectedStakeCount(count);
|
|
540
|
+
},
|
|
541
|
+
containerStyle: styles.stakeRow,
|
|
542
|
+
getLabel: v => t('wheel.roundsOption', {
|
|
543
|
+
count: v
|
|
544
|
+
})
|
|
545
|
+
}), isMultiRound && /*#__PURE__*/_jsx(Text, {
|
|
546
|
+
style: {
|
|
547
|
+
color: COLORS.slateLight,
|
|
548
|
+
fontSize: 11,
|
|
549
|
+
textAlign: 'center',
|
|
550
|
+
marginTop: 6
|
|
551
|
+
},
|
|
552
|
+
children: t('wheel.total', {
|
|
553
|
+
amount: formatNumber(totalCostVG)
|
|
554
|
+
})
|
|
555
|
+
})]
|
|
556
|
+
}), isMultiRound && roundNum > 0 && /*#__PURE__*/_jsxs(View, {
|
|
557
|
+
style: styles.sessionBar,
|
|
558
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
559
|
+
style: styles.sessionBarText,
|
|
560
|
+
children: t('wheel.wonAmount', {
|
|
561
|
+
amount: sessionTotalWon
|
|
562
|
+
})
|
|
563
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
564
|
+
style: styles.sessionBarText,
|
|
565
|
+
children: t('wheel.spinsWon', {
|
|
566
|
+
won: sessionWins,
|
|
567
|
+
total: roundNum
|
|
568
|
+
})
|
|
569
|
+
})]
|
|
570
|
+
})]
|
|
446
571
|
}), /*#__PURE__*/_jsx(View, {
|
|
447
|
-
style:
|
|
448
|
-
|
|
449
|
-
height: wheelSize
|
|
450
|
-
}, {
|
|
451
|
-
transform: [{
|
|
452
|
-
rotate: rotateDeg
|
|
453
|
-
}]
|
|
454
|
-
}],
|
|
455
|
-
children: /*#__PURE__*/_jsx(MonflowtsWheelView, {
|
|
456
|
-
segments: segments,
|
|
572
|
+
style: styles.actionBar,
|
|
573
|
+
children: sessionComplete ? /*#__PURE__*/_jsxs(View, {
|
|
457
574
|
style: {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
575
|
+
alignItems: 'center',
|
|
576
|
+
marginBottom: 36,
|
|
577
|
+
paddingHorizontal: 20
|
|
578
|
+
},
|
|
579
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
580
|
+
style: {
|
|
581
|
+
color: COLORS.gold,
|
|
582
|
+
fontSize: 16,
|
|
583
|
+
fontWeight: '700',
|
|
584
|
+
marginBottom: 8
|
|
585
|
+
},
|
|
586
|
+
children: t('wheel.sessionComplete')
|
|
587
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
588
|
+
style: {
|
|
589
|
+
color: COLORS.slateLight,
|
|
590
|
+
fontSize: 13
|
|
591
|
+
},
|
|
592
|
+
children: t('wheel.sessionSummary', {
|
|
593
|
+
won: sessionWins,
|
|
594
|
+
total: selectedStakeCount,
|
|
595
|
+
result: sessionTotalWon > 0 ? t('wheel.winningsAmount', {
|
|
596
|
+
amount: sessionTotalWon
|
|
597
|
+
}) : t('wheel.noWinnings')
|
|
598
|
+
})
|
|
599
|
+
})]
|
|
600
|
+
}) : /*#__PURE__*/_jsx(MonflowtsButton, {
|
|
601
|
+
title: isMultiRound && roundNum > 0 ? t('wheel.spinProgress', {
|
|
602
|
+
round: roundNum,
|
|
603
|
+
total: selectedStakeCount
|
|
604
|
+
}) : t('wheel.spinTheWheel'),
|
|
605
|
+
icon: /*#__PURE__*/_jsx(SvgIcon, {
|
|
606
|
+
name: "slotMachine",
|
|
607
|
+
size: 18,
|
|
608
|
+
color: "#ffffff"
|
|
609
|
+
}),
|
|
610
|
+
loading: isSpinning,
|
|
611
|
+
loadingText: t('wheel.spinning'),
|
|
612
|
+
onPress: spin,
|
|
613
|
+
textStyle: styles.spinBtnText
|
|
461
614
|
})
|
|
462
615
|
})]
|
|
463
|
-
})
|
|
464
|
-
}), (hasStakeOptions || !actualCostVG) && /*#__PURE__*/_jsxs(View, {
|
|
465
|
-
style: styles.stakeSection,
|
|
466
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
467
|
-
style: styles.stakeLabel,
|
|
468
|
-
children: t('wheel.selectBet')
|
|
469
|
-
}), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
|
|
470
|
-
options: stakeOptions,
|
|
471
|
-
selectedValue: activeStake,
|
|
472
|
-
onSelect: stake => {
|
|
473
|
-
sounds.playSelect();
|
|
474
|
-
setActiveStake(stake);
|
|
475
|
-
},
|
|
476
|
-
containerStyle: styles.stakeRow
|
|
477
|
-
}), /*#__PURE__*/_jsx(StakeInput, {
|
|
478
|
-
value: activeStake,
|
|
479
|
-
min: stakeOptions[0] ?? 100,
|
|
480
|
-
onConfirm: stake => setActiveStake(stake),
|
|
481
|
-
disabled: isSpinning
|
|
482
|
-
})]
|
|
483
|
-
}), hasStakeCount && /*#__PURE__*/_jsxs(View, {
|
|
484
|
-
style: styles.stakeSection,
|
|
485
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
486
|
-
style: styles.stakeLabel,
|
|
487
|
-
children: t('wheel.spinsPerSession')
|
|
488
|
-
}), /*#__PURE__*/_jsx(MonflowtsChipGroup, {
|
|
489
|
-
options: stakeCountOptions,
|
|
490
|
-
selectedValue: selectedStakeCount,
|
|
491
|
-
onSelect: count => {
|
|
492
|
-
sounds.playSelect();
|
|
493
|
-
setSelectedStakeCount(count);
|
|
494
|
-
},
|
|
495
|
-
containerStyle: styles.stakeRow,
|
|
496
|
-
getLabel: v => t('wheel.roundsOption', {
|
|
497
|
-
count: v
|
|
498
|
-
})
|
|
499
|
-
}), isMultiRound && /*#__PURE__*/_jsx(Text, {
|
|
500
|
-
style: {
|
|
501
|
-
color: COLORS.slateLight,
|
|
502
|
-
fontSize: 11,
|
|
503
|
-
textAlign: 'center',
|
|
504
|
-
marginTop: 6
|
|
505
|
-
},
|
|
506
|
-
children: t('wheel.total', {
|
|
507
|
-
amount: formatNumber(totalCostVG)
|
|
508
|
-
})
|
|
509
|
-
})]
|
|
510
|
-
}), isMultiRound && roundNum > 0 && /*#__PURE__*/_jsxs(View, {
|
|
511
|
-
style: styles.sessionBar,
|
|
512
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
513
|
-
style: styles.sessionBarText,
|
|
514
|
-
children: t('wheel.wonAmount', {
|
|
515
|
-
amount: sessionTotalWon
|
|
516
|
-
})
|
|
517
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
518
|
-
style: styles.sessionBarText,
|
|
519
|
-
children: t('wheel.spinsWon', {
|
|
520
|
-
won: sessionWins,
|
|
521
|
-
total: roundNum
|
|
522
|
-
})
|
|
523
616
|
})]
|
|
524
|
-
}),
|
|
525
|
-
style:
|
|
526
|
-
alignItems: 'center',
|
|
527
|
-
marginBottom: 36,
|
|
528
|
-
paddingHorizontal: 20
|
|
529
|
-
},
|
|
617
|
+
}), initPlay.enabled && initPlay.isExpired && /*#__PURE__*/_jsxs(View, {
|
|
618
|
+
style: styles.expiredOverlay,
|
|
530
619
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
531
|
-
style:
|
|
532
|
-
|
|
533
|
-
fontSize: 16,
|
|
534
|
-
fontWeight: '700',
|
|
535
|
-
marginBottom: 8
|
|
536
|
-
},
|
|
537
|
-
children: t('wheel.sessionComplete')
|
|
620
|
+
style: styles.expiredTitle,
|
|
621
|
+
children: t('wheel.timesUp')
|
|
538
622
|
}), /*#__PURE__*/_jsx(Text, {
|
|
539
|
-
style:
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
won: sessionWins,
|
|
545
|
-
total: selectedStakeCount,
|
|
546
|
-
result: sessionTotalWon > 0 ? t('wheel.winningsAmount', {
|
|
547
|
-
amount: sessionTotalWon
|
|
548
|
-
}) : t('wheel.noWinnings')
|
|
549
|
-
})
|
|
623
|
+
style: styles.expiredText,
|
|
624
|
+
children: t('wheel.stakeForfeited')
|
|
625
|
+
}), /*#__PURE__*/_jsx(MonflowtsButton, {
|
|
626
|
+
title: t('wheel.goBack'),
|
|
627
|
+
onPress: onBack
|
|
550
628
|
})]
|
|
551
|
-
}) : /*#__PURE__*/_jsx(MonflowtsButton, {
|
|
552
|
-
title: isMultiRound && roundNum > 0 ? t('wheel.spinProgress', {
|
|
553
|
-
round: roundNum,
|
|
554
|
-
total: selectedStakeCount
|
|
555
|
-
}) : t('wheel.spinTheWheel'),
|
|
556
|
-
icon: /*#__PURE__*/_jsx(SvgIcon, {
|
|
557
|
-
name: "slotMachine",
|
|
558
|
-
size: 18,
|
|
559
|
-
color: "#ffffff"
|
|
560
|
-
}),
|
|
561
|
-
loading: isSpinning,
|
|
562
|
-
loadingText: t('wheel.spinning'),
|
|
563
|
-
onPress: spin,
|
|
564
|
-
style: styles.spinBtnWrap,
|
|
565
|
-
textStyle: styles.spinBtnText
|
|
566
629
|
}), /*#__PURE__*/_jsx(InsufficientFundsOverlay, {
|
|
567
630
|
visible: showFundsOverlay,
|
|
568
631
|
balance: balance,
|
|
@@ -619,10 +682,18 @@ const FortuneWheel = ({
|
|
|
619
682
|
}), /*#__PURE__*/_jsx(Text, {
|
|
620
683
|
style: styles.resultSubtitle,
|
|
621
684
|
children: t(`${resultMsgKey}.sub`)
|
|
622
|
-
}), /*#__PURE__*/_jsx(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
685
|
+
}), !isMultiRound && lastSpin?.label ? /*#__PURE__*/_jsx(Text, {
|
|
686
|
+
style: styles.resultDetail,
|
|
687
|
+
children: t('wheel.landed', {
|
|
688
|
+
label: lastSpin.label
|
|
689
|
+
})
|
|
690
|
+
}) : null, lastSpin?.hash && lastSpin.nonce !== null ? /*#__PURE__*/_jsx(Text, {
|
|
691
|
+
style: styles.fairnessText,
|
|
692
|
+
children: t('wheel.fairness', {
|
|
693
|
+
nonce: lastSpin.nonce,
|
|
694
|
+
hash: lastSpin.hash.slice(0, 12)
|
|
695
|
+
})
|
|
696
|
+
}) : null, demoMode ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
626
697
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
627
698
|
style: styles.demoHookText,
|
|
628
699
|
children: lastAmountWon > 0 ? t('wheel.demoHookWin') : t('wheel.demoHookLoss')
|
|
@@ -672,15 +743,93 @@ const FortuneWheel = ({
|
|
|
672
743
|
})
|
|
673
744
|
})
|
|
674
745
|
})]
|
|
675
|
-
})
|
|
746
|
+
})
|
|
676
747
|
});
|
|
677
748
|
};
|
|
678
|
-
const styles =
|
|
749
|
+
const styles = scaledStyles({
|
|
679
750
|
container: {
|
|
680
751
|
flex: 1,
|
|
681
752
|
backgroundColor: COLORS.backgroundDark,
|
|
682
753
|
paddingTop: 50
|
|
683
754
|
},
|
|
755
|
+
body: {
|
|
756
|
+
flex: 1
|
|
757
|
+
},
|
|
758
|
+
bodyLandscape: {
|
|
759
|
+
flexDirection: 'row'
|
|
760
|
+
},
|
|
761
|
+
wheelPanePortrait: {
|
|
762
|
+
alignItems: 'center'
|
|
763
|
+
},
|
|
764
|
+
wheelPaneLandscape: {
|
|
765
|
+
justifyContent: 'center',
|
|
766
|
+
alignItems: 'center'
|
|
767
|
+
},
|
|
768
|
+
sidePane: {
|
|
769
|
+
flex: 1
|
|
770
|
+
},
|
|
771
|
+
sideScroll: {
|
|
772
|
+
flexGrow: 1,
|
|
773
|
+
justifyContent: 'center',
|
|
774
|
+
paddingRight: 28
|
|
775
|
+
},
|
|
776
|
+
actionBar: {
|
|
777
|
+
paddingHorizontal: 20,
|
|
778
|
+
paddingTop: 10,
|
|
779
|
+
paddingBottom: 28,
|
|
780
|
+
borderTopWidth: 1,
|
|
781
|
+
borderTopColor: COLORS.white10,
|
|
782
|
+
backgroundColor: COLORS.backgroundDark
|
|
783
|
+
},
|
|
784
|
+
paytable: {
|
|
785
|
+
marginHorizontal: 20,
|
|
786
|
+
marginBottom: 16,
|
|
787
|
+
padding: 12,
|
|
788
|
+
borderRadius: 14,
|
|
789
|
+
backgroundColor: 'rgba(30, 41, 59, 0.5)',
|
|
790
|
+
borderWidth: 1,
|
|
791
|
+
borderColor: COLORS.white10,
|
|
792
|
+
alignItems: 'center'
|
|
793
|
+
},
|
|
794
|
+
paytableRow: {
|
|
795
|
+
flexDirection: 'row',
|
|
796
|
+
alignSelf: 'stretch',
|
|
797
|
+
paddingVertical: 4
|
|
798
|
+
},
|
|
799
|
+
paytableCell: {
|
|
800
|
+
flex: 1,
|
|
801
|
+
fontSize: 12,
|
|
802
|
+
fontWeight: '700',
|
|
803
|
+
color: COLORS.slateLight
|
|
804
|
+
},
|
|
805
|
+
paytableMultiplier: {
|
|
806
|
+
color: COLORS.gold
|
|
807
|
+
},
|
|
808
|
+
paytableValue: {
|
|
809
|
+
color: '#fff',
|
|
810
|
+
textAlign: 'center'
|
|
811
|
+
},
|
|
812
|
+
paytableOdds: {
|
|
813
|
+
textAlign: 'right'
|
|
814
|
+
},
|
|
815
|
+
paytableNote: {
|
|
816
|
+
fontSize: 10,
|
|
817
|
+
color: COLORS.slateDark,
|
|
818
|
+
marginTop: 6,
|
|
819
|
+
textAlign: 'center'
|
|
820
|
+
},
|
|
821
|
+
resultDetail: {
|
|
822
|
+
color: COLORS.slateLight,
|
|
823
|
+
fontSize: 13,
|
|
824
|
+
marginBottom: 6,
|
|
825
|
+
textAlign: 'center'
|
|
826
|
+
},
|
|
827
|
+
fairnessText: {
|
|
828
|
+
color: COLORS.slateDark,
|
|
829
|
+
fontSize: 10,
|
|
830
|
+
marginBottom: 16,
|
|
831
|
+
textAlign: 'center'
|
|
832
|
+
},
|
|
684
833
|
header: {
|
|
685
834
|
flexDirection: 'row',
|
|
686
835
|
alignItems: 'center',
|
|
@@ -730,9 +879,9 @@ const styles = StyleSheet.create({
|
|
|
730
879
|
fontWeight: '700'
|
|
731
880
|
},
|
|
732
881
|
wheelArea: {
|
|
733
|
-
flex: 1,
|
|
734
882
|
alignItems: 'center',
|
|
735
|
-
justifyContent: 'center'
|
|
883
|
+
justifyContent: 'center',
|
|
884
|
+
paddingVertical: 28
|
|
736
885
|
},
|
|
737
886
|
wheelContainer: {
|
|
738
887
|
alignItems: 'center',
|
|
@@ -773,9 +922,6 @@ const styles = StyleSheet.create({
|
|
|
773
922
|
justifyContent: 'center',
|
|
774
923
|
gap: 8
|
|
775
924
|
},
|
|
776
|
-
spinBtnWrap: {
|
|
777
|
-
marginBottom: 36
|
|
778
|
-
},
|
|
779
925
|
spinBtnText: {
|
|
780
926
|
fontSize: 18,
|
|
781
927
|
fontWeight: '800',
|