public VirusButtonAnnouncerEntity(AnnouncerEnded endFunction, Color color, Dictionary<Type, EnemyData> viewedEnemies, string playText, ButtonPressed playPressed)
            : base(endFunction, 325)
        {
            this.text = new Text("Security Console", FontSize.Large);
            this.text.OriginX = this.text.Width / 2;

            this.virusBackImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\WindowGraphics\EnemyWindow"));
            this.virusBackImage.CenterOrigin();
            this.virusBackImage.TintColor = color;

            this.startLevel = new Button(color, playText, playPressed);
            this.nextVirus = new Button(color, "Next =>", GetNextEnemy);
            this.previousVirus = new Button(color, "<= Previous", GetPreviousEnemy);

            this.startLevel.TintColor = color;
            this.nextVirus.TintColor = color;
            this.previousVirus.TintColor = color;

            this.startLevel.Position.X = OGE.HUDCamera.Width / 2;
            this.startLevel.Position.Y = OGE.HUDCamera.Height / 2 + maxHeight / 2 - 40;

            this.previousVirus.Position.X = OGE.HUDCamera.Width / 2 - 350;
            this.previousVirus.Position.Y = OGE.HUDCamera.Height / 2 + maxHeight / 2 - 40;

            this.nextVirus.Position.X = OGE.HUDCamera.Width / 2 + 350;
            this.nextVirus.Position.Y = OGE.HUDCamera.Height / 2 + maxHeight / 2 - 40;

            this.viewedEnemies = viewedEnemies;
            this.selectedKey = 0;
            this.keys = this.viewedEnemies.Keys.ToList();
            if (this.viewedEnemies.Count > 0)
            {
                this.enemy = Activator.CreateInstance(keys[selectedKey], false) as BaseEntity;
            }

            this.nameWordText = new Text("Name", FontSize.Small);
            this.nameText = new Text("", FontSize.Small);
            this.descriptionWordText = new Text("Description", FontSize.Small);
            this.descriptionText = new Text("", FontSize.Small);

            this.nameText.TintColor = color;
            this.nameWordText.TintColor = color;
            this.descriptionWordText.TintColor = color;
            this.descriptionText.TintColor = color;

            this.nameWordText.Align(AlignType.Center);
            this.nameText.Align(AlignType.Center);
            this.descriptionText.Align(AlignType.Center);
            this.descriptionWordText.Align(AlignType.Center);

            this.TintColor = color;
        }
        public LevelSelectorAnnouncer(AnnouncerEnded endFunction,Color color, ButtonPressed playPressed, ButtonPressed backPressed)
            : base(endFunction, (float)(Math.Ceiling(LevelData.MAX_LEVEL_DRIVE_NUMBER / 5.0) * 110 + 200))
        {
            text = new Text("Sector Console", FontSize.Large);
            text.Align(AlignType.Center);

            levels = new List<CheckButton>();

            int rowNumber = (int)Math.Ceiling(LevelData.MAX_LEVEL_DRIVE_NUMBER / 5.0);
            for (int i = 0; i < rowNumber; i++)
            {
                int coloumNumber = Math.Min(5, LevelData.MAX_LEVEL_DRIVE_NUMBER - i * 5);
                for (int j = 0; j < coloumNumber; j++)
                {
                    levels.Add(new CheckButton(color, (i * 5 + j + 1).ToString(), new ButtonPressed(ClearSelection)));
                    levels[levels.Count - 1].Position.X = OGE.HUDCamera.Width / 2 + (j - coloumNumber / 2.0f) * 110 + 50;
                    levels[levels.Count - 1].Position.Y = OGE.HUDCamera.Height / 2 + (i - rowNumber / 2.0f) * 110;
                    levels[levels.Count - 1].Selected = false;
                    levels[levels.Count - 1].Active = !GlobalVariables.LockedLevels[(GlobalVariables.CurrentDrive - 1) *
                        LevelData.MAX_LEVEL_DRIVE_NUMBER + i * 5 + j];
                }
            }

            levels[GlobalVariables.CurrentLevel - 1].Selected = true;
            TintColor = color;

            backButton = new Button(color, "Return to Drive Console", backPressed);
            backButton.Position.X = OGE.HUDCamera.Width / 2;
            backButton.Position.Y = OGE.HUDCamera.Height / 2 + maxHeight / 2 - 35;

            playButton = new Button(color, "Select Sector", playPressed);
            playButton.Position.X = backButton.Position.X;
            playButton.Position.Y = backButton.Position.Y - 60;

            selectedLevel = GlobalVariables.CurrentLevel;
            levelDataText = new Text("Sector Name: " + LevelData.GetLevel(selectedLevel).LevelName, FontSize.Medium);
            levelDataText.TintColor = color;
            levelDataText.Align(AlignType.Center);
        }
