diff --git a/source/src/fairygui/GComboBox.ts b/source/src/fairygui/GComboBox.ts index fc32e87..699ab6a 100644 --- a/source/src/fairygui/GComboBox.ts +++ b/source/src/fairygui/GComboBox.ts @@ -114,7 +114,7 @@ namespace fgui { if (this._selectedIndex >= this._items.length) this._selectedIndex = this._items.length - 1; else if (this._selectedIndex == -1) - this._selectedIndex = 0; + this.selectedIndex = 0; this.text = this._items[this._selectedIndex]; if (this._icons && this._selectedIndex < this._icons.length) @@ -354,10 +354,10 @@ namespace fgui { str = buffer.readS(); if (str != null) { this.text = str; - this._selectedIndex = this._items.indexOf(str); + this.selectedIndex = this._items.indexOf(str); } else if (this._items.length > 0) { - this._selectedIndex = 0; + this.selectedIndex = 0; this.text = this._items[0]; } else @@ -393,7 +393,7 @@ namespace fgui { } this._list.resizeToFit(this._visibleItemCount); } - this._list.selectedIndex = -1; + this._list.selectedIndex = this.selectedIndex; this.dropdown.width = this.width; this._list.ensureBoundsCorrect(); diff --git a/source/src/fairygui/GLoader3D.ts b/source/src/fairygui/GLoader3D.ts index a9b3585..5bd7306 100644 --- a/source/src/fairygui/GLoader3D.ts +++ b/source/src/fairygui/GLoader3D.ts @@ -16,6 +16,7 @@ namespace fgui { private _container: Laya.Sprite; private _content: Laya.Skeleton; private _updatingLayout: boolean; + private _aniLoaded:Laya.Handler; public constructor() { super(); @@ -188,10 +189,14 @@ namespace fgui { } } - public get content(): Laya.Sprite { + public get content(): Laya.Skeleton { return this._content; } + public set onLoader(handler: Laya.Handler) { + this._aniLoaded = handler; + } + protected loadContent(): void { this.clearContent(); @@ -238,6 +243,7 @@ namespace fgui { this._content = skeleton; this._container.addChild(this._content); + this._aniLoaded && this._aniLoaded.runWith(this._content); this._content.pos(anchor.x, anchor.y); ToolSet.setColorFilter(this._content, this._color);