private void OnMotecChanged(IntEventArgs args)
 {
     if (View.Model.Name == PlaceholderName.MOTEC)
     {
         View.Render();
     }
 }
Example #2
0
    // If some other class wants to change happiness they can call InvokeHappinessChanged with an int
    // and this will add it to the happiness of the town.
    private void OnHappinessChanged(object sender, IntEventArgs happinessDiff)
    {
        int diff = happinessDiff.intPayload;

        currentHappiness += diff;
        UpdateDisplay();
    }
Example #3
0
        private void ContextMenuControl_PercentageNotificationChanged(object sender, IntEventArgs e)
        {
            var settings = UserSettings.Load();

            settings.PercentageNotification = e.Value;
            settings.Save();
        }
Example #4
0
 void HandlePlayerJoinedEvent(IntEventArgs args)
 {
     if (_playerInfo.ID == args.value)
     {
         gameObject.SetActive(true);
     }
 }
Example #5
0
        private void ProgramController_OnExecutionIndexCanged(object sender, IntEventArgs e)
        {
            Position rp = this.programController.Commands[e.Value];

            this.visuliser.SetCurrentPoint(e.Value);
            this.GoToPosition(rp);
        }
Example #6
0
 public void InvokeOnDistanceUpdate(object a_sender, IntEventArgs a_1intEventArgs)
 {
     if (OnDistanceUpdate != null)
     {
         OnDistanceUpdate.Invoke(a_sender, a_1intEventArgs);
     }
 }
Example #7
0
        private Rect DrawEmotionalControl(Rect initialBox, ref int dropDownIndex, ref float sliderPosition)
        {
            var dropDownBox = new Rect(initialBox.xMin + 5, initialBox.yMax + 10, 100, 20);

            int expressionIndex = Controller.Instance.SelectedExpressionIndex;

            dropDownIndex = EditorGUI.Popup(
                dropDownBox,
                expressionIndex,
                new[] { "Neutral", "Happiness", "Sadness", "Surprise", "Fear", "Anger", "Disgust" });

            if (expressionIndex != dropDownIndex)
            {
                ResetPoseConfig(DropDownEnum.expression);
                IntEventArgs args = new IntEventArgs(dropDownIndex);
                Controller.Instance.OnExpressionChanged(args);
            }

            float expressionStrength = Controller.Instance.ExpressionMovement;

            sliderPosition = DrawSliderWithTextBox(
                new Rect(dropDownBox.xMax + 5, dropDownBox.yMin, 100, 20),
                expressionStrength);

            if (expressionStrength != sliderPosition)
            {
                UpdateAnimation();

                IntensityEventArgs args = new IntensityEventArgs(sliderPosition);
                Controller.Instance.OnExpressionValueChanged(args);
            }

            return(dropDownBox);
        }
Example #8
0
 public void InvokeOnSpawnableNewDistance(object a_sender, IntEventArgs a_1intEventArgs)
 {
     if (OnSpawnableNewDistance != null)
     {
         OnSpawnableNewDistance.Invoke(a_sender, a_1intEventArgs);
     }
 }
Example #9
0
 public void InvokeOnStart(object a_sender, IntEventArgs a_1intEventArgs)
 {
     if (OnStart != null)
     {
         OnStart.Invoke(a_sender, a_1intEventArgs);
     }
 }
Example #10
0
 public void InvokeOnBulletTimeMaxCharge(object a_sender, IntEventArgs a_1intEventArgs)
 {
     if (OnBulletTimeMaxCharge != null)
     {
         OnBulletTimeMaxCharge.Invoke(a_sender, a_1intEventArgs);
     }
 }
Example #11
0
    private void HandleAttackEvent(IntEventArgs args)
    {
        var inputEvent = _inputController._inputEventNotifier.OnAttackEvent;
        var record     = new EventRecord(inputEvent, args);

        _frameInputs.Enqueue(record);
    }
