2023-07-15 02:35:33 +07:00
local CsXTextManager = CS.XTextManager
local Vector2 = CS.UnityEngine . Vector2
local XUiTheatreMassageGrid = require ( " XUi/XUiTheatre/RoleDetail/XUiTheatreMassageGrid " )
local XUiTheatreOwnedInfoPanel = require ( " XUi/XUiTheatre/RoleDetail/XUiTheatreOwnedInfoPanel " )
local XUiPanelRoleModel = require ( " XUi/XUiCharacter/XUiPanelRoleModel " )
--肉鸽成员列表界面
2024-09-01 22:49:41 +02:00
---@class XUiTheatreMainMassage:XLuaUi
2023-07-15 02:35:33 +07:00
local XUiTheatreMainMassage = XLuaUiManager.Register ( XLuaUi , " UiTheatreMainMassage " )
function XUiTheatreMainMassage : OnAwake ( )
2024-09-01 22:49:41 +02:00
self : AddBtnListener ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnStart ( )
self : Init ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnEnable ( )
if XTool.IsNumberValid ( self._CurSelectIndex ) then
self._PanelFilter : DoSelectIndex ( self._CurSelectIndex )
2023-07-15 02:35:33 +07:00
end
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnDestroy ( )
self : RemovePanelAsset ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : Init ( )
---@type XTheatreAdventureManager
self.AdventureManager = XDataCenter.TheatreManager . GetCurrentAdventureManager ( )
self : InitPanelAsset ( )
self : InitFilter ( )
self : InitRoleDetail ( )
self : InitModel ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
--region Data - Getter
---@return XCharacterViewModel
function XUiTheatreMainMassage : GetCharacterViewModelByEntityId ( entityId )
local role = self.AdventureManager : GetRole ( entityId )
if role == nil then return nil end
return role : GetCharacterViewModel ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
---@return number
2023-07-15 02:35:33 +07:00
function XUiTheatreMainMassage : GetCurrentCharacterId ( )
2024-09-01 22:49:41 +02:00
local entityId = self._CurrentEntityId
2023-07-15 02:35:33 +07:00
local adventureRole = self.AdventureManager : GetRole ( entityId )
return adventureRole : GetCharacterId ( )
end
2024-09-01 22:49:41 +02:00
--endregion
2023-07-15 02:35:33 +07:00
2024-09-01 22:49:41 +02:00
--region Ui - PanelAsset
function XUiTheatreMainMassage : InitPanelAsset ( )
self._PanelAsset = XUiHelper.NewPanelActivityAsset ( XDataCenter.TheatreManager . GetAdventureAssetItemIds ( ) , self.PanelSpecialTool )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : RemovePanelAsset ( )
XDataCenter.ItemManager . RemoveCountUpdateListener ( self._PanelAsset )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
--endregion
2023-07-15 02:35:33 +07:00
2024-09-01 22:49:41 +02:00
--region Ui - Filter
function XUiTheatreMainMassage : InitFilter ( )
if not self.PanelZuo then
return
end
local checkInTeam = function ( id )
return true
end
---招募角色当前显示的是试玩角色或自己的角色, false显示试玩角色, true显示对应自己的角色
self._RoleSelectStateDic = { }
---@type XCommonCharacterFiltAgency
self.FiltAgecy = XMVCA : GetAgency ( ModuleId.XCommonCharacterFilt )
self._PanelFilter = self.FiltAgecy : InitFilter ( self.PanelZuo , self )
local clickTag = function ( )
self : _RefreshEmptyPanel ( )
end
self._PanelFilter : InitData ( handler ( self , self._OnSelectTab ) , clickTag , nil , nil , XUiTheatreMassageGrid , checkInTeam )
self._PanelFilter : ImportList ( self : _GetCharacterList ( ) )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : _GetCharacterList ( )
local roles = self.AdventureManager : GetCurrentRoles ( true )
2023-07-15 02:35:33 +07:00
local result = { }
for _ , role in ipairs ( roles ) do
2024-09-01 22:49:41 +02:00
local entityId = role : GetCharacterId ( )
if self._RoleSelectStateDic [ entityId ] == nil then
self._RoleSelectStateDic [ entityId ] = false
end
if role : GetIsLocalRole ( ) and self._RoleSelectStateDic [ entityId ] then
table.insert ( result , role )
elseif not role : GetIsLocalRole ( ) and not self._RoleSelectStateDic [ entityId ] then
2023-07-15 02:35:33 +07:00
table.insert ( result , role )
end
end
return result
end
2024-09-01 22:49:41 +02:00
---@param character XTheatreAdventureRole
function XUiTheatreMainMassage : _OnSelectTab ( character , index , grid )
self._CurrentEntityId = character : GetId ( )
self._CurSelectIndex = index
self : RefreshModel ( )
self : _RefreshRoleDetail ( )
end
2023-07-15 02:35:33 +07:00
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : _RefreshEmptyPanel ( )
self.UiOwnedInfo . gameObject : SetActiveEx ( not self._PanelFilter : IsCurListEmpty ( ) )
self.BtnFashion . gameObject : SetActiveEx ( not self._PanelFilter : IsCurListEmpty ( ) )
self.BtnOwnedDetail . gameObject : SetActiveEx ( not self._PanelFilter : IsCurListEmpty ( ) )
self.BtnTeaching . gameObject : SetActiveEx ( not self._PanelFilter : IsCurListEmpty ( ) )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
--endregion
2023-07-15 02:35:33 +07:00
2024-09-01 22:49:41 +02:00
--region Ui - RoleDetail
function XUiTheatreMainMassage : InitRoleDetail ( )
---@type XUiTheatreOwnedInfoPanel
self._OwnedInfoPanel = XUiTheatreOwnedInfoPanel.New ( self.UiOwnedInfo , handler ( self , self.SwitchRoleState ) , self )
end
function XUiTheatreMainMassage : SwitchRoleState ( entityId )
self._OwnedInfoPanel : InitPanelActiveState ( )
self : PlayAnimationWithMask ( " RoleQieHuan " )
local characterId = self : GetCurrentCharacterId ( entityId )
local state = self._RoleSelectStateDic [ characterId ]
self._RoleSelectStateDic [ characterId ] = not state
self._PanelFilter : ImportList ( self : _GetCharacterList ( ) )
self._PanelFilter : DoSelectIndex ( self._CurSelectIndex )
2023-07-15 02:35:33 +07:00
self : RefreshModel ( )
2024-09-01 22:49:41 +02:00
self : _RefreshRoleDetail ( )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : _RefreshRoleDetail ( )
local entityId = self._CurrentEntityId
local adventureRole = self.AdventureManager : GetRole ( entityId )
local isOwnRole = self._RoleSelectStateDic [ entityId ]
local characterId = adventureRole : GetCharacterId ( )
if isOwnRole then
adventureRole = self.AdventureManager : GetRole ( characterId )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
self._OwnedInfoPanel : SetData ( adventureRole , entityId )
self.BtnFashion . gameObject : SetActiveEx ( self._RoleSelectStateDic [ characterId ] or false )
end
--endregion
--region Scene - Model
function XUiTheatreMainMassage : InitModel ( )
local panelRoleModel = self.UiModelGo . transform : FindTransform ( " PanelRoleModel " )
---@type UnityEngine.Transform
self.ImgEffectHuanren = self.UiModelGo . transform : FindTransform ( " ImgEffectHuanren " )
---@type UnityEngine.Transform
self.ImgEffectHuanren1 = self.UiModelGo . transform : FindTransform ( " ImgEffectHuanren1 " )
---@type XUiPanelRoleModel
self._UiPanelRoleModel = XUiPanelRoleModel.New ( panelRoleModel , self.Name , nil , true )
self.ImgEffectHuanren1 . gameObject : SetActiveEx ( false )
2023-07-15 02:35:33 +07:00
end
function XUiTheatreMainMassage : RefreshModel ( )
2024-09-01 22:49:41 +02:00
local entityId = self._CurrentEntityId
2023-07-15 02:35:33 +07:00
local adventureRole = self.AdventureManager : GetRole ( entityId )
2024-09-01 22:49:41 +02:00
local characterViewModel = self._RoleSelectStateDic [ entityId ] and self : GetCharacterViewModelByEntityId ( adventureRole : GetCharacterId ( ) ) or self : GetCharacterViewModelByEntityId ( entityId )
2023-07-15 02:35:33 +07:00
if not characterViewModel then
return
end
self.ImgEffectHuanren . gameObject : SetActiveEx ( false )
self.ImgEffectHuanren1 . gameObject : SetActiveEx ( false )
local finishedCallback = function ( model )
self.PanelDrag . Target = model.transform
2024-09-01 22:49:41 +02:00
self.ImgEffectHuanren . gameObject : SetActiveEx ( characterViewModel : GetCharacterType ( ) == XCharacterConfigs.CharacterType . Normal )
self.ImgEffectHuanren1 . gameObject : SetActiveEx ( characterViewModel : GetCharacterType ( ) == XCharacterConfigs.CharacterType . Isomer )
2023-07-15 02:35:33 +07:00
end
local sourceEntityId = characterViewModel : GetSourceEntityId ( )
if XRobotManager.CheckIsRobotId ( sourceEntityId ) then
local robot2CharId = XRobotManager.GetCharacterId ( sourceEntityId )
local isOwn = XDataCenter.CharacterManager . IsOwnCharacter ( robot2CharId )
if XRobotManager.CheckUseFashion ( sourceEntityId ) and isOwn then
local character = XDataCenter.CharacterManager . GetCharacter ( robot2CharId )
local robot2CharViewModel = character : GetCharacterViewModel ( )
2024-09-01 22:49:41 +02:00
self._UiPanelRoleModel : UpdateCharacterModel ( robot2CharId , nil , nil , finishedCallback , nil , robot2CharViewModel : GetFashionId ( ) )
2023-07-15 02:35:33 +07:00
else
local robotConfig = XRobotManager.GetRobotTemplate ( sourceEntityId )
2024-09-01 22:49:41 +02:00
self._UiPanelRoleModel : UpdateRobotModel ( sourceEntityId , robotConfig.CharacterId , nil , robotConfig.FashionId , robotConfig.WeaponId , finishedCallback )
2023-07-15 02:35:33 +07:00
end
else
2024-09-01 22:49:41 +02:00
self._UiPanelRoleModel : UpdateCharacterModel ( sourceEntityId , nil , nil , finishedCallback , nil , characterViewModel : GetFashionId ( ) )
2023-07-15 02:35:33 +07:00
end
end
2024-09-01 22:49:41 +02:00
--endregion
2023-07-15 02:35:33 +07:00
2024-09-01 22:49:41 +02:00
--region Ui - BtnListener
function XUiTheatreMainMassage : AddBtnListener ( )
self : BindHelpBtn ( self.BtnHelp , " Theatre " )
self : RegisterClickEvent ( self.BtnBack , self.Close )
self : RegisterClickEvent ( self.BtnMainUi , function ( ) XLuaUiManager.RunMain ( ) end )
self : RegisterClickEvent ( self.BtnFashion , self.OnBtnFashionClick )
self : RegisterClickEvent ( self.BtnOwnedDetail , self.OnBtnOwnedDetailClick )
self : RegisterClickEvent ( self.BtnTeaching , self.OnBtnTeachingClick )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnBtnOwnedDetailClick ( )
XLuaUiManager.Open ( " UiCharacterDetail " , self : GetCurrentCharacterId ( ) )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnBtnTeachingClick ( )
XDataCenter.PracticeManager . OpenUiFubenPractice ( self : GetCurrentCharacterId ( ) )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
function XUiTheatreMainMassage : OnBtnFashionClick ( )
XLuaUiManager.Open ( " UiFashion " , self : GetCurrentCharacterId ( ) )
2023-07-15 02:35:33 +07:00
end
2024-09-01 22:49:41 +02:00
--endregion
--region Old
--function XUiTheatreMainMassage:OnAwake()
-- self.TheatreManager = XDataCenter.TheatreManager
-- ---@type XTheatreAdventureManager
-- self.AdventureManager = self.TheatreManager.GetCurrentAdventureManager()
-- self.RoleSelectStateDic = {} --招募角色当前显示的是试玩角色或自己的角色, false显示试玩角色, true显示对应自己的角色
--
-- self.CurrentEntityId = nil
-- self.CurrentSelectTagGroup = {
-- [XCharacterConfigs.CharacterType.Normal] = {},
-- [XCharacterConfigs.CharacterType.Isomer] = {}
-- }
--
-- self.CurrentCharacterType = self:GetDefaultCharacterType()
--
-- -- 角色列表
-- self.DynamicTable = XDynamicTableNormal.New(self.SViewCharacterList)
-- self.DynamicTable:SetProxy(XUiTheatreMassageGrid)
-- self.DynamicTable:SetDelegate(self)
-- self.GridCharacterNew.gameObject:SetActiveEx(false)
-- self:RegisterUiEvents()
--
-- -- 模型初始化
-- local panelRoleModel = self.UiModelGo.transform:FindTransform("PanelRoleModel")
-- self.ImgEffectHuanren = self.UiModelGo.transform:FindTransform("ImgEffectHuanren")
-- self.ImgEffectHuanren1 = self.UiModelGo.transform:FindTransform("ImgEffectHuanren1")
-- self.ImgEffectHuanren1.gameObject:SetActiveEx(false)
-- self.UiPanelRoleModel = XUiPanelRoleModel.New(panelRoleModel, self.Name, nil, true)
-- XUiHelper.NewPanelActivityAsset(XDataCenter.TheatreManager.GetAdventureAssetItemIds(), self.PanelSpecialTool)
--
-- self.OwnedInfoPanel = XUiTheatreOwnedInfoPanel.New(self.UiOwnedInfo, handler(self, self.SwitchRoleState), self)
--
-- self.IsAscendOrder = false --初始降序
-- self:CheckBtnFilterActive()
-- self:InitBtnTabShougezhe()
--end
--
--function XUiTheatreMainMassage:OnEnable()
-- self.PanelCharacterTypeBtns:SelectIndex(self.CurrentCharacterType)
--end
--
--function XUiTheatreMainMassage:InitBtnTabShougezhe()
-- local lockShougezhe = not XFunctionManager.JudgeOpen(XFunctionManager.FunctionName.Isomer)
-- local roles = self.AdventureManager:GetCurrentRoles()
-- local isHaveIsomer = false
-- for _, role in ipairs(roles) do
-- if role:GetCharacterViewModel():GetCharacterType() == XCharacterConfigs.CharacterType.Isomer then
-- isHaveIsomer = true
-- break
-- end
-- end
-- self.BtnTabShougezhe:SetDisable(lockShougezhe and not isHaveIsomer)
--end
--
--function XUiTheatreMainMassage:GetDefaultCharacterType()
-- local roles
-- for characterType in ipairs(self.CurrentSelectTagGroup) do
-- roles = self:GetAdventureRoles(characterType)
-- if not XTool.IsTableEmpty(roles) then
-- return characterType
-- end
-- end
--end
--
--function XUiTheatreMainMassage:Filter(selectTagGroupDic, sortTagId, isThereFilterDataCb)
-- if self.TagCacheDic == nil then
-- self.TagCacheDic = {}
-- end
-- XDataCenter.RoomCharFilterTipsManager.Filter(
-- self.TagCacheDic,
-- selectTagGroupDic,
-- self:GetAdventureRoles(self.CurrentCharacterType),
-- handler(self, self.GetFilterJudge),
-- function(filteredData)
-- self.CurrentSelectTagGroup[self.CurrentCharacterType].TagGroupDic = selectTagGroupDic
-- self.CurrentSelectTagGroup[self.CurrentCharacterType].SortType = sortTagId
-- self:FilterRefresh(filteredData, sortTagId)
-- end,
-- isThereFilterDataCb
-- )
--end
--
--function XUiTheatreMainMassage:GetFilterJudge(groupId, tagValue, entity)
-- if not entity.GetCharacterViewModel then return false end
-- local characterViewModel = entity:GetCharacterViewModel()
-- -- 职业筛选
-- if groupId == XRoomCharFilterTipsConfigs.EnumFilterTagGroup.Career then
-- if tagValue == characterViewModel:GetCareer() then
-- return true
-- end
-- -- 能量元素筛选
-- elseif groupId == XRoomCharFilterTipsConfigs.EnumFilterTagGroup.Element then
-- local obtainElementList = characterViewModel:GetObtainElements()
-- for _, element in pairs(obtainElementList) do
-- if element == tagValue then
-- return true
-- end
-- end
-- else
-- XLog.Error(string.format("XUiTheatreMainMassage:GetFilterJudge函数错误, 没有处理排序组: %s的逻辑", groupId))
-- return false
-- end
--end
--
--function XUiTheatreMainMassage:FilterRefresh(filteredData, sortTagType)
-- if self.IsAscendOrder then
-- filteredData = XTool.ReverseList(filteredData)
-- end
-- self:RefreshRoleList(filteredData)
--end
--
--function XUiTheatreMainMassage:CheckBtnFilterActive()
-- self.BtnShengxu.gameObject:SetActiveEx(self.IsAscendOrder)
-- self.BtnJiangxu.gameObject:SetActiveEx(not self.IsAscendOrder)
--end
--
--function XUiTheatreMainMassage:GetAdventureRoles(characterType)
-- local roles = self.AdventureManager:GetCurrentRoles()
-- local result = {}
-- for _, role in ipairs(roles) do
-- if role:GetCharacterViewModel():GetCharacterType() == characterType then
-- local entityId = role:GetId()
-- table.insert(result, role)
--
-- if self.RoleSelectStateDic[entityId] == nil then
-- self.RoleSelectStateDic[entityId] = false
-- end
-- end
-- end
-- return result
--end
--
---- characterType : XCharacterConfigs.CharacterType
--function XUiTheatreMainMassage:OnPanelCharacterTypeBtnsClicked(characterType)
-- self.CurrentCharacterType = characterType
-- local selectTagGroupDic = self.CurrentSelectTagGroup[characterType].TagGroupDic or {}
-- local sortTagId = self.CurrentSelectTagGroup[characterType].SortType or XRoomCharFilterTipsConfigs.EnumSortTag.Default
-- local roles = self:GetAdventureRoles(self.CurrentCharacterType)
-- if XTool.IsTableEmpty(roles) then
-- XUiManager.TipError(XUiHelper.GetText("IsomerLimitTip"))
-- local defaultType = self:GetDefaultCharacterType()
-- roles = self:GetAdventureRoles(defaultType)
-- if not XTool.IsTableEmpty(roles) then
-- self.PanelCharacterTypeBtns:SelectIndex(defaultType)
-- end
-- return
-- end
--
-- self:Filter(
-- selectTagGroupDic,
-- sortTagId,
-- function(roles)
-- return true
-- end
-- )
--end
--
--function XUiTheatreMainMassage:RefreshRoleList(roleEntities)
-- local searchEntityId = self.CurrentEntityId
-- local index = 1
-- if searchEntityId ~= nil or searchEntityId ~= 0 then
-- for i, v in ipairs(roleEntities) do
-- if v:GetId() == searchEntityId then
-- index = i
-- break
-- end
-- end
-- end
-- self.CurrentEntityId = roleEntities[index]:GetId()
-- self.DynamicTable:SetDataSource(roleEntities)
-- self.DynamicTable:ReloadDataSync(index)
-- self:RefreshModel()
-- self:RefreshDetailPanel()
--end
--
--function XUiTheatreMainMassage:OnDynamicTableEvent(event, index, grid)
-- if index <= 0 or index > #self.DynamicTable.DataSource then
-- return
-- end
-- local entity = self.DynamicTable.DataSource[index]
-- if event == DYNAMIC_DELEGATE_EVENT.DYNAMIC_GRID_ATINDEX then
-- grid:SetSelect(self.CurrentEntityId == entity:GetId())
-- if self.RoleSelectStateDic[entity:GetId()] then
-- local characterId = entity:GetCharacterId()
-- entity = self.AdventureManager:GetRole(characterId)
-- end
-- grid:UpdateGrid(entity)
-- elseif event == DYNAMIC_DELEGATE_EVENT.DYNAMIC_GRID_TOUCHED then
-- self.CurrentEntityId = entity:GetId()
-- for _, tmpGrid in pairs(self.DynamicTable:GetGrids()) do
-- tmpGrid:SetSelect(false)
-- end
-- grid:SetSelect(true)
-- self:RefreshModel()
-- self:RefreshDetailPanel()
-- end
--end
--
--function XUiTheatreMainMassage:RefreshModel()
-- local entityId = self.CurrentEntityId
-- local adventureRole = self.AdventureManager:GetRole(entityId)
-- local characterViewModel = self.RoleSelectStateDic[entityId] and self:GetCharacterViewModelByEntityId(adventureRole:GetCharacterId()) or self:GetCharacterViewModelByEntityId(entityId)
-- if not characterViewModel then
-- return
-- end
--
-- self.ImgEffectHuanren.gameObject:SetActiveEx(false)
-- self.ImgEffectHuanren1.gameObject:SetActiveEx(false)
-- local finishedCallback = function(model)
-- self.PanelDrag.Target = model.transform
-- self.ImgEffectHuanren.gameObject:SetActiveEx(
-- self.CurrentCharacterType == XCharacterConfigs.CharacterType.Normal
-- )
-- self.ImgEffectHuanren1.gameObject:SetActiveEx(
-- self.CurrentCharacterType == XCharacterConfigs.CharacterType.Isomer
-- )
-- end
--
-- local sourceEntityId = characterViewModel:GetSourceEntityId()
-- if XRobotManager.CheckIsRobotId(sourceEntityId) then
-- local robot2CharId = XRobotManager.GetCharacterId(sourceEntityId)
-- local isOwn = XDataCenter.CharacterManager.IsOwnCharacter(robot2CharId)
-- if XRobotManager.CheckUseFashion(sourceEntityId) and isOwn then
-- local character = XDataCenter.CharacterManager.GetCharacter(robot2CharId)
-- local robot2CharViewModel = character:GetCharacterViewModel()
-- self.UiPanelRoleModel:UpdateCharacterModel(robot2CharId, nil, nil, finishedCallback, nil, robot2CharViewModel:GetFashionId())
-- else
-- local robotConfig = XRobotManager.GetRobotTemplate(sourceEntityId)
-- self.UiPanelRoleModel:UpdateRobotModel(sourceEntityId, robotConfig.CharacterId, nil, robotConfig.FashionId, robotConfig.WeaponId, finishedCallback)
-- end
-- else
-- self.UiPanelRoleModel:UpdateCharacterModel(
-- sourceEntityId,
-- nil,
-- nil,
-- finishedCallback,
-- nil,
-- characterViewModel:GetFashionId()
-- )
-- end
--end
--
--function XUiTheatreMainMassage:GetCharacterViewModelByEntityId(entityId)
-- local role = self.AdventureManager:GetRole(entityId)
-- if role == nil then return nil end
-- return role:GetCharacterViewModel()
--end
--
--function XUiTheatreMainMassage:RefreshDetailPanel()
-- local entityId = self.CurrentEntityId
-- local adventureRole = self.AdventureManager:GetRole(entityId)
-- local isOwnRole = self.RoleSelectStateDic[entityId]
-- if isOwnRole then
-- local characterId = adventureRole:GetCharacterId()
-- adventureRole = self.AdventureManager:GetRole(characterId)
-- end
-- self.OwnedInfoPanel:SetData(adventureRole, entityId)
-- self.BtnFashion.gameObject:SetActiveEx(isOwnRole or false)
--end
--
--function XUiTheatreMainMassage:SwitchRoleState(entityId)
-- self.OwnedInfoPanel:InitPanelActiveState()
-- self:PlayAnimationWithMask("RoleQieHuan")
--
-- local state = self.RoleSelectStateDic[entityId]
-- self.RoleSelectStateDic[entityId] = not state
--
-- for i, entity in ipairs(self.DynamicTable.DataSource) do
-- if entityId == entity:GetId() then
-- local grid = self.DynamicTable:GetGridByIndex(i)
-- if grid then
-- grid:PlaySwitchAnima()
--
-- if self.RoleSelectStateDic[entity:GetId()] then
-- local characterId = entity:GetCharacterId()
-- entity = self.AdventureManager:GetRole(characterId)
-- end
-- grid:UpdateGrid(entity)
-- end
-- end
-- end
-- self:RefreshModel()
-- self:RefreshDetailPanel()
--end
--
--function XUiTheatreMainMassage:PlayAnima(animaName, cb)
-- self:PlayAnimationWithMask(animaName, function()
-- if cb then
-- cb()
-- end
-- end)
--end
--
--function XUiTheatreMainMassage:RegisterUiEvents()
-- self:RegisterClickEvent(self.BtnBack, self.Close)
-- self:RegisterClickEvent(self.BtnMainUi, function() XLuaUiManager.RunMain() end)
-- self:RegisterClickEvent(self.BtnFashion, self.OnBtnFashionClick)
-- self:RegisterClickEvent(self.BtnOwnedDetail, self.OnBtnOwnedDetailClick)
-- self:RegisterClickEvent(self.BtnTeaching, self.OnBtnTeachingClick)
-- self:BindHelpBtn(self.BtnHelp, "Theatre")
--
-- self:RegisterClickEvent(self.BtnFilter, self.OnBtnFilterClicked)
-- self:RegisterClickEvent(self.BtnShengxu, self.OnBtnOrderClick)
-- self:RegisterClickEvent(self.BtnJiangxu, self.OnBtnOrderClick)
-- -- 角色类型按钮组
-- self.PanelCharacterTypeBtns:Init(
-- {
-- [XCharacterConfigs.CharacterType.Normal] = self.BtnTabGouzaoti,
-- [XCharacterConfigs.CharacterType.Isomer] = self.BtnTabShougezhe
-- },
-- function(tabIndex)
-- self:OnPanelCharacterTypeBtnsClicked(tabIndex)
-- end
-- )
--end
--
--function XUiTheatreMainMassage:GetCurrentCharacterId()
-- local entityId = self.CurrentEntityId
-- local adventureRole = self.AdventureManager:GetRole(entityId)
-- return adventureRole:GetCharacterId()
--end
--
--function XUiTheatreMainMassage:OnBtnOwnedDetailClick()
-- XLuaUiManager.Open("UiCharacterDetail", self:GetCurrentCharacterId())
--end
--
--function XUiTheatreMainMassage:OnBtnTeachingClick()
-- XDataCenter.PracticeManager.OpenUiFubenPractice(self:GetCurrentCharacterId())
--end
--
--function XUiTheatreMainMassage:OnBtnFashionClick()
-- XLuaUiManager.Open("UiFashion", self:GetCurrentCharacterId())
--end
--
--function XUiTheatreMainMassage:OnBtnFilterClicked()
-- XLuaUiManager.Open(
-- "UiRoomCharacterFilterTips",
-- self,
-- XRoomCharFilterTipsConfigs.EnumFilterType.Common,
-- XRoomCharFilterTipsConfigs.EnumSortType.Common,
-- self.CurrentCharacterType
-- )
--end
--
--function XUiTheatreMainMassage:OnBtnOrderClick()
-- self.IsAscendOrder = not self.IsAscendOrder
-- self:CheckBtnFilterActive()
-- self:OnPanelCharacterTypeBtnsClicked(self.CurrentCharacterType)
--end
--endregion
2023-07-15 02:35:33 +07:00
return XUiTheatreMainMassage