fairygui / FairyGUI-cocoscreator

A flexible UI framework for Cocos Creator
MIT License
548 stars 193 forks source link

GCombox 点击选中图片不切换的bug #10

Closed vikingsc2007 closed 5 years ago

vikingsc2007 commented 5 years ago

需要加入选中时icon的赋值

 GComboBox.prototype.onClickItem2 = function (index) {
            if (this.dropdown.parent instanceof fgui.GRoot)
                this.dropdown.parent.hidePopup();
            this._selectedIndex = index;
            if (this._selectedIndex >= 0)
            {
                this.text = this._items[this._selectedIndex];
                this.icon =  (this._icons != null && this._selectedIndex < this._icons.length) ? this._icons[this._selectedIndex] : null;
            }
            else
            {
                this.text = "";
                this.icon = null;
            }
            this._node.emit(fgui.Event.STATUS_CHANGED, this);
        };