Ejemplo n.º 1
0
        public override bool Run()
        {
            List <ObjectListPickerInfo> Entries = ListExpressions();
            string text = (string)ObjectListPickerDialog.Show("Expression", Entries);

            if (text != null && text != "")
            {
                ReactionTypes reaction = (ReactionTypes)Enum.Parse(typeof(ReactionTypes), text);

                Array             reactionTypes = Enum.GetValues(typeof(ReactionTypes));
                CustomOverlayData data          = null;
                CmoPoseBox        box           = PoseManager.FindPoseBox();
                string            poseData      = PoseManager.GetCurrentPose(Actor);
                if (poseData == null)
                {
                    return(false);
                }
                Actor.LookAtManager.DisableLookAts();
                PoseManager.SetCurrentPose(Actor, poseData);
                box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);//OverlayUpperbody);
                StateMachineClient stateMachineClient = StateMachineClient.Acquire(Actor.ObjectId, "facial_idle", AnimationPriority.kAPDefault, true);
                data = (CustomOverlayData)OverlayComponent.GetOverlayData(reaction, Actor);


                stateMachineClient.UseActorBridgeOrigins = false;
                stateMachineClient.SetActor("x", Actor);
                stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.InteractionPartLevelCallback));
                stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.ClearInteractionPartLevelCallback));
                stateMachineClient.EnterState("x", "Enter");
                stateMachineClient.SetProductVersion(data.ProductVersion);
                stateMachineClient.RequestState("x", data.AnimClipName);
                //Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);

                box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();

                Actor.WaitForExitReason(3.40282347E+38f, ExitReason.UserCanceled);
                Actor.LookAtManager.EnableLookAts();
                return(true);
            }
            return(false);
        }