Example #3
0
        public Button(Color color, string text, ButtonPressed pressedFunction)
        {
            this.Active = true;

            this.Position = new Vector2();
            this.status = WindowButtonState.Normal;

            Texture2D texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\WindowGraphics\Buttons");
            normalImage = new Image(texture, new Rectangle(0, 0, texture.Width, texture.Height / 2));
            overImage = new Image(texture, new Rectangle(0, texture.Height / 2, texture.Width, texture.Height / 2));
            normalImage.CenterOrigin();
            overImage.CenterOrigin();

            this.color = color;
            this.TintColor = color;
            this.text = new Text(text, FontSize.Medium);
            this.text.OriginX = this.text.Width / 2;
            this.text.OriginY = this.text.Height / 2;
            this.pressedFunction = new List<ButtonPressed>();
            this.pressedFunction.Add(pressedFunction);

            collision = new Rectangle(-normalImage.OriginX, -normalImage.OriginY, normalImage.Width, normalImage.Height);
        }
Example #4
0
        void IInputHandler.OnInputUp(InputEventData eventData)
        {
            if (IsEnabled && eventData.PressType == InteractionSourcePressInfo.Select)
            {
                ButtonPressed.RaiseEvent();
                eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers.

                if (eventData.selectedObject == Anatomy)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._representationType = SingleConnectome.representationTypes.Anatomy;
                    Anatomy.GetComponentInChildren <TextMesh>().color = Color.red;
                    Tsne.GetComponentInChildren <TextMesh>().color    = new Color(1.0f, 1.0f, 1.0f);
                    Mds.GetComponentInChildren <TextMesh>().color     = new Color(1.0f, 1.0f, 1.0f);
                    Isomap.GetComponentInChildren <TextMesh>().color  = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == Tsne)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._representationType = SingleConnectome.representationTypes.Tsne;
                    Anatomy.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                    Tsne.GetComponentInChildren <TextMesh>().color    = Color.red;
                    Mds.GetComponentInChildren <TextMesh>().color     = new Color(1.0f, 1.0f, 1.0f);
                    Isomap.GetComponentInChildren <TextMesh>().color  = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == Mds)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._representationType = SingleConnectome.representationTypes.MDS;
                    Anatomy.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                    Tsne.GetComponentInChildren <TextMesh>().color    = new Color(1.0f, 1.0f, 1.0f);
                    Mds.GetComponentInChildren <TextMesh>().color     = Color.red;
                    Isomap.GetComponentInChildren <TextMesh>().color  = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == Isomap)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._representationType = SingleConnectome.representationTypes.Isomap;
                    Anatomy.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                    Tsne.GetComponentInChildren <TextMesh>().color    = new Color(1.0f, 1.0f, 1.0f);
                    Mds.GetComponentInChildren <TextMesh>().color     = new Color(1.0f, 1.0f, 1.0f);
                    Isomap.GetComponentInChildren <TextMesh>().color  = Color.red;
                }

                if (eventData.selectedObject == CAnatomy)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._classificationType = SingleConnectome.classificationTypes.Anatomy;
                    CAnatomy.GetComponentInChildren <TextMesh>().color   = Color.red;
                    Embeddness.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                    RichClub.GetComponentInChildren <TextMesh>().color   = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == Embeddness)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._classificationType = SingleConnectome.classificationTypes.Embeddness;
                    CAnatomy.GetComponentInChildren <TextMesh>().color   = new Color(1.0f, 1.0f, 1.0f);
                    Embeddness.GetComponentInChildren <TextMesh>().color = Color.red;
                    RichClub.GetComponentInChildren <TextMesh>().color   = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == RichClub)
                {
                    this.transform.parent.GetComponentInChildren <SingleConnectome>()._classificationType = SingleConnectome.classificationTypes.RichClub;
                    CAnatomy.GetComponentInChildren <TextMesh>().color   = new Color(1.0f, 1.0f, 1.0f);
                    Embeddness.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                    RichClub.GetComponentInChildren <TextMesh>().color   = Color.red;
                }


                if (eventData.selectedObject == EdgeOn)
                {
                    this.transform.parent.GetComponentInChildren <BoxCollider>().enabled = false;
                    EdgeOn.GetComponentInChildren <TextMesh>().color  = Color.red;
                    EdgeOff.GetComponentInChildren <TextMesh>().color = new Color(1.0f, 1.0f, 1.0f);
                }
                else if (eventData.selectedObject == EdgeOff)
                {
                    this.transform.parent.GetComponentInChildren <BoxCollider>().enabled = true;
                    EdgeOn.GetComponentInChildren <TextMesh>().color  = new Color(1.0f, 1.0f, 1.0f);
                    EdgeOff.GetComponentInChildren <TextMesh>().color = Color.red;
                }
            }
        }
