Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Dec 13, 2023
2 parents 388d292 + b8671d8 commit 36dc0ba
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 30 deletions.
Binary file added packages/client/src/assets/img/fight-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/client/src/mud/supportedChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains";
import { sepolia, arbitrumGoerli } from 'viem/chains'

arbitrumGoerli.rpcUrls.default.http = ['https://arbitrum-goerli.infura.io/v3/5ca372516740427e97512d4dfefd9c47'];
arbitrumGoerli.rpcUrls.default.webSocket = [ 'wss://arbitrum-goerli.infura.io/ws/v3/5ca372516740427e97512d4dfefd9c47'];
arbitrumGoerli.rpcUrls.default.http = ['https://arbitrum-goerli.publicnode.com'];
arbitrumGoerli.rpcUrls.default.webSocket = [ 'wss://arbitrum-goerli.publicnode.com'];

const testnet = {
name: "Mississippi testnet",
Expand Down
72 changes: 67 additions & 5 deletions packages/client/src/pages/ffa/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,82 @@
import React from 'react';
import React, { useState } from 'react';
import './styles.scss';
import Header from './header';
import UserInfo from './userInfo';
import fightIcon from '@/assets/img/fight-icon.png';

const FFA = () => {

const [tab, setTab] = useState('home');


return (
<div className={'ffa-page'}>
<Header/>

<section className={'ffa-section'}>
<div className="ffa-switch-wrapper">
<h2 className={'switch-item active'}>Home</h2>
<h2 className={'switch-item'}>Battle</h2>
<h2
className={`switch-item ${tab === 'home' ? 'active' : ''}`}
onClick={() => {
setTab('home')
}}
>Home</h2>
<h2
className={`switch-item ${tab === 'battle' ? 'active' : ''}`}
onClick={() => {
setTab('battle')
}}
>Battle</h2>
</div>
<UserInfo/>
<button className="mi-btn">Mint and Go</button>
{
tab === 'home' && <>
<UserInfo/>
<button className="mi-btn">Mint and Go</button>
</>
}

{
tab === 'battle' && <div className={'ffa-battle-wrapper'} >
<div className="left-content">
<h3>Leaderboard</h3>
<div className="leaderboard-wrapper">
<ul className={'leaderboard-list'}>
<li className={'rank-row'}>
<div className="rank-num">1</div>
<div className="username">Bob</div>
<div className="addr">0x34..35</div>
<div className="win-count">V2</div>
<div className="lose-count">D6</div>
<div className="fight-icon">
<img src={fightIcon} alt="fight"/>
</div>
</li>
</ul>
<div className="my-rank-info rank-row">
<div className="rank-num">12</div>
<div className="username">Tom</div>
<div className="addr">0x34..35</div>
<div className="win-count">V2</div>
<div className="lose-count">D6</div>

</div>
</div>
</div>
<div className="right-content">
<h3>My Battle Logs</h3>
<ul className="ffa-logs-wrapper">
<li>
<div className="ffa-content">I challenged XX Victory</div>
<time>11/25 20:20</time>
</li>
<li>
<div className="ffa-content">XX challenged me Lose</div>
<time>11/24 21:20</time>
</li>
</ul>
</div>
</div>
}
</section>
</div>
);
Expand Down
67 changes: 59 additions & 8 deletions packages/client/src/pages/ffa/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,73 @@

.switch-item {
padding: 10px 12px;
//border: 4px solid;
cursor: pointer;
border-bottom: 4px solid #BC8C61;

&:not(:first-child) {
//border-left-width: 2px;
&.active {

color: #FFF5E9;
background: #BC8C61;
}
}
}

&:not(:last-child) {
//border-right-width: 2px;
.ffa-battle-wrapper {
display: flex;
justify-content: space-between;
h3 {
margin-bottom: 10px;
}

.left-content {
width: 570px;

.leaderboard-list {
flex: 1;
li {
margin-bottom: 6px;
}
}

&.active {
.leaderboard-wrapper {
display: flex;
flex-direction: column;
padding: 60px 92px 50px;
height: 380px;
background: url("../../assets/img/user_bg.png") no-repeat center/100% 100%;
}

color: #FFF5E9;
background: #BC8C61;
.rank-row {
display: grid;
grid-template-columns: 1fr 4fr 6fr 2fr 2fr 1fr;
}

.fight-icon {
img {
width: 19px;
height: 19px;
cursor: pointer;
}
}

.my-rank-info {
padding-top: 6px;
border-top: 2px solid;
}
}

.right-content {
width: 580px;

.ffa-logs-wrapper {
font-size: 12px;
color: #fff;

li {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/client/src/pages/home/StaticInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useState } from 'react';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Mousewheel } from 'swiper/modules';
import SwiperCore from 'swiper';
import 'swiper/css';
import './staticInfo.scss';
import FAQ from '@/config/faq';

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ eth_rpc_url = "https://follower.testnet-chain.linfra.xyz"


[profile.arb-testnet]
eth_rpc_url = "https://arbitrum-goerli.infura.io/v3/5ca372516740427e97512d4dfefd9c47"
eth_rpc_url = "https://arbitrum-goerli.publicnode.com"
optimizer = true
optimizer_runs = 3000

Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"deploy:local": "pnpm run build && mud deploy",
"deploy:testnet": "pnpm run build && mud deploy --profile=lattice-testnet",
"deploy:lidamao": "pnpm run build && mud deploy --profile=Mississippi-testnet",
"deploy:redstone": "pnpm run build && mud deploy --profile=REDSTONE-HOLESKY",
"deploy:arb": "pnpm run build && mud deploy --profile=arb-testnet",

"dev": "pnpm mud dev-contracts --rpc http://127.0.0.1:8545",
"lint": "pnpm run prettier && pnpm run solhint",
Expand Down
7 changes: 3 additions & 4 deletions packages/contracts/script/GameConfigInit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { GameConfig, GameConfigData } from "../src/codegen/index.sol";
import { GAME_CONFIG_KEY } from "../src/Constants.sol";

library GameConfigInit {
function initGameConfig(IWorld _world) internal {
function initGameConfig() internal {
console.log(" ========= initGameConfig");
bytes32 merkleRoot = 0x5df91eca63323dbb115087ef262075c5bcea99b8eaf95f520efb8d48ff447499;
// bytes32 merkleRoot = 0xa969691ad8c2e97e3d516e08f5b10ee4decd5f278a5f03ac4fa3532be181c854;
GameConfig.setBattleId(GAME_CONFIG_KEY,1);
// GameConfig.set(
Expand All @@ -29,12 +28,12 @@ library GameConfigInit {

}

function setInitPosition(IWorld _world) internal {
function setInitPosition() internal {
GameConfig.setOriginX(GAME_CONFIG_KEY, 4);
GameConfig.setOriginY(GAME_CONFIG_KEY, 4);
}

function getPosition(IWorld _world) internal view returns (uint256, uint256) {
function getPosition() internal view returns (uint256, uint256) {
uint256 x = GameConfig.getOriginX(GAME_CONFIG_KEY);
uint256 y = GameConfig.getOriginY(GAME_CONFIG_KEY);
return (x, y);
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/script/PostDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ contract PostDeploy is Script {

console.log(" ========== PostDeploy ========== ");

address muser = 0xBC9129Dc0487fc2E169941C75aABC539f208fb01;
address mloot = 0x6e989C01a3e3A94C973A62280a72EC335598490e;
address mplugin = 0xF6168876932289D073567f347121A267095f3DD6;
address muser = 0x2428109A9e775E4406fe079132F216dc77117333;
address mloot = 0x4A16f2658De79278Bce592258e7e38aB4c222787;
address mplugin = 0xcE34c3d4373A094d6e22ab15f0b0C36c771663cb;
bytes32 merkleRoot = 0x5df91eca63323dbb115087ef262075c5bcea99b8eaf95f520efb8d48ff447499;

IWorld(worldAddress).Init(muser, mloot, mplugin,merkleRoot);
Expand Down
10 changes: 5 additions & 5 deletions packages/contracts/worlds.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"17001": {
"address": "0x050499eBdbBBc1216011dE07A48b5182c983Ae74",
"blockNumber": 1069273
"address": "0x11f943bd1e3e37eb82216c01dc0a8d537cf4d31a",
"blockNumber": 1505273
},
"31337": {
"address": "0x6e9474e9c83676b9a71133ff96db43e7aa0a4342"
"address": "0x7bd472fc101d3a7caf3064b7c5788965cb34685f"
},
"33784": {
"address": "0x6e9474e9c83676b9a71133ff96db43e7aa0a4342",
"blockNumber": 273
},
"421613": {
"address": "0x2Bc1034975c3df48D6f3026802f372677844b85d",
"blockNumber": 46508363
"address": "0x060f3f0915999fa84886f6e993cd95c4b2046b43",
"blockNumber": 58857166
},
"11155111": {
"address": "0xec7F8CF3B3640b1C5E8fD3c208776aad056D4fc3",
Expand Down

0 comments on commit 36dc0ba

Please sign in to comment.