public static string GetPanFunction(TransitionMode transitionMode, TransitionVideo transitionVideo)
        {
            switch (transitionMode)
            {
            case TransitionMode.ToRight:
                if (transitionVideo == TransitionVideo.First)
                {
                    return("PanFromCenterToRight");
                }
                if (transitionVideo == TransitionVideo.Last)
                {
                    return("PanFromLeftToCenter");
                }
                break;

            case TransitionMode.ToLeft:
                if (transitionVideo == TransitionVideo.First)
                {
                    return("PanFromCenterToLeft");
                }
                if (transitionVideo == TransitionVideo.Last)
                {
                    return("PanFromRightToCenter");
                }
                break;

            default:
                return(String.Empty);
            }
            return(String.Empty);
        }
Esempio n. 2
0
 public void StartTransitionOut()
 {
     animating      = true;
     transitionTime = 0;
     transitionDone = false;
     mode           = TransitionMode.TM_Out;
 }
Esempio n. 3
0
        private void ChangeScene(Type type, TransitionMode useTransiiton, bool pushToStack, object[] args)
        {
            m_type = type;
            m_args = args;

            if (pushToStack)
            {
                // Push the scene we're changing from into the history.
                m_sceneStack.Push(m_currentScene);

                // Track the new scene.
                m_currentScene = new SceneInfo
                {
                    SceneType      = type,
                    TransitionMode = useTransiiton,
                    Args           = args
                };
            }

            if (m_transitionManager == null || useTransiiton == TransitionMode.Off)
            {
                OnTransitionInFinished();
            }
            else
            {
                m_transitionManager.StartTransition();
            }
        }
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            SerializedProperty modeProperty = property.FindPropertyRelative("Mode");
            TransitionMode     mode         = (TransitionMode)Enum.Parse(typeof(TransitionMode), modeProperty.enumNames[modeProperty.enumValueIndex], true);

            float line       = EditorGUIUtility.singleLineHeight;
            float baseHeight = line * 3;

            switch (mode)
            {
            case TransitionMode.Position:
                return(baseHeight + line * 3 + EditorGUI.GetPropertyHeight(SerializedPropertyType.Vector2, null) * 2);

            case TransitionMode.Rotation:
            case TransitionMode.Scale:
                return(baseHeight + line * 3 + EditorGUI.GetPropertyHeight(SerializedPropertyType.Vector3, null) * 2);

            case TransitionMode.Color:
                return(baseHeight + line * 5);

            case TransitionMode.Alpha:
                return(baseHeight + line * 4);

            case TransitionMode.Animation:
                return(baseHeight + line * 2);

            default:
                return(baseHeight);
            }
        }
Esempio n. 5
0
    //IEnumerator DelayedOnSceneLoadedParticles(Scene scene)
    //{
    //    //yield return new WaitForEndOfFrame();
    //    yield return null;
    //    yield return new WaitForEndOfFrame();


    //}

    void OnSceneUnloading(Scene scene, string nextScene)
    {
        if (nextScene == "Credits")
        {
            transitionMode = TransitionMode.Particle;
        }
        else if (scene.name == "MainGame")
        {
            return;
        }
        else
        {
            transitionMode = TransitionMode.Dissolve;
        }
        if (transitionEffect == null)
        {
            InitTransitionComponent();
        }

        //Workaround capturing UI - Not Working
        //Canvas canvas = FindObjectOfType<Canvas>();
        //if (canvas != null)
        //{
        //    RenderMode pre = canvas.renderMode;
        //    if(pre != RenderMode.ScreenSpaceCamera)
        //    {
        //        canvas.renderMode = RenderMode.ScreenSpaceCamera;
        //        canvas.planeDistance = 0.7f;

        //    }
        //}

        transitionEffect.Capture(ref LastSceneRenderTexture, mainCam);
    }
Esempio n. 6
0
    public void Show(TransitionMode mode)
    {
        Setup();
        if (panel == null)
        {
            Debug.LogError("[Transition] UIPanel not found");
            return;
        }

        this.gameObject.SetActive(true);
        if (mode == TransitionMode.EaseIn)
        {
            bShowing = true;
            bDone    = false;
            if (bFirstTime)
            {
                bFirstTime = false;
                tween.ResetToBeginning();
            }
            tween.Play(false);
        }
        else if (mode == TransitionMode.EaseOut)
        {
            panel.alpha = 1;
            bShowing    = false;
            bDone       = false;
            if (bFirstTime)
            {
                bFirstTime = false;
                tween.ResetToBeginning();
            }
            tween.PlayForward();
        }
        tween.enabled = true;
    }
