aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-05-16 08:45:46 -0400
committerbobzel <zzzman@gmail.com>2022-05-16 08:45:46 -0400
commit671e2a8265412deaf7e9ae93b38d36a2b6d87598 (patch)
tree87333de0ca5995af9dab3abfb55486cbe4ad8056 /src
parent444f5b91f28e12ab9d48c5445eb02021a6a563a1 (diff)
re-added fwd/back animation buttons
Diffstat (limited to 'src')
-rw-r--r--src/client/util/CurrentUserUtils.ts37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 9720343e1..78bf531c6 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -16,11 +16,13 @@ import { DocServer } from "../DocServer";
import { Docs, DocumentOptions, DocUtils } from "../documents/Documents";
import { DocumentType } from "../documents/DocumentTypes";
import { CollectionDockingView } from "../views/collections/CollectionDockingView";
+import { CollectionFreeFormView } from "../views/collections/collectionFreeForm";
import { CollectionView, CollectionViewType } from "../views/collections/CollectionView";
import { TreeView } from "../views/collections/TreeView";
import { Colors } from "../views/global/globalEnums";
import { MainView } from "../views/MainView";
import { ButtonType, NumButtonType } from "../views/nodes/button/FontIconBox";
+import { CollectionFreeFormDocumentView } from "../views/nodes/CollectionFreeFormDocumentView";
import { FormattedTextBox } from "../views/nodes/formattedText/FormattedTextBox";
import { OverlayView } from "../views/OverlayView";
import { DocumentManager } from "./DocumentManager";
@@ -992,6 +994,14 @@ export class CurrentUserUtils {
script: 'setView(value, _readOnly_)',
}, // Always show
{
+ title: "back", toolTip: "prev", width: 20, btnType: ButtonType.ClickButton, click: 'prevKeyFrame()', icon: "chevron-left",
+ hidden: 'IsNoviceMode()'
+ },
+ {
+ title: "Forward", toolTip: "next", width: 20, btnType: ButtonType.ClickButton, click: 'nextKeyFrame()', icon: "chevron-right",
+ hidden: 'IsNoviceMode()'
+ },
+ {
title: "Background Color", toolTip: "Background Color", btnType: ButtonType.ColorButton, ignoreClick: true, icon: "fill-drip",
script: "setBackgroundColor(value, _readOnly_)", hidden: 'selectedDocumentType()'
}, // Only when a document is selected
@@ -1588,4 +1598,29 @@ ScriptingGlobals.add(function makeTopLevelFolder() {
});
ScriptingGlobals.add(function toggleComicMode() {
Doc.UserDoc().renderStyle = Doc.UserDoc().renderStyle === "comic" ? undefined : "comic";
-}); \ No newline at end of file
+});
+ScriptingGlobals.add(function nextKeyFrame() {
+ const sel = SelectionManager.Views()[0];
+ const col = (sel.ComponentView as CollectionFreeFormView);
+ const currentFrame = Cast(sel.props.Document._currentFrame, "number", null);
+ if (currentFrame === undefined) {
+ sel.props.Document._currentFrame = 0;
+ CollectionFreeFormDocumentView.setupKeyframes(col.childDocs, 0);
+ }
+ CollectionFreeFormDocumentView.updateKeyframe(col.childDocs, currentFrame || 0);
+ sel.rootDoc._currentFrame = Math.max(0, (currentFrame || 0) + 1);
+ sel.rootDoc.lastFrame = Math.max(NumCast(sel.rootDoc._currentFrame), NumCast(sel.rootDoc.lastFrame));
+}
+);
+ScriptingGlobals.add(function prevKeyFrame() {
+ const sel = SelectionManager.Views()[0];
+ const col = (sel.ComponentView as CollectionFreeFormView);
+ const currentFrame = Cast(sel.props.Document._currentFrame, "number", null);
+ if (currentFrame === undefined) {
+ sel.props.Document._currentFrame = 0;
+ CollectionFreeFormDocumentView.setupKeyframes(col.childDocs, 0);
+ }
+ CollectionFreeFormDocumentView.gotoKeyframe(col.childDocs.slice());
+ sel.rootDoc._currentFrame = Math.max(0, (currentFrame || 0) - 1);
+}
+); \ No newline at end of file