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); } }
public override void Init() { try { if (containingAtom.type != "Person") { SuperController.LogError("Please add Doll Master to a Person atom"); return; } lastAtomName = containingAtom.uid; PLUGIN_PATH = GetPluginPath(); ASSETS_PATH = PLUGIN_PATH + "/Assets"; VAMASUTRA_PATH = ASSETS_PATH + "/VAMasutra"; LOAD_PATH = SuperController.singleton.currentLoadDir; headAudioSource = containingAtom.GetStorableByID("HeadAudioSource") as AudioSourceControl; RegisterActions(); ui = new UI(this, 0.001f); ui.canvas.transform.Translate(0, 0.2f, 0); config = new Config(this); personas = new Personas(this); ps = new PluginState(this); arousal = new Arousal(this); expressions = new Expressions(this); expressionController = new ExpressionController(this); sfxController = new SFXController(this); thrustController = new ThrustController(this); thrustAutoController = new ThrustAutoController(this); breathController = new BreathController(this); headController = new HeadController(this); poseController = new PoseController(this); montageController = new MontageController(this, poseController); dressController = new DressController(this); climaxController = new ClimaxController(this); kissController = new KissController(this); new TopButtons(this); //new WorldUI(this); CreateSpacer().height = 200; //SuperController singleton = SuperController.singleton; //singleton.onAtomUIDRenameHandlers = (SuperController.OnAtomUIDRename)Delegate.Combine(singleton.onAtomUIDRenameHandlers, new SuperController.OnAtomUIDRename(HandleRename)); } catch (Exception e) { SuperController.LogError("Exception caught: " + e); } }