Example #1
0
        public void ProcessMouseClick(MouseEventArgs e, ETarget tg, OnAction proc)
        {
            int x = e.X, y = e.Y;

            System.Drawing.Point pt = new System.Drawing.Point(x, y);
            IKeysProvider        kk = new KeyboardState(e);
            EAction act;
            bool    ert             = (e.Button == MouseButtons.Right);

            if (kk.qCtrl)
            {
                if (kk.qAlt)
                {
                    act = EAction.ActionCtrlAltClick;
                }
                else if (kk.qShift)
                {
                    act = ert ? EAction.ActionCtrlShiftRClick : EAction.ActionCtrlShiftClick;
                }
                else
                {
                    act = ert ? EAction.ActionCtrlRClick : EAction.ActionCtrlClick;
                }
            }
            else if (kk.qShift)
            {
                act = ert ? EAction.ActionShiftRClick : EAction.ActionShiftClick;
            }
            else if (kk.qAlt)
            {
                act = ert ? EAction.ActionAltRClick : EAction.ActionAltClick;
            }
            else
            {
                act = ert ? EAction.ActionRClick : EAction.ActionClick;
            }
            Camera.ProcessMouseMove(this, act, tg, pt, 0, 0, proc);
        }
        internal static void Action(SandboxDataValue value)
        {
            Logger.Trace("Start  Action(SandboxDataValue ", value, ")");
            var data = value;

            if (ActionConnections.TryGetValue($"{data.From}.{data.EventName}", out ActionConfig info))
            {
                data.To        = info.Events;
                data.Controled = info.Controled;
            }
            try
            {
                Logger.Trace("Start  Action invoke", data.ToJson());

                Task.Run(() => OnAction?.Invoke(data));
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex);
            }

            Logger.Trace("End  Action(SandboxDataValue value, string eventName)");
        }
Example #3
0
        internal IEnumerator ToggleAction()
        {
            for (int i = 0; i < ToogleAmount; i++)
            {
                action = true;

                if (AnimState == AnimTag.Action)
                {
                    OnAction.Invoke();                          //Invoke on Action
                    SetFloatID(-1);
                    break;
                }

                yield return(null);
            }
            action = false;     //Reset Action

            if (AnimState != AnimTag.Action)
            {
                ActionID = -1;              //Means that it could not make an action animation
                SetFloatID(0);
            }
        }
Example #4
0
 public void ProcessPrivmsgCommand(string[] tokens)
 {
     tokens[3] = RemoveLeadingColon(tokens[3]);
     if (tokens[3] == ACTION)
     {
         if (Rfc2812Util.IsValidChannelName(tokens[2]))
         {
             int last = tokens.Length - 1;
             tokens[last] = RemoveTrailingChar(tokens[last]);
             OnAction.Fire(this,
                           new UserChannelMessageEventArgs(Rfc2812Util.UserFromString(tokens[0]), tokens[2],
                                                           CondenseStrings(tokens, 4)));
             //Trace.WriteLine("Channel action", "IRC");
         }
         else
         {
             int last = tokens.Length - 1;
             tokens[last] = RemoveTrailingChar(tokens[last]);
             OnPrivateAction.Fire(this,
                                  new UserMessageEventArgs(Rfc2812Util.UserFromString(tokens[0]), CondenseStrings(tokens, 4)));
             //Trace.WriteLine("Private action", "IRC");
         }
     }
     else if (channelPattern.IsMatch(tokens[2]))
     {
         OnPublic.Fire(this,
                       new UserChannelMessageEventArgs(Rfc2812Util.UserFromString(tokens[0]), tokens[2],
                                                       CondenseStrings(tokens, 3)));
         Trace.WriteLine("Public msg", "IRC");
     }
     else
     {
         OnPrivate.Fire(this, new UserMessageEventArgs(Rfc2812Util.UserFromString(tokens[0]), CondenseStrings(tokens, 3)));
         //Trace.WriteLine("Private msg", "IRC");
     }
 }
Example #5
0
 private void OnInputAction(InputAction.CallbackContext context)
 {
     //Debug.Log($"{index}: Action");
     OnAction?.Invoke();
 }
Example #6
0
 private static void InvokeAction(OrbwalkerActionArgs e)
 {
     OnAction?.Invoke(e);
 }
