private void OnEnable()
    {
        if (!initialized)
        {
            return;
        }

        UI_ACItemGrid currentlyLoadedGrid = UI_ACItemGrid.LastInstanceOfItemGrid;

        if (currentlyLoadedGrid == null)
        {
            return;
        }

        IRAMReadWriter currentWriter = currentlyLoadedGrid.GetCurrentlyActiveReadWriter();

        foreach (AdditionalButton b in spawnedButtons)
        {
            if (b.AssociatedPanel.RequiresActiveConnection)
            {
                if (currentWriter != null)
                {
                    b.AssociatedPanel.CurrentConnection = currentWriter;
                }

                b.SetActiveForConnection(currentWriter != null);
            }
            else
            {
                b.SetActiveForConnection(true);
            }
        }
    }
Example #2
0
    private void Start()
    {
        //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
        //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
        //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
        //IL_0102: Expected O, but got Unknown
        sbc = new SysBotController(InjectionType.Pouch);
        UISB.AssignSysbot(sbc);
#if PLATFORM_ANDROID
        usbac = new USBBotAndroidController();
        UISB.AssignUSBBotAndroid(usbac);
#endif
#if UNITY_STANDALONE || UNITY_EDITOR
        usbc = new USBBotController();
        UISB.AssignUSBBot(usbc);
#endif
        for (int i = 0; i < MAXITEMS; i++)
        {
            Items.Add(new Item(Item.NONE));
        }

        uiitems = new List<UI_ACItem>(GetComponentsInChildren<UI_ACItem>());
        List<UI_ACItem> list = new List<UI_ACItem>();
        int num = 0;
        foreach (UI_ACItem uiitem in uiitems)
        {
            GameObject obj = Instantiate(PrefabItem.gameObject);
            obj.transform.SetParent(transform);
            obj.transform.position = uiitem.transform.position;
            obj.transform.localScale = uiitem.transform.localScale;
            UI_ACItem component = obj.GetComponent<UI_ACItem>();
            int currentIndex = num;
            component.ButtonComponent.onClick.AddListener(delegate
            {
                SetSelection(currentIndex);
            });
            list.Add(component);
            uiitem.gameObject.SetActive(false);
            num++;
        }
        uiitems = list;

        PrefabItem.gameObject.SetActive(false);
        set(Items.ToArray());

        PocketInjector inj = new PocketInjector(Items, sbc.Bot);
        injector = new AutoInjector(inj, AfterRead, AfterWrite);
#if PLATFORM_ANDROID
        PocketInjector usbaInj = new PocketInjector(Items, usbac.Bot);
        usbaInjector = new AutoInjector(usbaInj, AfterRead, AfterWrite);
#endif
#if UNITY_STANDALONE || UNITY_EDITOR
        PocketInjector usbInj = new PocketInjector(Items, usbc.Bot);
        usbInjector = new AutoInjector(usbInj, AfterRead, AfterWrite);
#endif

        SetSelection(0);
        LastInstanceOfItemGrid = this;
    }