Exemple #1
0
    public void InitialiseFor(string val, string contains, int itemId, ItemFilter uiFilter, UI_SearchWindow parentWindow)
    {
        //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ab: Expected O, but got Unknown
        ItemId         = itemId;
        UIFilter       = uiFilter;
        sWindow        = parentWindow;
        RawValue       = val;
        ProcessedValue = RawValue;
        int num        = val.ToLower().IndexOf(contains);
        int startIndex = num + contains.Length;

        ProcessedValue     = ProcessedValue.Insert(startIndex, "</color>");
        ProcessedValue     = ProcessedValue.Insert(num, "<color=cyan>");
        SelectionText.text = (ProcessedValue);
        SelectionButton.onClick.RemoveAllListeners();
        SelectionButton.onClick.AddListener(delegate
        {
            SetSelection();
        });

        // Sprite image
        Color     c;
        Texture2D t2d = SpriteBehaviour.ItemToTexture2D((ushort)itemId, 0, out c, uiFilter);

        ItemImage.texture = t2d;
        ItemImage.color   = c;
    }
Exemple #2
0
    public void InitialiseFor(string val, string contains, int itemId, ItemFilter uiFilter, UI_SearchWindow parentWindow)
    {
        //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ab: Expected O, but got Unknown
        ItemId         = itemId;
        UIFilter       = uiFilter;
        sWindow        = parentWindow;
        RawValue       = val;
        ProcessedValue = RawValue;
        int num        = val.ToLower().IndexOf(contains);
        int startIndex = num + contains.Length;

        ProcessedValue     = ProcessedValue.Insert(startIndex, "</color>");
        ProcessedValue     = ProcessedValue.Insert(num, "<color=cyan>");
        SelectionText.text = (ProcessedValue);
        SelectionButton.onClick.RemoveAllListeners();
        SelectionButton.onClick.AddListener(delegate
        {
            SetSelection();
        });

        // Sprite image
        Color     c;
        Texture2D t2d = SpriteBehaviour.ItemToTexture2D((ushort)itemId, 0, out c, uiFilter);

        ItemImage.texture = t2d;
        ItemImage.color   = c;

        // Menu icon
        t2d = MenuSpriteHelper.CurrentInstance.GetIconTexture((ushort)itemId);
        MenuIconImage.texture = t2d;
        MenuIconImage.color   = Color.white;

        if (ItemExtensions.IsInternalItem((ushort)itemId))
        {
            ColorBlock cb = SelectionButton.colors;
            cb.normalColor         = cb.normalColor * internalColor;
            cb.highlightedColor    = cb.highlightedColor * internalColor;
            cb.pressedColor        = cb.pressedColor * internalColor;
            cb.disabledColor       = cb.disabledColor * internalColor;
            cb.selectedColor       = cb.selectedColor * internalColor;
            SelectionButton.colors = cb;

            WarningImage.gameObject.SetActive(true);
        }
        else
        {
            WarningImage.gameObject.SetActive(false);
        }
    }
    // not used

    public static Texture2D ItemToTexture2DSlow(ushort itemId, ushort count, out Color c, ItemFilter iF)
    {
        if (iF == ItemFilter.Items)
        {
            return(ItemToTexture2D(itemId, count, out c));
        }

        ushort    checkValueId = UI_SearchWindow.FilterToItemId(iF, 0);
        ushort    toFindItem   = iF == ItemFilter.Fossils ? itemId : RecipeList.Recipes[itemId];
        Texture2D itemType     = ItemToTexture2D(checkValueId, count, out c);
        Texture2D itemMain     = ItemToTexture2D(toFindItem, count, out c);

        TextureScale.Bilinear(itemType, itemMain.width / 2, itemMain.height / 2);
        return(AddWatermark(itemMain, itemType, 0, 0));
    }
Exemple #4
0
    private void Start()
    {
        SearchField.onValueChanged.AddListener(delegate
        {
            UpdateSearchString(SearchField.text);
        });
        DropdownFilter.onValueChanged.AddListener(delegate
        {
            UpdateFilter(DropdownFilter);
        });
        KeepItemLoadedToggle.onValueChanged.AddListener(delegate
        {
            stopSearch = KeepItemLoadedToggle.isOn;
            SearchBlocker.gameObject.SetActive(stopSearch);
        });
        SearchItemPrefab.gameObject.SetActive(false);
        UpdateSearchString(SearchField.text);
        FlowerButtonRoot.SetActive(false);

        LastLoadedSearchWindow = this;
    }