边框、成员排序、亲友圈标题
parent
e57ed8a8d2
commit
d7e766509b
|
|
@ -6,6 +6,52 @@ local FGAssistView = {}
|
|||
local M = FGAssistView
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
||||
local function SortMembers(Members)
|
||||
|
||||
for _,player in pairs(Members) do
|
||||
if player.uid == DataManager.SelfUser.account_id then
|
||||
Members[_] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- ↓↓↓排序
|
||||
local re = {}
|
||||
local online = {}
|
||||
local playing = {}
|
||||
local offline = {}
|
||||
|
||||
for _, player in pairs(Members) do
|
||||
-- 在线 绿色状态
|
||||
if player.online == 1 and player.playing ~= "startPlaying" then
|
||||
online[#online + 1] = player
|
||||
end
|
||||
|
||||
-- 在线游戏中 红色状态
|
||||
if player.online == 1 and player.playing == "startPlaying" then
|
||||
playing[#playing + 1] = player
|
||||
end
|
||||
|
||||
-- 离线
|
||||
if player.online == 0 then
|
||||
offline[#offline + 1] = player
|
||||
end
|
||||
end
|
||||
|
||||
for _, player in pairs(online) do
|
||||
re[#re + 1] = player
|
||||
end
|
||||
|
||||
for _, player in pairs(playing) do
|
||||
re[#re + 1] = player
|
||||
end
|
||||
|
||||
for _, player in pairs(offline) do
|
||||
re[#re + 1] = player
|
||||
end
|
||||
|
||||
return re
|
||||
end
|
||||
|
||||
function FGAssistView.new(blur_view, group_id, callback)
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = "FGAssistView"
|
||||
|
|
@ -81,7 +127,7 @@ function M:ReFalsh(...)
|
|||
end
|
||||
end
|
||||
|
||||
self._data_number = group.members
|
||||
self._data_number = SortMembers(group.members) --group.members
|
||||
self.lst_player.numItems = #group.members
|
||||
end
|
||||
|
||||
|
|
@ -89,12 +135,22 @@ function M:PlayerRenderer(index, obj)
|
|||
local i = index + 1
|
||||
obj:GetChild('tex_name').text = self._data_number[i].nick
|
||||
local btn_invite = obj:GetChild('btn_invite')
|
||||
btn_invite:GetController('online').selectedIndex = self._data_number[i].uid ==
|
||||
DataManager.SelfUser.account_id and 0 or self._data_number[i].online
|
||||
local state = self._data_number[i].online
|
||||
if self._data_number[i].playing == "startPlaying" then
|
||||
state = 2
|
||||
|
||||
btn_invite:GetController('online').selectedIndex = 0
|
||||
if self._data_number[i].uid ~= DataManager.SelfUser.account_id and self._data_number[i].online == 1 and self._data_number[i].playing == "stopPlaying" then
|
||||
btn_invite:GetController('online').selectedIndex = 1
|
||||
end
|
||||
|
||||
--btn_invite:GetController('online').selectedIndex = self._data_number[i].uid == DataManager.SelfUser.account_id and 0 or self._data_number[i].online
|
||||
local state = 0
|
||||
if self._data_number[i].online == 1 and self._data_number[i].playing == "startPlaying" then
|
||||
state = 2
|
||||
elseif self._data_number[i].online == 1 and self._data_number[i].playing == "stopPlaying" then
|
||||
state = 1
|
||||
elseif self._data_number[i].online == 0 then
|
||||
state = 0
|
||||
end
|
||||
|
||||
obj:GetController('type').selectedIndex = state
|
||||
local loader = obj:GetChild("btn_head"):GetChild("icon")
|
||||
ImageLoad.Load(self._data_number[i].portrait, loader)
|
||||
|
|
@ -157,13 +213,17 @@ function M:GetOnlinePlayersshow(fgCtr, group, index)
|
|||
if res.ReturnCode ~= 0 then
|
||||
ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败")
|
||||
else
|
||||
self._data_number = group.members
|
||||
self.lst_player.numItems = #group.members
|
||||
--self._data_number = group.members
|
||||
--self.lst_player.numItems = #group.members
|
||||
self._data_number = SortMembers(group.members)
|
||||
self.lst_player.numItems = #self._data_number
|
||||
end
|
||||
end)
|
||||
else
|
||||
self._data_number = group.members
|
||||
self.lst_player.numItems = #group.members
|
||||
--self._data_number = group.members
|
||||
--self.lst_player.numItems = #group.members
|
||||
self._data_number = SortMembers(group.members)
|
||||
self.lst_player.numItems = #self._data_number
|
||||
end
|
||||
pt(self._data_number)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -795,7 +795,7 @@ function M:ConnetFamily(index, groups, isCreate)
|
|||
obj.text = Utils.TextOmit(group.name, 6, "...")
|
||||
obj.onClick:Add(function()
|
||||
if group.id == self._group.id then
|
||||
ViewUtil.ShowBannerOnScreenCenter("已在家族中")
|
||||
--ViewUtil.ShowBannerOnScreenCenter("已在家族中")
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@
|
|||
</image>
|
||||
<component id="n3_in3i" name="btn_close" src="in3i7cu9" fileName="Main/Component/btn_close.xml" xy="54,6" group="n17_in3i"/>
|
||||
<text id="n399_nq5b" name="n399" xy="199,26" size="203,97" group="n17_in3i" fontSize="30" align="center" autoSize="none" text="版本1.0.1"/>
|
||||
<image id="n392_f1fu" name="n392" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="967,24" group="n395_f1fu">
|
||||
<image id="n392_f1fu" name="n392" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="1039,24" group="n395_f1fu">
|
||||
<relation target="n393_f1fu" sidePair="left-left"/>
|
||||
</image>
|
||||
<text id="n393_f1fu" name="n393" xy="1084,27" size="364,94" group="n395_f1fu" font="ui://27vd145bg2mo7ij0" fontSize="72" color="#ffffff" align="center" vAlign="middle" shadowColor="#000000" shadowOffset="3,3" text="亲友圈成员">
|
||||
<text id="n393_f1fu" name="n393" xy="1156,27" size="220,94" group="n395_f1fu" font="ui://27vd145bg2mo7ij0" fontSize="72" color="#ffffff" align="center" vAlign="middle" shadowColor="#000000" shadowOffset="3,3" text="亲友圈">
|
||||
<relation target="" sidePair="center-center"/>
|
||||
</text>
|
||||
<image id="n394_f1fu" name="n394" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="1502,24" group="n395_f1fu" flip="hz">
|
||||
<image id="n394_f1fu" name="n394" src="yk1o7d3p" fileName="Main/Image/hall_club_common_tittle_icon1.png" xy="1430,24" group="n395_f1fu" flip="hz">
|
||||
<relation target="n393_f1fu" sidePair="right-right"/>
|
||||
</image>
|
||||
<group id="n395_f1fu" name="n395" xy="967,24" size="598,99" group="n17_in3i" advanced="true">
|
||||
<group id="n395_f1fu" name="n395" xy="1039,24" size="454,99" group="n17_in3i" advanced="true">
|
||||
<gearDisplay controller="familyType" pages="0"/>
|
||||
</group>
|
||||
<group id="n17_in3i" name="bg" xy="0,0" size="2532,1170"/>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@
|
|||
<image id="jrro7cya" name="btn_familyName_on.png" path="/Main/Image/"/>
|
||||
<image id="jrro7cyb" name="btn_familyName_off.png" path="/Main/Image/"/>
|
||||
<image id="jrro7cyc" name="btn_close.png" path="/Main/Image/"/>
|
||||
<image id="jrro7cyd" name="bt_top.png" path="/Main/Image/" atlas="alone"/>
|
||||
<image id="jrro7cyd" name="bt_top.png" path="/Main/Image/" atlas="alone" disableTrim="true"/>
|
||||
<image id="jrro7cye" name="bg_topTitle.png" path="/Main/Image/"/>
|
||||
<image id="jrro7cyf" name="bg_mainOpenGame.png" path="/Main/Image/"/>
|
||||
<image id="jrro7cyg" name="bg_mainListChild.png" path="/Main/Image/"/>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue