コード例 #1
0
ファイル: Animation.cs プロジェクト: stuart2w/SAW
        /// <summary>Repeats should usually be an odd number: changing to the new colour is no repeat and back again is the first, so an odd number is required to finish on the colour we started on</summary>
        internal static void CreateStart(IBlendableColourDisplay target, Color newColour, int step = 16, int repeats = 0)
        {
            // only calls Start if there was no previous animation on this target
            if (Exists(target))
            {
                return;
            }
            AnimationColourChange animation = (AnimationColourChange)Create(target, newColour, step, repeats);

            animation?.Start();
        }
コード例 #2
0
ファイル: ctrPrompts.cs プロジェクト: stuart2w/SAW
 private void StartWarningAnimation()
 {
     if (this.DesignMode)
     {
         return;
     }
     if (AnimationController.HasAnimation(this))
     {
         return;
     }
     this.BackColor = Color.White;
     // linen ' Color.Yellow, 6
     AnimationColourChange.CreateStart((IBlendableColourDisplay)this, Color.MistyRose, 2, int.MaxValue);
 }
コード例 #3
0
ファイル: Animation.cs プロジェクト: stuart2w/SAW
        private static AnimationColourChange Create(IBlendableColourDisplay target, Color newColour, int step = 16, int repeats = 0)
        {
            if (Exists(target))
            {
                return(Item(target) as AnimationColourChange);
            }
            Debug.Assert(repeats == 0 || repeats % 2 == 1);
            AnimationColourChange animation = new AnimationColourChange(newColour, step, repeats)
            {
                m_Target = target
            };

            Add(animation);
            return(animation);
        }
コード例 #4
0
ファイル: ctrScriptEdit.cs プロジェクト: stuart2w/SAW
 /// <summary>Stores any text changes, returning null on success or error message</summary>
 private string StoreTextChanges()
 {
     if (m_TextChanged)
     {
         string error = m_Script.ParseFromScript(txtScript.Text, false);
         if (error != null)
         {
             AnimationColourChange.CreateStart(btnAbandonText, Color.LightYellow, 8, 1);
             return(error);
         }
         FillCommandList();
         m_TextChanged = false;
     }
     return(null);
 }