Esempio n. 7
0
 public void Lift()
 {
     source.PlayOneShot(clips.ChooseRandom());
     transitioning = true;
     mode          = TransitionMode.In;
     orgColor      = hex.GetOutlineColor();
     hex.SetOutlineColor(orangeColor);
 }
Esempio n. 8
0
    public void StartTransition(TransitionMode g_trasitionMode)
    {
        myTransitionMode = g_trasitionMode;

        myNextScene = "";
        //		myGrapeAnimator.SetBool ("isGrape", true);
        TransitionOut();
    }
Esempio n. 9
0
    public void StartTransition(string g_scene)
    {
        myTransitionMode = TransitionMode.Normal;

        myNextScene = g_scene;
        //		myGrapeAnimator.SetBool ("isGrape", true);
        TransitionOut();
    }
Esempio n. 10
0
 private void Awake()
 {
     button.onClick.AddListener(() => {
         mode          = mode == TransitionMode.In ? TransitionMode.Out : TransitionMode.In;
         transitioning = true;
         triangleImage.localRotation = mode == TransitionMode.In ? Quaternion.Euler(0, 0, 0) : Quaternion.Euler(180, 0, 0);
     });
 }
Esempio n. 11
0
 private void FinishTransition()
 {
     this.IsTransitioning       = false;
     this.TransitionTimeElapsed = TimeSpan.FromTicks(0);
     this.TransitionMode        = 0;
     //if(this.PoppedStateTransitionRender != null && !this.PoppedStateTransitionRender.IsDisposed)
     //	this.PoppedStateTransitionRender.Dispose();
 }
Esempio n. 12
0
 public void SetTransitionMode(string a_transitionMode)
 {
     try {
         CurTransitionMode = (TransitionMode)System.Enum.Parse(typeof(TransitionMode), a_transitionMode);
     } catch (System.ArgumentException) {
         Debug.LogErrorFormat("Unknown transition mode {0} in song manager.", a_transitionMode);
         return;
     }
 }
Esempio n. 13
0
        /// <summary>
        /// Initializes the tooltip; this is separate from Start in case SetText is called externally before Start gets a chance to run
        /// </summary>
        private void Initialize()
        {
            if (canvasToBeAttachedTo == null)
            {
                canvasToBeAttachedTo = gameObject.GetComponentInParents <Canvas>();
            }

            if (anchorMode == AnchorMode.AttachedToCursor)
            {
                if (cameraThatRendersCanvas == null)
                {
                    if (cameraThatRendersCanvasName != null && cameraThatRendersCanvasName != "")
                    {
                        cameraThatRendersCanvas = GameObject.Find(cameraThatRendersCanvasName).GetComponent <Camera>();
                    }
                    else
                    {
                        cameraThatRendersCanvas = Camera.main;
                    }
                }

                tooltipInstance = Instantiate(tooltipPrefab, canvasToBeAttachedTo.transform).GetComponent <TooltipPrefab>();
                if (transitionMode == TransitionMode.ShiftDown || transitionMode == TransitionMode.ShiftUp)
                {
                    transitionMode = TransitionMode.Fade;
                }
            }

            else
            {
                tooltipInstance = Instantiate(tooltipPrefab, GetComponent <RectTransform>()).GetComponent <TooltipPrefab>();
            }

            tooltipInstanceParent = tooltipInstance.transform.parent;
            isActive = tooltipInstance.gameObject.activeSelf;
            SetActive(false, TransitionMode.None);
            isInitialized = true;

            // Override sizing/anchors in prefab in case they may conflict with tooltipping system
            // Padding is a serialized variable, the anchor for text must be vertical+horizontal stretch for it to work properly
            tooltipInstance.Text.rectTransform.offsetMin = new Vector2(tooltipPadding.w, tooltipPadding.z);
            tooltipInstance.Text.rectTransform.offsetMax = new Vector2(-tooltipPadding.y, -tooltipPadding.x);
            tooltipInstance.Text.rectTransform.anchorMin = new Vector2(0, 0);
            tooltipInstance.Text.rectTransform.anchorMax = new Vector2(1, 1);

            // Ensure arrow and container are set to center+center so that positioning is correct
            tooltipInstance.RTransform.anchorMin = new Vector2(0.5f, 0.5f);
            tooltipInstance.RTransform.anchorMax = new Vector3(0.5f, 0.5f);

            if (tooltipInstance.ArrowEnabled)
            {
                tooltipInstance.Arrow.rectTransform.anchorMin = new Vector2(0.5f, 0.5f);
                tooltipInstance.Arrow.rectTransform.anchorMax = new Vector2(0.5f, 0.5f);
            }

            tooltipInstance.Initialize(this);
        }
 public StaticTransitionScreen(TransitionMode mode, float transitionTime, Action onTransitionFinished, bool automaticallyPopWhenFinished = true)
 {
     DrawPreviousScreen = true;
     staticTransitionTime = transitionTime;
     transitionDirection = (mode == TransitionMode.ToStatic) ? 1 : -1;
     staticAlpha = (mode == TransitionMode.ToStatic) ? (byte)0 : byte.MaxValue;
     this.onTransitionFinished = onTransitionFinished;
     this.automaticallyPopWhenFinished = automaticallyPopWhenFinished;
 }