Example #5
0
 protected void FireButtonPressedEvent(ApplicationBar source, ApplicationBar.Item button)
 {
     OnButtonPressed(source, button);
     ButtonPressed?.Invoke(source, button);
 }
Example #6
0
 private void rdoNeither_Click(object sender, RoutedEventArgs e)
 {
     if (buttonPressed == ButtonPressed.Neither)
     {
         rdoNeither.IsChecked = false;
         buttonPressed = ButtonPressed.Null;
     }
     else
     {
         buttonPressed = ButtonPressed.Neither;
     }
 }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        //if (Time.time - timeLastCombo > comboTextLinger) comboOutput.text = "(Nothing!)";
        //if (Time.time - timeLastCombo2 > comboTextLinger) comboOutput2.text = "(Nothing!)";
        if (!gameObject.GetComponent<PlayerController>().player2)
        {
            if (Time.time - player1Times.LeftRightPressed > 0.4)
            {
                lastLeftPressed = false;
                lastRightPressed = false;
            }
        }
        else {
            if (Time.time - player2Times.LeftRightPressed > 0.5)
            {
                lastLeftPressed = false;
                lastRightPressed = false;
            }
        }

        if (layout == 2)
        {
            if (!gameObject.GetComponent<PlayerController>().player2)
            {
                if (Input.GetKeyDown(KeyCode.W))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('1', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.S))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('2', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.A))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('3', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    player1Times.LeftRightPressed = Time.time;
                    if (lastLeftPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player1Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashLeftBool1 = true;
                        p1DBool = true;
                    }
                    lastLeftPressed = true;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.D))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('4', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    player1Times.LeftRightPressed = Time.time;
                    if (lastRightPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player1Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashRightBool1 = true;
                        p1DBool = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = true;
                }
                if (Input.GetKeyDown(inputMappings1[0]))
                {
                    ButtonPressed bp = new ButtonPressed('5', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchHighBool1 = true;
                    }
                }
                if (Input.GetKeyDown(inputMappings1[1]))
                {
                    ButtonPressed bp = new ButtonPressed('6', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchMedBool1 = true;
                    }
                }
                if (Input.GetKeyDown(inputMappings1[2]))
                {
                    ButtonPressed bp = new ButtonPressed('7', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchLowBool1 = true;
                    }
                }
            }

            else
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    lastLeftPressed = false;
                    lastRightPressed = false;
                    /*
                    ButtonPressed bp = new ButtonPressed('1', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                }
                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    lastLeftPressed = false;
                    lastRightPressed = false;
                    /*
                    ButtonPressed bp = new ButtonPressed('2', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                }
                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    player2Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('3', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                    if (lastLeftPressed && Time.time - player2Times.Dash > dashThreshold)
                    {
                        player2Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashLeftBool2 = true;
                        p2DBool = true;
                    }
                    lastLeftPressed = true;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    player2Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('4', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                    if (lastRightPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player2Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashRightBool2 = true;
                        p2DBool = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = true;
                }
                if (Input.GetKeyDown(inputMappings2[0]))
                {
                    ButtonPressed bp = new ButtonPressed('5', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchHighBool2 = true;
                    }
                }
                if (Input.GetKeyDown(inputMappings2[1]))
                {
                    ButtonPressed bp = new ButtonPressed('6', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchMedBool2 = true;
                    }
                }
                if (Input.GetKeyDown(inputMappings2[2]))
                {
                    ButtonPressed bp = new ButtonPressed('7', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchLowBool2 = true;
                    }
                }
            }
        }
        else if (layout == 3)
        {
            if (!gameObject.GetComponent<PlayerController>().player2)
            {
                if (Input.GetKeyDown(KeyCode.W))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('1', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.S))
                {
                    /*
                    ButtonPressed bp = new ButtonPressed('2', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.A))
                {
                    player1Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('3', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    if (lastLeftPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player1Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashLeftBool1 = true;
                        p1DBool = true;
                    }
                    lastLeftPressed = true;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.D))
                {
                    player1Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('4', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    */
                    if (lastRightPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player1Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashRightBool1 = true;
                        p1DBool = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = true;
                }
                if (Input.GetKeyDown(KeyCode.T))
                {
                    ButtonPressed bp = new ButtonPressed('5', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchHighBool1 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.Y))
                {
                    ButtonPressed bp = new ButtonPressed('6', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchMedBool1 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.U))
                {
                    ButtonPressed bp = new ButtonPressed('7', Time.time);
                    buttonPressedEnqueue(buttonPressedQueue, bp);
                    if (Time.time - player1Times.Punch > punchThreshold)
                    {
                        player1Times.Punch = Time.time;
                        punchLowBool1 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    lastLeftPressed = false;
                    lastRightPressed = false;
                    /*
                    ButtonPressed bp = new ButtonPressed('1', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                }
                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    lastLeftPressed = false;
                    lastRightPressed = false;
                    /*
                    ButtonPressed bp = new ButtonPressed('2', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                }
                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    player2Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('3', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                    if (lastLeftPressed && Time.time - player2Times.Dash > dashThreshold)
                    {
                        player2Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashLeftBool2 = true;
                        p2DBool = true;
                    }
                    lastLeftPressed = true;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    player2Times.LeftRightPressed = Time.time;
                    /*
                    ButtonPressed bp = new ButtonPressed('4', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    */
                    if (lastRightPressed && Time.time - player1Times.Dash > dashThreshold)
                    {
                        player2Times.Dash = Time.time;
                        audio.PlayOneShot(dash);
                        dashRightBool2 = true;
                        p2DBool = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = true;
                }
                if (Input.GetKeyDown(KeyCode.Keypad1))
                {
                    ButtonPressed bp = new ButtonPressed('5', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchHighBool2 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.Keypad2))
                {
                    ButtonPressed bp = new ButtonPressed('6', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchMedBool2 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.Keypad3))
                {
                    ButtonPressed bp = new ButtonPressed('7', Time.time);
                    buttonPressedEnqueue2(buttonPressedQueue2, bp);
                    if (Time.time - player2Times.Punch > punchThreshold)
                    {
                        player2Times.Punch = Time.time;
                        punchLowBool2 = true;
                    }
                    lastLeftPressed = false;
                    lastRightPressed = false;
                }
            }
        }
        else print("WTF");
    }
