public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var titleButton = new TitleButton {
                Frame = new CGRect(0, 0, 320f, 44f)
            };

            titleButton.TouchUpInside += (sender, e) => ViewModel.GoToLanguages.ExecuteIfCan();
            ViewModel.WhenAnyValue(x => x.SelectedLanguage).Subscribe(x => titleButton.Text = x.Name);
            NavigationItem.TitleView = titleButton;

            ViewModel.LoadCommand.IsExecuting.Where(x => x).Subscribe(_ =>
                                                                      TableView.ScrollRectToVisible(new CGRect(0, 0, 1, 1), true));

            TableView.RegisterNibForCellReuse(RepositoryTableViewCell.Nib, RepositoryTableViewCell.Key);
            TableView.RowHeight          = UITableView.AutomaticDimension;
            TableView.EstimatedRowHeight = 80f;

            ViewModel.Repositories.Changed.Subscribe(_ =>
            {
                var sections   = new List <Section>();
                var repoGroups = ViewModel.Repositories.GroupBy(x => x.Time);
                foreach (var g in repoGroups)
                {
                    var sec = new Section(CreateHeaderView(g.Key));
                    foreach (var x in g.Select(x => x.Repository).Where(x => x.Owner != null))
                    {
                        sec.Add(new RepositoryElement(x.Owner.Login, x.Name, x.Description, x.Owner.AvatarUrl, () => ViewModel.GoToRepositoryCommand.ExecuteIfCan(x)));
                    }
                    sections.Add(sec);
                }
                Root.Reset(sections);
            });
        }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     button       = this.gameObject.GetComponent <Button>();
     title_Button = main_camera.GetComponent <TitleButton>();
     inventory    = inven.GetComponent <Inventory>();
     Equip        = inven.GetComponent <Equipment>();
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    public IEnumerator LoadGame(string pName)
    {
        Time.timeScale = 1;
        canvasElements[fadeOutElement].raycastTarget = true;
        foreach (MaskableGraphic element in canvasElements)
        {
            element.CrossFadeAlpha(1.0f, 1.0f, true);
        }

        yield return(new WaitForSeconds(2.0f));

        AsyncOperation tmp = SceneManager.LoadSceneAsync(pName);

        while (!tmp.isDone)
        {
            yield return(new WaitForEndOfFrame());
        }

        canvasElements[fadeOutElement].raycastTarget = false;
        foreach (MaskableGraphic element in canvasElements)
        {
            element.CrossFadeAlpha(0.0f, 1.0f, true);
        }
        ButtonManager tmp2 = FindObjectOfType <ButtonManager>();
        TitleButton   tmp3 = FindObjectOfType <TitleButton>();

        if (tmp2 != null)
        {
            tmp2.SwapToMenuWithIndex(ButtonManager.activeMenu);
            if (tmp3 != null)
            {
                tmp3.LerpMove();
            }
        }
    }
Ejemplo n.º 4
0
    public void OnButtonExit(TitleButton button)
    {
        if (_hoverButton != null && _hoverButton == button)
        {
            StopCoroutine(_runningCoroutine);
        }

        ResetButton();
    }
Ejemplo n.º 5
0
    public void OnButtonEnter(TitleButton button)
    {
        _hoverButton = button;
        ResetButton();

        button.BackGround.sprite = _sprites[button.name + "Hover"];
        button.BackGround.color  = Color.white;
        Blick();
    }
