diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index e5516726..5417ee40 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -1049,6 +1049,25 @@ function M:FG_GetGroupRecordSpe(group_id, platform, qid, includeMembers, limit, end) end +-- 战绩记录 +function M:FG_GetGroupRecordSpe2(group_id, platform, qid, includeMembers, limit, num, begin_time, end_time, time_type, + callback) + local _client = ControllerManager.GroupClient + local data = {} + data.id = group_id + data.qid = qid + data.platform = platform + data.includeMembers = includeMembers + data.limit = limit + data.num = num + data.bt = begin_time + data.et = end_time + data.tt = time_type + _client:send(Protocol.WEB_FG_GET_RECORD2, data, function(res) + callback(res) + end) +end + -- 获取战绩 function M:FG_GetGroupPersonRecord(group_id, platform, qid, time_type, begin_time, end_time, limit, num, callback) local _client = ControllerManager.GroupClient diff --git a/lua_probject/base_project/Game/IGameInfo.lua b/lua_probject/base_project/Game/IGameInfo.lua index c30c46f1..a5e2ff59 100644 --- a/lua_probject/base_project/Game/IGameInfo.lua +++ b/lua_probject/base_project/Game/IGameInfo.lua @@ -68,6 +68,10 @@ function M:ShowVariablePrice(ctype) -- tex_owner.text = price end +function M:SetDefault() + +end + function M:LoadConfigToDetail(data) local returnString = '' diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index a848357c..9300afd9 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -328,6 +328,8 @@ Protocol = { WEB_FG_GET_PROPORTION_LOG = "group/log/get_hplog_pump", -- 获取战绩 WEB_FG_GET_RECORD = "group/log/get_records", + -- 战绩记录 + WEB_FG_GET_RECORD2 = "group/log/get_records_owner", -- 获取个人战绩 WEB_FG_GET_PERSON_RECORD = "group/log/get_person_records", -- 获取成员战绩 diff --git a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua index dc25e318..81975670 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua @@ -208,8 +208,7 @@ function M:RecordItemRenderer(data, obj) end function M:RecursionRecord(fgCtr, index, uid, leftTime, rightTime) - print("lingmeng RecursionRecord", self.group_id, GetPlatform(), uid, 0, index * 60, 60, leftTime, rightTime, 3) - fgCtr:FG_GetGroupRecordSpe(self.group_id, GetPlatform(), uid, 0, index * 60, 60, leftTime, rightTime, 0, + fgCtr:FG_GetGroupRecordSpe2(self.group_id, GetPlatform(), uid, 0, index * 60, 60, leftTime, rightTime, 0, function(res) if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "查看个人战绩失败") diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua index 8ac25c3a..e5a0fbe6 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua @@ -183,8 +183,6 @@ function M:FillGameData() self.cJiesan.selectedIndex = hpData.JieShan - 1 self.cChat.selectedIndex = hpData.BanChat self.cMisslie.selectedIndex = hpData.BanMissile - else - self.cGps.selectedIndex = 2 end end diff --git a/lua_probject/base_project/Game/View/WitnessView.lua b/lua_probject/base_project/Game/View/WitnessView.lua index 15d537e2..fe3281af 100644 --- a/lua_probject/base_project/Game/View/WitnessView.lua +++ b/lua_probject/base_project/Game/View/WitnessView.lua @@ -172,6 +172,96 @@ function M:EventInit() end end ) + + _gamectr:AddEventListener(GameEvent.OnUpdateInfo, function(...) + local arg = { ... } + local p = arg[1] + local t = arg[2] + -- 托管状态变化 + if t == 5 then + if p == DataManager.CurrenRoom.self_player then + if p.entrust then + self:closeTipOnTuoguan() + self:MarkSelfTuoguan() + else + self:UnmarkSelfTuoguan() + end + else + local player_info = self._player_info[self:GetPos(p.seat)] + if p.entrust then + player_info:MarkTuoguan() + else + player_info:UnmarkTuoguan() + end + end + end + end) +end + +-- 标记自己托管 +function M:MarkSelfTuoguan() + if self._com_tuoguan then + return + end + + + self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self') + local com_tuoguan = self._com_tuoguan + GRoot.inst:AddChild(com_tuoguan) + --com_tuoguan:Center() + --com_tuoguan.y = GRoot.inst.height - com_tuoguan.height + --com_tuoguan.x = (GRoot.inst.width - com_tuoguan.width) * 0.5 + -- local _msg_view = nil + -- com_tuoguan:GetChild('n0').onClick:Set( + -- function() + -- if _msg_view then + -- _msg_view:Dispose() + -- end + -- local _curren_msg = UIPackage.CreateObjectFromURL('ui://Common/MessageBox') + -- _msg_view = _curren_msg + -- _msg_view:GetChild('btn_ok').onClick:Set( + -- function() + -- _msg_view:Dispose() + -- _msg_view = nil + -- self._gamectr:Entrust(false) + -- end + -- ) + -- _msg_view:GetChild('btn_close').onClick:Set( + -- function() + -- _msg_view:Dispose() + -- _msg_view = nil + -- end + -- ) + + -- _msg_view:GetChild('btn_close1').onClick:Set( + -- function() + -- _msg_view:Dispose() + -- _msg_view = nil + -- end + -- ) + -- local roate = GRoot.inst.width / GRoot.inst.height + -- local num = 100 + -- if roate < 1.9 then + -- num = 250 + -- end + -- com_tuoguan:AddChild(_msg_view) + -- _msg_view:GetChild('tex_message').text = '确定要取消托管吗?' + -- _msg_view.x = (com_tuoguan.width - _msg_view.width) * 0.5 - num + -- _msg_view.y = (com_tuoguan.height - com_tuoguan.y - _msg_view.height) * 0.5 + -- end + -- ) +end + +-- 取消标记自己托管 +function M:UnmarkSelfTuoguan() + if self._com_tuoguan then + self._com_tuoguan:Dispose() + self._com_tuoguan = nil + end +end + +-- 托管时关闭一些提示窗口,如起手胡、吃碰提示、海底,由扩展实现 +function M:closeTipOnTuoguan() end function M:PlayChatSound(sex, chat_index) @@ -301,7 +391,7 @@ end function M:Destroy() TimerManager.Clear() - -- self:UnmarkSelfTuoguan() + self:UnmarkSelfTuoguan() self:DestroyPlayerInfo() DSTweenManager.ClearTween() diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index c9fdd63c..314bfd59 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -190,6 +190,8 @@ function M:fillResult0(room, peopleNum, result) print("===============================FZType.Peng", room.jing, fzCardInfo[j].card) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Chi then @@ -202,6 +204,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].opcard[l] then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then @@ -216,6 +220,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end end @@ -231,6 +237,8 @@ function M:fillResult0(room, peopleNum, result) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end handCardList.numItems = handInfoNum @@ -260,6 +268,8 @@ function M:fillResult0(room, peopleNum, result) huCardBtn.icon = string.format("ui://Main_Majiang/b202_%d", infoList.win_card) if room.jing == infoList.win_card then huCardBtn:GetController('jing').selectedIndex = 1 + else + huCardBtn:GetController('jing').selectedIndex = 0 end huCardBtn.visible = true @@ -360,6 +370,8 @@ function M:RemindCardRender(data, obj) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) if room.jing == data then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index 0062877d..aeaf2792 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -21,6 +21,9 @@ function M:FillData() self._config:GetChild("n93").text = string.format("奖%s马", Mathf.Round(jiangmaSlider.value) * 2) end) + local com_editSetting = self._config:GetChild("com_editSetting") + + com_editSetting:GetController("cGps").selectedIndex = 2 -- if oldGameVersion == 2 then -- self._config:GetController("xipai").selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 5512d5cf..ecaa7eab 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -238,7 +238,9 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) local arg = { ... } - -- self._left_time = 15 + if not self._left_time or self._left_time <= 15 then + self._left_time = 15 + end local seat = arg[1] self:UpdateCardBox(self:GetPos(seat)) -- if seat == self._room.self_player.seat then diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua index ac74d71b..3a8b3a84 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua @@ -3,17 +3,17 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} -function M.new(view, mainView) +function M.new(view, mainView,flag_witness) setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView - self:init() + self:init(flag_witness) return self end -function M:init() - PlayerInfoView2.init(self) +function M:init(flag_witness) + PlayerInfoView2.init(self,flag_witness) end function M:ShowInteraction(type, str) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index 0b34e031..3ae81a7e 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -156,72 +156,13 @@ end function M:EventInit() -- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong") - MainView.EventInit(self) + getmetatable(M).__index.EventInit(self) local _room = self._room local _view = self._view local _gcm_outcard_url = UIPackage.GetItemURL("Main_Majiang", "Gcm_OutCard") local _player_info = self._player_info local _gamectr = self._gamectr - _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1:FillData(p) - info1._view.visible = true - - local info2 = self._player_card_info[self:GetPos(p.seat)] - info2:SetPlayer(p) - info2:FillData() - end) - - _gamectr:AddEventListener(GameEvent.PlayerLeave, function(...) - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1._view.visible = false - self:PlayMJSound("user_leave.mp3") - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local witnessPlayerList = arg[1] - self._room.witness_player_list = witnessPlayerList - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - print("linemng tcp", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems) - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerLeave, function(...) - ---- print("刷新托管数据=====") - local arg = { ... } - local player = arg[1] - local witnessPlayerList = self._room.witness_player_list - for i, _player in ipairs(witnessPlayerList) do - if _player.aid == player then - table.remove(witnessPlayerList, i) - break - end - end - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - print("linemng", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems) - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - _gamectr:AddEventListener(TX_GameEvent.SendLaiZi, function(...) local arg = { ... } print("lingmeng witness SendLaiZi") @@ -237,67 +178,10 @@ function M:EventInit() print("lingmeng witness EventBuGang") end) - _gamectr:AddEventListener(TX_GameEvent.SendCards, function(...) - print("lingmeng witness SendCards") - -- self:ShowJing() - if self._clearingView then - self._clearingView:Destroy() - self._clearingView = nil - end - self:UpdateRound() - self:RemoveCursor() - self._state.selectedIndex = 4 - local list = _room.player_list - for i = 1, #list do - local p = list[i] - local info = self._player_info[self:GetPos(p.seat)] - info:FillData(p) - info:MarkBank(p.seat == _room.banker_seat) - info:Ready(false) - local card_info = self._player_card_info[self:GetPos(p.seat)] - card_info:Clear() - card_info:UpdateHandCardWitness() - end - end) - _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) - print("lingmeng witness EventTurn") - local arg = { ... } - -- self._left_time = 15 - local seat = arg[1] - self:UpdateCardBox(self:GetPos(seat)) - local playerInfo = self._player_info[self:GetPos(seat)] - local info = self._player_card_info[self:GetPos(seat)] - print("lingmeng hand_left_count", info._player.hand_left_count) - info._player.hand_left_count = info._player.hand_left_count + 1 - info:UpdateHandCardWitness(true) - end) - _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) print("lingmeng witness OutHint") end) - local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard" - _gamectr:AddEventListener(TX_GameEvent.OutCard, function(...) - print("lingmeng witness OutCard") - self._left_time = 0 - local arg = { ... } - local p = arg[1] - local card = arg[2] - local seat = p.seat - local info = self._player_card_info[self:GetPos(seat)] - - self:RemoveCursor() - - info:UpdateHandCardWitness(false) - - info:UpdateOutCardList(nil, nil, self._cursor) - self:PlayMJSound("chupai.mp3") - self:PlaySound("FuZhou_MJ", p.self_user.sex, tostring(card)) - if seat == _room.self_player.seat then - _room.curren_outcard_seat = -1 - end - print("ling 2zhihou2") - end) _gamectr:AddEventListener(TX_GameEvent.GetCard, function(...) print("lingmeng witness GetCard") end) @@ -416,6 +300,7 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + self:PlayMJSound("end_music.mp3") local _room = self._room self._left_time = 0 self:UpdateCardBox(0) @@ -439,6 +324,7 @@ function M:EventInit() -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -449,6 +335,31 @@ function M:EventInit() if _room.curren_round ~= _room.room_config.round then -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) + for i = 1, #data do + local p = _room:GetPlayerBySeat(data[i].seat) + p.total_score = data[i].total_score + local card_info = self._player_card_info[self:GetPos(p.seat)] + local info = self._player_info[self:GetPos(p.seat)] + --card_info:Clear() + card_info:ResetCardType() + if _room:checkHpNonnegative() then + p.cur_hp = data[i].total_score + end + info:UpdateScore() + info._view:GetChild("zhanji").visible = true + local num = data[i].total_score + if num >= 0 then + info._view:GetController("text_color").selectedIndex = 0 + info._view:GetChild("text_jifen").text = "+" .. num + else + info._view:GetController("text_color").selectedIndex = 1 + info._view:GetChild("text_jifen").text = num + end + + info._view:GetChild("mask_piao").title = "" + info._view:GetController("piao_niao").selectedIndex = 0 + p.fz_list = {} + end DataManager.CurrenRoom.self_player.card_list = {} self._clearingView = nil end) @@ -457,7 +368,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) print("lingmeng witness ZPResult2") - -- self:UnmarkSelfTuoguan() + self:UnmarkSelfTuoguan() self._left_time = 0 self:UpdateCardBox(0) self._ctr_cardbox.selectedIndex = 0 @@ -487,6 +398,18 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...) print("lingmeng witness EventResidueCard") end) + + --替换mianview的事件 + _gamectr:AddEventListener( + GameEvent.PlayerState, + function(...) + printlog("lingmeng OnEventOnlineState") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 + end + ) end function M:InitPlayerInfoView() @@ -494,7 +417,7 @@ function M:InitPlayerInfoView() local _player_info = self._player_info for i = 1, self._room.room_config.people_num do local tem = self._view:GetChild(string.format("player_info%d_2", i)) - _player_info[i] = PlayerInfoView.new(tem, self) + _player_info[i] = PlayerInfoView.new(tem, self,true) tem.visible = false end end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua index 5a652030..61e51516 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua @@ -99,22 +99,21 @@ function M:FillRoomData(s2croom) local tem = _info_list[i] local playerid = tem["playerid"] local p = room:GetPlayerById(playerid) - local outcard_list = tem["outcard_list"] - p.outcard_list = outcard_list p.total_score = tem["score"] - p.hand_left_count = tem["card_count"] p.piao_niao = tem["piao_niao"] or 0 - local opcard = tem["opcard"] - for k = 1, #opcard do - local op = opcard[k] - local fz = {} - fz.type = op["type"] - fz.card = op["card"] - fz.from_seat = op["from_seat"] - p.fz_list[#p.fz_list + 1] = fz - end - if not playing and room.curren_round > 0 then - -- self.GetGameController():PlayerReady() + if playing then + local outcard_list = tem["outcard_list"] + p.hand_left_count = tem["card_count"] + p.outcard_list = outcard_list + local opcard = tem["opcard"] + for k = 1, #opcard do + local op = opcard[k] + local fz = {} + fz.type = op["type"] + fz.card = op["card"] + fz.from_seat = op["from_seat"] + p.fz_list[#p.fz_list + 1] = fz + end end end end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index 3af4029a..ed3bc704 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -190,6 +190,8 @@ function M:fillResult0(room, peopleNum, result) print("===============================FZType.Peng", room.jing, fzCardInfo[j].card) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Chi then @@ -202,6 +204,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].opcard[l] then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then @@ -216,6 +220,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end end @@ -231,6 +237,8 @@ function M:fillResult0(room, peopleNum, result) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end handCardList.numItems = handInfoNum @@ -259,6 +267,8 @@ function M:fillResult0(room, peopleNum, result) huCardBtn.icon = string.format("ui://Main_Majiang/b202_%d", infoList.win_card) if room.jing == infoList.win_card then huCardBtn:GetController('jing').selectedIndex = 1 + else + huCardBtn:GetController('jing').selectedIndex = 0 end huCardBtn.visible = true @@ -359,6 +369,8 @@ function M:RemindCardRender(data, obj) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) if room.jing == data then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua index aef7f81c..ebca9907 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua @@ -21,6 +21,9 @@ function M:FillData() self._config:GetChild("n93").text = string.format("奖%s马", Mathf.Round(jiangmaSlider.value) * 2) end) + local com_editSetting = self._config:GetChild("com_editSetting") + + com_editSetting:GetController("cGps").selectedIndex = 2 -- if oldGameVersion == 2 then -- self._config:GetController("xipai").selectedIndex = 0 diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index fed28f1a..c08b9e2f 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -189,6 +189,8 @@ function M:fillResult0(room, peopleNum, result) print("===============================FZType.Peng", room.jing, fzCardInfo[j].card) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Chi then @@ -201,6 +203,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].opcard[l] then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then @@ -215,6 +219,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end end @@ -230,6 +236,8 @@ function M:fillResult0(room, peopleNum, result) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end handCardList.numItems = handInfoNum @@ -259,6 +267,8 @@ function M:fillResult0(room, peopleNum, result) huCardBtn.icon = string.format("ui://Main_Majiang/b202_%d", infoList.win_card) if room.jing == infoList.win_card then huCardBtn:GetController('jing').selectedIndex = 1 + else + huCardBtn:GetController('jing').selectedIndex = 0 end huCardBtn.visible = true @@ -358,6 +368,8 @@ function M:RemindCardRender(data, obj) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) if room.jing == data then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua index 03a132f2..ecf19337 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua @@ -16,6 +16,12 @@ function M:FillData() self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_LiChuan/Label_Detail_83") + + local com_editSetting = self._config:GetChild("com_editSetting") + + com_editSetting:GetController("cGps").selectedIndex = 2 + self._config:GetController("jingbibo").selectedIndex = 1 + -- if oldGameVersion == 2 then -- self._config:GetController("xipai").selectedIndex = 0 @@ -171,7 +177,7 @@ function M:LoadConfigToDetail(data, hpdata) returnString = string.format("%s人数%s人", returnString, configData.maxPlayers) returnString = string.format("%s,%s,%s,%s", returnString, - configData.zimo == 0 and "只能自摸" or "自摸可点炮", + configData.zimo == 0 and "可点炮,可自摸" or "只能自摸", configData.tuoguan == 0 and string.format("%d秒后自动托管", configData.tuoguan_active_time) or "不能托管", configData.jingbibo == 1 and "有精必博" or "有精可胡") diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua index b47719d3..9cb80434 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua @@ -326,6 +326,7 @@ function M:EventInit() -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -370,7 +371,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) print("lingmeng witness ZPResult2") - -- self:UnmarkSelfTuoguan() + self:UnmarkSelfTuoguan() self._left_time = 0 self:UpdateCardBox(0) self._ctr_cardbox.selectedIndex = 0 @@ -401,6 +402,18 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...) print("lingmeng witness EventResidueCard") end) + + --替换mianview的事件 + _gamectr:AddEventListener( + GameEvent.PlayerState, + function(...) + printlog("lingmeng OnEventOnlineState") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 + end + ) end function M:InitPlayerInfoView() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua index d6e4b640..fc18c369 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua @@ -106,22 +106,21 @@ function M:FillRoomData(s2croom) local tem = _info_list[i] local playerid = tem["playerid"] local p = room:GetPlayerById(playerid) - local outcard_list = tem["outcard_list"] - p.outcard_list = outcard_list p.total_score = tem["score"] - p.hand_left_count = tem["card_count"] p.piao_niao = tem["piao_niao"] or 0 - local opcard = tem["opcard"] - for k = 1, #opcard do - local op = opcard[k] - local fz = {} - fz.type = op["type"] - fz.card = op["card"] - fz.from_seat = op["from_seat"] - p.fz_list[#p.fz_list + 1] = fz - end - if not playing and room.curren_round > 0 then - -- self.GetGameController():PlayerReady() + if playing then + local outcard_list = tem["outcard_list"] + p.hand_left_count = tem["card_count"] + p.outcard_list = outcard_list + local opcard = tem["opcard"] + for k = 1, #opcard do + local op = opcard[k] + local fz = {} + fz.type = op["type"] + fz.card = op["card"] + fz.from_seat = op["from_seat"] + p.fz_list[#p.fz_list + 1] = fz + end end end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua index 81792463..a9a44f4c 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua @@ -20,6 +20,10 @@ function M:FillData() jiangmaSlider.onChanged:Set(function() self._config:GetChild("n93").text = string.format("奖%s马", Mathf.Round(jiangmaSlider.value) * 2) end) + + local com_editSetting = self._config:GetChild("com_editSetting") + + com_editSetting:GetController("cGps").selectedIndex = 2 -- if oldGameVersion == 2 then -- self._config:GetController("xipai").selectedIndex = 0 @@ -102,6 +106,9 @@ function M:GetPlayList() return _play_list end +function M:SetDefault() +end + function M:SelectedConfigData() local _config = self._config local round = _config:GetController("round").selectedIndex + 1 @@ -199,12 +206,12 @@ function M:LoadConfigToDetail(data, hpdata) returnString = string.format("%s,%s马%s%s%s%s%s%s,%s", returnString, configData.jiangma and string.format("奖%d", configData.jiangma * 2) or "不奖", - configData.shaozhuang and ",有烧庄" or "", - configData.zuoma and ",庄家坐马" or "", - configData.zimo and ",只能自摸" or ",自摸可点炮", + configData.shaozhuang == 1 and ",有烧庄" or "", + configData.zuoma == 0 and ",庄家坐马" or "", + configData.zimo == 0 and ",可点炮,可自摸" or ",只能自摸", configData.tuoguan and string.format(",%d秒后自动托管", configData.tuoguan_active_time) or ",不能托管", - configData.jiahu and ",可以假胡" or "", configData.fengding and ",封顶20炮" or "", - configData.zhuanwan and "大转弯" or "小转弯") + configData.jiahu == 0 and ",可以假胡" or "", configData.fengding and ",封顶20炮" or "", + configData.zhuanwan == 0 and "大转弯" or "小转弯") if configData.GPSDetection then returnString = string.format("%s%s", returnString, diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index f5cc16d7..33c33df6 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -215,10 +215,12 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self:InitXiPai() self:InitXiPai1() - self.btn_setting.onClick:Set(function() - local view = MJSettingView.new(self) - view:Show() - end) + self.btn_setting.onClick:Set(handler(self,self.ClickSetting)) +end + +function M:ClickSetting() + local view = MJSettingView.new(self) + view:Show() end function M:InitXiPai() @@ -721,6 +723,7 @@ function M:OnResult1(...) -- end -- self:RemoveCursor() self._clearingView = self.EXClearingViewClass.new(self._root_view) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index ba64034f..aa53771e 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -135,6 +135,8 @@ end function M:fillCard(obj, pos_str, card, use3d) if DataManager.CurrenRoom.jing and card == DataManager.CurrenRoom.jing and obj:GetController('jing') then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end if self._current_card_type == 2 and (use3d == nil or use3d == true) then obj.icon = 'ui://MajiangCard3d/' .. 'b' .. pos_str .. card @@ -149,6 +151,8 @@ function M:fillCard2(obj, pos_str, card, out) if obj:GetController('out') then obj:GetController('out').selectedIndex = out or 0 end + else + obj:GetController('jing').selectedIndex = 0 end obj:GetChild("icon").url = 'ui://Main_Majiang/' .. pos_str .. card diff --git a/lua_probject/main_project/main/majiang/MJWitnessView.lua b/lua_probject/main_project/main/majiang/MJWitnessView.lua index 61aabe33..fcf28657 100644 --- a/lua_probject/main_project/main/majiang/MJWitnessView.lua +++ b/lua_probject/main_project/main/majiang/MJWitnessView.lua @@ -50,10 +50,12 @@ function M:InitView() TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config) self.btn_setting = self._view:GetChild("btn_setting") - self.btn_setting.onClick:Set(function() - local view = MJSettingView.new(self, true) - view:Show() - end) + self.btn_setting.onClick:Set(handler(self,self.ClickSetting)) +end + +function M:ClickSetting() + local view = MJSettingView.new(self, true) + view:Show() end local majiang_asset_path = "base/main_majiang/sound/" diff --git a/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml b/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml index db0b20ac..b952f68c 100644 --- a/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml +++ b/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml @@ -42,7 +42,7 @@ - + @@ -110,7 +110,7 @@