Example #8
0
 public void OnUIButtonPress()
 {
     ButtonPressed.Invoke(this);
 }
Example #9
0
 /// <summary>
 /// Raises the <see cref="ButtonPressed"/> event.
 /// </summary>
 /// <param name="window">The window that raised the event.</param>
 /// <param name="scancode">The <see cref="Scancode"/> that represents the button that was pressed.</param>
 protected virtual void OnButtonPressed(IUltravioletWindow window, Scancode scancode) =>
 ButtonPressed?.Invoke(window, this, scancode);
Example #10
0
 public void OnButtonPress(int Id)
 {
     ButtonPressed?.Invoke(Id);
 }
Example #11
0
 private void NoButtonPressed()
 {
     noButtonPressed?.Invoke();
     noButtonPressed = null;
     yesNoModalTransform.transform.SetParent(rootTransform);
 }
Example #12
0
 private void OnButtonPressed()
 {
     ButtonPressed?.Invoke(this);
 }
    public void setImage(Image image, ButtonPressed button)
    {
        Sprite toSet = getSpriteForButton(button);

        image.sprite = toSet;
    }
 public ButtonPressedMessage(ButtonPressed buttonPressEvent)
 {
     this.buttonType = buttonPressEvent.ButtonType;
 }
Example #15
0
        private void setWindow()
        {
            buttonPressed = ButtonPressed.Null;

            lblRecordCount.Content = "Record " + (contract.getIndex() + 1) + "/" + contract.getLength();

            DateTime date = new DateTime();
            Boolean bltsend = new Boolean();
            if (DateTime.TryParse(contract.getValue(1), out date))
                lblDateRevised.Content = date.ToShortDateString();
            else
                lblDateRevised.Content = null;
            txtClient.Text = contract.getValue(2);
            cboStatus.Text = contract.getValue(3);
            cboTypeofAgreement.Text = contract.getValue(4);
            cboUIDepartment.Text = contract.getValue(5);
            txtSpecialty.Text = contract.getValue(6);
            txtDepartmentContact.Text = contract.getValue(7);
            txtServiceClientLocation.Text = contract.getValue(8);
            txtSummaryofServices.Text = contract.getValue(9);
            setRadioButtons(contract.getValue(10));
            if (DateTime.TryParse(contract.getValue(11), out date))
                dtNextAutoRenewal.Text = date.ToShortDateString();
            else
                dtNextAutoRenewal.Text = null;
            if (DateTime.TryParse(contract.getValue(12), out date))
                dtHardTermination.Text = date.ToShortDateString();
            else
                dtHardTermination.Text = null;
            if (DateTime.TryParse(contract.getValue(13), out date))
                dtEffective.Text = date.ToShortDateString();
            else
                dtEffective.Text = null;
            if (DateTime.TryParse(contract.getValue(14), out date))
                dtCommitteeApproval.Text = date.ToShortDateString();
            else
                dtCommitteeApproval.Text = null;
            txtDurationofContract.Text = contract.getValue(15);
            txtFrequencyofServices.Text = contract.getValue(16);
            txtReimbursement1.Text = contract.getValue(17);
            txtReimbursement2.Text = contract.getValue(18);
            txtReimbursement3.Text = contract.getValue(19);
            txtTravelReimbursement.Text = contract.getValue(20);
            cboReimbursement1Period.Text = contract.getValue(21);
            cboReimbursement2Period.Text = contract.getValue(22);
            cboReimbursement3Period.Text = contract.getValue(23);
            cboTravelReimbursementPeriod.Text = contract.getValue(24);
            txtIndividualResponsible.Text = contract.getValue(25);
            txtFMR.Text = contract.getValue(26);
            if (DateTime.TryParse(contract.getValue(27), out date))
                dtLastFMRReview.Text = date.ToShortDateString();
            else
                dtLastFMRReview.Text = null;
            txtMFK.Text = contract.getValue(28);
            txtTimesheetInformation.Text = contract.getValue(29);
            txtEstimatedAnnualValue.Text = contract.getValue(30);
            txtReimbursementNotes.Text = contract.getValue(31);
            txtPeopleSoftContractNum.Text = contract.getValue(32);
            txtCredentialingProcess.Text = contract.getValue(33);
            if (DateTime.TryParse(contract.getValue(34), out date))
                dtMostRecentAnnualWorksheet.Text = date.ToShortDateString();
            else
                dtMostRecentAnnualWorksheet.Text = null;
            if (Boolean.TryParse(contract.getValue(35), out bltsend))
                chkBillingbyUI.IsChecked = bltsend;
            else
                chkBillingbyUI.IsChecked = false;
            if (Boolean.TryParse(contract.getValue(36), out bltsend))
                chkBAANeededCompleted.IsChecked = bltsend;
            else
                chkBAANeededCompleted.IsChecked = false;
            txtProviders.Text = contract.getValue(37);

            updateExpirationCountdown();
        }