Example #7
0
 internal void _OnAction(ActionEventArgs e)
 {
     OnAction?.Invoke(this, e);
     Utils.Call("self.EventStarted = False");
 }
 private void EditBtn_Tapped(object sender, TappedRoutedEventArgs e)
 {
     OnAction?.Invoke(this, ActionEvent.EDIT);
     MenuBox.Visibility = Visibility.Collapsed;
 }
 private void MainBox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     OnAction?.Invoke(this, Source, ActionEvent.CLICK);
 }
Example #10
0
 void IReportEntity.SetFormChanged(OnAction FormChanged)
 {
     OnFormChanged = FormChanged;
 }
Example #11
0
 public override void ActionMode(OnAction e)
 {
     return;
 }
Example #12
0
        private FileResult FileCopy()
        {
            try
            {
                if (CheckCancel())
                {
                    return(new FileResult()
                    {
                        Job = this, Success = false, Reason = $"Cancelled by user"
                    });
                }
                if (IsFile)
                {
                    if (!FileCreated)
                    {
                        SourceFile.Refresh();
                        TargetFile.Refresh();
                        //FastResume(sourcefile, targetfile, null, BUFFERSIZE);
                        if ((CopyType == CopyJobType.Copy || CopyType == CopyJobType.Move) && Target.Exists)
                        {
                            switch (ExistsAction)
                            {
                            case ExistsAction.Overwrite:
                            case ExistsAction.OverwriteFix:
                                break;

                            case ExistsAction.Skip:
                                return(new FileResult()
                                {
                                    Job = this, Success = true, Reason = "Skipped"
                                });

                            case ExistsAction.Rename:
                                Rename();
                                break;

                            case ExistsAction.None:
                            default:
                                return(new FileResult()
                                {
                                    Job = this, Success = false, IsOverWriteError = true, Reason = "File already exists"
                                });
                            }
                        }
                    }
                    var sourcefile = SourceFile;
                    var targetfile = TargetFile;
                    if (CopyType == CopyJobType.Copy || CopyType == CopyJobType.Move)
                    {
                        FileCreated = true;
                        OnAction?.Invoke(COPYING);
                        FastCopy(sourcefile, targetfile, ProgressP1, BUFFERSIZE);
                        OnAction?.Invoke(COMPARING);
                        if (Compare(sourcefile, targetfile, ProgressP2, BUFFERSIZE, true))
                        {
                            if (CopyType == CopyJobType.Move)
                            {
                                OnAction?.Invoke(DELETING);
                                sourcefile.Delete();
                            }
                            return(new FileResult()
                            {
                                Job = this, Success = true
                            });
                        }
                        else
                        {
                            return(new FileResult()
                            {
                                Job = this, Success = false, Reason = "Compare NOK"
                            });
                        }
                    }
                    if (CopyType == CopyJobType.Compare)
                    {
                        OnAction?.Invoke(COMPARING);
                        if (Compare(sourcefile, targetfile, ProgressP1, BUFFERSIZE, false))
                        {
                            targetfile.Delete();
                        }
                        return(new FileResult()
                        {
                            Job = this, Success = true
                        });
                    }
                }
                else if (Target is ZlpDirectoryInfo td && CopyType != CopyJobType.Compare)
                {
                    td.Create();
                    return(new FileResult()
                    {
                        Job = this, Success = true
                    });
                }
                return(new FileResult()
                {
                    Job = this, Success = false
                });
            }
            catch (Exception e)
            {
                return(new FileResult()
                {
                    Job = this, Success = false, Reason = $"{e.GetType().Name}: {e.Message}"
                });
            }
        }
