private void refresh_scrollers()
    {
        int num = 0;

        foreach (EdiblesManager.FoodInfo item in FOOD.FOOD_TYPES_LIST)
        {
            if (DebugHandler.InstantBuildMode || ConsumerManager.instance.isDiscovered(item.ConsumableId.ToTag()))
            {
                num++;
            }
        }
        foreach (TableRow row in rows)
        {
            GameObject scroller = row.GetScroller("consumableScroller");
            if ((UnityEngine.Object)scroller != (UnityEngine.Object)null)
            {
                KScrollRect component = scroller.transform.parent.GetComponent <KScrollRect>();
                if ((UnityEngine.Object)component.horizontalScrollbar != (UnityEngine.Object)null)
                {
                    component.horizontalScrollbar.gameObject.SetActive(num >= 12);
                    row.GetScrollerBorder("consumableScroller").gameObject.SetActive(num >= 12);
                }
                component.horizontal = (num >= 12);
                component.enabled    = (num >= 12);
            }
        }
    }
 public override void OnKeyUp(KButtonEvent e)
 {
     if (!e.Consumed)
     {
         KScrollRect componentInChildren = GetComponentInChildren <KScrollRect>();
         if ((Object)componentInChildren != (Object)null)
         {
             componentInChildren.OnKeyUp(e);
         }
     }
     e.Consumed = true;
 }
Exemple #3
0
 internal void OnDestroy()
 {
     forceShow.Clear();
     if (scroll != null)
     {
         scroll.onValueChanged.RemoveListener(OnScroll);
         itemList      = null;
         realLayout    = null;
         scroll        = null;
         virtualLayout = null;
     }
 }
 public override void OnKeyDown(KButtonEvent e)
 {
     if ((Object)Game.Instance != (Object)null && (e.TryConsume(Action.TogglePause) || e.TryConsume(Action.CycleSpeed)))
     {
         KMonoBehaviour.PlaySound(GlobalAssets.GetSound("Negative", false));
     }
     if (!e.Consumed && e.TryConsume(Action.Escape))
     {
         Deactivate();
     }
     if (!e.Consumed)
     {
         KScrollRect componentInChildren = GetComponentInChildren <KScrollRect>();
         if ((Object)componentInChildren != (Object)null)
         {
             componentInChildren.OnKeyDown(e);
         }
     }
     e.Consumed = true;
 }
Exemple #5
0
 /// <summary>
 /// Called when the component is first added.
 /// </summary>
 internal void Awake()
 {
     scroll     = GetComponentInParent <KScrollRect>();
     parentRect = scroll.rectTransform();
 }