Example #16
0
 private void rdoBoth_Click(object sender, RoutedEventArgs e)
 {
     if (buttonPressed == ButtonPressed.Both)
     {
         rdoBoth.IsChecked = false;
         buttonPressed = ButtonPressed.Null;
     }
     else
     {
         buttonPressed = ButtonPressed.Both;
     }
 }
 public void OnButtonPress(int Id)
 {
     ButtonPressed?.Invoke(Id);
     DataChanged?.Invoke();
 }
Example #18
0
        // Methods

        internal void ShowYesNoModal(Transform parent, string text, ButtonPressed yesButtonPressedCallback, string yesButtonText = "Yes", string noButtonText = "No", ButtonPressed noButtonPressedCallback = null, bool animateParentCanvas = true, string checkboxText = "")
        {
            Parse();
            yesNoModalTransform.position = yesNoModalPosition;
            keyboardTransform.transform.SetParent(rootTransform);
            yesNoModalTransform.transform.SetParent(parent);

            YesNoText     = text;
            YesButtonText = yesButtonText;
            NoButtonText  = noButtonText;

            yesButtonPressed = yesButtonPressedCallback;
            noButtonPressed  = noButtonPressedCallback;

            CheckboxText   = checkboxText;
            CheckboxValue  = false;
            CheckboxActive = !string.IsNullOrEmpty(checkboxText);

            yesNoModalView.SetField("_animateParentCanvas", animateParentCanvas);

            parserParams.EmitEvent("close-yes-no");
            parserParams.EmitEvent("open-yes-no");
        }
