南城使用新二人对战页面,初始hp移动到邀请人时触发
parent
b97e76dd92
commit
b5fb6912da
|
|
@ -282,19 +282,6 @@ function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
||||||
else
|
else
|
||||||
list_familyNumber.itemRenderer = function(index, obj)
|
list_familyNumber.itemRenderer = function(index, obj)
|
||||||
obj:GetChild('text_name').text = members[index + 1].nick
|
obj:GetChild('text_name').text = members[index + 1].nick
|
||||||
if self._lev ~= 3 then
|
|
||||||
if members[index + 1].hp < 777777000 then
|
|
||||||
fgCtr:FG_ChangeFag(group_id, members[index + 1].uid, members[index + 1].hp + 777777000,
|
|
||||||
function(res)
|
|
||||||
if res.ReturnCode == 0 then
|
|
||||||
|
|
||||||
else
|
|
||||||
ViewUtil.CloseModalWait('join_room')
|
|
||||||
ViewUtil.ErrorMsg(self._root_view, res.ReturnCode, '默认分配积分失败')
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
list_familyNumber.numItems = res.Data.member_num
|
list_familyNumber.numItems = res.Data.member_num
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -506,7 +493,21 @@ function M:JoinRoom(roomId)
|
||||||
-- ViewUtil.ShowBannerOnScreenCenter("加入房间回调")
|
-- ViewUtil.ShowBannerOnScreenCenter("加入房间回调")
|
||||||
-- end)
|
-- end)
|
||||||
--先换成邀请玩家
|
--先换成邀请玩家
|
||||||
fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function()
|
fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function(res)
|
||||||
|
if (res.ReturnCode == 0) then
|
||||||
|
ViewUtil.ShowBannerOnScreenCenter('添加成功!', 1)
|
||||||
|
fgCtr:FG_ChangeFag(self._group.id, tonumber(roomId), 777777000,
|
||||||
|
function(res)
|
||||||
|
if res.ReturnCode == 0 then
|
||||||
|
ViewUtil.ShowBannerOnScreenCenter('分配默认积分成功!', 1)
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorMsg(self._root_view, res.ReturnCode, '默认分配积分失败')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
ViewUtil.ErrorTip(res.ReturnCode, '邀请玩家失败!')
|
||||||
|
end
|
||||||
|
|
||||||
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false,
|
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false,
|
||||||
1)
|
1)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,11 @@ function M:UpdateRemainCard(card_num, hide)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData(player)
|
function M:FillData(player)
|
||||||
|
if self._main_view._room.room_config.people_num == 2 then
|
||||||
|
PlayerInfoView_copy.FillData(self, player)
|
||||||
|
else
|
||||||
PlayerInfoView.FillData(self, player)
|
PlayerInfoView.FillData(self, player)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,11 @@ function M:InitView(url)
|
||||||
self._gps_style = 1
|
self._gps_style = 1
|
||||||
self._full = true
|
self._full = true
|
||||||
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
|
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
|
||||||
|
if self._room.room_config.people_num == 2 then
|
||||||
|
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
|
||||||
|
else
|
||||||
MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2")
|
MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2")
|
||||||
|
end
|
||||||
self._hu_tip = HuTipView.new(self)
|
self._hu_tip = HuTipView.new(self)
|
||||||
|
|
||||||
self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '倍'
|
self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '倍'
|
||||||
|
|
@ -95,9 +99,14 @@ function M:IsShowGangZi(btn, isShow)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:UpdateRound()
|
function M:UpdateRound()
|
||||||
|
if self._room.room_config.people_num == 2 then
|
||||||
|
self._view:GetChild("text_round").text = string.format("当前局数:%d/%d", self._room.curren_round,
|
||||||
|
self._room.room_config.round)
|
||||||
|
else
|
||||||
self._view:GetChild("tex_round1").text = self._room.curren_round
|
self._view:GetChild("tex_round1").text = self._room.curren_round
|
||||||
self._view:GetChild("tex_round2").text = self._room.room_config.round
|
self._view:GetChild("tex_round2").text = self._room.room_config.round
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M:InitPlayerInfoView()
|
function M:InitPlayerInfoView()
|
||||||
self._player_info = {}
|
self._player_info = {}
|
||||||
|
|
@ -204,7 +213,7 @@ function M:EventInit()
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
-- self._tex_leftTime.text = arg[3]
|
-- self._tex_leftTime.text = arg[3]
|
||||||
self._tex_LeftCard.text = arg[3]
|
self._tex_LeftCard.text = string.format("剩余%d张牌", arg[3])
|
||||||
-- self:UpdateRoomInfo()
|
-- self:UpdateRoomInfo()
|
||||||
local info = self._player_card_info[self:GetPos(seat)]
|
local info = self._player_card_info[self:GetPos(seat)]
|
||||||
info:UpdateHandCard(true)
|
info:UpdateHandCard(true)
|
||||||
|
|
@ -365,7 +374,7 @@ function M:EventInit()
|
||||||
if _room:checkHpNonnegative() then
|
if _room:checkHpNonnegative() then
|
||||||
p.cur_hp = data[i].hp_info.cur_hp
|
p.cur_hp = data[i].hp_info.cur_hp
|
||||||
end
|
end
|
||||||
info:UpdateScore()
|
-- info:UpdateScore()
|
||||||
info._view:GetChild("zhanji").visible = true
|
info._view:GetChild("zhanji").visible = true
|
||||||
local num = data[i].hp_info.total_hp
|
local num = data[i].hp_info.total_hp
|
||||||
if num > 0 then
|
if num > 0 then
|
||||||
|
|
@ -408,7 +417,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EvnetPiaoTip, function()
|
_gamectr:AddEventListener(TX_GameEvent.EvnetPiaoTip, function()
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._tex_LeftCard.text = "0"
|
self._tex_LeftCard.text = "剩余0张牌"
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:__PiaoNiaoTip()
|
self:__PiaoNiaoTip()
|
||||||
end)
|
end)
|
||||||
|
|
@ -719,7 +728,7 @@ function M:ReloadRoom(bskip)
|
||||||
end
|
end
|
||||||
info:UpdateHandCard()
|
info:UpdateHandCard()
|
||||||
local head_info = self._player_info[self:GetPos(p.seat)]
|
local head_info = self._player_info[self:GetPos(p.seat)]
|
||||||
head_info:UpdateScore()
|
-- head_info:UpdateScore()
|
||||||
head_info._view:GetChild('zhanji').visible = true
|
head_info._view:GetChild('zhanji').visible = true
|
||||||
local num = p.total_hp or 0
|
local num = p.total_hp or 0
|
||||||
if num > 0 then
|
if num > 0 then
|
||||||
|
|
@ -760,7 +769,7 @@ function M:ReloadRoom(bskip)
|
||||||
|
|
||||||
if bskip == nil or bskip == false then
|
if bskip == nil or bskip == false then
|
||||||
self:UpdateCardBox(self:GetPos(room.curren_outcard_seat))
|
self:UpdateCardBox(self:GetPos(room.curren_outcard_seat))
|
||||||
self._tex_LeftCard.text = room.left_count
|
self._tex_LeftCard.text = string.format("剩余%d张牌", room.left_count)
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
local PlayerInfoView = require("Game.View.PlayerInfoView")
|
local PlayerInfoView = require("Game.View.PlayerInfoView")
|
||||||
|
local PlayerInfoView_copy = require("Game.View.PlayerInfoView copy")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.new(view, mainView)
|
function M.new(view, mainView)
|
||||||
|
if mainView._room.room_config.people_num == 2 then
|
||||||
|
setmetatable(M, { __index = PlayerInfoView_copy })
|
||||||
|
else
|
||||||
setmetatable(M, { __index = PlayerInfoView })
|
setmetatable(M, { __index = PlayerInfoView })
|
||||||
|
end
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self._view = view
|
self._view = view
|
||||||
self._main_view = mainView
|
self._main_view = mainView
|
||||||
|
|
@ -12,10 +17,14 @@ function M.new(view, mainView)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init()
|
function M:init()
|
||||||
|
if self._main_view._room.room_config.people_num ~= 2 then
|
||||||
PlayerInfoView.init(self)
|
PlayerInfoView.init(self)
|
||||||
self._tex_score = self._view:GetChild("info"):GetChild("tex_score1")
|
self._tex_score = self._view:GetChild("info"):GetChild("tex_score1")
|
||||||
self._tex_score2 = self._view:GetChild("info"):GetChild("tex_score2")
|
self._tex_score2 = self._view:GetChild("info"):GetChild("tex_score2")
|
||||||
self._ct_score = self._view:GetChild("info"):GetController("score")
|
self._ct_score = self._view:GetChild("info"):GetController("score")
|
||||||
|
else
|
||||||
|
PlayerInfoView_copy.init(self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShowInteraction(type, str)
|
function M:ShowInteraction(type, str)
|
||||||
|
|
@ -48,9 +57,13 @@ function M:UpdateRemainCard(card_num, hide)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:FillData(player)
|
function M:FillData(player)
|
||||||
|
if self._main_view._room.room_config.people_num == 2 then
|
||||||
|
PlayerInfoView_copy.FillData(self, player)
|
||||||
|
else
|
||||||
PlayerInfoView.FillData(self, player)
|
PlayerInfoView.FillData(self, player)
|
||||||
self:UpdateScore(player.total_score)
|
self:UpdateScore(player.total_score)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M:UpdateScore()
|
function M:UpdateScore()
|
||||||
local score = self._player.total_score
|
local score = self._player.total_score
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue