Skip to content

Commit

Permalink
fix: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Dec 3, 2023
1 parent 7a1c8ed commit acdc563
Show file tree
Hide file tree
Showing 12 changed files with 4,708 additions and 4,701 deletions.
4 changes: 2 additions & 2 deletions packages/client/src/components/Battle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default function Battle(props) {
data.attackerHP = attackerHP
setBattleData(data)
if (battle?.attackerHP == 0) {
duel.current.kill('left')
duel.current.kill('right')
setBattleState(4)
} else {
if (!battle?.isEnd) {
Expand All @@ -224,7 +224,7 @@ export default function Battle(props) {
data.attackerHP = attackerHP
setBattleData(data)
if (battle?.attackerHP == 0) {
duel.current.kill('right')
duel.current.kill('left')
setBattleState(4)
} else {
if (!battle?.isEnd) {
Expand Down
5 changes: 4 additions & 1 deletion packages/client/src/components/PIXIAPP/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ const PIXIAPP = () => {
return [];
})
if (isDelivery(coordinate)) {
onMoveToDelivery();
let path = paths[paths.length - 1];
if (path.x === 4 && path.y === 5) {
onMoveToDelivery();
}
} else {
tryHunt();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/components/Talk/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ const Talk = (props) => {
}
</div>
<div className='text' onClick={() => props.onNext()}>
<div className='step'>{step} / 9</div>
<div className='step'>{step} / 9 <p onClick={skip}>Skip {'>'}</p></div>
<div className='name' style={{marginBottom: '18px'}}>{curPlayer?.name || 'Mistery Duck'}:</div>
<Typewriter text={text} typingSpeed={30} step={step} />
<div style={{position: 'absolute', bottom: '18px', right: '18px', fontSize: '12px', color: 'rgba(255, 255, 255, 0.80)', cursor: 'pointer'}} onClick={skip}>Skip The Tutorial {'>'}</div>
<div style={{position: 'absolute', bottom: '18px', right: '18px', fontSize: '12px', color: 'rgba(255, 255, 255, 0.80)', cursor: 'pointer'}}>Click any button to continue</div>
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions packages/client/src/components/Talk/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
right: 0px;
display: flex;
align-items: center;
p {
margin-left: 50px;
cursor: pointer;
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/components/UserInfoDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface IProps extends IUserInfo {
const UserInfoDialog = (props: IProps) => {

const { visible, onClose, ...rest } = props;
console.log(props)

return (
<div className={`mi-userinfo-dialog ${visible ? '' : 'hidden'}`}>
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/pages/game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ const Game = () => {
return b.oreBalance - a.oreBalance
})

console.log('PlayerSeasonData', PlayerSeasonData)


const curPlayer = players.find(player => player.addr.toLocaleLowerCase() == account.toLocaleLowerCase());
if (curPlayer && curPlayer.state == 0 && percentage == 100) {
Expand Down Expand Up @@ -292,6 +290,7 @@ const Game = () => {
}

const onMoveToDelivery = async () => {
console.log('onMoveToDelivery')
submitGemFun();
}

Expand Down
12 changes: 7 additions & 5 deletions packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,14 @@ const Home = () => {
setModalVisible(true);
}
const toMint = async () => {
console.log(usernameRef.current.value, 'usernameRef.current.value')
if (!usernameRef.current.value) {
message.error('Please input your username');
return;
}
setUsername(usernameRef.current.value);
setModalVisible(false);
mintAndGo();
mintAndGo('', usernameRef.current.value);
}

const handleKeyUp = (e) => {
Expand Down Expand Up @@ -236,12 +237,13 @@ const Home = () => {
))
}

const mintAndGo = async (type) => {
const mintAndGo = async (type, uName) => {
console.log('mintAndGo')
if (syncprogress?.percentage != 100) {
message.error('Waiting for sync...');
return;
}
if (!username) {
if (!username && !uName) {
createWallet();
return;
}
Expand Down Expand Up @@ -297,11 +299,11 @@ const Home = () => {
head,
}

let player = Object.assign(playerData, {username, clothes, handheld, head, userUrl: url.image, lootUrl: lootUrl.image})
let player = Object.assign(playerData, {username: username || uName, clothes, handheld, head, userUrl: url.image, lootUrl: lootUrl.image})
console.log(player, 'player')
// localStorage.setItem('playerInfo', JSON.stringify(toObject(player)));

let result = await Promise.all([setInfo(username, ''), joinBattlefield()])
let result = await Promise.all([setInfo(player.username, ''), joinBattlefield()])
console.log(result, 'result')
setMinting(false);
navigate('/game', {
Expand Down
Loading

0 comments on commit acdc563

Please sign in to comment.