void RegisterActions() { JSONStorableAction emotionTrigger = new JSONStorableAction("emotionTrigger", () => { ForcePlayExpression(); }); RegisterAction(emotionTrigger); CreateButton("Test Emotion Trigger", true).button.onClick.AddListener(() => { emotionTrigger.actionCallback(); }); JSONStorableAction climaxTrigger = new JSONStorableAction("climaxTrigger", () => { arousal.MaxOut(); }); RegisterAction(climaxTrigger); CreateButton("Test Climax Trigger", true).button.onClick.AddListener(() => { climaxTrigger.actionCallback(); }); CreateSpacer(true); CreateButton("Zero Pose Morphs", true).button.onClick.AddListener(() => { ExpressionController.ZeroPoseMorphs(containingAtom); }); }
public static void BeginMontage(DollmasterPlugin dm, JSONNode montageJSON) { dm.poseController.StopCurrentAnimation(); JSONArray atoms = montageJSON["atoms"].AsArray; JSONClass person1Pose = null; JSONClass person2Pose = null; for (int i = 0; i < atoms.Count; i++) { JSONClass atomObj = atoms[i].AsObject; string id = atomObj["id"].Value; if (id == "Person") { person1Pose = atomObj; } if (id == "Person#2") { person2Pose = atomObj; } } Atom atom = dm.containingAtom; if (person1Pose != null) { atom.PreRestore(); atom.RestoreTransform(person1Pose); atom.Restore(person1Pose, restorePhysical: true, restoreAppearance: false, restoreCore: false); atom.LateRestore(person1Pose, restorePhysical: true, restoreAppearance: false, restoreCore: false); atom.PostRestore(); } Atom otherPerson = DollmasterPlugin.GetSomeoneElse(atom); if (person2Pose != null && otherPerson != null) { otherPerson.PreRestore(); otherPerson.RestoreTransform(person2Pose); otherPerson.Restore(person2Pose, restorePhysical: true, restoreAppearance: false, restoreCore: false); otherPerson.LateRestore(person2Pose, restorePhysical: true, restoreAppearance: false, restoreCore: false); otherPerson.PostRestore(); } SuperController.singleton.PauseSimulation(5, "Loading Sutra"); dm.thrustController.Clear(); dm.thrustController.GenerateThrustAtoms(); ExpressionController.ZeroPoseMorphs(atom); if (otherPerson != null) { ExpressionController.ZeroPoseMorphs(otherPerson); } }