Esempio n. 15
0
 public void Reset()
 {
     transitioning = true;
     if (ellapsedDuration == 0)
     {
         ellapsedDuration = raiseDuration;
     }
     mode = TransitionMode.Out;
     hex.SetOutlineColor(orgColor);
 }
Esempio n. 16
0
 private void TransitionToNotOn()
 {
     transitionProgress -= Time.deltaTime * (1f / transitionSpeed);
     image.fillAmount    = transitionProgress;
     if (transitionProgress <= 0f)
     {
         isDone         = true;
         transitionMode = TransitionMode.NotOn;
     }
 }
Esempio n. 17
0
    public void ManualBeforeSceneUnloading()
    {
        transitionMode = TransitionMode.Particle;
        if (transitionEffect == null)
        {
            InitTransitionComponent();
        }

        transitionEffect.Capture(ref LastSceneRenderTexture, mainCam);
    }
Esempio n. 18
0
 public static void StartTransition(string SceneName)
 {
     if (eTransitionMode == TransitionMode.FadingIn)
     {
         return;
     }
     eTransitionMode   = TransitionMode.FadingIn;
     TransitionElapsed = 1.0f;
     SceneToLoad       = SceneName;
 }
Esempio n. 19
0
 protected override void RenderTransition(RenderTarget2D From, RenderTarget2D To, TransitionMode Mode, TimeSpan Elapsed)
 {
     float ToLerp = Math.Min(Elapsed.Ticks / TotalTime.Ticks, 1);
     float FromLerp = 1.0f - ToLerp;
     SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
     if(From != null)
         SpriteBatch.Draw(From, new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), new Color(1f, 1f, 1f, 1f - FromLerp));
     if(To != null)
         SpriteBatch.Draw(To, new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), new Color(1f, 1f, 1f, 1f - ToLerp));
     SpriteBatch.End();
 }
Esempio n. 20
0
 public UIShowHideController(GameObject go, Component panel, TransitionMode animationMode = TransitionMode.Trigger)
 {
     this.panel    = panel;
     this.animator = (go != null) ? go.GetComponent <Animator>() : null;
     if (animator == null && panel != null)
     {
         animator = panel.GetComponent <Animator>();
     }
     this.animCoroutine  = null;
     this.transitionMode = animationMode;
 }
Esempio n. 21
0
 public override void HandleSwitchWorld(bool inAlternateWorld)
 {
     isDone = false;
     if (inAlternateWorld)
     {
         transitionMode = TransitionMode.TransitionToOn;
     }
     else
     {
         transitionMode = TransitionMode.TransitionToNotOn;
     }
 }
