Add actuator model

This commit is contained in:
2022-03-30 12:34:10 +08:00
parent 873a2a8d0a
commit c811b5b1e5
5 changed files with 148 additions and 7 deletions
+8 -2
View File
@@ -15,7 +15,7 @@ interface ICommandBarProps {
}
@useSetting
@useStatusWithEvent("mouseModChange")
@useStatusWithEvent("mouseModChange", "actuatorStartChange")
class CommandBar extends Component<ICommandBarProps & IMixinSettingProps & IMixinStatusProps> {
render(): ReactNode {
@@ -34,7 +34,13 @@ class CommandBar extends Component<ICommandBarProps & IMixinSettingProps & IMixi
>
<div>
{this.getRenderButton({ iconName: "Save", i18NKey: "Command.Bar.Save.Info" })}
{this.getRenderButton({ iconName: "Play", i18NKey: "Command.Bar.Play.Info" })}
{this.getRenderButton({
iconName: this.props.status?.actuator.start() ? "Pause" : "Play",
i18NKey: "Command.Bar.Play.Info",
click: () => this.props.status ? this.props.status.actuator.start(
!this.props.status.actuator.start()
) : undefined
})}
{this.getRenderButton({
iconName: "HandsFree", i18NKey: "Command.Bar.Drag.Info",
active: mouseMod === MouseMod.Drag,