diff --git a/packages-user/client-modules/src/render/ui/main.tsx b/packages-user/client-modules/src/render/ui/main.tsx index 055ba98..fcd5ac9 100644 --- a/packages-user/client-modules/src/render/ui/main.tsx +++ b/packages-user/client-modules/src/render/ui/main.tsx @@ -117,6 +117,7 @@ const MainScene = defineComponent(() => { magicDef: 0 }); const replayStatus: ReplayingStatus = reactive({ + replaying: false, playing: false, speed: 1, played: 0, @@ -129,7 +130,6 @@ const MainScene = defineComponent(() => { jumpCount: 0, springCount: 0, floor: 'MT0', - replaying: false, replayStatus, night: 0 }); @@ -161,8 +161,8 @@ const MainScene = defineComponent(() => { rightStatus.skillDesc = HeroSkill.getSkillDesc(); rightStatus.night = NightSpecial.getNight(floor); rightStatus.floor = floor; - rightStatus.replaying = core.isReplaying(); const { pausing, speed, toReplay, totalList } = core.status.replay; + replayStatus.replaying = core.isReplaying(); replayStatus.playing = !pausing; replayStatus.speed = speed; replayStatus.played = totalList.length - toReplay.length; diff --git a/packages-user/client-modules/src/render/ui/statusBar.tsx b/packages-user/client-modules/src/render/ui/statusBar.tsx index 03f3529..83657c2 100644 --- a/packages-user/client-modules/src/render/ui/statusBar.tsx +++ b/packages-user/client-modules/src/render/ui/statusBar.tsx @@ -12,12 +12,7 @@ import { transitionedColor } from '../use'; import { linear } from 'mutate-animate'; import { Scroll } from '../components'; import { getArea, MinimapDrawer } from '@motajs/legacy-ui'; -import { - NumpadToolbar, - PlayingToolbar, - ReplayingStatus, - ReplayingToolbar -} from './toolbar'; +import { MixedToolbar, ReplayingStatus } from './toolbar'; import { HeroSkill } from '@user/data-state'; import { openViewMap } from './viewmap'; import { mainUIController } from './controller'; @@ -55,8 +50,6 @@ export interface IRightHeroStatus { springCount: number; /** 当前楼层 */ floor: FloorIds; - /** 是否正在录像播放 */ - replaying: boolean; /** 录像播放状态 */ replayStatus: ReplayingStatus; /** 极昼永夜 */ @@ -216,11 +209,6 @@ export const RightStatusBar = defineComponent>( const font2 = new Font('normal', 16); const minimap = ref(); - const inNumpad = ref(false); - - const onNumpad = () => { - inNumpad.value = !inNumpad.value; - }; const s = p.status; const skill = computed(() => @@ -395,22 +383,10 @@ export const RightStatusBar = defineComponent>( lineWidth={1} zIndex={-20} > - {inNumpad.value ? ( - - ) : s.replaying ? ( - - ) : ( - - )} + ); }; diff --git a/packages-user/client-modules/src/render/ui/toolbar.tsx b/packages-user/client-modules/src/render/ui/toolbar.tsx index c7155e6..dd3c490 100644 --- a/packages-user/client-modules/src/render/ui/toolbar.tsx +++ b/packages-user/client-modules/src/render/ui/toolbar.tsx @@ -145,6 +145,8 @@ export const PlayingToolbar = defineComponent< }, toolbarProps); export interface ReplayingStatus { + /** 是否处在录像播放状态 */ + replaying: boolean; /** 是否正在播放 */ playing: boolean; /** 录像播放速度 */ @@ -378,3 +380,20 @@ export const NumpadToolbar = defineComponent< ); }, toolbarProps); + +export const MixedToolbar = defineComponent(props => { + const inNumpad = ref(false); + + const onNumpad = () => { + inNumpad.value = !inNumpad.value; + }; + + return () => + inNumpad.value ? ( + + ) : props.status.replaying ? ( + + ) : ( + + ); +}, replayingProps);