protected override void Start()
        {
            base.Start();

            _closeButtonUI        = EntityManager.Find("closeButton").FindComponent <ButtonUI>();
            _closeButtonUI.Click += OnButtonCloseClicked;

            _goPlayButton          = EntityManager.Find("goPlayButton");
            _goPlayButtonUI        = _goPlayButton.FindComponent <ButtonUI>();
            _goPlayButtonUI.Click += OnButtonGoPlayClicked;

            _goRouletteButton          = EntityManager.Find("goRouletteButton");
            _goRouletteButtonUI        = _goRouletteButton.FindComponent <ButtonUI>();
            _goRouletteButtonUI.Click += OnButtonGoRouletteClicked;

            _onePlayerToggleButtonUI        = EntityManager.Find("onePlayerToggleButton").FindComponent <ToggleButtonUI>();
            _onePlayerToggleButtonUI.Click += OnPlayerToggleButtonClicked;

            _twoPlayersPlayToggleButton          = EntityManager.Find("twoPlayersPlayToggleButton");
            _twoPlayersPlayToggleButtonUI        = _twoPlayersPlayToggleButton.FindComponent <ToggleButtonUI>();
            _twoPlayersPlayToggleButtonUI.Click += OnPlayersToggleButtonClicked;

            _twoPlayersRouletteToggleButton          = EntityManager.Find("twoPlayersRouletteToggleButton");
            _twoPlayersRouletteToggleButtonUI        = _twoPlayersRouletteToggleButton.FindComponent <ToggleButtonUI>();
            _twoPlayersRouletteToggleButtonUI.Click += OnPlayersToggleButtonClicked;

            _touchWarningText = EntityManager.Find("touchWarningText");
        }
Example #2
0
    // Use this for initialization
    void Start()
    {
        buttonUI = GameObject.FindObjectOfType <ButtonUI> ();

        PlayerController player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController> ();
        //player.PowerupChange += buttonUI.c_ItemChangeEvent;
    }
Example #3
0
        public WindowUI(string name)
        {
            transform.UniformMargins = Theme.LargeMargin;

            title = new ButtonUI
            {
                transform =
                {
                    BottomPercent = 1f,
                    BottomMargin  = -Theme.LayoutHeight
                },
                label = { Text = name }
            };

            group = new AutoLayoutAreaUI
            {
                transform  = { TopMargin = Theme.LayoutHeight + Theme.MediumMargin },
                PanelColor = Theme.BackgroundColor
            };

            Add(title);
            Add(group);

            title.OnPressedMethods += OnTitlePressed;
        }
        protected override void Start()
        {
            base.Start();

            _closeButtonUI        = EntityManager.Find("closeButton").FindComponent <ButtonUI>();
            _closeButtonUI.Click += OnButtonCloseClicked;
        }
Example #5
0
    private void Start()
    {
        buttonUIScript    = FindObjectOfType <ButtonUI>();
        inventoryUIScript = FindObjectOfType <InventoryUI>();

        AddInventory();
    }
Example #6
0
 /* Add color cyan to button passed */
 private void addColor(ButtonUI button)
 {
     resetColorButtons();
     button.button.GetComponent <Image>().color = Color.cyan;
     string[] splitString = button.textInfo.text.Split(' ');
     GameManager.instance.levelChoosen = int.Parse(splitString[1]);
 }
    void ChangeSelection(int _directionSign)
    {
        selectable = false;

        switch (Mathf.Sign(_directionSign))
        {
        case -1:
            if (currentlySelectedButtonIndex == customButtons.Length - 1)
            {
                currentlySelectedButtonIndex = 0;
            }
            else
            {
                currentlySelectedButtonIndex++;
            }
            break;

        case 1:
            if (currentlySelectedButtonIndex == 0)
            {
                currentlySelectedButtonIndex = customButtons.Length - 1;
            }
            else
            {
                currentlySelectedButtonIndex--;
            }
            break;
        }

        currentlySelectedButton?.Deselect();
        currentlySelectedButton = customButtons[currentlySelectedButtonIndex];
        currentlySelectedButton.Select();
    }
 public void PotongRockwool()
 {
     RKUtuh.SetActive(false);
     PotonganRK.SetActive(true);
     ButtonUI.SetActive(true);
     AlertUI.SetActive(true);
 }
Example #9
0
 public static RenderFragment ToRenderFragment(this ButtonUI button, ButtonViewModel model)
 => builder =>
 {
     builder.OpenComponent(0, button.CustomType ?? typeof(DefaultButton));
     builder.AddAttribute(1, nameof(DefaultButton.Model), model);
     builder.CloseComponent();
 };
