local UIFreeLineupDetailChildPanel = UIViewClass() function UIFreeLineupDetailChildPanel:OnOpened(context) self:RegistSystemEvent(EventID.UI_FreeLineUp_RefreshUI, self.RefreshLineupGS) self.root = context.parentView UIUtils.SetActive(self.btn_Save, context.showSaveBtn) UIUtils.SetActive(self.headGSGroupCollections.gameObject, context.showGSGroup) if context.showGSGroup then self:RefreshLineupGS() end end function UIFreeLineupDetailChildPanel:RefreshLineupGS() local lineNumber = MDL.FreeLineUp.GetFreeLineUpLineNumber(self.context.curFuncType) local curLineupInfo = MDL.FreeLineUp.GetLineNumberInfo(self.context.curFuncType, lineNumber) if curLineupInfo then for ii, heroDetailInfo in ipairs(curLineupInfo.heroInfos) do self.headGSGroupCollections[ii].txt_BaseBR.text = heroDetailInfo.heroBaseGs self.headGSGroupCollections[ii].txt_OtherBR.text = heroDetailInfo.lineUpGs UIUtils.SetLabelText(self.headGSGroupCollections[ii].lab_Base, Const_IDS.IDS_LineUpSelect_Detail_1) UIUtils.SetLabelText(self.headGSGroupCollections[ii].lab_Other, Const_IDS.IDS_LineUpSelect_Detail_2) end end end function UIFreeLineupDetailChildPanel:OnButtonClicked(comp) if comp == self.btn_Save then self.root.OnClickSave(self.root) end end return UIFreeLineupDetailChildPanel