Exemplo n.º 1
0
    public void PickSlugItem(string hash, SerializablePackages data, string slugCurrent, float x, float y, float w, ref float yGui, ref bool isWaitUI, OnPickSlugItem onPick)
    {
        int idProperty = data.IndexOf(slugCurrent);
        var comboBox   = PackagesGUI.Instance.ComboBoxSlug(data);

        if (slugCurrent == null || slugCurrent == "")
        {
            comboBox.Empty = "NULL";
        }
        else
        {
            comboBox.Empty = slugCurrent + " (Not found)";
        }
        comboBox.SelectedItemIndex = idProperty;
        comboBox.Rect.x            = x;
        comboBox.Rect.y            = y;
        comboBox.Rect.width        = w;
        comboBox.Rect.height       = 32f;
        float limitHeight = 32f * 6;

        comboBox.Show(limitHeight, hash, (int idNext) => {
            onPick(data.SlugByIndex(idNext));
        });
        if (comboBox.IsDropDownWithHash(hash))
        {
            yGui    += limitHeight;
            isWaitUI = true;
        }
    }