Example #10
0
        public override void Render()
        {
            base.Render();

            Draw.SpriteBatch.Begin(
                SpriteSortMode.Deferred,
                BlendState.AlphaBlend,
                SamplerState.LinearClamp,
                DepthStencilState.None,
                RasterizerState.CullNone,
                null,
                Engine.ScreenMatrix
                );

            Vector2 anchor = new Vector2(96f, 96f);

            // render the spinning cogwheel
            if (!(cogwheel?.Texture?.Texture?.IsDisposed ?? true))
            {
                Vector2 cogPosition = anchor + new Vector2(0f, 0f);
                float   cogScale    = 0.25f;
                float   cogRot      = (cogwheelSpinning ? RawTimeActive : cogwheelStopTime) * 4f;

                // render a 2 pixel-thick cogwheel shadow / outline
                for (int x = -2; x <= 2; x++)
                {
                    for (int y = -2; y <= 2; y++)
                    {
                        if (x != 0 || y != 0)
                        {
                            cogwheel.DrawCentered(cogPosition + new Vector2(x, y), Color.Black, cogScale, cogRot);
                        }
                    }
                }

                // render the cogwheel itself
                cogwheel.DrawCentered(cogPosition, Color.White, cogScale, cogRot);
            }

            if (modUpdatingMessage != null)
            {
                // render sub-text (appears smaller under the text)
                drawText(modUpdatingMessage, anchor + new Vector2(48f, 0f), 0.8f);
            }

            if (modUpdatingSubMessage != null)
            {
                // render sub-text (appears smaller under the text)
                drawText(modUpdatingSubMessage, anchor + new Vector2(53f, 40f), 0.5f);
            }

            if (showCancel)
            {
                string label = Dialog.Clean("AUTOUPDATECHECKER_SKIP");
                ButtonUI.Render(new Vector2(1880f, 1024f), label, Input.MenuCancel, 0.5f, 1f);
            }

            Draw.SpriteBatch.End();
        }
    /* Add color cyan to button passed */
    private void addColor(ButtonUI button)
    {
        resetColorButtons();
        button.button.GetComponent <Image>().color = Color.cyan;
        string username = button.textInfo.text;

        GameManager.instance.userAgainst = haveUser(username);
    }
Example #12
0
 private void Start()
 {
     buttonUIScript = FindObjectOfType <ButtonUI>();
     if (rotatedState)
     {
         transform.rotation = Quaternion.Euler(rotateAngle);
     }
 }
    public void SelectFirst()
    {
        DeselectAll();

        currentlySelectedButtonIndex = 0;
        currentlySelectedButton      = customButtons[currentlySelectedButtonIndex];
        currentlySelectedButton.Select();
    }
Example #14
0
 public override void Unload()
 {
     InfoUI = null;
     ButtonUI = null;
     ConfirmPanelUI = null;
     InfoUserInterface = null;
     ButtonUserInterface = null;
     ConfirmPanelUserInterface = null;
 }
Example #15
0
    private void Start()
    {
        buttonUIScript = FindObjectOfType <ButtonUI>();

        if (screwedState)
        {
            transform.position = transform.position + screwMoveDirection;
        }
    }
Example #16
0
 public void Select()
 {
     if (_active)
     {
         _active.Diselect();
     }
     _active = this;
     animator.SetBool("selected", true);
     //button.color = colors[1];
 }
Example #17
0
        public static ButtonUI NewButtonUI(string name = UIBaser.UIDefaultName, string description = "")
        {
            ButtonUI button = new ButtonUI()
            {
                Name        = name,
                Description = description
            };

            return(button);
        }
Example #18
0
        public static ButtonUI NewButtonUI(DynamicSpriteFont font, string name = UIBaser.UIDefaultName, string description = "")
        {
            ButtonUI button = new ButtonUI(font)
            {
                Name        = name,
                Description = description
            };

            return(button);
        }
Example #19
0
        public HierarchyUI() : base("Hierarchy")
        {
            transform.RightPercent = 0.84f;

            rebuildButton = new ButtonUI {
                label = { Text = "Rebuild Scene" }
            };
            rebuildButton.OnPressedMethods += OnRebuildPressed;

            group.Add(rebuildButton);
        }
Example #20
0
    private void Start()
    {
        buttonUIScript = FindObjectOfType <ButtonUI>();

        meshRenderer = GetComponent <MeshRenderer>();

        if (removedState)
        {
            transform.position = transform.position + moveDirection;
        }
    }
Example #21
0
 public static ButtonViewModel ToViewModel(this ButtonUI button)
 => new ButtonViewModel
 {
     ButtonId          = button.ButtonId,
     Icon              = button.Icon ?? "",
     Label             = button.Label ?? "",
     ShouldConfirm     = button.ShouldConfirm,
     IsPrimary         = button.IsPrimary,
     IsVisible         = button.IsVisible ?? ((object o, EntityState s) => true),
     RequiresValidForm = button.RequiresValidForm
 };
Example #22
0
        public static ButtonUI NewButtonUI(Texture2D defaultTexture, Texture2D enterTexture, Texture2D pressTexture,
                                           string name = UIBaser.UIDefaultName, string description = "")
        {
            ButtonUI button = new ButtonUI(defaultTexture, enterTexture, pressTexture)
            {
                Name        = name,
                Description = description
            };

            return(button);
        }
Example #23
0
        public static ButtonUI NewButtonUI(Texture2D defaultTexture, Texture2D pressingTexture, DynamicSpriteFont font,
                                           string name = UIBaser.UIDefaultName, string description = "")
        {
            ButtonUI button = new ButtonUI(defaultTexture, pressingTexture, font)
            {
                Name        = name,
                Description = description
            };

            return(button);
        }
Example #24
0
 public static ButtonViewModel ToViewModel(this ButtonUI button)
 {
     return(new ButtonViewModel
     {
         ButtonId = button.ButtonId,
         Icon = button.Icon ?? "",
         Label = button.Label ?? "",
         ShouldConfirm = button.ShouldConfirm,
         IsPrimary = button.IsPrimary,
         RequiresValidForm = button.RequiresValidForm
     });
 }
    private void addButton(User user)
    {
        GameObject newButton = btnObjectPool.GetObject();

        newButton.transform.SetParent(contentPanel);

        ButtonUI button = newButton.GetComponent <ButtonUI>();

        button.setup(user.name);
        buttons.Add(button.button);
        button.button.onClick.AddListener(() => addColor(button));
    }
Example #26
0
    private void Start()
    {
        buttonUIScript = FindObjectOfType <ButtonUI>();

        for (int i = 0; i < rotateAngleData.Length; i++)
        {
            if (i == rotatedStepStartStateIndex)
            {
                indexRotation      = rotatedStepStartStateIndex;
                transform.rotation = Quaternion.Euler(rotateAngleData[i].rotateAngle);
            }
        }
    }
Example #27
0
 bool ButtonSelected(WindowUI window, ButtonUI button)
 {
     if (window != null && button != null)
     {
         int buttonWindowId   = button.GetWindow().GetWindowId();
         int expectedWindowId = window.GetWindowId();
         if (buttonWindowId.Equals(expectedWindowId))
         {
             return(true);
         }
     }
     return(false);
 }
Example #28
0
    private void Start()
    {
        buttonUIScript = FindObjectOfType <ButtonUI>();

        //ObjectA
        objectA.AddComponent <APosition>();
        objectA.AddComponent <Outline>();
        meshRendererA  = objectA.GetComponent <MeshRenderer>();
        materialA      = meshRendererA.material;
        materialAColor = materialA.color;

        objectA.GetComponent <APosition>().buttonUIScript    = buttonUIScript;
        objectA.GetComponent <APosition>().installableScript = this;
        objectA.GetComponent <APosition>().outline           = objectA.GetComponent <Outline>();
        objectA.GetComponent <APosition>().meshRenderer      = meshRendererA;

        objectA.GetComponent <Outline>().enabled = false;

        //ObjectB
        objectB.AddComponent <BPosition>();
        objectB.AddComponent <Outline>();
        meshRendererB  = objectB.GetComponent <MeshRenderer>();
        materialB      = meshRendererB.material;
        materialBColor = materialB.color;

        objectB.GetComponent <BPosition>().buttonUIScript    = buttonUIScript;
        objectB.GetComponent <BPosition>().installableScript = this;
        objectB.GetComponent <BPosition>().outline           = objectB.GetComponent <Outline>();
        objectB.GetComponent <BPosition>().meshRenderer      = meshRendererB;

        objectB.GetComponent <Outline>().enabled = false;

        if (installState)
        {
            meshRendererA.enabled = true;
            meshRendererB.enabled = false;

            materialBColor.a = 0f;
            materialB.color  = materialBColor;
        }
        else
        {
            meshRendererA.enabled = false;
            meshRendererB.enabled = true;

            materialAColor.a = 0f;
            materialA.color  = materialAColor;
        }
    }
Example #29
0
    private void Start()
    {
        buttonUIScript = FindObjectOfType <ButtonUI>();

        gameObject.AddComponent <Outline>();
        outline      = GetComponent <Outline>();
        meshRenderer = GetComponent <MeshRenderer>();

        outline.enabled = false;

        if (removedState)
        {
            transform.position = transform.position + moveDirection;
        }
    }
Example #30
0
        private void Initialize()
        {
            this.eventAggregator
            .GetEvent <ExpenseAddedEvent>()
            .Subscribe(async() => await this.RefreshAsync(this.dateTimeService.UtcNow));

            this.eventAggregator
            .GetEvent <DateSelectedEvent>()
            .Subscribe(async(date) => await this.RefreshAsync(date));

            this.ExpensesList = new CollectionUI <Expense>();
            this.AddButton    = new ButtonUI(new Command(async() => await this.OnButtonAddClicked()));

            this.RefreshAsync(this.dateTimeService.UtcNow);
        }