放置提示同步
|
|
@ -51,6 +51,7 @@ function M:init()
|
|||
|
||||
self._ctr_getCard = self._view:GetController('getCard')
|
||||
self._ctr_seletedGet = self._view:GetController('seletedGetCard')
|
||||
self._ctr_tip = self._view:GetController('tip')
|
||||
end
|
||||
|
||||
function M:ShowHuTip(card_list)
|
||||
|
|
|
|||
|
|
@ -575,59 +575,122 @@ function M:OutCard(card)
|
|||
end
|
||||
end
|
||||
|
||||
-- function M:__FangziTip(tip, weight)
|
||||
-- printlog("__FangziTip")
|
||||
-- local _gamectr = self._gamectr
|
||||
-- local _chipeng_tip = UIPackage.CreateObject("Main_Majiang", "Gcm_action_tips")
|
||||
-- _chipeng_tip:GetController("hide_bg").selectedIndex = 1
|
||||
-- self._chipeng_tip = _chipeng_tip
|
||||
-- local p = self._room.self_player
|
||||
-- -- self._player_card_info[self:GetPos(p.seat)]
|
||||
|
||||
-- local _lit_fanzi = _chipeng_tip:GetChild("lit_fanzi")
|
||||
-- _lit_fanzi:RemoveChildrenToPool()
|
||||
-- local _tlist = table.keys(tip.tip_map_type)
|
||||
-- printlog(tip.tip_map_type)
|
||||
-- pt(_tlist)
|
||||
-- local tip_hu = false
|
||||
-- local count = #_tlist
|
||||
-- table.sort(_tlist)
|
||||
-- local isHu = false
|
||||
-- for k = 1, #_tlist do
|
||||
-- local td = tip.tip_map_type[_tlist[k]][1]
|
||||
-- local url = "ui://Main_Majiang/Btn_fztip"
|
||||
-- local td_weight = td.weight
|
||||
-- if td_weight == 16 then td_weight = 8 end
|
||||
-- if td_weight == 8 then url = "ui://Main_Majiang/Btn_hu" end
|
||||
-- local btn_t = _lit_fanzi:AddItemFromPool(url)
|
||||
-- btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight
|
||||
-- btn_t.data = { tip, td }
|
||||
-- btn_t.onClick:Add(self.__TipAction, self)
|
||||
-- end
|
||||
|
||||
-- -- if not (tonumber(weight) >= 16) then
|
||||
-- local _btn_pass = _lit_fanzi:AddItemFromPool("ui://Main_Majiang/Btn_pass")
|
||||
-- -- local _btn_pass = _chipeng_tip:GetChild("btn_pass")
|
||||
-- _btn_pass.onClick:Set(function()
|
||||
-- if tonumber(weight) >= 8 then
|
||||
-- local guo_msg = MsgWindow.new(self._root_view, "确定要点过吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
-- guo_msg.onOk:Add(function()
|
||||
-- _gamectr:SendAction(0)
|
||||
-- _chipeng_tip:Dispose()
|
||||
-- self._chipeng_tip = nil
|
||||
-- guo_msg:Close()
|
||||
-- end)
|
||||
-- guo_msg:Show()
|
||||
-- else
|
||||
-- _gamectr:SendAction(0)
|
||||
-- _chipeng_tip:Dispose()
|
||||
-- self._chipeng_tip = nil
|
||||
-- end
|
||||
-- end)
|
||||
-- -- end
|
||||
|
||||
-- self._view:AddChild(_chipeng_tip)
|
||||
-- _chipeng_tip:Center()
|
||||
-- end
|
||||
|
||||
function M:__FangziTip(tip, weight)
|
||||
printlog("__FangziTip")
|
||||
local _gamectr = self._gamectr
|
||||
local _chipeng_tip = UIPackage.CreateObject("Main_Majiang", "Gcm_action_tips")
|
||||
_chipeng_tip:GetController("hide_bg").selectedIndex = 1
|
||||
self._chipeng_tip = _chipeng_tip
|
||||
local p = self._room.self_player
|
||||
-- self._player_card_info[self:GetPos(p.seat)]
|
||||
local info = self._player_card_info[1]
|
||||
local _chipeng_tip = info._view_FZTips
|
||||
local _ctr_tips = info._ctr_tip
|
||||
|
||||
local _lit_fanzi = _chipeng_tip:GetChild("lit_fanzi")
|
||||
_lit_fanzi:RemoveChildrenToPool()
|
||||
local _tlist = table.keys(tip.tip_map_type)
|
||||
printlog(tip.tip_map_type)
|
||||
pt(_tlist)
|
||||
local tip_hu = false
|
||||
local count = #_tlist
|
||||
table.sort(_tlist)
|
||||
local isHu = false
|
||||
for k = 1, #_tlist do
|
||||
local td = tip.tip_map_type[_tlist[k]][1]
|
||||
local url = "ui://Main_Majiang/Btn_fztip"
|
||||
local td_weight = td.weight
|
||||
if td_weight == 16 then td_weight = 8 end
|
||||
if td_weight == 8 then url = "ui://Main_Majiang/Btn_hu" end
|
||||
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
||||
btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight
|
||||
btn_t.data = { tip, td }
|
||||
btn_t.onClick:Add(self.__TipAction, self)
|
||||
end
|
||||
|
||||
-- if not (tonumber(weight) >= 16) then
|
||||
local _btn_pass = _lit_fanzi:AddItemFromPool("ui://Main_Majiang/Btn_pass")
|
||||
-- local _btn_pass = _chipeng_tip:GetChild("btn_pass")
|
||||
_btn_pass.onClick:Set(function()
|
||||
if tonumber(weight) >= 8 then
|
||||
local guo_msg = MsgWindow.new(self._root_view, "确定要点过吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
guo_msg.onOk:Add(function()
|
||||
_gamectr:SendAction(0)
|
||||
_chipeng_tip:Dispose()
|
||||
self._chipeng_tip = nil
|
||||
guo_msg:Close()
|
||||
print("lingmengfz")
|
||||
local _lit_fanzi = _chipeng_tip:GetChild("list")
|
||||
_lit_fanzi:SetVirtual()
|
||||
local _tlist = tip.tip_map_id
|
||||
print("lingmengfz2")
|
||||
_lit_fanzi.itemRenderer = function(index, obj)
|
||||
local type = obj:GetController('type')
|
||||
if index == tip.tip_num then
|
||||
type.selectedIndex = 0
|
||||
obj.onClick:Set(function()
|
||||
local guo_msg = MsgWindow.new(self._root_view, "确定要点过吗?", MsgWindow.MsgMode.OkAndCancel)
|
||||
guo_msg.onOk:Add(function()
|
||||
_gamectr:SendAction(0)
|
||||
_ctr_tips.selectedIndex = 0
|
||||
guo_msg:Close()
|
||||
end)
|
||||
guo_msg:Show()
|
||||
end)
|
||||
guo_msg:Show()
|
||||
else
|
||||
_gamectr:SendAction(0)
|
||||
_chipeng_tip:Dispose()
|
||||
self._chipeng_tip = nil
|
||||
index = index + 1
|
||||
if _tlist[index].type == FZType.HU then
|
||||
type.selectedIndex = 4
|
||||
obj:GetChild('btn_Card1').icon = string.format('ui://Main_Majiang/202_%d', _tlist[index].card)
|
||||
elseif _tlist[index].type == FZType.Chi then
|
||||
type.selectedIndex = FZType.Chi
|
||||
for i = 1, 3 do
|
||||
obj:GetChild(string.format('btn_Card%d', i)).icon = string.format('ui://Main_Majiang/202_%d',
|
||||
_tlist[index].opcard[i])
|
||||
end
|
||||
elseif _tlist[index].type == FZType.Peng then
|
||||
type.selectedIndex = FZType.Peng
|
||||
for i = 1, 3 do
|
||||
obj:GetChild(string.format('btn_Card%d', i)).icon = string.format('ui://Main_Majiang/202_%d',
|
||||
_tlist[index].card)
|
||||
end
|
||||
else
|
||||
for i = 1, 4 do
|
||||
obj:GetChild(string.format('btn_Card%d', i)).icon = string.format('ui://Main_Majiang/202_%d',
|
||||
_tlist[index].card)
|
||||
end
|
||||
type.selectedIndex = FZType.Gang
|
||||
if _tlist[index].type == FZType.Gang_An then
|
||||
obj:GetChild('btn_Card4').icon = 'ui://Main_Majiang/202_00'
|
||||
end
|
||||
end
|
||||
obj.onClick:Set(function()
|
||||
_gamectr:SendAction(_tlist[index].id)
|
||||
_ctr_tips.selectedIndex = 0
|
||||
end)
|
||||
end
|
||||
end)
|
||||
-- end
|
||||
|
||||
self._view:AddChild(_chipeng_tip)
|
||||
_chipeng_tip:Center()
|
||||
end
|
||||
_ctr_tips.selectedIndex = 1
|
||||
_lit_fanzi.numItems = tip.tip_num + 1
|
||||
print("lingmengfzend", _ctr_tips.selectedIndex)
|
||||
end
|
||||
|
||||
function M:__TipAction(context)
|
||||
|
|
@ -749,14 +812,10 @@ function M:OnFangziAction(...)
|
|||
local fs_info = _player_card_info[self:GetPos(fz.from_seat)]
|
||||
fs_info:UpdateOutCardList()
|
||||
end
|
||||
print("lingmengfz1")
|
||||
info:UpdateFzList(fz, index, true)
|
||||
print("lingmengfz2")
|
||||
local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi
|
||||
print("lingmengfz3")
|
||||
print(getcard)
|
||||
info:UpdateHandCard(getcard)
|
||||
print("lingmengfz4")
|
||||
self:__CloseTip()
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ local FZTip = {
|
|||
op_card = nil
|
||||
}
|
||||
|
||||
]]--
|
||||
]] --
|
||||
|
||||
FZType =
|
||||
{
|
||||
|
|
@ -51,9 +51,10 @@ local M = FZTipList
|
|||
|
||||
function M.new()
|
||||
local self = {}
|
||||
setmetatable(self,{__index = FZTipList})
|
||||
setmetatable(self, { __index = FZTipList })
|
||||
self.tip_map_id = {}
|
||||
self.tip_map_type = {}
|
||||
self.tip_num = 0
|
||||
return self
|
||||
end
|
||||
|
||||
|
|
@ -64,7 +65,8 @@ function M:AddTip(tip)
|
|||
tiplist = {}
|
||||
self.tip_map_type[tip.weight] = tiplist
|
||||
end
|
||||
tiplist[#tiplist+1] = tip
|
||||
tiplist[#tiplist + 1] = tip
|
||||
self.tip_num = self.tip_num + 1
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -229,7 +229,6 @@ function M:UpdateFzList(fz, index, show_card)
|
|||
local ctr_Four = outCard:GetController("isFour")
|
||||
for i = 1, 3 do
|
||||
local FZCard = outCard:GetChild(string.format("Comp_Card%d", i))
|
||||
print("lingmengfz", string.format("Comp_Card%d", i), FZCard)
|
||||
self:fillCard2(FZCard, FZame, fz.card)
|
||||
end
|
||||
if fz.type == FZType.Peng then
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@ function M:init()
|
|||
MJPlayerCardInfoView.init(self)
|
||||
|
||||
self._view_getCard = self._view:GetChild('Btn_HandCard')
|
||||
self._view_FZTips = self._view:GetChild('Comp_FZTips')
|
||||
|
||||
self._ctr_seletedGet = self._view:GetController('seletedGetCard')
|
||||
self._ctr_tip = self._view:GetController('tip')
|
||||
end
|
||||
|
||||
function M:ShowHuTip(card_list)
|
||||
|
|
@ -223,6 +226,8 @@ end
|
|||
function M:Clear()
|
||||
MJPlayerCardInfoView.Clear(self)
|
||||
|
||||
self._view_FZTips:RemoveChildren(0, -1, true)
|
||||
|
||||
self._ctr_seletedGet.selectedIndex = 0
|
||||
end
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 820 KiB After Width: | Height: | Size: 819 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 888 KiB After Width: | Height: | Size: 887 KiB |