Example #13
0
    private void Update()
    {
        anim.SetFloat("fallSpeed", rigid.velocity.magnitude);
        if (pi.lockon)
        {
            camcon.LockUnlock();
        }
        if (camcon.lockState == false)
        {
            anim.SetFloat("Forward", pi.Dmag * Mathf.Lerp(anim.GetFloat("Forward"), (pi.run) ? 2.0f : 1.0f, 0.05f));//设置走跑动画,平滑切换
            anim.SetFloat("right", 0);
        }
        else
        {
            Vector3 localDVec = transform.InverseTransformVector(pi.Dvec);
            anim.SetFloat("Forward", localDVec.z * ((pi.run) ? 2.0f : 1.0f));
            anim.SetFloat("right", localDVec.x * ((pi.run) ? 2.0f : 1.0f));
        }

        if (CheckState("ground") || CheckState("blocked"))
        {
            anim.SetBool("defense", pi.defense);
            anim.SetLayerWeight(anim.GetLayerIndex("defense"), 1);
            anim.SetLayerWeight(anim.GetLayerIndex("defense2"), 1);
        }
        else
        {
            anim.SetBool("defense", false);
            anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);
            anim.SetLayerWeight(anim.GetLayerIndex("defense2"), 0);
        }

        if (pi.jump)
        {
            anim.SetTrigger("jump");
            canAttack = false;
        }


        if (pi.attack == true && canAttack && pi.heavyAttack == false)
        {
            if (anim.GetFloat("Forward") < 1.3f)
            {
                anim.SetTrigger("attack");
            }
            else
            {
                anim.SetTrigger("runAttack");
            }
        }

        if (pi.heavyAttack == true && canAttack)
        {
            anim.SetTrigger("heavyAttack");
        }
        if (pi.counterBack == true && CheckState("ground"))
        {
            anim.SetTrigger("counterBack");
        }



        if (anim.GetBool("rollLock") == false)
        {
            if (pi.roll)
            {
                anim.SetTrigger("roll");
                canAttack = false;
            }
        }

        if (trackDirection == true)//锁死人物方向
        {
            model.transform.forward = planarVec.normalized;
        }
        if (camcon.lockState == false)
        {
            if (pi.lockEnable == false)
            {
                if (pi.inputEnable == true)
                {
                    if (pi.Dmag > 0.01f)
                    {
                        model.transform.forward = Vector3.Slerp(model.transform.forward, pi.Dvec, 0.3f);//平滑转向
                    }
                }

                if (lockPlanar == false)
                {
                    planarVec = pi.Dmag * model.transform.forward * walkSpeed * ((pi.run) ? runSpeed : 1.0f);//移动速度
                }
                if (lockPlanar == true && landing == true)
                {
                    planarVec = Vector3.zero;
                }
            }
            else if (lockroll == false)
            {
                planarVec = rollDvec * rollSpeed;
            }
            else if (CheckState("die") && lockroll == true)
            {
                planarVec = Vector3.zero;
            }
        }
        else
        {
            if (pi.lockEnable == false)
            {
                if (trackDirection == false)
                {
                    model.transform.forward = transform.forward;
                }

                if (lockPlanar == false)
                {
                    planarVec = pi.Dvec * walkSpeed * ((pi.run) ? runSpeed : 1.0f);
                }
                if (lockPlanar == true && landing == true)
                {
                    planarVec = Vector3.zero;
                }
            }
            else if (lockroll == false)
            {
                planarVec = rollDvec * rollSpeed;
            }
            else if (CheckState("die") && lockroll == true)
            {
                planarVec = Vector3.zero;
            }
        }
        if (CheckState("lock"))
        {
            planarVec = Vector3.zero;
        }
        if (pi.action)
        {
            OnAction.Invoke();
        }
    }
 protected void InvokeAction(UiElement element)
 {
     OnAction?.Invoke(element);
 }
Example #15
0
 public void SetHandle(OnAction onAction, params object[] _params)
 {
     MyOnAction  = onAction;
     Params      = _params;
 }
Example #16
0
    private void actCtrl()
    {
        if (pi.roll)
        {
            anim.SetTrigger("roll");
            canAttack = false;
        }

        if (pi.jump)
        {
            anim.SetTrigger("jump");
            canAttack = false;
        }

        if (pi.jab)
        {
            anim.SetTrigger("jab");
            canAttack = false;
        }

        if ((pi.attack || pi.defense) && (CheckState("ground") || CheckStateTag("attackR") || CheckStateTag("attackL")) && canAttack)
        {
            if (pi.attack)
            {
                anim.SetBool("R0L1", false);
                anim.SetTrigger("attack");
            }
            else if (pi.defense && !leftIsShield)
            {
                anim.SetBool("R0L1", true);
                anim.SetTrigger("attack");
            }
        }

        if ((pi.rt || pi.lt) && (CheckState("ground") || CheckStateTag("attackR") || CheckStateTag("attackL")) && canAttack)
        {
            if (pi.rt)
            {
            }
            else
            {
                if (!leftIsShield)
                {
                }
                else
                {
                    anim.SetTrigger("counterBack");
                }
            }
        }

        if (pi.action)
        {
            OnAction.Invoke();
        }

        if (leftIsShield)
        {
            if (CheckState("ground") || CheckState("blocked"))
            {
                anim.SetBool("defense", pi.defense);
                anim.SetLayerWeight(anim.GetLayerIndex("defense"), 1);
            }
            else
            {
                anim.SetBool("defense", false);
                anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);

                //anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);
            }
        }
        else
        {
            anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);
        }
    }
 private void RemoveBtn_Tapped(object sender, TappedRoutedEventArgs e)
 {
     OnAction?.Invoke(this, ActionEvent.DELETE);
     MenuBox.Visibility = Visibility.Collapsed;
 }
