コード例 #1
0
        protected override void onObjectRemoved(RectTransform item, int index)
        {
            IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

            component.DraggedOffDragArea -= onDraggedOffDragArea;
            base.onObjectRemoved(item, index);
        }
コード例 #2
0
 protected virtual void SetupIglooCustomizationButton(IglooCustomizationButton button, int index)
 {
     if (index < numberOfStaticButtons)
     {
         button.SetupCatalogButton();
     }
     else
     {
         button.SetupItemButton();
         int index2 = index - numberOfStaticButtons;
         DecorationDefinitionType key = inventoryCountPairs[index2].Key;
         button.gameObject.name = key.Name + "_button";
         button.Init(key.Icon, BreadcrumbType, GetIntegerDefinitionId(key), canDrag: true);
         inventoryProgressionStatus.TryGetValue(key.GetId(), out var value);
         if (!SetLockableButtonLockedStatus(button, key, value))
         {
             int value2 = inventoryCountPairs[index2].Value;
             button.SetItemCount(value2, showItemCountsWithZeroCount, tintItemsWithZeroCount);
             if (value2 <= 0)
             {
                 button.SetCanDrag(drag: false);
             }
         }
         AccessibilitySettings component = button.GetComponent <AccessibilitySettings>();
         if (component != null)
         {
             component.CustomToken = key.Name;
         }
     }
     button.SetDragReferences(scrollRect, index, 0f);
 }