Example #12
0
    private void HandleOnAttack(ZMInputEventArgs args)
    {
        if (IsValidInputControl(args.input))
        {
            if (args.input.Pressed)
            {
                var dotX       = Vector2.Dot(_movement, Vector2.right);
                var dotY       = Vector2.Dot(_movement, Vector2.up);
                var notifyArgs = new IntEventArgs(0);

                if (dotY < -DOT_THRESHOLD)
                {
                    // Excepting plunge case.
                    _inputEventNotifier.TriggerEvent(_inputEventNotifier.OnPlungeEvent);
                }
                else if (dotX > DOT_THRESHOLD)
                {
                    notifyArgs.value = 1;
                    _inputEventNotifier.TriggerEvent(_inputEventNotifier.OnAttackEvent, notifyArgs);
                }
                else if (dotX < -DOT_THRESHOLD)
                {
                    notifyArgs.value = -1;
                    _inputEventNotifier.TriggerEvent(_inputEventNotifier.OnAttackEvent, notifyArgs);
                }
                else
                {
                    // Default lunge case.
                    _inputEventNotifier.TriggerEvent(_inputEventNotifier.OnAttackEvent, notifyArgs);
                }
            }
        }
    }
Example #13
0
 //avant compressing - #1
 private static void FilesFound(object sender, IntEventArgs e)
 {
     BoxProgress.dProgress.InfoSup = _ArchiveName;
     // BoxProgress.FilesDone = 0;
     BoxProgress.dProgress.TotalFiles = e.Value;
     BoxProgress.dProgress.GlobalProgress(BoxProgress.dProgress.FilesDone, BoxProgress.dProgress.TotalFiles);
     Console.WriteLine($"Files: {e.Value} Found");
 }
Example #14
0
 private void HandleAnyInput(IntEventArgs args)
 {
     if (_isActive && _canToggleOff)
     {
         Deactivate();
         Toggle();
     }
 }
Example #15
0
    // Listens to FoodAdded(which is called by tasks) and does the work of adding the food to the state.
    void OnFoodAdded(object sender, IntEventArgs args)
    {
        int foodAdded = args.intPayload;

        this.currentFood += foodAdded;

        this.UpdateDisplay();
    }
Example #16
0
        private void OnManualControlEnable(object sender, IntEventArgs e)
        {
            //Debug.Log(e.intField);
            ActiveToggle(e.intField);
            updateControl = true;

            //TODO: start manual control
        }
Example #17
0
        private void FilmBufferOnFilmChanged(object sender, IntEventArgs intEventArgs)
        {
            var filmIndex = intEventArgs.Int;

            Debug.Assert(filmIndex >= 0);
            Debug.Assert(filmIndex < GlobalDefinitions.MaxDisplayMode);

            _films[filmIndex].Film = _filmBuffer[filmIndex];
        }
Example #18
0
 private void OnChangeQuestion(object sender, IntEventArgs e)
 {
     if (_questionIndex > -1)
     {
         _go[_questionIndex].SetActive(false);
     }
     _questionIndex += e.intField;
     UpdateLiveFeed();
 }
Example #19
0
        private void OnManualControlDisable(object sender, IntEventArgs e)
        {
            //Debug.Log(e.intField);
            ActiveToggle(e.intField);
            updateControl = false;


            //TODO: stop manual control
        }
 private void OnFaceCenterPositionAvailable(int position)
 {
     if (FaceCenterPositionAvailable != null)
     {
         EventHandler <IntEventArgs> handler = FaceCenterPositionAvailable;
         IntEventArgs e = new IntEventArgs(position);
         handler(this, e);
     }
 }
Example #21
0
            //  Cambiamos el método OnClick original del objeto Button por este código, lo que se hace es que al pulsar el botón, se dispara este evento en vez del original
            //  y este evento contiene el índice para poder distinguirlo del resto de botones
            protected override void OnClick(EventArgs e)
            {
                IntEventArgs eA1 = new IntEventArgs(indice, campo1, campo2, campo3, campo4, campo5);

                if (Click_ConIndice != null)
                {
                    Click_ConIndice(this, eA1);
                }
            }
Example #22
0
    private void HandleJoinedEvent(IntEventArgs args)
    {
        if (_playerInfo.ID == args.value)
        {
            SetActive(_activateOnJoin || !_deactivateOnJoin);

            HandleJoinedEvent();
        }
    }
 private void OnChangeQuestion(object sender, IntEventArgs e)
 {
     Debug.Log(string.Format("Changing Index to {0}", e.intField));
     if (_questionIndex > -1)
     {
         _go[_questionIndex].SetActive(false);
     }
     _questionIndex += e.intField;
     UpdateLiveFeed();
 }
 public DeleteBackgroundCommand(IntEventArgs args, CollectionModel <BackgroundModel> backgroundCollection, ScreenModel screenModel, Database database, LocationModel locationModel,
                                CollectionModel <ProfileModel> profileCollection)
 {
     this.args = args;
     this.backgroundCollection = backgroundCollection;
     this.screenModel          = screenModel;
     this.database             = database;
     this.locationModel        = locationModel;
     this.profileCollection    = profileCollection;
 }