Example #18
0
 // Update is called once per frame
 void Update()
 {
     if (isLock)
     {
         return;
     }
     if (camcon.isAI)
     {
         if (CheckStateTag("AttackR"))
         {
             pi.targetDmag = 0;
         }
         pi.dmag = Mathf.SmoothDamp(pi.dmag, pi.targetDmag, ref pi.velocityDmag, 0.1f);
     }
     if (pi.lockon)
     {
         camcon.LockChange();
     }
     if (camcon.lockState == false)
     {
         anim.SetFloat("forward", pi.dmag * Mathf.Lerp(anim.GetFloat("forward"), pi.run ? 2.0f : 1f, 0.1f));
         anim.SetFloat("right", 0);
     }
     else
     {
         Vector3 localDVecz = transform.InverseTransformVector(pi.dvec);
         anim.SetFloat("forward", Mathf.Lerp(anim.GetFloat("forward"), localDVecz.z * (pi.run ? 2 : 1), 0.1f));
         anim.SetFloat("right", Mathf.Lerp(anim.GetFloat("right"), localDVecz.x * (pi.run ? 2 : 1), 0.1f));
     }
     if (pi.roll)
     {
         if (rigid.velocity.magnitude < 1f)
         {
             anim.SetTrigger("jump");
             canAttack = false;
         }
         else
         {
             anim.SetTrigger("roll");
         }
     }
     if (pi.jump)
     {
         anim.SetTrigger("jump");
         canAttack = false;
     }
     if (pi.attack && (CheckState("Ground") || CheckStateTag("AttackR")) && canAttack)
     {
         //mw.enabled = true;
         int x = Random.Range(0, 2);
         anim.SetInteger("attackWay", x);
         anim.SetTrigger("attack");
     }
     if (camcon.lockState == false)
     {
         if (pi.dmag > 0.1f && pi.inputEnabled)
         {
             model.transform.forward = Vector3.Slerp(model.transform.forward, pi.dvec, 0.1f);
         }
         if (lockPlanar == false)
         {
             planarVec = walkSpeed * model.transform.forward * pi.dmag * (pi.run ? runMultiplier : 1f);
         }
     }
     else
     {
         if (trackDirection == false)
         {
             model.transform.forward = transform.forward;
         }
         else
         {
             model.transform.forward = planarVec.normalized;
         }
         if (lockPlanar == false)
         {
             planarVec = pi.dvec * walkSpeed * (pi.run ? runMultiplier : 1f);
         }
     }
     if (pi.defense && (CheckState("Ground") || CheckStateTag("Defense")) && canAttack)
     {
         anim.SetBool("rightCounter", EnemyAttackDirection.isRight);
         anim.SetTrigger("defense");
     }
     if (pi.action && am.sm.isExecuteEnable)
     {
         OnAction.Invoke();
     }
 }
Example #19
0
 private void EditBtn_Click(object sender, RoutedEventArgs e)
 {
     OnAction?.Invoke(this, Source, ActionEvent.EDIT);
 }
Example #20
0
 public abstract void ProcessMouseMove(S3DirectX scene, EAction action, ETarget tg, System.Drawing.Point pt, int DX, int DY, OnAction proc);
Example #21
0
 private void MainBox_Tapped(object sender, TappedRoutedEventArgs e)
 {
     OnAction?.Invoke(this, Source, ActionEvent.CLICK);
 }
Example #22
0
 void IReportEntity.SetReportRefresh(OnAction ReportRefresh)
 {
     OnReportRefresh = ReportRefresh;
 }
Example #23
0
 public void SetHandle(OnAction onAction, params object[] _params)
 {
     MyOnAction = onAction;
     Params     = _params;
 }