Ejemplo n.º 6
0
 /// <summary>
 /// Обновить информацию по оператору
 /// </summary>
 protected void UpdateOperatorInfo(string operatorName, Image operatorIcon)
 {
     TitleButton.TextMain = operatorName;
     TitleButton.ChangeWidth();
     TitleButton.DisplayerText     = operatorName;
     TitleButton.ReflectionType    = ReflectionTypes.DisplayInNew;
     LogotypeButton.Icon           = operatorIcon;
     LogotypeButton.DisplayerText  = operatorName;
     LogotypeButton.ReflectionType = ReflectionTypes.DisplayInNew;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Обновить информацию по оператору
 /// </summary>
 protected void UpdateOperatorInfo(Operator op)
 {
     if (op == null)
     {
         return;
     }
     TitleButton.TextMain = op.Name;
     TitleButton.ChangeWidth();
     TitleButton.DisplayerText     = op.Name;
     TitleButton.ReflectionType    = ReflectionTypes.DisplayInCurrent;
     LogotypeButton.Icon           = op.LogoTypeImage;
     LogotypeButton.DisplayerText  = op.Name;
     LogotypeButton.ReflectionType = ReflectionTypes.DisplayInCurrent;
 }
Ejemplo n.º 8
0
        public override Rectangle GetTitleButtonRectangle(TitleButton button, int windowWidth, int windowHeight)
        {
            switch (button)
            {
            case TitleButton.Close:
                return(new Rectangle(windowWidth - 21, 3, 17, 17));

            case TitleButton.Maximize:
                return(new Rectangle(windowWidth - 40, 3, 17, 17));

            case TitleButton.Minimize:
                return(new Rectangle(windowWidth - 59, 3, 17, 17));
            }
            return(Rectangle.Empty);
        }
Ejemplo n.º 9
0
        void Start()
        {
            OnUnPause();

            Button pausebtn = PauseButton.GetComponent <Button>();

            pausebtn.onClick.AddListener(PauseOnClick);

            Button playbtn = PlayButton.GetComponent <Button>();//スタート(ポーズ中)

            playbtn.onClick.AddListener(PlayOnClick);

            Button titlebtn = TitleButton.GetComponent <Button>();//タイトル(ポーズ中)

            titlebtn.onClick.AddListener(TitleOnClick);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            BackgroundView.StyleBasicPanel();

            TitleButton.SetText(ItemText);

            DeleteButton.SetImage(UIImage.FromFile("Images/External/redx.png"), UIControlState.Normal);

            TitleButton.TouchUpInside  += HandleTitleButtonClicked;
            DeleteButton.TouchUpInside += HandleDeleteButtonClicked;

            TitleButton.SetTitleColor(0xFFFFFFFF.UIColor(), UIControlState.Normal);
            TitleButton.AlignButtonLeft();
            DeleteButton.SetTitleColor(0xFFFFFFFF.UIColor(), UIControlState.Normal);
        }
        private async void QueryTextBox_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
        {
            if ((e.Key == Windows.System.VirtualKey.Accept || e.Key == Windows.System.VirtualKey.Search || e.Key == Windows.System.VirtualKey.Enter))
            {
                if (!String.IsNullOrEmpty(queryText.Text) && queryText.Text != QueryText)
                {
                    QueryText = queryText.Text;
                    await SearchForResultAsync();
                }
                else
                {
                    queryText.Text = QueryText;
                    var res = queryText.Focus(FocusState.Unfocused);
#if WINDOWS_PHONE_APP
                    TitleButton.Focus(FocusState.Keyboard);
#endif
                }
            }
        }
Ejemplo n.º 12
0
        void ReleaseDesignerOutlets()
        {
            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (TitleButton != null)
            {
                TitleButton.Dispose();
                TitleButton = null;
            }
        }
Ejemplo n.º 13
0
        public override Rectangle GetButtonRect(TitleButton button, int windowWidth)
        {
            int buttonSize       = 24;
            int buttonY          = (TitleHeight - buttonSize) / 2;
            int paddingFromRight = BorderSize;

            switch (button)
            {
            case TitleButton.Close:
                return(new Rectangle(windowWidth - (paddingFromRight + buttonSize), buttonY, buttonSize, buttonSize));

            case TitleButton.Maximize:
                return(new Rectangle(windowWidth - ((paddingFromRight + buttonSize) * 2), buttonY, buttonSize, buttonSize));

            case TitleButton.Minimize:
                return(new Rectangle(windowWidth - ((paddingFromRight + buttonSize) * 3), buttonY, buttonSize, buttonSize));

            default:
                return(Rectangle.Empty);
            }
        }
Ejemplo n.º 14
0
        private void ProcessMouseUP(Point mousePoint)
        {
            this.m_MouseDown = false;

            int index = SearchPointInRects(mousePoint);

            if (index != -1)
            {
                TitleButton tb = this.m_Rconfig.ButtonList[index];
                if (tb.State == ButtonStatus.Pressed)
                {
                    tb.State = ButtonStatus.Normal;
                    tb.ButtonPressed(mousePoint);
                    m_HostForm.OnTitleButtonClick(tb, mousePoint);
                }
            }
            else
            {
                ProcessMouseLeave();
            }
        }
Ejemplo n.º 15
0
        /// <inheritdoc/>
        public override Rectangle GetTitleButtonRectangle(TitleButton button, int windowWidth, int windowHeight)
        {
            const int _buttonWidth = 16;
            const int _spacing     = 2;

            int _closeX    = (windowWidth - _spacing) - _buttonWidth;
            int _maximizeX = (_closeX - _spacing) - _buttonWidth;
            int _minimizeX = (_maximizeX - _spacing) - _buttonWidth;

            int _buttonY = (WindowTitleHeight - _buttonWidth) / 2;

            switch (button)
            {
            case TitleButton.Close:
                return(new Rectangle(_closeX, _buttonY, _buttonWidth, _buttonWidth));

            case TitleButton.Minimize:
                return(new Rectangle(_minimizeX, _buttonY, _buttonWidth, _buttonWidth));

            case TitleButton.Maximize:
                return(new Rectangle(_maximizeX, _buttonY, _buttonWidth, _buttonWidth));
            }
            return(Rectangle.Empty);
        }
Ejemplo n.º 16
0
 public abstract Rectangle GetButtonRect(TitleButton button, int windowWidth);
Ejemplo n.º 17
0
 protected void AddButton(TitleButton tb)
 {
     m_Rconfig.ButtonList.Add(tb);
 }
Ejemplo n.º 18
0
 public void OnButtonClick(TitleButton button)
 {
     _clickButton = button;
     _clickButton.ClickEvent();
     //button.BackGround.sprite = _sprites[button.name + "Click"];
 }
Ejemplo n.º 19
0
 static extern private void tguiChildWindow_setTitleButtons(IntPtr cPointer, TitleButton buttons);
Ejemplo n.º 20
0
 /// <summary>
 /// Constructor to create the ChildWindow with the given title and title buttons
 /// </summary>
 /// <param name="title">Title to display in the title bar</param>
 /// <param name="titleButtons">Buttons to display in the title bar</param>
 public ChildWindow(string title, TitleButton titleButtons = TitleButton.Close)
     : base(tguiChildWindow_create())
 {
     Title        = title;
     TitleButtons = titleButtons;
 }
Ejemplo n.º 21
0
 public abstract void DrawWindowButton(GraphicsContext gfx, TitleButton button, Hitbox hitbox);
Ejemplo n.º 22
0
    //Fade fade;

    // Start is called before the first frame update
    void Start()
    {
        scene = GetComponent <Scene>();
        tb    = GameObject.Find("Canvas").GetComponent <TitleButton>();
        //fade = GameObject.FindWithTag("Fade").GetComponent<Fade>();
    }
Ejemplo n.º 23
0
 public override void DrawWindowButton(GraphicsContext gfx, TitleButton button, Hitbox hitbox)
 {
     gfx.FillRectangle(new Rectangle(hitbox.X, hitbox.Y, hitbox.Width, hitbox.Height), Color.Black);
 }