diff --git a/lua_probject/base_project/Game/View/Common/BaseWindow.lua b/lua_probject/base_project/Game/View/Common/BaseWindow.lua index d8a6db50..1f4356bd 100644 --- a/lua_probject/base_project/Game/View/Common/BaseWindow.lua +++ b/lua_probject/base_project/Game/View/Common/BaseWindow.lua @@ -101,6 +101,7 @@ function M:init(url) contentPane:AddRelation(self._root_view, RelationType.Right_Right) self._view.x = GRoot.inst.width - self._view.width - offset end + print("lingmeng", PopPanel.height, self._view.height) self._view.y = (PopPanel.height - self._view.height) * 0.5 click_item.xy = self._view.xy click_item.width = self._view.width diff --git a/lua_probject/base_project/Game/View/FGAssistView.lua b/lua_probject/base_project/Game/View/FGAssistView.lua index 4659b0eb..5fe78b57 100644 --- a/lua_probject/base_project/Game/View/FGAssistView.lua +++ b/lua_probject/base_project/Game/View/FGAssistView.lua @@ -11,7 +11,7 @@ function FGAssistView.new(blur_view, group_id, callback) self.class = "FGAssistView" self._blur_view = blur_view self._full = true - self._anim_pop = 1 + self._anim_pop = 2 self._animation = true self.group_id = group_id @@ -30,6 +30,16 @@ end function M:init(url) BaseWindow.init(self, url) self.lst_player = self._view:GetChild("lst_player") + self.lst_player:SetVirtual() + self.lst_player.itemRenderer = function(index, obj) + self:PlayerRenderer(index, obj) + end + self.lst_player.scrollPane.onPullUpRelease:Set( + function() + self:GetOnlinePlayers(self.lst_player.numItems) + end + ) + local btn_refresh = self._view:GetChild("btn_refresh") btn_refresh.onClick:Set(function() self:ReloadView() @@ -48,6 +58,22 @@ function M:FillData() -- end end +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 + obj:GetController('type').selectedIndex = self._data_number[i].online + btn_invite.onClick:Set(function() + local mgr_ctr = ControllerManager.GetController(GroupMgrController) + local room = DataManager.CurrenRoom + mgr_ctr:FG_InvitePlayer(self._data_number[i].uid, room.room_id, room.play_id, room.room_config:GetGameName(), + function() + end) + end) +end + -- function M:GetOnlinePlayers() -- local mgr_ctr = ControllerManager.GetController(GroupMgrController) -- mgr_ctr:FG_GetOnlinePlayers(function(res) @@ -60,12 +86,32 @@ end -- end -- end) -- end -function M:GetOnlinePlayers() +function M:GetOnlinePlayers(index) + index = index or 0 print("lingmeng GetOnlinePlayers", self.group_id) - pt(DataManager.groups) + local group = DataManager.groups:get(self.group_id) local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GroupMembers12(self.group_id, 0, 10, 2, 2, function(res) - end) + if not group then + fgCtr:FG_GroupList(function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败") + end + end) + end + if #group.members == 0 or index ~= 0 then + fgCtr:FG_GroupMembers12(self.group_id, 0, index + 10, 2, 2, function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "连接亲友圈失败") + else + self._data_number = group.members + self.lst_player.numItems = #group.members + end + end) + else + self._data_number = group.members + self.lst_player.numItems = #group.members + end + pt(self._data_number) end local function _showLeftTime(item, time) @@ -127,28 +173,28 @@ function M:ShowOnlinePlayers() end function M:OnUpdate() - local deltaTime = Time.deltaTime - self._timer = self._timer + deltaTime - if self._timer >= 1 then - self._timer = 0 + -- local deltaTime = Time.deltaTime + -- self._timer = self._timer + deltaTime + -- if self._timer >= 1 then + -- self._timer = 0 - if self.lst_player.numChildren == 0 then return end - for i = 1, #self.players do - local p = self.players[i] - local invite_time = _list_invite_time[p.uid] - if invite_time then - local i_timer = os.time() - invite_time - local item = self.lst_player:GetChildAt(i - 1) - if not item then break end - if i_timer < 15 then - _showLeftTime(item, 15 - i_timer) - else - item:GetController("enable").selectedIndex = 0 - _list_invite_time[p.uid] = nil - end - end - end - end + -- if self.lst_player.numChildren == 0 then return end + -- for i = 1, #self.players do + -- local p = self.players[i] + -- local invite_time = _list_invite_time[p.uid] + -- if invite_time then + -- local i_timer = os.time() - invite_time + -- local item = self.lst_player:GetChildAt(i - 1) + -- if not item then break end + -- if i_timer < 15 then + -- _showLeftTime(item, 15 - i_timer) + -- else + -- item:GetController("enable").selectedIndex = 0 + -- _list_invite_time[p.uid] = nil + -- end + -- end + -- end + -- end end function M:Close() diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index c8113257..1ce298e5 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -470,12 +470,10 @@ function M:InitView(url, isHideIpAdds) -------------------------lingmeng--------------------------- _view:GetChild('text_roomId').text = string.format("房间:%s", self._room.room_id) - local btn_invite = self._view:GetChild('btn_invite') - if btn_invite then - print("lingmeng init FGAssist", self._room.group_id) - pt(DataManager.groups) + local btn_inviteFamily = self._view:GetChild('btn_inviteFamily') + if btn_inviteFamily then UIPackage.AddPackage('base/newgroup/ui/FGAssist') - btn_invite.onClick:Set(function() + btn_inviteFamily.onClick:Set(function() local panel_assist = FGAssistView.new(self._root_view, self._room.group_id, function() print("lingmeng assistcallback") end) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index a1a4705d..47676d01 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -668,14 +668,15 @@ function M:__FangziTip(tip, weight) 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() + if tip.is_hu then + info._ctr_showGuoHu.selectedIndex = 1 + info._viewBtn_guoHu.onClick:Set(function() + _gamectr:SendAction(0) + end) + else + _gamectr:SendAction(0) + end end) else index = index + 1 diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXRoomConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXRoomConfig.lua index 8a08bead..d0ad9bd9 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXRoomConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXRoomConfig.lua @@ -146,7 +146,7 @@ function M:GetGameSMSize() end function M:GetGameName() - return "个旧麻将" + return "黎川麻将" end return M diff --git a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua index 66029da4..0331e7d1 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua @@ -199,7 +199,6 @@ function M:FillWitnessData(pd_data) room.banker_seat = bank_seat room.curren_turn_seat = active_seat room.curren_round = _tableInfo["round"] - local _info_list = _tableInfo["playerData"] for i = 1, #_info_list do local _jp = _info_list[i] @@ -247,6 +246,7 @@ function M:FillWitnessData(pd_data) room:AddPlayer(p) end + room.self_player.self_user = DataManager.SelfUser end function M.HandCardSortAndJing(a, b) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXRoomConfig.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXRoomConfig.lua index de4f2c33..a609fc44 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXRoomConfig.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXRoomConfig.lua @@ -1,159 +1,152 @@ - - - ---- +--- local M = {} --- Create a new RoomConfig function M.new(config) - setmetatable(M,{__index = RoomConfig}) - local self = setmetatable({}, {__index = M}) - RoomConfig.init(self,config) - self.config=config + setmetatable(M, { __index = RoomConfig }) + local self = setmetatable({}, { __index = M }) + RoomConfig.init(self, config) + self.config = config self.class = "RoomConfig" self.round = config["times"] self.maxPlayers = config["maxPlayers"] self.fengding = config["fengding"] self.wanfa = config["wanfa"] - self.qiduijiafan=config["qiduijiafan"] - self.shoudailongjiafan=config["shoudailongjiafan"] - self.loudilongjiafan=config["loudilongjiafan"] - self.bunengchi=config["bunengchi"] + self.qiduijiafan = config["qiduijiafan"] + self.shoudailongjiafan = config["shoudailongjiafan"] + self.loudilongjiafan = config["loudilongjiafan"] + self.bunengchi = config["bunengchi"] - return self + return self end function M:GetDes(sp) - sp = sp or " " - local count=0 + sp = sp or " " + local count = 0 local str = self.round and self.round .. "局" .. " " or "" - str = str .. RoomConfig.GetDes(self, sp).."\n" - + str = str .. RoomConfig.GetDes(self, sp) .. "\n" - if (self.fengding) then + + if (self.fengding) then str = str .. "封顶" - count=count+1 - if count%2==0 then - str = str .."\n" + count = count + 1 + if count % 2 == 0 then + str = str .. "\n" else - sp1="" - local strL=2 - for i=1,strL do - sp1=sp1.." " + sp1 = "" + local strL = 2 + for i = 1, strL do + sp1 = sp1 .. " " end - str = str .. sp1..sp + str = str .. sp1 .. sp end - end - - if (self.qiduijiafan) then - local strL=2 - str = str .."可胡七对" - if self.qiduijiafan then - str = str .."翻倍" - strL=0 - end - count=count+1 - if count%2==0 then - str = str .."\n" - else - sp1="" - for i=1,strL do - sp1=sp1.." " - end - str = str .. sp1..sp - end - end - - - if self.shoudailongjiafan then - str = str .."手逮龙加番" - count=count+1 - if count%2==0 then - str = str .."\n" - else - sp1="" - local strL=2 - for i=1,strL do - sp1=sp1.." " - end - str = str .. sp1..sp - end end - - if self.loudilongjiafan then - str = str .."落地龙" - count=count+1 - if count%2==0 then - str = str .."\n" - else - sp1="" - local strL=3 - for i=1,strL do - sp1=sp1.." " - end - str = str .. sp1..sp + + if (self.qiduijiafan) then + local strL = 2 + str = str .. "可胡七对" + if self.qiduijiafan then + str = str .. "翻倍" + strL = 0 + end + count = count + 1 + if count % 2 == 0 then + str = str .. "\n" + else + sp1 = "" + for i = 1, strL do + sp1 = sp1 .. " " end + str = str .. sp1 .. sp + end + end + + + if self.shoudailongjiafan then + str = str .. "手逮龙加番" + count = count + 1 + if count % 2 == 0 then + str = str .. "\n" + else + sp1 = "" + local strL = 2 + for i = 1, strL do + sp1 = sp1 .. " " + end + str = str .. sp1 .. sp + end + end + + if self.loudilongjiafan then + str = str .. "落地龙" + count = count + 1 + if count % 2 == 0 then + str = str .. "\n" + else + sp1 = "" + local strL = 3 + for i = 1, strL do + sp1 = sp1 .. " " + end + str = str .. sp1 .. sp + end end if self.bunengchi then - str = str .."不能吃" - count=count+1 - if count%2==0 then - str = str .."\n" - else - sp1="" - local strL=3 - for i=1,strL do - sp1=sp1.." " - end - str = str .. sp1..sp + str = str .. "不能吃" + count = count + 1 + if count % 2 == 0 then + str = str .. "\n" + else + sp1 = "" + local strL = 3 + for i = 1, strL do + sp1 = sp1 .. " " end + str = str .. sp1 .. sp + end end - - str = str.sub(str, 1, string.len(str) - string.len(sp)) - return str + + str = str.sub(str, 1, string.len(str) - string.len(sp)) + return str end - function M:GetDes2(sp) - sp = sp or " " - local str = RoomConfig.GetDes(self, sp) - local str = self.round and self.round .. "局" .. sp or "" - str = str .. RoomConfig.GetDes(self, sp) - + sp = sp or " " + local str = RoomConfig.GetDes(self, sp) + local str = self.round and self.round .. "局" .. sp or "" + str = str .. RoomConfig.GetDes(self, sp) - - if (self.qiduijiafan) then - str = str .."可胡七对" + + + if (self.qiduijiafan) then + str = str .. "可胡七对" if self.qiduijiafan then - str = str .."-翻倍" + str = str .. "-翻倍" end str = str .. sp - end - - + end - str = str.sub(str, 1, string.len(str) - string.len(sp)) - return str + + + str = str.sub(str, 1, string.len(str) - string.len(sp)) + return str end - function M:GetGameJS() - local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_MJ_NanCheng/gamerule") + local gamerulepanel = UIPackage.CreateObjectFromURL("ui://Extend_MJ_NanCheng/gamerule") return gamerulepanel end - function M:GetGameSMSize() - return 467,500 + return 467, 500 end - function M:GetGameName() - return "个旧麻将" + return "南城麻将" end -return M \ No newline at end of file +return M diff --git a/lua_probject/extend_project/extend/zipai/fulushou/main/FZData.lua b/lua_probject/extend_project/extend/zipai/fulushou/main/FZData.lua index 75e94b3c..956ac432 100644 --- a/lua_probject/extend_project/extend/zipai/fulushou/main/FZData.lua +++ b/lua_probject/extend_project/extend/zipai/fulushou/main/FZData.lua @@ -1,31 +1,31 @@ RB_FZTypeFLS = { --Chi = 1, - -- Peng = 2, - -- Pao = 3, - -- Ti = 4, - --zhao = 5, - -- HU = 6, - - Chi = 1, + -- Peng = 2, + -- Pao = 3, + -- Ti = 4, + --zhao = 5, + -- HU = 6, + + Chi = 1, Peng = 2, - Gang=3, - SGang=4, - Zhao=5, - SZhao=6, - HU = 7, + Gang = 3, + SGang = 4, + Zhao = 5, + SZhao = 6, + HU = 7, } local FZTipList = { tip_map_id = nil, - tip_map_type = nil + tip_map_type = nil, } local M = FZTipList function M.new() local self = {} - setmetatable(self,{__index = FZTipList}) + setmetatable(self, { __index = FZTipList }) self.tip_map_id = {} self.tip_map_type = {} return self @@ -38,7 +38,7 @@ function M:AddTip(tip) tiplist = {} self.tip_map_type[tip.weight] = tiplist end - tiplist[#tiplist+1] = tip + tiplist[#tiplist + 1] = tip end -return M \ No newline at end of file +return M diff --git a/lua_probject/main_project/main/majiang/FZData.lua b/lua_probject/main_project/main/majiang/FZData.lua index 4787d954..272040db 100644 --- a/lua_probject/main_project/main/majiang/FZData.lua +++ b/lua_probject/main_project/main/majiang/FZData.lua @@ -44,7 +44,8 @@ FZType = local FZTipList = { tip_map_id = nil, - tip_map_type = nil + tip_map_type = nil, + is_hu = false } local M = FZTipList @@ -55,11 +56,15 @@ function M.new() self.tip_map_id = {} self.tip_map_type = {} self.tip_num = 0 + self.is_hu = false return self end function M:AddTip(tip) self.tip_map_id[tip.id] = tip + if not self.is_hu then + self.is_hu = tip.type == FZType.HU + end local tiplist = self.tip_map_type[tip.weight] if not tiplist then tiplist = {} diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index fa946bb1..9ef55635 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -40,15 +40,23 @@ function M:init() self._view_getCard = self._view:GetChild('Btn_HandCard') self._view_FZTips = self._view:GetChild('Comp_FZTips') self._area_allDown = self._view:GetChild('area_allDown') + self._viewBtn_guoHu = self._view:GetChild('btn_guohu') + self._viewBtn_buGuoHu = self._view:GetChild('btn_buguohu') + self._ctr_seletedGet = self._view:GetController('seletedGetCard') self._ctr_tip = self._view:GetController('tip') + self._ctr_showGuoHu = self._view:GetController('showGuoHu') self._area_allDown.onClick:Set(function() self._view_handCardList.selectedIndex = -1 self._click_index = self._view_handCardList.selectedIndex self._ctr_seletedGet.selectedIndex = 1 end) + + self._viewBtn_buGuoHu.onClick:Set(function() + self._ctr_tip.selectedIndex = 1 + end) end function M:ShowHuTip(card_list) diff --git a/wb_new_ui/assets/Common/PopPanel.xml b/wb_new_ui/assets/Common/PopPanel.xml index f34fc293..e6519eb3 100644 --- a/wb_new_ui/assets/Common/PopPanel.xml +++ b/wb_new_ui/assets/Common/PopPanel.xml @@ -1,5 +1,5 @@ - + diff --git a/wb_new_ui/assets/Common/UIPanel.xml b/wb_new_ui/assets/Common/UIPanel.xml index 568e630c..658715bb 100644 --- a/wb_new_ui/assets/Common/UIPanel.xml +++ b/wb_new_ui/assets/Common/UIPanel.xml @@ -1,17 +1,19 @@ - + + + - + - + diff --git a/wb_new_ui/assets/FGAssist/invite/component/invite/btn_invite.xml b/wb_new_ui/assets/FGAssist/invite/component/invite/btn_invite.xml index 29313918..06d30ced 100644 --- a/wb_new_ui/assets/FGAssist/invite/component/invite/btn_invite.xml +++ b/wb_new_ui/assets/FGAssist/invite/component/invite/btn_invite.xml @@ -1,12 +1,12 @@ - + - +