protected override void onObjectRemoved(RectTransform item, int index)
    {
        base.onObjectRemoved(item, index);
        IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

        component.IglooButtonClicked -= onLotButton;
    }
Exemple #2
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);
        }
    }
Exemple #3
0
    protected override void onObjectRemoved(RectTransform item, int index)
    {
        IglooCustomizationButton component = item.GetComponent <IglooCustomizationButton>();

        component.DraggedOffDragArea -= onDraggedOffDragArea;
        base.onObjectRemoved(item, index);
    }
Exemple #4
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 ProgressionUtils.ParsedProgression <DecorationDefinitionType> 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);
 }
Exemple #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;
    }
    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;
        }
    }
Exemple #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);
    }
Exemple #8
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);
        }
    }
Exemple #9
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;
            }
        }
    }
    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));
        }
    }
Exemple #11
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;
        }
    }
Exemple #12
0
 protected void onDraggedOffDragArea(IglooCustomizationButton iglooCustomizationButton, Vector2 finalTouchPoint, int index)
 {
     transitionToInteraction(index, finalTouchPoint);
 }