コード例 #3
0
        protected void onObjectAddedOrRemoved(ManipulatableObject manipulatableObject)
        {
            inventoryCountPairs = GetAvailableItems();
            if (manipulatableObject.Type != decorationDefinitionType || inventoryCountPairs == null)
            {
                return;
            }
            inventoryCountPairs = sortInventoryList(inventoryCountPairs);
            bool flag  = false;
            int  count = inventoryCountPairs.Count;

            for (int i = 0; i < count; i++)
            {
                DecorationDefinitionType key = inventoryCountPairs[i].Key;
                if (key.GetId() == manipulatableObject.DefinitionId)
                {
                    if (PooledScrollRect.IsIndexCellVisible(i + numberOfStaticButtons))
                    {
                        IglooCustomizationButton component = PooledScrollRect.GetCellAtIndex(i + numberOfStaticButtons).GetComponent <IglooCustomizationButton>();
                        component.SetItemCount(inventoryCountPairs[i].Value, showItemCountsWithZeroCount, tintItemsWithZeroCount);
                    }
                    objectAddedOrRemoved(i, manipulatableObject);
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                manipulatedObjectNotFound(manipulatableObject);
            }
        }
コード例 #4
0
        protected override void onObjectRemoved(RectTransform item, int index)
        {
            base.onObjectRemoved(item, index);
            IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

            component.IglooButtonClicked -= onLotButton;
        }
コード例 #5
0
        protected override void onObjectAdded(RectTransform item, int index)
        {
            base.onObjectAdded(item, index);
            IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

            component.SetDragReferences(base.scrollRect, index, totalDragHeight, dragContainerInstance);
            component.DraggedOffDragArea += onDraggedOffDragArea;
        }
コード例 #6
0
 protected override void onObjectAdded(RectTransform item, int index)
 {
     base.onObjectAdded(item, index);
     if (index == 0)
     {
         catalogButton = item.GetComponent <IglooCustomizationButton>();
         int currentCategoryId = decorationCategoryManager.GetCurrentCategoryId();
         setCatalogButtonCategory(currentCategoryId);
     }
 }
コード例 #7
0
        protected override void SetupIglooCustomizationButton(IglooCustomizationButton iglooCustomizationButton, int index)
        {
            if (index == 0)
            {
                iglooCustomizationButton.SetupCatalogButton(IglooCustomizationButton.CatalogFilterType.STRUCTURES);
                return;
            }
            base.SetupIglooCustomizationButton(iglooCustomizationButton, index);
            int index2 = index - numberOfStaticButtons;
            StructureDefinition key = inventoryCountPairs[index2].Key;

            iglooCustomizationButton.SetSizeIconSprite(key.SizeUnits - 1);
        }
コード例 #8
0
        protected override void SetupIglooCustomizationButton(IglooCustomizationButton iglooCustomizationButton, int index)
        {
            base.SetupIglooCustomizationButton(iglooCustomizationButton, index);
            iglooCustomizationButton.IglooButtonClicked += onLotButton;
            iglooCustomizationButton.DefinitionId        = index;
            LotDefinition key = inventoryCountPairs[index].Key;

            iglooCustomizationButton.SetSelected(sceneLayoutData.LotZoneName == key.LotName);
            if (lastSelected == null && sceneLayoutData.LotZoneName == key.LotName)
            {
                lastSelected = iglooCustomizationButton;
            }
        }
コード例 #9
0
        protected virtual void onObjectAdded(RectTransform item, int index)
        {
            item.anchoredPosition = Vector2.zero;
            item.anchorMin        = Vector2.zero;
            item.anchorMax        = Vector2.one;
            item.sizeDelta        = Vector2.zero;
            item.localScale       = Vector3.one;
            IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

            if (component != null)
            {
                SetupIglooCustomizationButton(component, index);
            }
        }
コード例 #10
0
        protected override void SetupIglooCustomizationButton(IglooCustomizationButton iglooCustomizationButton, int index)
        {
            base.SetupIglooCustomizationButton(iglooCustomizationButton, index);
            int index2             = index - numberOfStaticButtons;
            LightingDefinition key = inventoryCountPairs[index2].Key;

            iglooCustomizationButton.IglooButtonClicked += onLightingButton;
            if (sceneLayoutData != null)
            {
                iglooCustomizationButton.SetSelected(sceneLayoutData.LightingId == key.Id);
                if (lastSelected == null && sceneLayoutData.LightingId == key.Id)
                {
                    lastSelected = iglooCustomizationButton;
                }
            }
        }
コード例 #11
0
        private void onLotButton(IglooCustomizationButton customizationButton)
        {
            LotDefinition  key            = inventoryCountPairs[customizationButton.DefinitionId].Key;
            ZoneDefinition zoneDefinition = zoneDefinitions[key.ZoneDefintion.Id];

            if (!Service.Get <SceneTransitionService>().IsTransitioning&& Service.Get <SceneTransitionService>().CurrentScene != zoneDefinition.SceneName)
            {
                if (sceneLayoutData != null)
                {
                    sceneLayoutData.LotZoneName = zoneDefinition.ZoneName;
                    Service.Get <ICPSwrveService>().Action("igloo", "lot_selection", sceneLayoutData.LotZoneName);
                }
                lastSelected.SetSelected(isSelected: false);
                customizationButton.SetSelected(isSelected: true);
                lastSelected = customizationButton;
                eventDispatcher.DispatchEvent(new IglooUIEvents.SwapScene(zoneDefinition.SceneName));
            }
        }
コード例 #12
0
        private void onLightingButton(IglooCustomizationButton customizationButton)
        {
            customizationButton.RemoveBreadcrumb();
            Service.Get <NotificationBreadcrumbController>().RemoveBreadcrumb(MenuBreadcrumbType);
            if (lastSelected.DefinitionId == customizationButton.DefinitionId)
            {
                return;
            }
            LightingDefinition key = inventoryCountPairs[customizationButton.Index - numberOfStaticButtons].Key;

            if (key != null)
            {
                if (sceneLayoutData != null)
                {
                    sceneLayoutData.LightingId = key.Id;
                    Service.Get <ICPSwrveService>().Action("igloo", "lighting_selection", key.InternalName);
                }
                lastSelected.SetSelected(isSelected: false);
                customizationButton.SetSelected(isSelected: true);
                lastSelected = customizationButton;
            }
        }
コード例 #13
0
 protected void onDraggedOffDragArea(IglooCustomizationButton iglooCustomizationButton, Vector2 finalTouchPoint, int index)
 {
     transitionToInteraction(index, finalTouchPoint);
 }