Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
b077b9f2
Commit
b077b9f2
authored
Feb 12, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mora v2
parent
12f150aa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
94 deletions
+53
-94
src/styles/_mora.scss
src/styles/_mora.scss
+0
-12
src/styles/_wait-room.scss
src/styles/_wait-room.scss
+0
-21
src/styles/core.scss
src/styles/core.scss
+1
-3
src/ui/Mora.tsx
src/ui/Mora.tsx
+50
-56
src/ui/Neos.tsx
src/ui/Neos.tsx
+2
-2
No files found.
src/styles/_mora.scss
deleted
100644 → 0
View file @
12f150aa
.mora_container
{
display
:
flex
;
margin
:
auto
;
padding
:
0
;
}
.item
{
text-align
:
center
;
flex
:
1
;
margin
:
auto
;
padding
:
10%
;
}
src/styles/_wait-room.scss
deleted
100644 → 0
View file @
12f150aa
.wait_container
{
display
:
flex
;
margin
:
auto
;
padding
:
0
;
}
.playerRegion
{
text-align
:
center
;
flex
:
1
;
margin
:
auto
;
padding
:
10%
;
}
.roomRegion
{
flex
:
1
;
margin
:
auto
;
padding
:
10%
;
}
.roomRegion
>
p
{
text-align
:
start
;
}
src/styles/core.scss
View file @
b077b9f2
...
...
@@ -52,9 +52,7 @@ url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css")
"commom"
,
"header"
,
"login-form"
,
"sign-in"
,
"wait-room"
,
"mora"
;
"sign-in"
;
*
{
...
...
src/ui/Mora.tsx
View file @
b077b9f2
/*
* 猜拳页面
*
* */
import
React
from
"
react
"
;
import
{
sendHandResult
,
sendTpResult
}
from
"
../api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
../hook
"
;
...
...
@@ -12,23 +7,17 @@ import {
selectTpSelectAble
,
unSelectTpAble
,
}
from
"
../reducers/moraSlice
"
;
import
{
selectPlayer0
,
selectPlayer1
}
from
"
../reducers/playerSlice
"
;
import
{
selectDuelHsStart
}
from
"
../reducers/duel/mod
"
;
import
{
store
}
from
"
../store
"
;
import
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
Button
}
from
"
antd
"
;
import
"
../styles/core.scss
"
;
import
{
Button
,
Modal
}
from
"
antd
"
;
// TODO: 应该展示聊天信息
export
default
function
Mora
()
{
const
Mora
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
selectHandAble
=
useAppSelector
(
selectHandSelectAble
);
const
selectTpAble
=
useAppSelector
(
selectTpSelectAble
);
const
player0
=
useAppSelector
(
selectPlayer0
);
const
player1
=
useAppSelector
(
selectPlayer1
);
const
duelHsStart
=
useAppSelector
(
selectDuelHsStart
);
const
navigate
=
useNavigate
();
useEffect
(()
=>
{
...
...
@@ -38,58 +27,63 @@ export default function Mora() {
}
},
[
duelHsStart
]);
const
handleSelect
Scissors
=
(
)
=>
{
sendHandResult
(
"
scissors
"
);
const
handleSelect
Mora
=
(
selected
:
string
)
=>
{
sendHandResult
(
selected
);
dispatch
(
unSelectHandAble
());
};
const
handleSelectRock
=
()
=>
{
sendHandResult
(
"
rock
"
);
dispatch
(
unSelectHandAble
());
};
const
handleSelectPaper
=
()
=>
{
sendHandResult
(
"
paper
"
);
dispatch
(
unSelectHandAble
());
};
const
handleSelectFirst
=
()
=>
{
sendTpResult
(
true
);
dispatch
(
unSelectTpAble
());
};
const
handleSelectSecond
=
()
=>
{
sendTpResult
(
false
);
const
handleSelectTp
=
(
isFirst
:
boolean
)
=>
{
sendTpResult
(
isFirst
);
dispatch
(
unSelectTpAble
());
};
return
(
<
div
className=
"mora_container"
>
<
div
className=
"item"
>
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
handleSelectScissors
}
>
scissors
<>
<
Modal
open=
{
selectHandAble
}
footer=
{
<></>
}
>
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
()
=>
{
handleSelectMora
(
"
scissors
"
);
}
}
>
剪刀
</
Button
>
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
handleSelectRock
}
>
rock
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
()
=>
{
handleSelectMora
(
"
rock
"
);
}
}
>
石头
</
Button
>
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
handleSelectPaper
}
>
paper
<
Button
disabled=
{
!
selectHandAble
}
onClick=
{
()
=>
{
handleSelectMora
(
"
paper
"
);
}
}
>
布
</
Button
>
</
div
>
<
div
className=
"item"
>
<
Button
disabled=
{
!
selectTpAble
}
onClick=
{
handleSelectFirst
}
>
first
</
Modal
>
<
Modal
open=
{
!
selectHandAble
&&
selectTpAble
}
footer=
{
<></>
}
>
<
Button
disabled=
{
!
selectTpAble
}
onClick=
{
()
=>
{
handleSelectTp
(
true
);
}
}
>
先攻
</
Button
>
<
Button
disabled=
{
!
selectTpAble
}
onClick=
{
handleSelectSecond
}
>
second
<
Button
disabled=
{
!
selectTpAble
}
onClick=
{
()
=>
{
handleSelectTp
(
false
);
}
}
>
后攻
</
Button
>
</
div
>
<
div
className=
"item"
>
<
p
>
Me: main=
{
player0
.
deckInfo
?.
mainCnt
}
, extra=
{
player0
.
deckInfo
?.
extraCnt
}
, side=
{
player0
.
deckInfo
?.
sideCnt
}
</
p
>
<
p
>
Me: main=
{
player1
.
deckInfo
?.
mainCnt
}
, extra=
{
player1
.
deckInfo
?.
extraCnt
}
, side=
{
player1
.
deckInfo
?.
sideCnt
}
</
p
>
</
div
>
</
div
>
</
Modal
>
</>
);
}
};
export
default
Mora
;
src/ui/Neos.tsx
View file @
b077b9f2
import
React
from
"
react
"
;
import
JoinRoom
from
"
./JoinRoom
"
;
import
WaitRoomV2
from
"
./WaitRoom
"
;
import
MoraV2
from
"
./Mora
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
Mora
from
"
./Mora
"
;
import
NeosDuel
from
"
./Duel/main
"
;
export
default
function
()
{
...
...
@@ -11,7 +11,7 @@ export default function () {
<
Routes
>
<
Route
path=
"/"
element=
{
<
JoinRoom
/>
}
/>
<
Route
path=
"/:player/:passWd/:ip"
element=
{
<
WaitRoomV2
/>
}
/>
<
Route
path=
"/mora"
element=
{
<
Mora
/>
}
/>
<
Route
path=
"/mora"
element=
{
<
Mora
V2
/>
}
/>
<
Route
path=
"/duel"
element=
{
<
NeosDuel
/>
}
/>
</
Routes
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment