Ejemplo n.º 1
0
    // BUTTON INTERACTION METHODS //

    // Menu Buttons
    public void initializeButtonRoot()
    {
        Button[] temp = optionsRoot.GetComponentsInChildren <Button>();
        buttons = new List <GameObject>();
        foreach (var button in temp)
        {
            buttons.Add(button.gameObject);
        }
        buttonRoot = new ButtonDisplay(buttons[0], null);
    }
Ejemplo n.º 2
0
    public void clickEventCameraMenu()
    {
        ButtonDisplay crawler = buttonRoot.branchButtons[1];

        if (crawler.open == true)
        {
            crawler.closeList();
        }
        else
        {
            crawler.addList(new List <ButtonDisplay> {
                new ButtonDisplay(buttons[6], null), new ButtonDisplay(buttons[7], null), new ButtonDisplay(buttons[8], null)
            });
        }
        redrawOptions();
    }
Ejemplo n.º 3
0
    public void clickEventSaveMenu()
    {
        ButtonDisplay crawler = buttonRoot.branchButtons[0];

        if (crawler.open == true)
        {
            crawler.closeList();
        }
        else
        {
            crawler.addList(new List <ButtonDisplay> {
                new ButtonDisplay(buttons[2], null), new ButtonDisplay(buttons[3], null), new ButtonDisplay(buttons[4], null)
            });
        }
        redrawOptions();
    }
    private void Init()
    {
        for (int i = 0; i < cardSpaces.Length; i++)
        {
            RectTransform space = cardSpaces[i];

            ButtonDisplay currButton = LeanPool.Spawn(buttonDisplayPrefab);
            currButton.transform.SetParent(space, false);
            RectTransform rTransform = (RectTransform)currButton.transform;
            rTransform.anchorMin = new Vector2(0, 0);
            rTransform.anchorMax = new Vector2(1, 1);
            rTransform.offsetMin = Vector2.zero;
            rTransform.offsetMax = Vector2.zero;

            buttonInstances[i] = currButton;
        }
    }
        /// <summary>
        /// Initialize a new instance of the NavigatorButton class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorButton(KryptonNavigator navigator,
                               NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create collection for use defined and fixed buttons
            _buttonSpecs = new NavigatorButtonSpecCollection(navigator);
            _fixedSpecs  = new NavFixedButtonSpecCollection(navigator);

            // Create the fixed buttons
            _fixedPrevious = new ButtonSpecNavPrevious(_navigator);
            _fixedNext     = new ButtonSpecNavNext(_navigator);
            _fixedContext  = new ButtonSpecNavContext(_navigator);
            _fixedClose    = new ButtonSpecNavClose(_navigator);

            // Hook into the click events for the buttons
            _fixedPrevious.Click += new EventHandler(OnPreviousClick);
            _fixedNext.Click     += new EventHandler(OnNextClick);
            _fixedContext.Click  += new EventHandler(OnContextClick);
            _fixedClose.Click    += new EventHandler(OnCloseClick);

            // Add fixed buttons into the display collection
            _fixedSpecs.AddRange(new ButtonSpecNavFixed[] { _fixedPrevious, _fixedNext, _fixedContext, _fixedClose });

            // Default fields
            _displayLogic     = ButtonDisplayLogic.Context;
            _mapTextContext   = MapKryptonPageText.TextTitle;
            _mapImageContext  = MapKryptonPageImage.Small;
            _actionClosed     = CloseButtonAction.RemovePageAndDispose;
            _actionContext    = ContextButtonAction.SelectPage;
            _actionPrevious   = _actionNext = DirectionButtonAction.ModeAppropriateAction;
            _displayPrevious  = _displayNext = _displayContext = _displayClosed = ButtonDisplay.Logic;
            _shortcutClose    = DEFAULT_SHORTCUT_CLOSE;
            _shortcutContext  = DEFAULT_SHORTCUT_CONTEXT;
            _shortcutNext     = DEFAULT_SHORTCUT_NEXT;
            _shortcutPrevious = DEFAULT_SHORTCUT_PREVIOUS;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initialize a new instance of the NavigatorButton class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorButton(KryptonNavigator navigator,
                               NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create collection for use defined and fixed buttons
            _buttonSpecs = new NavigatorButtonSpecCollection(navigator);
            _fixedSpecs = new NavFixedButtonSpecCollection(navigator);

            // Create the fixed buttons
            _fixedPrevious = new ButtonSpecNavPrevious(_navigator);
            _fixedNext = new ButtonSpecNavNext(_navigator);
            _fixedContext = new ButtonSpecNavContext(_navigator);
            _fixedClose = new ButtonSpecNavClose(_navigator);

            // Hook into the click events for the buttons
            _fixedPrevious.Click += new EventHandler(OnPreviousClick);
            _fixedNext.Click += new EventHandler(OnNextClick);
            _fixedContext.Click += new EventHandler(OnContextClick);
            _fixedClose.Click += new EventHandler(OnCloseClick);

            // Add fixed buttons into the display collection
            _fixedSpecs.AddRange(new ButtonSpecNavFixed[] { _fixedPrevious, _fixedNext, _fixedContext, _fixedClose });

            // Default fields
            _displayLogic = ButtonDisplayLogic.Context;
            _mapTextContext = MapKryptonPageText.TextTitle;
            _mapImageContext = MapKryptonPageImage.Small;
            _actionClosed = CloseButtonAction.RemovePageAndDispose;
            _actionContext = ContextButtonAction.SelectPage;
            _actionPrevious = _actionNext = DirectionButtonAction.ModeAppropriateAction;
            _displayPrevious = _displayNext = _displayContext = _displayClosed = ButtonDisplay.Logic;
            _shortcutClose = _defaultShortcutClose;
            _shortcutContext = _defaultShortcutContext;
            _shortcutNext = _defaultShortcutNext;
            _shortcutPrevious = _defaultShortcutPrevious;
        }