MCPcopy Create free account
hub / github.com/esengine/esengine / setupItem

Method setupItem

packages/fairygui/src/widgets/GList.ts:693–738  ·  view source on GitHub ↗
(buffer: ByteBuffer, obj: GObject)

Source from the content-addressed store, hash-verified

691 }
692
693 protected setupItem(buffer: ByteBuffer, obj: GObject): void {
694 let str = buffer.readS();
695 if (str) {
696 obj.text = str;
697 }
698 str = buffer.readS();
699 if (str && obj instanceof GButton) {
700 obj.selectedTitle = str;
701 }
702 str = buffer.readS();
703 if (str) {
704 obj.icon = str;
705 }
706 str = buffer.readS();
707 if (str && obj instanceof GButton) {
708 obj.selectedIcon = str;
709 }
710 str = buffer.readS();
711 if (str) {
712 obj.name = str;
713 }
714
715 if (obj instanceof GComponent) {
716 const cnt = buffer.getInt16();
717 for (let i = 0; i < cnt; i++) {
718 const cc = obj.getController(buffer.readS());
719 const pageId = buffer.readS();
720 if (cc) {
721 cc.selectedPageId = pageId;
722 }
723 }
724
725 if (buffer.version >= 2) {
726 const cnt2 = buffer.getInt16();
727 for (let i = 0; i < cnt2; i++) {
728 const target = buffer.readS();
729 const propertyId = buffer.getInt16();
730 const value = buffer.readS();
731 const obj2 = obj.getChildByPath(target);
732 if (obj2) {
733 obj2.setProp(propertyId, value);
734 }
735 }
736 }
737 }
738 }
739
740 public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {
741 super.setup_afterAdd(buffer, beginPos);

Callers 1

readItemsMethod · 0.95

Calls 5

readSMethod · 0.80
getInt16Method · 0.80
getChildByPathMethod · 0.80
getControllerMethod · 0.45
setPropMethod · 0.45

Tested by

no test coverage detected