Commit 7cd2a667 authored by Chunchi Che's avatar Chunchi Che

add ActionHistory

parent 56493c78
Pipeline #28898 passed with stages
in 12 minutes and 18 seconds
...@@ -8,7 +8,9 @@ import { AudioActionType, changeScene } from "@/infra/audio"; ...@@ -8,7 +8,9 @@ import { AudioActionType, changeScene } from "@/infra/audio";
import { matStore, SideStage, sideStore } from "@/stores"; import { matStore, SideStage, sideStore } from "@/stores";
import { import {
ActionHistory,
Alert, Alert,
AnnounceModal,
CardListModal, CardListModal,
CardModal, CardModal,
CheckCounterModal, CheckCounterModal,
...@@ -21,10 +23,7 @@ import { ...@@ -21,10 +23,7 @@ import {
SortCardModal, SortCardModal,
YesNoModal, YesNoModal,
} from "./Message"; } from "./Message";
import { AnnounceModal } from "./Message/AnnounceModal"; import { ChatBox, HandChain, LifeBar, Mat, Menu, Underlying } from "./PlayMat";
import { LifeBar, Mat, Menu, Underlying } from "./PlayMat";
import { ChatBox } from "./PlayMat/ChatBox";
import { HandChain } from "./PlayMat/HandChain";
export const loader: LoaderFunction = async () => { export const loader: LoaderFunction = async () => {
// 更新场景 // 更新场景
...@@ -88,6 +87,7 @@ export const Component: React.FC = () => { ...@@ -88,6 +87,7 @@ export const Component: React.FC = () => {
<EndModal /> <EndModal />
<ChatBox /> <ChatBox />
<HandChain /> <HandChain />
<ActionHistory />
</> </>
); );
}; };
......
.root {
:global(.ant-drawer-content-wrapper) {
box-shadow: none;
}
:global(.ant-drawer-content) {
display: flex;
flex-direction: column;
background: #0b0a0a96;
}
}
.drawer {
width: 100%;
right: 10%;
--height: 40rem;
top: calc((100% - var(--height)) / 2);
height: var(--height) !important;
position: relative;
border-radius: 0.375rem;
:global(.ant-drawer-header) {
padding: 1rem 0;
:global(.ant-drawer-header-title) {
flex-direction: row-reverse;
padding-left: 1.5rem;
}
}
}
.container {
position: relative;
height: 100%;
.timeline {
p {
font-family: var(--theme-font);
font-size: 1rem;
}
}
}
import { RightOutlined } from "@ant-design/icons";
import { Drawer, Timeline } from "antd";
import React from "react";
import { proxy, useSnapshot } from "valtio";
import { ScrollableArea } from "@/ui/Shared";
import styles from "./index.module.scss";
const defaultStore = {
isOpen: false,
};
const store = proxy(defaultStore);
export const ActionHistory: React.FC = () => {
const { isOpen } = useSnapshot(store);
return (
<Drawer
open={isOpen}
placement="right"
rootClassName={styles.root}
className={styles.drawer}
mask={false}
closeIcon={<RightOutlined />}
onClose={() => (store.isOpen = false)}
title="操作历史" // TODO: I18N
>
<ScrollableArea className={styles.container} maxHeight="var(--height)">
<Timeline
className={styles.timeline}
items={[
{
color: "red",
children: <p>我方发动灰流丽的效果</p>,
},
{
color: "blue",
children: <p>对方发动墓穴的指名者</p>,
},
]}
/>
</ScrollableArea>
</Drawer>
);
};
export const displayActionHistory = () => (store.isOpen = true);
export * from "./ActionHistory";
export * from "./Alert"; export * from "./Alert";
export * from "./AnnounceModal";
export * from "./CardListModal"; export * from "./CardListModal";
export * from "./CardModal"; export * from "./CardModal";
export * from "./CheckCounterModal"; export * from "./CheckCounterModal";
......
...@@ -2,6 +2,7 @@ import { ...@@ -2,6 +2,7 @@ import {
ArrowRightOutlined, ArrowRightOutlined,
CheckOutlined, CheckOutlined,
CloseCircleFilled, CloseCircleFilled,
FileSearchOutlined,
MessageFilled, MessageFilled,
RobotFilled, RobotFilled,
RobotOutlined, RobotOutlined,
...@@ -37,6 +38,7 @@ import { useTranslation } from "react-i18next"; ...@@ -37,6 +38,7 @@ import { useTranslation } from "react-i18next";
import { getUIContainer } from "@/container/compat"; import { getUIContainer } from "@/container/compat";
import { displayActionHistory } from "../../Message";
import { clearAllIdleInteractivities, clearSelectInfo } from "../../utils"; import { clearAllIdleInteractivities, clearSelectInfo } from "../../utils";
import { openChatBox } from "../ChatBox"; import { openChatBox } from "../ChatBox";
...@@ -349,6 +351,13 @@ export const Menu = () => { ...@@ -349,6 +351,13 @@ export const Menu = () => {
type="text" type="text"
></Button> ></Button>
</DropdownWithTitle> </DropdownWithTitle>
<Tooltip title={i18n("History")}>
<Button
icon={<FileSearchOutlined />}
onClick={displayActionHistory}
type="text"
/>
</Tooltip>
<Tooltip title="AI"> <Tooltip title="AI">
<Button <Button
icon={enableKuriboh ? <RobotFilled /> : <RobotOutlined />} icon={enableKuriboh ? <RobotFilled /> : <RobotOutlined />}
......
export * from "./ChatBox";
export * from "./HandChain";
export * from "./LifeBar"; export * from "./LifeBar";
export * from "./Mat"; export * from "./Mat";
export * from "./Menu"; export * from "./Menu";
......
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
}, },
"Menu": { "Menu": {
"DoYouSurrunder": "是否投降?", "DoYouSurrunder": "是否投降?",
"History": "操作历史",
"Cancel": "取消", "Cancel": "取消",
"Confirm": "确定", "Confirm": "确定",
"SelectPhase": "请选择要进入的阶段", "SelectPhase": "请选择要进入的阶段",
......
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
}, },
"Menu": { "Menu": {
"DoYouSurrunder": "Do you surrender?", "DoYouSurrunder": "Do you surrender?",
"History": "Operation History",
"Cancel": "Cancel", "Cancel": "Cancel",
"Confirm": "Confirm", "Confirm": "Confirm",
"SelectPhase": "Please select the phase", "SelectPhase": "Please select the phase",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment