Skip to content

Commit

Permalink
display when game is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Nov 18, 2024
1 parent 5bf6dac commit 44c98e6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ slot_ryo2_torii = "slot d create ryo2 torii -v v1.0.0-rc.2 --config-file ./torii
slot_ryosepolia_torii = "slot d create ryosepolia2 torii -v v1.0.0-rc.2 --config-file ./torii_ryosepolia2.toml"

# slot ryomainnet
slot_ryomainnet_torii = "slot d create --tier rare ryomainnet torii -v v1.0.0-rc.2 --config-file ./torii_mainnet.toml"
slot_ryomainnet_torii = "slot d create --tier rare ryomainnet torii -v v1.0.1 --config ./torii_mainnet.toml"

[profile.ryo1]
[profile.ryo2]
Expand Down
11 changes: 8 additions & 3 deletions torii_mainnet.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
rpc = "https://api.cartridge.gg/x/starknet/mainnet"

world_address = "0x04f3dccb47477c087ad9c76b8067b8aadded57f8df7f2d7543e6066bcb25332c"

[indexing]
allowed_origins = ["*"]
index_pending = true
index_transactions = false
polling_interval = 1000
historical_events = [
contracts = []

[events]
raw = false
historical = [
"dopewars-GameCreated",
"dopewars-Traveled",
"dopewars-GameOver",
Expand All @@ -20,5 +27,3 @@ historical_events = [
"dopewars-TrophyCreation",
"dopewars-TrophyProgression",
]

contracts = []
39 changes: 18 additions & 21 deletions web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import { Button } from "@/components/common";
import { Flipflop, LaundromatIcon, PaperIcon, Warning } from "@/components/icons";
import { CopsIcon, Flipflop, LaundromatIcon, PaperIcon, Warning } from "@/components/icons";
import { Layout } from "@/components/layout";
import { HomeLeftPanel, Leaderboard, Tutorial } from "@/components/pages/home";
import { HallOfFame } from "@/components/pages/home/HallOfFame";
import { useConfigStore, useDojoContext, useRouterContext, useSeasonByVersion, useSystems } from "@/dojo/hooks";
import { sleep } from "@/dojo/utils";
import { play } from "@/hooks/media";
import { Sounds, playSound } from "@/hooks/sound";
import {
Card,
Divider,
HStack,
Progress,
Tab,
TabList,
TabPanel,
TabPanels,
Tabs,
Text,
VStack,
} from "@chakra-ui/react";
import { Card, HStack, Progress, Tab, TabList, TabPanel, TabPanels, Tabs, Text, VStack } from "@chakra-ui/react";
import { useAccount, useConnect } from "@starknet-react/core";
import { useEffect, useState } from "react";
import colors from "@/theme/colors";
Expand All @@ -30,7 +16,7 @@ import { gameModeName } from "@/dojo/helpers";
export default function Home() {
const { router, isLocalhost } = useRouterContext();
const { account } = useAccount();
const { uiStore, burnerManager } = useDojoContext();
const { uiStore } = useDojoContext();
const { launder, isPending } = useSystems();
const { connectors, connect } = useConnect();

Expand All @@ -47,6 +33,8 @@ export default function Home() {

const [progressPercent, setProgressPercent] = useState(0);

const isPaused = config?.ryo.paused;

useEffect(() => {
if (!sortedList || sortedList.process_max_size === 0) return;

Expand Down Expand Up @@ -96,18 +84,27 @@ export default function Home() {
<VStack boxSize="full" gap="10px">
<Card variant="pixelated">
<HStack w="full" p={["10px", "20px"]} gap="10px" justify="center">
{isSeasonOpen && canCreateGame && (
{isPaused && (
<HStack w="full" color="yellow.400" justifyContent="center" alignItems="center" gap={6}>
<CopsIcon color="yellow.400" />
<VStack flexDirection={["column", "row"]}>
<Text>Game under arrest.</Text>
<Text>The streets are silent...</Text>
</VStack>
</HStack>
)}
{!isPaused && isSeasonOpen && canCreateGame && (
<Button flex="1" onClick={() => onHustle(GameMode.Noob)}>
<Flipflop /> Play guest
</Button>
)}
{isSeasonOpen && canCreateGame && (
{!isPaused && isSeasonOpen && canCreateGame && (
<Button flex="1" onClick={() => onHustle(GameMode.Ranked)}>
<Glock /> Play Ranked
</Button>
)}

{isSeasonOpen && !canCreateGame && (
{!isPaused && isSeasonOpen && !canCreateGame && (
<HStack w="full" color="yellow.400" justifyContent="center" gap={3}>
<Button flex="1" onClick={() => onHustle(GameMode.Noob)}>
<Flipflop /> Play guest
Expand All @@ -120,7 +117,7 @@ export default function Home() {
</HStack>
)}

{!isSeasonOpen && !isSeasonWashed && (
{!isPaused && !isSeasonOpen && !isSeasonWashed && (
<HStack w="full">
<LaundromatIcon isWashing={isPending} />

Expand Down

0 comments on commit 44c98e6

Please sign in to comment.