Esempio n. 22
0
 public static float GetEasing(TransitionMode easing, float t)
 {
     return(easing switch
     {
         TransitionMode.Smooth => MathUtils.SmoothStep(t),
         TransitionMode.Smoother => MathUtils.SmootherStep(t),
         TransitionMode.EaseIn => MathUtils.EaseIn(t),
         TransitionMode.EaseOut => MathUtils.EaseOut(t),
         TransitionMode.Exponential => t * t,
         TransitionMode.Linear => t,
         _ => t,
     });
Esempio n. 23
0
 public void Transition(string sceneName)
 {
     if (transitioning)
     {
         return;
     }
     toLoad               = sceneName;
     mode                 = TransitionMode.Out;
     ellapsedTime         = 0;
     transitioning        = true;
     group.interactable   = true;
     group.blocksRaycasts = true;
 }
Esempio n. 24
0
 public UIShowHideController(GameObject gameObjectToControl, Component panelToControl, TransitionMode animationMode = TransitionMode.Trigger, bool debug = false)
 {
     panel      = panelToControl;
     m_animator = (gameObjectToControl != null) ? gameObjectToControl.GetComponent <Animator>() : null;
     if (m_animator == null && panelToControl != null)
     {
         m_animator = panelToControl.GetComponent <Animator>();
     }
     state            = State.Undefined;
     m_transitionMode = animationMode;
     m_animCoroutine  = null;
     this.debug       = debug;
 }
Esempio n. 25
0
 private void BeginTransition(TransitionMode Mode)
 {
     if (IsTransitioning)
     {
         FinishTransition();
     }
     this.IsTransitioning       = true;
     this.TransitionTimeElapsed = TimeSpan.FromTicks(0);
     this.TransitionMode        = Mode;
     // Should probably copy to a texture, but we'll just use RenderTarget and prevent dispose instead.
     //this.PoppedStateTransitionRender = PoppedStateRender;
     //RecreateRenderTarget(ref PoppedStateRender, false);
 }
Esempio n. 26
0
 public UIShowHideController(GameObject gameObjectToControl, Component panelToControl, TransitionMode animationMode = TransitionMode.Trigger, bool debug = false)
 {
     panel      = panelToControl;
     m_animator = (gameObjectToControl != null) ? gameObjectToControl.GetComponent <Animator>() : null;
     if (m_animator == null && panelToControl != null)
     {
         m_animator = panelToControl.GetComponent <Animator>();
     }
     state            = (m_animator != null && m_animator.gameObject.activeInHierarchy) ? State.Shown: State.Hidden;
     m_transitionMode = animationMode;
     m_animCoroutine  = null;
     this.debug       = debug;
 }
Esempio n. 27
0
    private void TransitionToNotOn()
    {
        // Set transition progress
        transitionProgress       -= Time.deltaTime * (1f / transitionSpeed);
        vignette.intensity.value  = transitionProgress;
        vignette.smoothness.value = transitionProgress;

        // Doneness checks
        if (transitionProgress <= 0f)
        {
            isDone         = true;
            transitionMode = TransitionMode.NotOn;
        }
    }
Esempio n. 28
0
    //bool val = false;

    //public TransitionMode mode = TransitionMode.ScaleIn;

    public void Animate(TransitionMode mode)
    {
        switch (mode)
        {
        case TransitionMode.SlideLeft: {
            StartCoroutine("SlideLeft");
            break;
        }

        case TransitionMode.SlideRight: {
            StartCoroutine("SlideRight");
            break;
        }

        case TransitionMode.SlideUp: {
            StartCoroutine("SlideUp");
            break;
        }

        case TransitionMode.SlideDown: {
            StartCoroutine("SlideDown");
            break;
        }

        case TransitionMode.FadeIn: {
            StartCoroutine("FadeIn");
            break;
        }

        case TransitionMode.FadeOut: {
            StartCoroutine("FadeOut");
            break;
        }

        case TransitionMode.ScaleIn: {
            StartCoroutine("ScaleIn");
            break;
        }

        case TransitionMode.ScaleOut: {
            StartCoroutine("ScaleOut");
            break;
        }

        case TransitionMode.Null: {
            break;
        }
        }
    }
        public UISprite(XElement element)
        {
            Sprite = new Sprite(element);
            MaintainAspectRatio       = element.GetAttributeBool("maintainaspectratio", false);
            MaintainBorderAspectRatio = element.GetAttributeBool("maintainborderaspectratio", false);
            Tile         = element.GetAttributeBool("tile", true);
            CrossFadeIn  = element.GetAttributeBool("crossfadein", CrossFadeIn);
            CrossFadeOut = element.GetAttributeBool("crossfadeout", CrossFadeOut);
            string transitionMode = element.GetAttributeString("transition", string.Empty);

            if (Enum.TryParse(transitionMode, ignoreCase: true, out TransitionMode transition))
            {
                TransitionMode = transition;
            }

            Vector4 sliceVec = element.GetAttributeVector4("slice", Vector4.Zero);

            if (sliceVec != Vector4.Zero)
            {
                minBorderScale = element.GetAttributeFloat("minborderscale", 0.1f);
                maxBorderScale = element.GetAttributeFloat("minborderscale", 10.0f);

                Rectangle slice = new Rectangle((int)sliceVec.X, (int)sliceVec.Y, (int)(sliceVec.Z - sliceVec.X), (int)(sliceVec.W - sliceVec.Y));

                Slice  = true;
                Slices = new Rectangle[9];

                //top-left
                Slices[0] = new Rectangle(Sprite.SourceRect.Location, slice.Location - Sprite.SourceRect.Location);
                //top-mid
                Slices[1] = new Rectangle(slice.Location.X, Slices[0].Y, slice.Width, Slices[0].Height);
                //top-right
                Slices[2] = new Rectangle(slice.Right, Slices[0].Y, Sprite.SourceRect.Right - slice.Right, Slices[0].Height);

                //mid-left
                Slices[3] = new Rectangle(Slices[0].X, slice.Y, Slices[0].Width, slice.Height);
                //center
                Slices[4] = slice;
                //mid-right
                Slices[5] = new Rectangle(Slices[2].X, slice.Y, Slices[2].Width, slice.Height);

                //bottom-left
                Slices[6] = new Rectangle(Slices[0].X, slice.Bottom, Slices[0].Width, Sprite.SourceRect.Bottom - slice.Bottom);
                //bottom-mid
                Slices[7] = new Rectangle(Slices[1].X, slice.Bottom, Slices[1].Width, Sprite.SourceRect.Bottom - slice.Bottom);
                //bottom-right
                Slices[8] = new Rectangle(Slices[2].X, slice.Bottom, Slices[2].Width, Sprite.SourceRect.Bottom - slice.Bottom);
            }
        }
Esempio n. 30
0
        public PushBlur(List <TrackEvent> SelectedMedias, Vegas vegas, TransitionMode TransitionMode)
        {
            selectedMedias = SelectedMedias;
            myVegas        = vegas;
            transitionMode = TransitionMode;

            group1 = selectedMedias[0].Group;
            group2 = selectedMedias[1].Group;

            if (Config.DebugMode)
            {
                MessageBox.Show($"group1 events = {group1.Count}");
                MessageBox.Show($"group2 events = {group2.Count}");
            }
        }
Esempio n. 31
0
        public TransitionMessage(Type windowType, ViewModel transitionViewModel, TransitionMode mode, string messageKey)
            : base(messageKey)
        {
            Mode = mode;
            TransitionViewModel = transitionViewModel;

            if (windowType != null)
            {
                if (!windowType.IsSubclassOf(typeof(Window)))
                {
                    throw new ArgumentException("windowType need Window based.", nameof(windowType));
                }
            }

            WindowType = windowType;
        }
Esempio n. 32
0
        /// <summary>
        /// 新しいWindowの型と新しいWindowに設定するViewModel、画面遷移モードとメッセージキーを指定して新しい相互作用メッセージのインスタンスを生成します。
        /// </summary>
        /// <param name="windowType">新しいWindowの型</param>
        /// <param name="transitionViewModel">新しいWindowのDataContextに設定するViewModel</param>
        /// <param name="mode">画面遷移の方法を決定するTransitionMode列挙体。初期値はUnKnownです。</param>
        /// <param name="messageKey">メッセージキー</param>
        public TransitionMessage(Type windowType, ViewModel transitionViewModel, TransitionMode mode, string messageKey)
            : base(messageKey)
        {
            Mode = mode;
            TransitionViewModel = transitionViewModel;

            if (windowType != null)
            {
                if (!windowType.IsSubclassOf(typeof(Window)))
                {
                    throw new ArgumentException("Windowの派生クラスを指定してください。", "windowType");
                }
            }

            WindowType = windowType;
        }
Esempio n. 33
0
    public void GotoNewState(BehaviourState newState, TransitionMode transitionMode)
    {
        BehaviourState oldState = currentState;
        oldState.ExitState(owner);

        #if VERBOSE_AI_STATES
        Debug.Log("AI state change: [" + oldState.GetType().Name + "] --> [" + newState.GetType().Name + "] :: <" + transitionMode + ">");
        #endif

        switch(transitionMode) {
            case TransitionMode.PopPrevious:
                // Go back to the previous state on the stack
                BehaviourState nextState = stateStack.Pop();
                if(nextState != null) {
                    currentState = nextState;
                }
                else {
                    // in case there was no state on the stack, go back to base state
                    currentState = baseState;
                }
                break;
            case TransitionMode.PushCurrent:
                // Pushes the current state onto the stack and goes to the returned next state
                stateStack.Push(currentState);
                currentState = newState;
                if(currentState == null) {
                    // If a null state was added, go back tot eh previous one
                    currentState = stateStack.Pop();
                }
                break;
            case TransitionMode.AbandonCurrent:
                // Go to the new state, without pushing the current one on the stack
                if(newState != null) {
                    currentState = newState;
                }
                break;
        }

        currentState.EnterState(owner);
    }
Esempio n. 34
0
        /// <summary>
        /// Loads a slide show file from the specified file path.
        /// </summary>
        /// <param name="sFilePath">Specifies the full path of the slide show file.</param>
        private void LoadSlideShowFile(string sFilePath)
        {
            if ((!string.IsNullOrEmpty(sFilePath)) && (File.Exists(sFilePath)))
            {
                try
                {
                    SlideShowDocument oDoc = new SlideShowDocument();
                    oDoc.Load(sFilePath);

                    m_WaitInterval = oDoc.WaitInterval;
                    m_nTransitionMode = oDoc.TransitionMode;
                    m_fFadeSpeed = oDoc.FadeSpeed;
                    m_sFilePaths = new List<string>(oDoc.GetEntries());
                }
                catch (FileFormatException e)
                {
                    MessageBox.Show("Unable to load the specified slide show file.\n\nReason: " + e.Message, "Load File Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (UnauthorizedAccessException e)
                {
                    MessageBox.Show("Unable to load the specified slide show file.\n\nReason: " + e.Message, "Load File Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (System.Security.SecurityException e)
                {
                    MessageBox.Show("Unable to load the specified slide show file.\n\nReason: " + e.Message, "Load File Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (IOException e)
                {
                    MessageBox.Show("Unable to load the specified slide show file.\n\nReason: " + e.Message, "Load File Error",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 35
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsmi_NormalTransition_Click(object sender, EventArgs e)
 {
     m_nTransitionMode = TransitionMode.Normal;
     m_bFadeIn = false;
 }
Esempio n. 36
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsmi_FadeTransition_Click(object sender, EventArgs e)
 {
     m_nTransitionMode = TransitionMode.Fade;
     m_nSpinWait = 0;
 }
Esempio n. 37
0
        public virtual bool load(List<property_t> properties)
        {
            string opr2TypeName = null;
            string comparatorName = null;

            foreach(property_t p in properties)
            {
                if (p.name == "Mode")
                {
                    switch (p.value)
                    {
                        case "Condition":
                            this.m_mode = TransitionMode.Condition;
                            break;

                        case "Success":
                            this.m_mode = TransitionMode.Success;
                            break;

                        case "Failure":
                            this.m_mode = TransitionMode.Failure;
                            break;

                        case "End":
                            this.m_mode = TransitionMode.End;
                            break;
                    }
                }
                else if (p.name == "Opl")
                {
                    if (StringUtils.IsValidString(p.value))
                    {
                        int pParenthesis = p.value.IndexOf('(');

                        if (pParenthesis == -1)
                        {
                            string typeName = null;
                            this.m_opl = Condition.LoadRight(p.value, ref typeName);
                        }
                        else
                        {
                            //method
                            this.m_opl_m = Action.LoadMethod(p.value);
                        }
                    }
                }
                else if (p.name == "Opr1")
                {
                    if (StringUtils.IsValidString(p.value))
                    {
                        int pParenthesis = p.value.IndexOf('(');

                        if (pParenthesis == -1)
                        {
                            string typeName = null;
                            this.m_opr1 = Condition.LoadRight(p.value, ref typeName);
                        }
                        else
                        {
                            //method
                            this.m_opr1_m = Action.LoadMethod(p.value);
                        }
                    }
                }
                else if (p.name == "Operator")
                {
                    comparatorName = p.value;

                    switch (p.value)
                    {
                        case "Invalid":
                            this.m_operator = EOperatorType.E_INVALID;
                            break;

                        case "Assign":
                            this.m_operator = EOperatorType.E_ASSIGN;
                            break;

                        case "Add":
                            this.m_operator = EOperatorType.E_ADD;
                            break;

                        case "Sub":
                            this.m_operator = EOperatorType.E_SUB;
                            break;

                        case "Mul":
                            this.m_operator = EOperatorType.E_MUL;
                            break;

                        case "Div":
                            this.m_operator = EOperatorType.E_DIV;
                            break;

                        case "Equal":
                            this.m_operator = EOperatorType.E_EQUAL;
                            break;

                        case "NotEqual":
                            this.m_operator = EOperatorType.E_NOTEQUAL;
                            break;

                        case "Greater":
                            this.m_operator = EOperatorType.E_GREATER;
                            break;

                        case "Less":
                            this.m_operator = EOperatorType.E_LESS;
                            break;

                        case "GreaterEqual":
                            this.m_operator = EOperatorType.E_GREATEREQUAL;
                            break;

                        case "LessEqual":
                            this.m_operator = EOperatorType.E_LESSEQUAL;
                            break;
                    }
                }
                else if (p.name == "Opr2")
                {
                    if (StringUtils.IsValidString(p.value))
                    {
                        int pParenthesis = p.value.IndexOf('(');

                        if (pParenthesis == -1)
                        {
                            this.m_opr2 = Condition.LoadRight(p.value, ref opr2TypeName);
                        }
                        else
                        {
                            //method
                            this.m_opr2_m = Action.LoadMethod(p.value);
                        }
                    }
                }
                else
                {
                    //Debug.Check(0, "unrecognised property %s", p.name);
                }
            }

            // compare
            if (this.m_operator >= EOperatorType.E_EQUAL && this.m_operator <= EOperatorType.E_LESSEQUAL)
            {
                if (!string.IsNullOrEmpty(comparatorName) && (this.m_opl != null || this.m_opl_m != null) &&
                    (this.m_opr2 != null || this.m_opr2_m != null))
                {
                    this.m_comparator = Condition.Create(comparatorName, this.m_opl, this.m_opl_m, this.m_opr2, this.m_opr2_m);
                }
            }

            return this.m_opl != null;
        }
Esempio n. 38
0
 protected void Transition(ViewModel viewModel, Type windowType, TransitionMode mode, bool isOwned)
 {
     var message = new TransitionMessage(windowType, viewModel, mode, isOwned ? "Window.Transition.Child" : "Window.Transition");
     this.Messenger.Raise(message);
 }
Esempio n. 39
0
 private void FinishTransition()
 {
     this.IsTransitioning = false;
     this.TransitionTimeElapsed = TimeSpan.FromTicks(0);
     this.TransitionMode = 0;
     //if(this.PoppedStateTransitionRender != null && !this.PoppedStateTransitionRender.IsDisposed)
     //	this.PoppedStateTransitionRender.Dispose();
 }
Esempio n. 40
0
            public virtual bool load(List<property_t> properties)
            {
                for (int i = 0; i < properties.Count; ++i)
                {
                    property_t p = properties[i];
                    if (p.name == "Mode")
                    {
                        switch (p.value)
                        {
                            case "Condition":
                                this.m_mode = TransitionMode.Condition;
                                break;

                            case "Success":
                                this.m_mode = TransitionMode.Success;
                                break;

                            case "Failure":
                                this.m_mode = TransitionMode.Failure;
                                break;

                            case "End":
                                this.m_mode = TransitionMode.End;
                                break;
                        }
                    }
                    else if (p.name == "Opl")
                    {
                        if (StringUtils.IsValidString(p.value))
                        {
                            int pParenthesis = p.value.IndexOf('(');

                            if (pParenthesis == -1)
                            {
                                this.m_opl = AgentMeta.ParseProperty(p.value);
                            }
                            else
                            {
                                this.m_opl = AgentMeta.ParseMethod(p.value);
                            }
                        }
                    }
                    else if (p.name == "Opr1")
                    {
                        if (StringUtils.IsValidString(p.value))
                        {
                            int pParenthesis = p.value.IndexOf('(');

                            if (pParenthesis == -1)
                            {
                                this.m_opr1 = AgentMeta.ParseProperty(p.value);
                            }
                            else
                            {
                                this.m_opr1 = AgentMeta.ParseMethod(p.value);
                            }
                        }
                    }
                    else if (p.name == "Operator")
                    {
                        this.m_operator = OperationUtils.ParseOperatorType(p.value);
                    }
                    else if (p.name == "Opr2")
                    {
                        if (StringUtils.IsValidString(p.value))
                        {
                            int pParenthesis = p.value.IndexOf('(');

                            if (pParenthesis == -1)
                            {
                                this.m_opr2 = AgentMeta.ParseProperty(p.value);
                            }
                            else
                            {
                                this.m_opr2 = AgentMeta.ParseMethod(p.value);
                            }
                        }
                    }
                }

                return this.m_opl != null;
            }
Esempio n. 41
0
 public TransitionExMessage(Window transitionTarget, TransitionMode mode, string messageKey)
     : base(messageKey)
 {
     this.Target = transitionTarget;
     this.Mode = mode;
 }
Esempio n. 42
0
        /// <summary>
        /// Adds a cutover for added rules.
        /// </summary>
        /// <remarks>
        /// A cutover is a point where the standard offset from GMT/UTC changed. This occurs mostly
        /// pre-1900. The standard offset at the cutover defaults to 0. Call <see
        /// cref="DateTimeZoneBuilder.SetStandardOffset"/> afterwards to change it.
        /// </remarks>
        /// <param name="year">The year of cutover.</param>
        /// <param name="mode">The transition mode.</param>
        /// <param name="monthOfYear">The month of year.</param>
        /// <param name="dayOfMonth">The day of the month. If negative, set to ((last day of month)
        /// - ~dayOfMonth). For example, if -1, set to last day of month</param>
        /// <param name="dayOfWeek">The day of week. If 0, ignore.</param>
        /// <param name="advanceDayOfWeek">if dayOfMonth does not fall on dayOfWeek, then if advanceDayOfWeek set to <c>true</c>
        /// advance to dayOfWeek when true, otherwise retreat to dayOfWeek when true.</param>
        /// <param name="tickOfDay">The <see cref="Duration"/> into the day. Additional precision for specifying time of day of transitions</param>
        /// <returns>This <see cref="DateTimeZoneBuilder"/> for chaining.</returns>
        public DateTimeZoneBuilder AddCutover(int year, TransitionMode mode, int monthOfYear, int dayOfMonth, int dayOfWeek, bool advanceDayOfWeek,
                                              Offset tickOfDay)
        {
            FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.MonthOfYear, "monthOfYear", monthOfYear);
            FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.DayOfMonth, "dayOfMonth", dayOfMonth, true);
            if (dayOfWeek != 0)
            {
                FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.DayOfWeek, "dayOfWeek", dayOfWeek);
            }
            FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.TickOfDay, "tickOfDay", tickOfDay.TotalTicks);

            return AddCutover(year, new ZoneYearOffset(mode, monthOfYear, dayOfMonth, dayOfWeek, advanceDayOfWeek, tickOfDay));
        }
Esempio n. 43
0
 /// <summary>
 /// Adds a recurring daylight saving time rule.
 /// </summary>
 /// <param name="nameKey">The name key of new rule.</param>
 /// <param name="savings">The <see cref="Duration"/> to add to standard offset.</param>
 /// <param name="fromYear">First year that rule is in effect. <see cref="Int32.MinValue"/> indicates beginning of time.</param>
 /// <param name="toYear">Last year (inclusive) that rule is in effect. <see cref="Int32.MaxValue"/> indicates end of time.</param>
 /// <param name="mode">The transition mode.</param>
 /// <param name="monthOfYear">The month of year.</param>
 /// <param name="dayOfMonth">The day of the month. If negative, set to ((last day of month)
 /// - ~dayOfMonth). For example, if -1, set to last day of month</param>
 /// <param name="dayOfWeek">The day of week. If 0, ignore.</param>
 /// <param name="advanceDayOfWeek">if dayOfMonth does not fall on dayOfWeek, then if advanceDayOfWeek set to <c>true</c>
 /// advance to dayOfWeek when true, otherwise retreat to dayOfWeek when true.</param>
 /// <param name="tickOfDay">The <see cref="Duration"/> into the day. Additional precision for specifying time of day of transitions</param>
 /// <returns>This <see cref="DateTimeZoneBuilder"/> for chaining.</returns>
 public DateTimeZoneBuilder AddRecurringSavings(String nameKey, Offset savings, int fromYear, int toYear, TransitionMode mode, int monthOfYear,
                                                int dayOfMonth, int dayOfWeek, bool advanceDayOfWeek, Offset tickOfDay)
 {
     FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.MonthOfYear, "monthOfYear", monthOfYear);
     FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.DayOfMonth, "dayOfMonth", dayOfMonth, true);
     if (dayOfWeek != 0)
     {
         FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.DayOfWeek, "dayOfWeek", dayOfWeek);
     }
     FieldUtils.VerifyFieldValue(CalendarSystem.Iso.Fields.TickOfDay, "tickOfDay", tickOfDay.TotalTicks);
     var yearOffset = new ZoneYearOffset(mode, monthOfYear, dayOfMonth, dayOfWeek, advanceDayOfWeek, tickOfDay);
     return AddRecurringSavings(new ZoneRecurrence(nameKey, savings, yearOffset, fromYear, toYear));
 }
Esempio n. 44
0
 /// <summary>
 /// Called before the GameStates being transitioned from are rendered.
 /// </summary>
 /// <param name="From">The current rendering of the GameState that was previously at the top of the stack. Can be null.</param>
 /// <param name="To">The current rendering of the GameState that is now going to be at the top of the stack. Can be null.</param>
 /// <param name="Mode">Indicates if To was pushed on to the stack, or if From was popped.</param>
 /// <param name="Elapsed">The amount of time that has elapsed since the start of the transition (not neccessarily real time).</param>
 protected abstract void RenderTransition(RenderTarget2D From, RenderTarget2D To, TransitionMode Mode, TimeSpan Elapsed);
Esempio n. 45
0
 private void BeginTransition(TransitionMode Mode)
 {
     if(IsTransitioning)
         FinishTransition();
     this.IsTransitioning = true;
     this.TransitionTimeElapsed = TimeSpan.FromTicks(0);
     this.TransitionMode = Mode;
     // Should probably copy to a texture, but we'll just use RenderTarget and prevent dispose instead.
     //this.PoppedStateTransitionRender = PoppedStateRender;
     //RecreateRenderTarget(ref PoppedStateRender, false);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFormClosed(FormClosedEventArgs e)
        {
            m_nImageViewTime = (int)nud_Seconds.Value;
            m_nFadeSpeed = (FadeSpeed)cbx_FadeSpeed.SelectedIndex;
            m_nTransitionMode = (TransitionMode)cbx_TransitionMode.SelectedIndex;
            m_sSaveLocation = txtb_SaveLocation.Text;

            base.OnFormClosed(e);
        }
Esempio n. 47
0
 public StateResponse(TransitionMode transitionMode, BehaviourState newState = null)
 {
     this.transitionMode = transitionMode;
     this.newState = newState;
 }