Example #19
0
 public static void AddButtonPressedListener(ButtonPressed buttonPressEvent)
 {
     _buttonEvent += buttonPressEvent;
 }
Example #20
0
 private void OnButtonPressed(Buttons button)
 {
     ButtonPressed?.Invoke(this,
                           new GamepadButtonEventArgs(button));
 }
 void onButtonPressed()
 {
     ButtonPressed?.Invoke(this);
 }
Example #22
0
 private void button1_Click(object sender, EventArgs e)
 {
     ButtonPressed?.Invoke();
 }
Example #23
0
    public void buttonPressedEnqueue2(Queue<ButtonPressed> q, ButtonPressed bp)
    {
        while (q.Count > 0 && Time.time - q.Peek().TimeCreated > comboTimeout)
        {
            //print("delete! There are " + q.Count + " buttons left.");
            q.Dequeue();
        }

        if (q.Count <= keyBufferSize)
        {
            q.Enqueue(bp);
        }
        if (q.Count > keyBufferSize)
        {
            q.Dequeue();
            q.Enqueue(bp);
        }
        /*
        Queue<ButtonPressed> q1 = new Queue<ButtonPressed>();
        Queue<ButtonPressed> q2 = new Queue<ButtonPressed>();
        Queue<ButtonPressed> q3 = new Queue<ButtonPressed>();
        */
        Queue<ButtonPressed> qPunchHigh = new Queue<ButtonPressed>();
        Queue<ButtonPressed> qPunchMed = new Queue<ButtonPressed>();
        Queue<ButtonPressed> qPunchLow = new Queue<ButtonPressed>();
        //Queue<ButtonPressed> qDashLeft = new Queue<ButtonPressed>();
        //Queue<ButtonPressed> qDashRight = new Queue<ButtonPressed>();
        foreach (ButtonPressed obj in q)
        {
            /*
            q1.Enqueue(obj);
            q2.Enqueue(obj);
            q3.Enqueue(obj);
            */
            qPunchHigh.Enqueue(obj);
            qPunchMed.Enqueue(obj);
            qPunchLow.Enqueue(obj);
            //qDashLeft.Enqueue(obj);
            //qDashRight.Enqueue(obj);
        }
        /*
        if (containsCombo(q1, comboHadouken, 0) && Time.time - player2Times.Hadouken > hadoukenThreshold)
        {
            player2Times.Hadouken = Time.time;
            player2Times.LastCombo = Time.time;
            //audio.PlayOneShot(hadoukenSound);
            q.Clear();
        }
        if (containsCombo(q2, comboTatsumaki, 0) && Time.time - comboTimeTatsumaki2 > tatsumakiThreshold)
        {
            comboTimeTatsumaki2 = Time.time;
            timeLastCombo2 = Time.time;
            comboOutput2.text = "TATSUMAKI SEMPUKYAKU";
            audio.PlayOneShot(dodge);
            q.Clear();
        }
        if (containsCombo(q3, comboWhirlwind, 0) && Time.time - player2Times.Whirlwind > whirlwindThreshold)
        {
            player2Times.Whirlwind = Time.time;
            player2Times.LastCombo = Time.time;
            //audio.PlayOneShot(whirlwindSound);
            q.Clear();
        }
        */
        if (containsCombo(qPunchHigh, comboPunchHigh, 0) && Time.time - player2Times.PunchHighCombo > punchHighComboThreshold)
        {

            player2Times.PunchHighCombo = Time.time;
            //player2Times.LastCombo = Time.time;
            audio.PlayOneShot(punchHighSound);
            punchHighComboBool2 = true;
            p2c1Bool = true;
            q.Clear();
        }
        if (containsCombo(qPunchMed, comboPunchMed, 0) && Time.time - player2Times.PunchMedCombo > punchMedComboThreshold)
        {

            player2Times.PunchMedCombo = Time.time;
            //player2Times.LastCombo = Time.time;
            audio.PlayOneShot(punchMedSound);
            punchMedComboBool2 = true;
            p2c2Bool = true;
            q.Clear();
        }
        if (containsCombo(qPunchLow, comboPunchLow, 0) && Time.time - player2Times.PunchLowCombo > punchLowComboThreshold)
        {

            player2Times.PunchLowCombo = Time.time;
            //player2Times.LastCombo = Time.time;
            audio.PlayOneShot(punchLowSound);
            punchLowComboBool2 = true;
            p2c3Bool = true;
            q.Clear();
        }
        /*
        if (containsCombo(qDashLeft, comboDashLeft, 0) && Time.time - player2Times.Dash > dashThreshold)
        {
            player2Times.Dash = Time.time;
            //player2Times.LastCombo = Time.time;
            audio.PlayOneShot(dash);
            dashLeftBool2 = true;
            p2DBool = true;
            q.Clear();
        }
        if (containsCombo(qDashRight, comboDashRight, 0) && Time.time - player2Times.Dash > dashThreshold)
        {
            player2Times.Dash = Time.time;
            audio.PlayOneShot(dash);
            dashRightBool2 = true;
            p2DBool = true;
            q.Clear();
        }
        */
        //queuePrint(q);
    }
