Exemplo n.º 1
0
        protected virtual void UpdateScrollBar()
        {
            if (!bScrollbarUpdating)
            {
                bScrollbarUpdating = true;

                int ScrollMax = (pListItems.Count * ListRow.CONTROL_HEIGHT) - ElementsPanel.Height;

                if (ScrollMax >= 0)
                {
                    ListScroller.Maximum     = ScrollMax;
                    ListScroller.LargeChange = SCROLL_LARGE_CHANGE;
                    ListScroller.Visible     = true;
                    ListScroller.BringToFront();
                    ListScroller.Left = this.Width - ListScroller.Width;
                }
                else
                {
                    ListScroller.Maximum = 0;
                    ListScroller.Visible = false;
                }

                bScrollbarUpdating = false;
            }
        }
        protected virtual void UpdateScrollBar()
        {
            int ControlHeight = 0;

            for (int i = 0; i < pRowControls.Count; i++)
            {
                ControlHeight += pRowControls[i].ControlHeight;
            }

            int ScrollMax = ControlHeight - ElementsPanel.Height;

            if (ScrollMax >= 0)
            {
                ListScroller.Maximum     = ScrollMax;
                ListScroller.LargeChange = SCROLL_LARGE_CHANGE;
                ListScroller.SmallChange = SCROLL_SMALL_CHANGE;
                ListScroller.Visible     = true;
                ElementsPanel.Width      = this.Width - (ListScroller.Width - 2);
            }
            else
            {
                ListScroller.Maximum = 0;
                ListScroller.Visible = false;
                ElementsPanel.Width  = this.Width - 2;
            }

            ListScroller.BringToFront();
        }
Exemplo n.º 3
0
    /// <summary>
    /// set up the physical dimensions for the quest prefab instances
    /// </summary>
    private void setupList()
    {
        if (availableQuests.Count == 0)
        {
            return;
        }

        ListScroller.setupList(this.gameObject, questGO, availableQuests.Count, setSingleQuestData);
    }
Exemplo n.º 4
0
    /// <summary>
    /// onclick event for dots[dotIndex], will pan & zoom to that site and open up the sublocation UI
    /// </summary>
    /// <param name="dotIndex"></param>
    public void onClickSiteDot(int siteIndex)
    {
        List <Sublocation> sublocationList = mapLoader.getSublocationsOfSite(siteIndex);

        //set up site detail for new site
        ListScroller.setupList(siteDetailListRect, siteListItemPrefab, sublocationList.Count,
                               (GameObject listItem, int index) => { setSiteSublocationData(listItem, sublocationList[index].sublocationIndex, sublocationList[index].sublocationName,
                                                                                            sublocationList[index].displayImage); });

        //pan & zoom to site, and then open up site detail panel
        panToSite(dots[siteIndex - 1].transform.position - transform.position, openSiteDetailPanel);
    }
Exemplo n.º 5
0
        protected override void List_Resize(object sender, EventArgs e)
        {
            int ScrollerWidth = 0;

            if (ListScroller.Visible)
            {
                ScrollerWidth = ListScroller.Width;
            }

            ListScroller.Height  = this.Height;
            ListScroller.Left    = this.Width - ScrollerWidth;
            ElementsPanel.Top    = HeaderBar.Top + HeaderBar.Height;
            ElementsPanel.Width  = this.Width - (ScrollerWidth + 2);
            ElementsPanel.Height = this.Height - (ElementsPanel.Top + 1);
            ElementsPanel.Left   = 1;

            HeaderBar.Width = this.Width;

            base.List_Resize(sender, e);

            ListScroller.BringToFront();
        }