Example #25
0
    public void HealHealth(int value)
    {
        IntEventArgs args = new IntEventArgs(value);

        OnHealHealth?.Invoke(this, args);
        if (args.value > 0)
        {
            character.ChangeHealthPoint(args.value);
        }
    }
Example #26
0
        private void ContextMenuControl_RefreshIntervalChanged(object sender, IntEventArgs e)
        {
            tickerController.SetRefreshInterval(e.Value);
            tickerController.UpdateData();

            var settings = UserSettings.Load();

            settings.RefreshInterval = e.Value;
            settings.Save();
        }
Example #27
0
    public void GetShield(int value)
    {
        IntEventArgs args = new IntEventArgs(value);

        OnGetShield?.Invoke(this, args);
        if (args.value > 0)
        {
            character.ChangeShield(args.value);
        }
    }
 public DeleteProfileCommand(IntEventArgs args, CollectionModel <ProfileModel> profileCollection, SelectedProfileModel profileSelection,
                             Database database, LocationModel location, LayoutIOModel layoutIO)
 {
     this.args = args;
     this.profileCollection = profileCollection;
     this.profileSelection  = profileSelection;
     this.database          = database;
     this.location          = location;
     this.layoutIO          = layoutIO;
 }
Example #29
0
        internal void OnExpressionChanged(IntEventArgs e)
        {
            SelectedExpressionIndex = e.IntVal;

            EventHandler <IntEventArgs> temp = PrimaryExpressionChanged;

            if (temp != null)
            {
                temp(this, e);
            }
        }
Example #30
0
        internal void OnMouthMuscleChanged(IntEventArgs e)
        {
            SelectedMouthMuscleIndex = e.IntVal;

            EventHandler <IntEventArgs> temp = MouthMuscleChanged;

            if (temp != null)
            {
                temp(this, e);
            }
        }
Example #31
0
 private void OnBytesRead(IntEventArgs e)
 {
     if (BytesRead != null)
     {
         BytesRead(this, e);
     }
 }
Example #32
0
 private void OnBytesWritten(IntEventArgs e)
 {
     if (BytesWritten != null)
     {
         BytesWritten(this, e);
     }
 }
Example #33
0
 private void IntEventArgsHandler(object sender, IntEventArgs e)
 {
     var pold = (int)((_bytesWrittenOld * 100) / _bytesCount);
     _bytesWritten += e.Value;
     var pnow = (int)((_bytesWritten * 100) / _bytesCount);
     if (pnow > pold)
     {
         if (pnow > 100)
         {
             pold = pnow = 0;
         }
         _bytesWrittenOld = _bytesWritten;
         OnExtracting(new ProgressEventArgs((byte)pnow, (byte)(pnow - pold)));
     }
 }
 void OnConsoleRelativeSizeChanged(object sender, IntEventArgs e)
 {
     Height += e.Value;
 }
Example #35
0
 private void IntEventArgsHandler(object sender, IntEventArgs e)
 {
     lock (this)
     {
         var pold = (byte) ((_bytesWrittenOld*100)/_bytesCount);
         _bytesWritten += e.Value;
         byte pnow;
         if (_bytesCount < _bytesWritten) //Holy shit, this check for ZIP is golden
         {
             pnow = 100;
         }
         else
         {
             pnow = (byte)((_bytesWritten * 100) / _bytesCount);
         }
         if (pnow > pold)
         {
             _bytesWrittenOld = _bytesWritten;
             OnCompressing(new ProgressEventArgs(pnow, (byte) (pnow - pold)));
         }
     }
 }
Example #36
0
 /// <summary>
 /// Event proxy for FilesFound.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void FilesFoundEventProxy(object sender, IntEventArgs e)
 {
     OnEvent(FilesFound, e, false);
 }