Example #24
0
        private void UpdateTimer(Keys key, Buttons button, float directionX, float directionY, float elapsedTime, ButtonDown downAction, ButtonUp upAction, ButtonPressed pressAction, ref float downTimer, ref float upTimer)
        {
            if (IsKeyDown(key) || currentGamePadState.IsButtonDown(button))
            {
                if(downAction != null && downTimer == 0)
                    downAction.Invoke(directionX, directionY, upTimer, PlayerIndex);

                downTimer += elapsedTime;
                upTimer = 0;
            }
            else if (IsKeyUp(key) || currentGamePadState.IsButtonUp(button))
            {
                //Check if it was a press of key
                if(this.oldKeyboardState.IsKeyDown(key) || oldGamePadState.IsButtonDown(button)){
                    if (pressAction != null)
                        pressAction.Invoke(PlayerIndex);

                    if (upAction != null)
                        upAction.Invoke(downTimer, PlayerIndex);
                }
                upTimer += elapsedTime;
                downTimer = 0;
            }
        }
Example #25
0
 public void AddFunction(ButtonPressed pressed)
 {
     this.pressedFunction.Add(pressed);
 }
Example #26
0
 private void rdoConsultative_Click(object sender, RoutedEventArgs e)
 {
     if (buttonPressed == ButtonPressed.Consultative)
     {
         rdoConsultative.IsChecked = false;
         buttonPressed = ButtonPressed.Null;
     }
     else
     {
         buttonPressed = ButtonPressed.Consultative;
     }
 }
 private void OnButtonPress(object sender, EventArgs args)
 {
     ButtonPressed?.Invoke(sender, args);
 }
Example #28
0
 private void rdoProcedural_Click(object sender, RoutedEventArgs e)
 {
     if (buttonPressed == ButtonPressed.Procedural)
     {
         rdoProcedural.IsChecked = false;
         buttonPressed = ButtonPressed.Null;
     }
     else
     {
         buttonPressed = ButtonPressed.Procedural;
     }
 }
Example #29
0
 public void ButtonPressedMessage(ButtonPressed btnPrs, PlayerNumber playnum)
 {
     Enqueue(new LogMsg
     {
         ReportedAt = DateTime.UtcNow,
         ButtonPressed = btnPrs,
         Player = playnum,
         Seriousness = Severity.Info,
         LogType = LogType.InputPressed
     });
 }
Example #30
0
 protected virtual void OnButtonPressed(JoystickEventArgs e)
 {
     ButtonPressed?.Invoke(this, e);
 }