Example #24
0
    void Update()
    {
        if (playerInput.lockon)
        {
            camcon.LockUnLock();
        }

        if (camcon.lockState)
        {
            camcon.ChangeEnemys(playerInput.changeEnemys);
        }

        if (camcon.lockState == false)
        {
            anim.SetFloat("forward", playerInput.Dmag * Mathf.Lerp(anim.GetFloat("forward"), JudgeRun(), 0.5f));
            anim.SetFloat("right", 0);
        }
        else
        {
            Vector3 localDVec = transform.InverseTransformVector(playerInput.Dvec);
            anim.SetFloat("forward", localDVec.z * JudgeRun());
            anim.SetFloat("right", localDVec.x * JudgeRun());
        }

        //       anim.SetBool("defense", playerInput.defense);

        if (playerInput.roll || anim.GetBool("isGround") == false && rigid.velocity.magnitude > 7f)      //roll or jab
        {
            anim.SetTrigger("roll");
            canAttack = false;
        }

        if (playerInput.jump)
        {
            anim.SetTrigger("jump");
            canAttack = false;
        }

        if ((playerInput.rb || playerInput.lb) && (CheckState("ground") || CheckStateTag("attackR") || CheckStateTag("attackL")) && canAttack)
        {
            if (playerInput.rb)
            {
                anim.SetBool("R0L1", false);
                anim.SetTrigger("attack");
            }
            else if (playerInput.lb && !leftIsShield)
            {
                anim.SetBool("R0L1", true);
                anim.SetTrigger("attack");
            }
        }

        if ((playerInput.lrt != 0) && (CheckState("ground") || CheckStateTag("attackR") || CheckStateTag("attackL")) && canAttack)
        {
            if (playerInput.lrt == -1)
            {
                //do right heavy attack
                print(playerInput.lrt);
            }
            else if (playerInput.lrt == 1)
            {
                if (!leftIsShield)
                {
                    //do left heavy attack
                }
                else
                {
                    //shield defense
                    anim.SetTrigger("counterBack");
                }
            }
        }


        if ((CheckState("ground") || CheckState("blocked")))
        {
            if (leftIsShield)
            {
                anim.SetBool("defense", playerInput.defense);
                if (playerInput.defense)
                {
                    anim.SetLayerWeight(anim.GetLayerIndex("defense"), 1);
                }
                else
                {
                    anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);
                }
            }
            else
            {
                anim.SetLayerWeight(anim.GetLayerIndex("defense"), 0);
            }
        }

        //如果没锁定
        if (!camcon.lockState)
        {
            if (playerInput.Dmag > 0.1f)
            {
                model.transform.forward = Vector3.Slerp(model.transform.forward, playerInput.Dvec, 0.3f);
            }
            //lockPlanar是锁刚体速度向量
            if (lockPlanar == false)
            {
                planarVec = playerInput.Dmag * model.transform.forward * walkSpeed * ((playerInput.run) ? runMultiplier : 1.0f);
            }
        }
        //如果锁定了
        else
        {
            if (trackDirection == false)
            {
                model.transform.forward = transform.forward;
            }
            else
            {
                model.transform.forward = planarVec.normalized * 0.99f + model.transform.forward * 0.01f;
            }

            if (lockPlanar == false)
            {
                planarVec = playerInput.Dvec * walkSpeed * ((playerInput.run) ? runMultiplier : 1.0f);
            }
        }

        if (playerInput.action)
        {
            OnAction.Invoke();
        }

        leftIsShield = !playerInput.dualHands;
    }
Example #25
0
 public virtual void ActionMode(OnAction e)
 {
 }
Example #26
0
 private void RemoveBtn_Click(object sender, RoutedEventArgs e)
 {
     OnAction?.Invoke(this, Source, ActionEvent.DELETE);
 }
Example #27
0
 public Action(GoToLotSituation.MeetUp meetUp, OnAction perform)
 {
     mMeetUp  = meetUp;
     mPerform = perform;
 }
Example #28
0
 private void MoreBtn_Tapped(object sender, TappedRoutedEventArgs e)
 {
     OnAction?.Invoke(this, Source, ActionEvent.NONE);
     e.Handled = true;
 }
Example #29
0
 public static void CallEventLocal(EventAction action, params Tuple <string, object>[] objects)
 {
     OnAction?.Invoke(action, ReturnDictonary(objects));
 }
 public void InvokeAction(FrameworkElement ui, AdaptiveActionEventArgs args)
 {
     OnAction?.Invoke(ui, args);
 }
 internal void InvokeOnAction(AdaptiveActionEventArgs args)
 {
     OnAction?.Invoke(this, args);
 }