diff --git a/fk101/lua_probject/base_project/Game/View/Common/BaseWindow.lua b/fk101/lua_probject/base_project/Game/View/Common/BaseWindow.lua index 8dfe694c..611e2468 100644 --- a/fk101/lua_probject/base_project/Game/View/Common/BaseWindow.lua +++ b/fk101/lua_probject/base_project/Game/View/Common/BaseWindow.lua @@ -87,6 +87,7 @@ function M:init(url) if self._anim_pop == 0 then self._view:AddRelation(contentPane, RelationType.Size) contentPane:AddChild(self._view) + self._view:Center() else contentPane:RemoveRelation(self._root_view, RelationType.Center_Center) contentPane:AddRelation(self._root_view, RelationType.Middle_Middle) @@ -136,27 +137,29 @@ function M:Show() -- 判断当前窗口是否已经在队列中,如果在就不重复添加 local _inQueue = false - if self._new_hide then - for i=1,#WindowQueue do - local win = WindowQueue[i] - if win == self then - _inQueue = true - end - if win._queue then - win._root_view:RemoveFromParent() - end - end - end - if self._queue and not _inQueue then - WindowQueue[#WindowQueue + 1] = self - end - AddPanel(self._root_view) - if self._full then - local offset = get_offset(self._full_offset) - self._contentPane.width = GRoot.inst.width - 2 * offset - self._contentPane.height = GRoot.inst.height - self._contentPane.x = offset - end + if self._new_hide then + for i = 1, #WindowQueue do + local win = WindowQueue[i] + if win == self then + _inQueue = true + end + if win._queue then + win._root_view:RemoveFromParent() + end + end + end + if self._queue and not _inQueue then + WindowQueue[#WindowQueue + 1] = self + end + AddPanel(self._root_view) + if self._full then + local offset = get_offset(self._full_offset) + self._contentPane:MakeFullScreen() + self._contentPane:AddRelation(GRoot.inst, RelationType.Size) + -- self._contentPane.width = GRoot.inst.width - 2 * offset + -- self._contentPane.height = GRoot.inst.height + self._contentPane.x = offset + end end -- 关闭窗口 diff --git a/fk101/lua_probject/base_project/Game/View/MainView.lua b/fk101/lua_probject/base_project/Game/View/MainView.lua index 22ef88a1..5e75d507 100644 --- a/fk101/lua_probject/base_project/Game/View/MainView.lua +++ b/fk101/lua_probject/base_project/Game/View/MainView.lua @@ -241,9 +241,11 @@ function M:InitView(url, isHideIpAdds) local btn_start = _view:GetChild('btn_start') + if btn_start then btn_start.onClick:Set(function() self._gamectr:StartGame() end) + end local _btn_wxyqhy = _view:GetChild('btn_wxyqhy') if _btn_wxyqhy then @@ -870,6 +872,8 @@ function M:MarkSelfTuoguan() self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self') local com_tuoguan = self._com_tuoguan GRoot.inst:AddChild(com_tuoguan) + self._com_tuoguan.height = GRoot.inst.height + self._com_tuoguan.width = GRoot.inst.width --com_tuoguan:Center() --com_tuoguan.y = GRoot.inst.height - com_tuoguan.height --com_tuoguan.x = (GRoot.inst.width - com_tuoguan.width) * 0.5 @@ -984,14 +988,20 @@ function M:OnUpdate() if (self._popEvent) then local func = self._gamectr:PopEvent() if (func ~= nil) then - if pcall(func) then - - else - self._gamectr = ControllerManager.GetController(GameController) - if self._gamectr then - self._gamectr:ResetConnect() - end - end + if self._flag_fanpaofa then + self._popEvent = false + end + local result, resultInfo = pcall(func) + if result then + + else + printlog("game_error", resultInfo) + printlog("game_error_tra", debug.traceback()) + self._gamectr = ControllerManager.GetController(GameController) + if self._gamectr then + self._gamectr:ResetConnect() + end + end --func() end end diff --git a/fk101/lua_probject/base_project/Game/View/PlayBackView.lua b/fk101/lua_probject/base_project/Game/View/PlayBackView.lua index 2ce322b2..9409186e 100644 --- a/fk101/lua_probject/base_project/Game/View/PlayBackView.lua +++ b/fk101/lua_probject/base_project/Game/View/PlayBackView.lua @@ -27,7 +27,8 @@ function M:init() UIPackage.AddPackage('base/chat/ui/Chat') self.cmdList = self._room.cmdList self._eventmap = {} - -- self._full = true + self._full = true + self._full_offset = false self._put_map = false self._new_hide = false self._queue = false @@ -72,6 +73,11 @@ function M:InitView(url) for i = 1, #list do local p = list[i] local info = _player_info[self:GetPos(p.seat)] + if not p.seat or p.seat == 0 then + p.seat = i + info = _player_info[self:GetPos(i)] + end + info._view.visible = true info:FillData(p) info:MarkBank(p.seat == _room.banker_seat) @@ -107,31 +113,31 @@ function M:InitView(url) local tex_time = com_roominfo:GetChild('tex_time') self._co_timer = coroutine.start( - function() - tex_time.text = os.date('%m-%d %H:%M') - local _client = ControllerManager.GameNetClinet - if not _client then - return + function() + tex_time.text = os.date('%m-%d %H:%M') + local _client = ControllerManager.GameNetClinet + if not _client then + return + end + local ping = _client:getAveragePingTime() + if not ping then + return + end + local ctr_xh = com_roominfo:GetChild('gcm_xinhao'):GetController('c1') + ping = math.floor(ping / 2) + if ping > 300 then + ping = 300 + end + if ping <= 100 then + ctr_xh.selectedIndex = 0 + elseif ping <= 300 then + ctr_xh.selectedIndex = 1 + else + ctr_xh.selectedIndex = 2 + end + coroutine.wait(10) end - local ping = _client:getAveragePingTime() - if not ping then - return - end - local ctr_xh = com_roominfo:GetChild('gcm_xinhao'):GetController('c1') - ping = math.floor(ping / 2) - if ping > 300 then - ping = 300 - end - if ping <= 100 then - ctr_xh.selectedIndex = 0 - elseif ping <= 300 then - ctr_xh.selectedIndex = 1 - else - ctr_xh.selectedIndex = 2 - end - coroutine.wait(10) - end - ) + ) end self._eventmap = {} @@ -308,16 +314,12 @@ function M:CmdBackToLobby() _curren_msg:Show() end -function M:GetPos(seat,myseat) +function M:GetPos(seat, myseat) local my_seat = 1 - if myseat == nil then - for i = 1, #self._room.player_list do - if DataManager.SelfUser.account_id == self._room.player_list[i].self_user.account_id then - my_seat = self._room.player_list[i].seat - end - end + if not myseat and self._room.self_player ~= nil then + my_seat = self._room.self_player.seat else - my_seat = myseat + my_seat = myseat end return ViewUtil.GetPos(my_seat, seat, self._room.room_config.people_num) end @@ -351,12 +353,12 @@ function M:ChangeAlpha(...) end self._record_alpha = coroutine.start( - function() - self._record.alpha = 1 - coroutine.wait(2) - self._record.alpha = 0.5 - end - ) + function() + self._record.alpha = 1 + coroutine.wait(2) + self._record.alpha = 0.5 + end + ) end function M:Show() diff --git a/fk101/lua_probject/base_project/Game/View/PlayerInfoView.lua b/fk101/lua_probject/base_project/Game/View/PlayerInfoView.lua index 3cf632e9..402676e2 100644 --- a/fk101/lua_probject/base_project/Game/View/PlayerInfoView.lua +++ b/fk101/lua_probject/base_project/Game/View/PlayerInfoView.lua @@ -26,9 +26,12 @@ function M.new(view, main_view, isHideIpAdds) self._view = view self._main_view = main_view self._isHideIpAdds = isHideIpAdds - self.isShowTGTimer=false - self.currentTime=0 - self.totalTime=0 + self.isShowTGTimer = false + self.currentTime = 0 + self.totalTime = 0 + self.maxTime = 0 + self.starttimeflag = true + self.timer = nil --self.isShow = fasle self:init() return self @@ -82,63 +85,133 @@ function M:init() self._ctr_room_owner = view:GetController('room_owner') self._ctr_mask_voice = view:GetController('mask_voice') self._ctr_dismiss_room = view:GetController('dismiss_room') - - self.PlayerTGTips=view:GetChild('tuoguanTips') - if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then - self.PlayerTGTips.displayObject.gameObject:SetActive(false) - end - + + self.PlayerTGTips = view:GetChild('tuoguanTips') + if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then + self.PlayerTGTips.displayObject.gameObject:SetActive(false) + end + + self.PlayerTGBg = view:GetChild('pb_tuoGuan_Bg') + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(false) + end + self.PlayerTGBorder = view:GetChild('pb_tuoGuan_Border') + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(false) + end end +function M:showmmm() + if self.totalTime > 0 then + self.starttimeflag = false + self.totalTime = self.totalTime - 0.0165 + if self.totalTime < 60 then + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(true) + end + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(true) + end + if self.PlayerTGBg then + self.PlayerTGBg.max = self.maxTime + self.PlayerTGBg.value = self.maxTime - self.totalTime + end + if self.PlayerTGBorder then + self.PlayerTGBorder.max = self.maxTime + self.PlayerTGBorder.value = self.totalTime + end + end + else + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(false) + end + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(false) + end + end +end -function M:IsShowTGTips(isShow,time) - --printlog("isShowisShowisShow==== ",isShow," time ",time) - if time==nil then time=0 end - +function M:IsShowTGTips(isShow, time) + printlog("isShowisShowisShow==== ", isShow, " time ", time) + if time == nil then time = 0 end + self.totalTime = time self.isShowTGTimer = isShow if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then self.PlayerTGTips.displayObject.gameObject:SetActive(isShow) end - self.currentTime=0 - if isShow then - if self.PlayerTGTips then - self.PlayerTGTips.text="开启托管剩余时间"..time.."s" - end - self.totalTime=time + if self.PlayerTGBg and self.PlayerTGBg.displayObject.gameObject then + self.PlayerTGBg.displayObject.gameObject:SetActive(false) + end + if self.PlayerTGBorder and self.PlayerTGBorder.displayObject.gameObject then + self.PlayerTGBorder.displayObject.gameObject:SetActive(false) + end + self.currentTime = 0 + + if isShow then + if self.PlayerTGTips then + self.PlayerTGTips.text = "开启托管剩余时间" .. time .. "s" + end + + self.maxTime = time + + if self.timer ~= nil then + self.timer:Stop() + end + self.timer = FrameTimer.New(function() + self:showmmm() + end, 0.1, -1, false) + self.timer:Start() + + + + --[[ if self.PlayerTGBg then + self.PlayerTGBg.max = time + end + if self.PlayerTGBorder then + self.PlayerTGBorder.max = time + end + self.totalTime = time]] --UpdateBeat:Remove(self.OnUpdate,self) - --UpdateBeat:Add(self.OnUpdate,self) - -- printlog("aaaaaaaaa111111111111111111111111111111") - --TimerManager.RemoveTimer(self.OnUpdate) - TimerManager.AddTimer(self.OnUpdate,self) - --printlog(self) - else - -- printlog("移除IsShowTGTips",self.isShow) - --UpdateBeat:Remove(self.OnUpdate,self) - TimerManager.RemoveTimer(self.OnUpdate,self) - end - + --UpdateBeat:Add(self.OnUpdate,self) + -- printlog("aaaaaaaaa111111111111111111111111111111") + --TimerManager.RemoveTimer(self.OnUpdate) + -- TimerManager.AddTimer(self.OnUpdate, self) + --printlog(self) + else + if self.timer ~= nil then + self.timer:Stop() + end + -- printlog("移除IsShowTGTips",self.isShow) + --UpdateBeat:Remove(self.OnUpdate,self) + -- TimerManager.RemoveTimer(self.OnUpdate, self) + end end function M:OnUpdate() - --printlog("OnUpdate=====================") - if self.isShowTGTimer then - self.currentTime=self.currentTime+Time.deltaTime - if self.currentTime>=1 then - self.currentTime=0 - self.totalTime=self.totalTime-1 - --printlog("当前计时器===>>>",self.totalTime) - if self.PlayerTGTips then - self.PlayerTGTips.text="开启托管剩余时间"..self.totalTime.."s" - end - - if self.totalTime<=0 then - self.isShowTGTimer=false - if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then - self.PlayerTGTips.displayObject.gameObject:SetActive(false) - end - end - end + --printlog("OnUpdate=====================") + if self.isShowTGTimer then + self.currentTime = self.currentTime + Time.deltaTime + if self.currentTime >= 1 then + self.currentTime = 0 + self.totalTime = self.totalTime - 1 + --printlog("当前计时器===>>>",self.totalTime) + if self.PlayerTGTips then + self.PlayerTGTips.text = "开启托管剩余时间" .. self.totalTime .. "s" + end + if self.PlayerTGBg then + self.PlayerTGBg.value = self.totalTime + end + if self.PlayerTGBorder then + self.PlayerTGBorder.value = self.totalTime + end + if self.totalTime <= 0 then + self.isShowTGTimer = false + if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then + self.PlayerTGTips.displayObject.gameObject:SetActive(false) + end + end + end if self.muShiPlayerUpdate then self:muShiPlayerUpdate() diff --git a/fk101/lua_probject/base_project/Game/View/ViewUtil.lua b/fk101/lua_probject/base_project/Game/View/ViewUtil.lua index 6066283d..d5663447 100644 --- a/fk101/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/fk101/lua_probject/base_project/Game/View/ViewUtil.lua @@ -142,26 +142,24 @@ function ViewUtil.HandCardSort3(a,b) return sort_a0 then - self.maPaiCtr.selectedIndex=1 + if niaoList and #niaoList > 0 then + self.maPaiCtr.selectedIndex = 1 self:HideAllMapai() - for i=1,#niaoList do - self:IsMapaiShow(self.maPaiList[i],true) - self:SetMaPaiValue(self.maPaiList[i],niaoList[i].card) - if niaoList[i].score>0 then - self:SetMaPaiColor(self.maPaiList[i],2) + for i = 1, #niaoList do + self:IsMapaiShow(self.maPaiList[i], true) + self:SetMaPaiValue(self.maPaiList[i], niaoList[i].card) + if niaoList[i].score > 0 then + self:SetMaPaiColor(self.maPaiList[i], 2) end end else - self.maPaiCtr.selectedIndex=0 + self.maPaiCtr.selectedIndex = 0 end end - function M:InitData(over, room, result, total_result, callback) self._callback = callback local _overCtr = self._view:GetController("over") @@ -88,47 +81,55 @@ function M:InitData(over, room, result, total_result, callback) local _btnCtr = self._view:GetController("button") local _sdkCtr = self._view:GetController("sdk") local ctr_type = self._view:GetController("type") - self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round, room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) + self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round, + room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes(), "\r", "") - local paixingxiangqing=self._view:GetChild("btn_detal") - paixingxiangqing.visible=false - - local fanhuipaixing=self._view:GetChild("btn_fanhuipaixing") - fanhuipaixing.visible=false - - - local round=DataManager.CurrenRoom.room_config.config.times or 1 - local xpconfig=DataManager.CurrenRoom.room_config.config.xi_pai - if xpconfig and round>1 then - self.xiPaiCtr.selectedIndex=1 + self.bgWindow = self._view:GetChild('bgWindow') + + local paixingxiangqing = self._view:GetChild("btn_detal") + paixingxiangqing.visible = false + + local fanhuipaixing = self._view:GetChild("btn_fanhuipaixing") + fanhuipaixing.visible = false + + + local round = DataManager.CurrenRoom.room_config.config.times or 1 + local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai + --默认开启洗牌准备,不管配置是否勾选 + xpconfig = true + if xpconfig and round > 1 then + self.xiPaiCtr.selectedIndex = 1 else - self.xiPaiCtr.selectedIndex=0 + self.xiPaiCtr.selectedIndex = 0 end - - + if result then self:ShowSelectMaPai(result.niao) end - + if over ~= 2 then - local xipai=self._view:GetChild("btn_xipai") - xipai.touchable=true + local xipai = self._view:GetChild("btn_xipai") + xipai.touchable = true xipai.onClick:Add(function() - local xiPaiCallBack=function () - xipai.touchable=false - self.xiPaiCtr.selectedIndex=0 - ViewUtil.ErrorTip(1000000,"申请洗牌成功") - end - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:SendXiPaiAction(xiPaiCallBack) - end) + local xiPaiCallBack = function() + xipai.touchable = false + self.xiPaiCtr.selectedIndex = 0 + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + --ViewUtil.ErrorTip(1000000, "申请洗牌成功") + end + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:SendXiPaiAction(xiPaiCallBack) + end) if result and result.xipai_score then --xipai.text="洗牌 积分x"..result.xipai_score end - + if result.liuju then ctr_type.selectedIndex = 3 + self.bgWindow:GetController('bianhui').selectedIndex = 1 else local info_list = result.info_list for i = 1, #info_list do @@ -136,8 +137,10 @@ function M:InitData(over, room, result, total_result, callback) if is_win then if info_list[i].seat == room.self_player.seat then ctr_type.selectedIndex = 1 + self.bgWindow:GetController('bianhui').selectedIndex = 0 else ctr_type.selectedIndex = 2 + self.bgWindow:GetController('bianhui').selectedIndex = 1 end end end @@ -152,14 +155,14 @@ function M:InitData(over, room, result, total_result, callback) end) self:AddClearItem(room, result.info_list, nil, over, result.niao, result.active_player) elseif over == 1 then - self.xiPaiCtr.selectedIndex=0 + self.xiPaiCtr.selectedIndex = 0 _btnCtr.selectedIndex = 1 _sdkCtr.selectedIndex = 1 btn_result.onClick:Add(function() _overCtr.selectedIndex = 1 _btnCtr.selectedIndex = 0 _sdkCtr.selectedIndex = 0 - self.maPaiCtr.selectedIndex=0 + self.maPaiCtr.selectedIndex = 0 if self._qsinfo_view then self._qsinfo_view:Dispose() end @@ -171,32 +174,34 @@ function M:InitData(over, room, result, total_result, callback) end else _overCtr.selectedIndex = 1 - self.xiPaiCtr.selectedIndex=0 - self.maPaiCtr.selectedIndex=0 + self.xiPaiCtr.selectedIndex = 0 + self.maPaiCtr.selectedIndex = 0 btn_close.onClick:Add(function() ViewManager.ChangeView(ViewManager.View_Lobby) end) self:AddClearItem(room, nil, total_result.info_list, over) end + self.xiPaiCtr.selectedIndex = 1 + printlog("lingmeng xipai ", self.xiPaiCtr.selectedIndex) end -function M:AddClearItem(room, data, total_data,over, niao, active_player) +function M:AddClearItem(room, data, total_data, over, niao, active_player) local n = over + 1 local list_view1 = self._view:GetChild("player_list_1") local list_view2 = self._view:GetChild("player_list_2") if 0 == over or 1 == over then - table.sort(data, function(a,b) return a.seat > b.seat end) + table.sort(data, function(a, b) return a.seat > b.seat end) list_view1:RemoveChildrenToPool() - for i=1,#data do + for i = 1, #data do local item = list_view1:AddItemFromPool() self:FillItemData(room, data[i], item, active_player, niao) end - if #data == 3 then - list_view1.lineGap = 54 - elseif #data == 2 then - list_view1.lineGap = 108 - end - if 1 == over then + -- if #data == 3 then + -- list_view1.lineGap = 54 + -- elseif #data == 2 then + -- list_view1.lineGap = 108 + -- end + if 1 == over then self:FillItemData2(room, total_data, list_view2) end elseif 2 == over then @@ -208,15 +213,15 @@ function M:FillItemData(room, data, item, active_player, niao) local _gamectr = ControllerManager.GetController(GameController) local p = room:GetPlayerBySeat(data["seat"]) item:GetChild("playerName").text = p.self_user.nick_name - + ImageLoad.Load(p.self_user.head_url, item:GetChild('head')._iconObject) -- 手牌 local hand_cards = data["hand_card"] - table.sort( hand_cards, ViewUtil.HandCardSort) + table.sort(hand_cards, ViewUtil.HandCardSort) local hand_list_view = item:GetChild("hand_card_list") hand_list_view:RemoveChildrenToPool() - for i=1,#hand_cards do + for i = 1, #hand_cards do local card = hand_list_view:AddItemFromPool() - card.icon = "ui://Main_Majiang/202_"..hand_cards[i] + card.icon = "ui://Main_Majiang/202_" .. hand_cards[i] end hand_list_view.width = 52 * #hand_cards @@ -224,21 +229,21 @@ function M:FillItemData(room, data, item, active_player, niao) local fz_card_list = item:GetChild("fz_card_list") fz_card_list.width = 157 * #fz_card * 0.8 fz_card_list:RemoveChildrenToPool() - for i=1,#fz_card do + for i = 1, #fz_card do if fz_card[i].type == FZType.Peng then local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3") - for j=1,3 do + for j = 1, 3 do local card = item:GetChild("card_" .. j) - card.icon = "ui://Main_Majiang/202_"..fz_card[i].card + card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card end elseif fz_card[i].type == FZType.Gang or fz_card[i].type == FZType.Gang_An or fz_card[i].type == FZType.Gang_Peng then local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_4") - for j=1,4 do + for j = 1, 4 do local card = item:GetChild("card_" .. j) if fz_card[i].type == FZType.Gang_An and j == 4 then card.icon = "ui://Main_Majiang/202_00" else - card.icon = "ui://Main_Majiang/202_"..fz_card[i].card + card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card end end end @@ -249,20 +254,20 @@ function M:FillItemData(room, data, item, active_player, niao) local birdadd = data["niao_score"] local total = data["round_score"] local sp = " " - local str = "胡:"..huadd.."分" - str = str..sp.."杠:"..gangadd.."分" - str = str..sp.."扎鸟:"..birdadd.."分" + local str = "胡:" .. huadd .. "分" + str = str .. sp .. "杠:" .. gangadd .. "分" + str = str .. sp .. "扎鸟:" .. birdadd .. "分" if data["piao_niao_score"] then - str = str..sp.."飘鸟:"..data["piao_niao_score"].."分" + str = str .. sp .. "飘鸟:" .. data["piao_niao_score"] .. "分" end item:GetChild("score1").text = str -- local total_score = data["total_score"] if total >= 0 then - item:GetChild("score2").text = "+"..total - item:GetChild("score2").grayed = false + item:GetChild("score2win").text = "+" .. total + -- item:GetChild("score2win").grayed = false else - item:GetChild("score2").text = total - item:GetChild("score2").grayed = true + item:GetChild("score2lose").text = total + -- item:GetChild("score2win").grayed = true end local hp_nonnegative = room:checkHpNonnegative() @@ -278,19 +283,19 @@ function M:FillItemData(room, data, item, active_player, niao) local is_win = data["is_win"] or false item:GetController("win").selectedIndex = is_win and 0 or 1 - if p.self_user.account_id == active_player and is_win == false and total < 0 then - item:GetController("win").selectedIndex = 2 + if p.self_user.account_id == active_player and is_win == false and total < 0 then + item:GetController("win").selectedIndex = 2 end local win_card = item:GetChild("win_card") - if is_win then - win_card.icon = "ui://Main_Majiang/202_"..data["win_card"] + if is_win then + win_card.icon = "ui://Main_Majiang/202_" .. data["win_card"] local lst_niao = item:GetChild("list_niao") lst_niao:RemoveChildrenToPool() for i = 1, #niao do if niao[i].score > 0 then local card_niao = lst_niao:AddItemFromPool() - card_niao.icon = "ui://Main_Majiang/202_" .. niao[i].card - end + card_niao.icon = "ui://Main_Majiang/202_" .. niao[i].card + end end end if p.seat == room.banker_seat then @@ -299,70 +304,71 @@ function M:FillItemData(room, data, item, active_player, niao) end function M:FillItemData2(room, data, list) - -- 赋值result_info,聊天室分享需要 - local player_list = {} - for i = 1, #data do - player_list[i] = {} - local user = room:GetPlayerBySeat(data[i].seat).self_user - player_list[i].id = user.account_id - player_list[i].hp_info = data[i].hp_info - player_list[i].score = data[i].total_score - player_list[i].house = room.owner_id == player_list[i].id and 1 or 0 - player_list[i].nick = user.nick_name - player_list[i].head_url = user.head_url + -- 赋值result_info,聊天室分享需要 + local player_list = {} + for i = 1, #data do + player_list[i] = {} + local user = room:GetPlayerBySeat(data[i].seat).self_user + player_list[i].id = user.account_id + player_list[i].hp_info = data[i].hp_info + player_list[i].score = data[i].total_score + player_list[i].house = room.owner_id == player_list[i].id and 1 or 0 + player_list[i].nick = user.nick_name + player_list[i].head_url = user.head_url - local settle_log = data[i].settle_log - player_list[i].param = {} - player_list[i].param[1]={} - player_list[i].param[1].key = "自摸次数:" - player_list[i].param[1].value = tostring(data[i].settle_log.zimo) - player_list[i].param[2]={} - player_list[i].param[2].key = "接炮次数:" - player_list[i].param[2].value = tostring(data[i].settle_log.jie_pao) - player_list[i].param[3]={} - player_list[i].param[3].key = "点炮次数:" - player_list[i].param[3].value = tostring(data[i].settle_log.dian_pao) - player_list[i].param[4]={} - player_list[i].param[4].key = "暗杠次数:" - player_list[i].param[4].value = tostring(data[i].settle_log.an_kong) - player_list[i].param[5]={} - player_list[i].param[5].key = "明杠次数:" - player_list[i].param[5].value = tostring(data[i].settle_log.ming_kong) - end - local round = room.room_config.round - self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list) + local settle_log = data[i].settle_log + player_list[i].param = {} + player_list[i].param[1] = {} + player_list[i].param[1].key = "自摸次数:" + player_list[i].param[1].value = tostring(data[i].settle_log.zimo) + player_list[i].param[2] = {} + player_list[i].param[2].key = "接炮次数:" + player_list[i].param[2].value = tostring(data[i].settle_log.jie_pao) + player_list[i].param[3] = {} + player_list[i].param[3].key = "点炮次数:" + player_list[i].param[3].value = tostring(data[i].settle_log.dian_pao) + player_list[i].param[4] = {} + player_list[i].param[4].key = "暗杠次数:" + player_list[i].param[4].value = tostring(data[i].settle_log.an_kong) + player_list[i].param[5] = {} + player_list[i].param[5].key = "明杠次数:" + player_list[i].param[5].value = tostring(data[i].settle_log.ming_kong) + end + local round = room.room_config.round + self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list) local big_result = self._view:GetChild("big_result") - big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()), room.room_id, room.curren_round, room.room_config.round) - local lst_p = big_result:GetChild("player_list") - if #player_list == 3 then + big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()), + room.room_id, room.curren_round, room.room_config.round) + local lst_p = big_result:GetChild("player_list") + if #player_list == 3 then lst_p.columnGap = 108 elseif #player_list == 2 then - lst_p.columnGap = 208 + lst_p.columnGap = 323 end - self:InitBigResult(room, 30) + self:InitBigResult(room, 30) local show_detail = room.hpOnOff == 1 - for i = 1, lst_p.numChildren do - local com_p = lst_p:GetChildAt(i - 1) - local list_param = com_p:GetChild("list_param") - for j = 1, list_param.numChildren do - local tem = list_param:GetChildAt(j - 1) - tem:GetChild("txt_value").textFormat.size = 30 - end - if show_detail then - local score = 0 - if com_p:GetController("pn").selectedIndex == 0 then - score = com_p:GetChild("txt_navigate").text - else - score = com_p:GetChild("txt_positive").text - end - score = score / room.score_times - com_p:GetChild("tex_detail_score").text = string.format("%s × %s倍", score, room.score_times) - end - end - if room.group_id ~= 0 then - big_result:GetController("group").selectedIndex = 1 - end - DataManager.CurrenRoom = nil + for i = 1, lst_p.numChildren do + local com_p = lst_p:GetChildAt(i - 1) + local list_param = com_p:GetChild("list_param") + for j = 1, list_param.numChildren do + local tem = list_param:GetChildAt(j - 1) + tem:GetChild("txt_value").textFormat.size = 30 + end + if show_detail then + local score = 0 + if com_p:GetController("pn").selectedIndex == 0 then + score = com_p:GetChild("txt_navigate").text + else + score = com_p:GetChild("txt_positive").text + end + score = score / room.score_times + com_p:GetChild("tex_detail_score").text = string.format("%s × %s倍", score, room.score_times) + end + end + if room.group_id ~= 0 then + big_result:GetController("group").selectedIndex = 1 + end + DataManager.CurrenRoom = nil end function M:LoadHead(p, room) @@ -375,11 +381,11 @@ function M:LoadHead(p, room) end end -function M:DestroyWithCallback() +function M:DestroyWithCallback() if self._callback then self._callback() end self:Destroy() end -return M \ No newline at end of file +return M diff --git a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua index 2ee052c4..7b0623c7 100644 --- a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua +++ b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua @@ -3,59 +3,54 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) - self.class = "EXGameInfo" - UIPackage.AddPackage("extend/majiang/hongzhong/ui/Info_MJ_HongZhong") - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = "EXGameInfo" + UIPackage.AddPackage("extend/majiang/hongzhong/ui/Info_MJ_HongZhong") + return self end function M:FillData() - self._maxPlayer = 4 -- 默认玩家人数 - self._roundChoice = 4 -- 回合选项数 - - if oldGameVersion==1 then + self._maxPlayer = 4 -- 默认玩家人数 + self._roundChoice = 4 -- 回合选项数 + + if oldGameVersion == 1 then self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room") else self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room_yueyang") end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=0 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValue=1 - self.anchouValueText=self._config:GetChild('anchoufen') - self.anchouValueText.text=1 - self.anchouValue=1 - + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 0 + + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValue = 1 + + self.anchouValueText = self._config:GetChild('anchoufen') + self.anchouValueText.text = 1 + self.anchouValue = 1 + local btn_cr = self._config:GetChild('sdsrbtn') btn_cr.onClick:Set( function() - - local gniv = GroupNumberInputView_Game.new(nil, function(num) - + local gniv = GroupNumberInputView_Game.new(nil, function(num) local value = limit if otype == 1 then value = value + ad2d(num) - elseif otype == - 1 then + elseif otype == -1 then value = value - ad2d(num) else value = ad2d(num) end - + if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") + ViewUtil.ErrorTip(1, "输入数据异常!") end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 end, 3, nil) gniv:Show() - - end ) @@ -64,146 +59,144 @@ function M:FillData() local btn_cr2 = self._config:GetChild('anchoubtn') btn_cr2.onClick:Set( function() - - local gniv = GroupNumberInputView_Game.new(nil, function(num) - + local gniv = GroupNumberInputView_Game.new(nil, function(num) local value = limit if otype == 1 then value = value + ad2d(num) - elseif otype == - 1 then + elseif otype == -1 then value = value - ad2d(num) else value = ad2d(num) end - + if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") + ViewUtil.ErrorTip(1, "输入数据异常!") end - - self.anchouValueText.text=value/1000 - self.anchouValue=value/1000 - + + self.anchouValueText.text = value / 100 + self.anchouValue = value / 100 end, 3, nil) gniv:Show() - - end ) - end - -end +end -local _help_url= "ui://Info_MJ_HongZhong/Com_help" +local _help_url = "ui://Info_MJ_HongZhong/Com_help" function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_MJ_HongZhong/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_MJ_HongZhong/icon1" function M:GetIconUrl1() - return _icon_url1 + return _icon_url1 end -local _play_list = {}--{"红中麻将","三人红中","二人红中"} +local _play_list = {} --{"红中麻将","三人红中","二人红中"} function M:GetPlayList() - return _play_list + return _play_list end function M:SelectedConfigData() - local _config = self._config - local round = _config:GetController("round").selectedIndex + 1 - local people = _config:GetController("play_list").selectedIndex+2 - local qiangkong = _config:GetChild("btn_qgh").selected and true or false - local qiangkong_niao = _config:GetChild("btn_qghjm").selected and true or false - local seven_pair = _config:GetChild("btn_qidui").selected and true or false - local niao_type = _config:GetController("NiaoType").selectedIndex + 1 - local zha_ma = _config:GetController("zha").selectedIndex + 1 - local wo_niao = _config:GetController("wowoniao").selectedIndex + 1 - local laizi = _config:GetChild("btn_laizi").selected and true or false - local aa = _config:GetController("Cost").selectedIndex - -- local zhuangxian = _config:GetChild("btn_zhuangxian").selected and true or false - local piao_niao = _config:GetChild("btn_piao_niao").selected - local jiangma = _config:GetController("jiangma").selectedIndex + local _config = self._config + local round = _config:GetController("round").selectedIndex + 1 + local people = _config:GetController("play_list").selectedIndex + 2 + local qiangkong = _config:GetChild("btn_qgh").selected and true or false + local qiangkong_niao = _config:GetChild("btn_qghjm").selected and true or false + local seven_pair = _config:GetChild("btn_qidui").selected and true or false + local niao_type = _config:GetController("NiaoType").selectedIndex + 1 + local zha_ma = _config:GetController("zha").selectedIndex + 1 + local wo_niao = _config:GetController("wowoniao").selectedIndex + 1 + local laizi = _config:GetChild("btn_laizi").selected and true or false + local aa = _config:GetController("Cost").selectedIndex + -- local zhuangxian = _config:GetChild("btn_zhuangxian").selected and true or false + local piao_niao = _config:GetChild("btn_piao_niao").selected + local jiangma = _config:GetController("jiangma").selectedIndex local wuguizhuopaojiabei = _config:GetChild("btn_wuhongzhongzuobaofanbei").selected - + ---------- - local piao_niao1=0 + local piao_niao1 = 0 if _config:GetController('piao') then - piao_niao1=_config:GetController('piao').selectedIndex - end - local piao1=false - local piao2=false - local piao3=false - local piao_niao_opt=0 - if piao_niao1==2 then - piao_niao_opt=_config:GetController("piaofen").selectedIndex + piao_niao1 = _config:GetController('piao').selectedIndex end - - + local piao1 = false + local piao2 = false + local piao3 = false + local piao_niao_opt = 0 + if piao_niao1 == 2 then + piao_niao_opt = _config:GetController("piaofen").selectedIndex + end + + local laizi4_hu = false if _config:GetChild("btn_sihongzhong") then laizi4_hu = _config:GetChild("btn_sihongzhong").selected end - - local hz_hu =false + + local hz_hu = false if _config:GetChild("btn_wuhongzhong") then hz_hu = _config:GetChild("btn_wuhongzhong").selected end - - local wuguijiabei =false + + local wuguijiabei = false if _config:GetChild("btn_wuhongzhongzimo") then wuguijiabei = _config:GetChild("btn_wuhongzhongzimo").selected end - - local di_fen=false + + local dianpaohu = false + if _config:GetChild("btn_dianpaohu") then + dianpaohu = _config:GetChild("btn_dianpaohu").selected + end + + local di_fen = false if _config:GetController('difen') then - di_fen=_config:GetController('difen').selectedIndex + di_fen = _config:GetController('difen').selectedIndex end - - local xi_pai=false + + local xi_pai = false if _config:GetChild("xipai") then - xi_pai=_config:GetChild("xipai").selected + xi_pai = _config:GetChild("xipai").selected + end + + local fengding_score = 0 + if _config:GetController("fengding") then + fengding_score = _config:GetController("fengding").selectedIndex end - - local fengding_score=0 - if _config:GetController("fengding") then - fengding_score=_config:GetController("fengding").selectedIndex - end ---------- - local _data = {} - _data["opt"] = round - _data["maxPlayers"] = people - -- _data["maxPlayers"] = 2 - -- _data["zhuangxian"] = zhuangxian - _data["qidui"] = seven_pair - _data["qiangkong"] = qiangkong - _data["qiangkong_niao"] = not qiangkong and false or qiangkong_niao - _data["niao"] = niao_type - if oldGameVersion==1 then + local _data = {} + _data["opt"] = round + _data["maxPlayers"] = people + -- _data["maxPlayers"] = 2 + -- _data["zhuangxian"] = zhuangxian + _data["qidui"] = seven_pair + _data["qiangkong"] = qiangkong + _data["qiangkong_niao"] = not qiangkong and false or qiangkong_niao + _data["niao"] = niao_type + if oldGameVersion == 1 then _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) else _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) end - + _data["niao_opt_score"] = wo_niao - - - _data["laizi8"] = laizi - _data["AA"] = aa - if oldGameVersion==1 then + + + _data["laizi8"] = laizi + _data["AA"] = aa + if oldGameVersion == 1 then _data["piao_niao"] = piao_niao else _data["piao_niao"] = piao_niao1 end - - _data["jiangma"] = jiangma - + + _data["jiangma"] = jiangma + _data['piao1'] = piao1 _data['piao2'] = piao2 _data['piao3'] = piao3 @@ -212,97 +205,96 @@ function M:SelectedConfigData() _data['wuguijiabei'] = wuguijiabei _data['di_fen'] = di_fen _data['xi_pai'] = xi_pai - - auto_piao=false - if piao_niao==2 then + + auto_piao = false + if piao_niao == 2 then if piao1 or piao2 or piao3 then - auto_piao=true + auto_piao = true end end _data['auto_piao'] = auto_piao _data['piao_niao_opt'] = piao_niao_opt - - local xi_pai_score=0 - local an_chou_score=0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue - an_chou_score=self.anchouValue + + local xi_pai_score = 0 + local an_chou_score = 0 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + an_chou_score = self.anchouValue end - - _data['xi_pai_score'] = xi_pai_score*1000 - _data['an_chou_score'] = an_chou_score*1000 - + + _data['xi_pai_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 + _data["fengding_score"] = fengding_score _data["wuguizhuopaojiabei"] = wuguizhuopaojiabei - + _data["dianpaohu"] = dianpaohu - return _data -end + return _data +end function M:LoadConfigData(data) - local _config = self._config - _config:GetController("round").selectedIndex = data.opt-1 - _config:GetController("play_list").selectedIndex = data.maxPlayers-2 - _config:GetChild("btn_qgh").selected = data.qiangkong - _config:GetChild("btn_qghjm").selected = data.qiangkong_niao - _config:GetChild("btn_qidui").selected = data.qidui - -- _config:GetChild("btn_zhuangxian").selected = data.zhuangxian - _config:GetController("NiaoType").selectedIndex = data.niao - 1 - if data.niao == 1 then - _config:GetController("zha").selectedIndex = data.niao_opt - 1 - elseif data.niao == 3 then - _config:GetController("wowoniao").selectedIndex = data.niao_opt - 1 - end + local _config = self._config + _config:GetController("round").selectedIndex = data.opt - 1 + _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 + _config:GetChild("btn_qgh").selected = data.qiangkong + _config:GetChild("btn_qghjm").selected = data.qiangkong_niao + _config:GetChild("btn_qidui").selected = data.qidui + -- _config:GetChild("btn_zhuangxian").selected = data.zhuangxian + _config:GetController("NiaoType").selectedIndex = data.niao - 1 + if data.niao == 1 then + _config:GetController("zha").selectedIndex = data.niao_opt - 1 + elseif data.niao == 3 then + _config:GetController("wowoniao").selectedIndex = data.niao_opt - 1 + end _config:GetController("wowoniao").selectedIndex = data.niao_opt_score - 1 - - _config:GetChild("btn_laizi").selected = data.laizi8 - _config:GetController("Cost").selectedIndex = data.AA or 0 - if oldGameVersion==1 then + + _config:GetChild("btn_laizi").selected = data.laizi8 + _config:GetController("Cost").selectedIndex = data.AA or 0 + if oldGameVersion == 1 then _config:GetChild("btn_piao_niao").selected = data.piao_niao end - _config:GetController("jiangma").selectedIndex = data.jiangma - - - if _config:GetController("piao") then - _config:GetController("piao").selectedIndex=data.piao_niao - _config:GetChild('pf1').selected=data.piao1 - _config:GetChild('pf2').selected=data.piao2 - _config:GetChild('pf3').selected=data.piao3 - end - - if _config:GetChild("btn_sihongzhong") then - _config:GetChild("btn_sihongzhong").selected=data.laizi4_hu - _config:GetChild("btn_wuhongzhong").selected=data.hz_hu - _config:GetChild("btn_wuhongzhongzimo").selected=data.wuguijiabei - end - - if _config:GetController("difen") then - _config:GetController("difen").selectedIndex=data.di_fen - end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if _config:GetController("piaofen") then - _config:GetController("piaofen").selectedIndex=data.piao_niao_opt - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + _config:GetController("jiangma").selectedIndex = data.jiangma - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 + _config:GetChild("btn_dianpaohu").selected = data.dianpaohu + + if _config:GetController("piao") then + _config:GetController("piao").selectedIndex = data.piao_niao + _config:GetChild('pf1').selected = data.piao1 + _config:GetChild('pf2').selected = data.piao2 + _config:GetChild('pf3').selected = data.piao3 end - - if _config:GetController("fengding") then - _config:GetController("fengding").selectedIndex=data.fengding_score + + if _config:GetChild("btn_sihongzhong") then + _config:GetChild("btn_sihongzhong").selected = data.laizi4_hu + _config:GetChild("btn_wuhongzhong").selected = data.hz_hu + _config:GetChild("btn_wuhongzhongzimo").selected = data.wuguijiabei end - - _config:GetChild("btn_wuhongzhongzuobaofanbei").selected=data.wuguizhuopaojiabei - - end - -return M - \ No newline at end of file + + if _config:GetController("difen") then + _config:GetController("difen").selectedIndex = data.di_fen + end + + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end + + if _config:GetController("piaofen") then + _config:GetController("piaofen").selectedIndex = data.piao_niao_opt + end + + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score / 100 + self.xipaiValue = data.xi_pai_score / 100 + + self.anchouValueText.text = data.an_chou_score / 100 + self.anchouValue = data.an_chou_score / 100 + end + + if _config:GetController("fengding") then + _config:GetController("fengding").selectedIndex = data.fengding_score + end + + _config:GetChild("btn_wuhongzhongzuobaofanbei").selected = data.wuguizhuopaojiabei +end + +return M diff --git a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXMainView.lua b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXMainView.lua index b6514381..60a039f0 100644 --- a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXMainView.lua +++ b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXMainView.lua @@ -28,8 +28,11 @@ function M:InitView(url) MJMainView.InitView(self,"ui://Main_Majiang/Main_"..room.room_config.people_num .. "_s2") 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.score_times + local text_playName = self._view:GetChild('text_playName') + if text_playName then + text_playName.text = "红中麻将" + end self.LaiziBG=self._view:GetChild('n103') self.LaiziBG.text="鬼牌" self.LaiziBG.visible=false diff --git a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXPlayBackView.lua b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXPlayBackView.lua index c66e33d1..7b1c5fb6 100644 --- a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXPlayBackView.lua +++ b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/EXPlayBackView.lua @@ -21,7 +21,7 @@ end function M:InitView(url) local room = self._room UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong") - MJPlayBackView.InitView(self,"ui://Main_Majiang/Main_"..room.room_config.people_num) + MJPlayBackView.InitView(self,"ui://Main_Majiang/Main_"..room.room_config.people_num .. "_s2") local _cardbox = self._view:GetChild("cardbox") --self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false self._ctr_cardbox = _cardbox:GetController("c1") @@ -141,6 +141,7 @@ function M:ShowStep(index) if step.cmd == Record_Event.Evt_Result then if not self.result then self.result = EXClearingView.new(self._root_view, true) + self.result:InitData(0, self._room, step.result_data) self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5 self.result._view.width = GRoot.inst.width @@ -152,7 +153,7 @@ function M:ShowStep(index) else self.result._view.visible = true end - -- self.result._view:Center() + self.result._view:Center() else if self.result then self.result._view.visible = false @@ -287,8 +288,14 @@ function M:UpdateCardBox(seat) self._ctr_cardbox.selectedIndex = index end -function M:UpdateRound(round) - self._tex_round.text = "第 "..round.."/"..self._room.room_config.round.." 局" +function M:UpdateRound() + local currRD=self._room.curren_round + if self._room.curren_round==0 then + currRD=1 + end + + self._view:GetChild("tex_round1").text = currRD + self._view:GetChild("tex_round2").text = self._room.room_config.round end function M:UpdateStep(step) diff --git a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/ExtendConfig.lua b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/ExtendConfig.lua index 681f4cf3..645d76da 100644 --- a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/ExtendConfig.lua +++ b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/ExtendConfig.lua @@ -4,7 +4,7 @@ local EXGameInfo = import(".EXGameInfo") local EXMainView = import(".EXMainView") local EXGameController = import(".EXGameController") local EXRoomConfig = import(".EXRoomConfig") -local EXPlayBackView =import(".EXPlayBackView") +local EXPlayBackView = import(".EXPlayBackView") local MJRoom = require("main.majiang.MJRoom") local ExtendConfig = {} @@ -13,14 +13,14 @@ local M = ExtendConfig function ExtendConfig.new() - setmetatable(M, {__index = IExtendConfig}) - local self = setmetatable({}, {__index = M}) - self.class = "ExtendConfig" - self.extend_id = 22 - self._viewMap = {} - self._viewMap[ViewManager.View_Main] = EXMainView - self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView - return self + setmetatable(M, { __index = IExtendConfig }) + local self = setmetatable({}, { __index = M }) + self.class = "ExtendConfig" + self.extend_id = 22 + self._viewMap = {} + self._viewMap[ViewManager.View_Main] = EXMainView + self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView + return self end --卸载资源 @@ -45,24 +45,24 @@ end local _ctr_game = nil function M:GetGameController() - if _ctr_game == nil then - _ctr_game = EXGameController.new() - end - return _ctr_game + if _ctr_game == nil then + _ctr_game = EXGameController.new() + end + return _ctr_game end function M:NewRoom() return MJRoom.new() end -function M:FillRoomConfig(room,_config) +function M:FillRoomConfig(room, _config) room.room_config = EXRoomConfig.new(_config) end function M:FillRoomData(s2croom) - local room = DataManager.CurrenRoom - - local reload = s2croom["reload"] + local room = DataManager.CurrenRoom + + local reload = s2croom["reload"] local _tableInfo = s2croom["tableInfo"] local _config = _tableInfo["config"] @@ -74,10 +74,10 @@ function M:FillRoomData(s2croom) if (reload) then local _reloadInfo = s2croom["reloadInfo"] - local _hand_card = _reloadInfo["hand_card"] + local _hand_card = _reloadInfo["hand_card"] room.self_player.card_list = _hand_card table.sort(_hand_card, ViewUtil.HandCardSort) - + local active_seat = _reloadInfo["active_seat"] local bank_seat = _reloadInfo["banker_seat"] local playing = _reloadInfo["playing"] @@ -88,23 +88,23 @@ function M:FillRoomData(s2croom) room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"] room.last_outcard_seat = last_outcard_seat room.playing = playing - for i=1,#_info_list do - 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"] - p.fz_list[#p.fz_list+1] = fz - end + for i = 1, #_info_list do + 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"] + p.fz_list[#p.fz_list + 1] = fz + end if not playing and room.curren_round > 0 then self.GetGameController():PlayerReady() end @@ -128,7 +128,8 @@ function M:FillPlayBackData(pd_data) room.curren_round = _tableInfo["round"] local _info_list = _tableInfo["playerData"] - for i = 1,#_info_list do + + for i = 1, #_info_list do local _jp = _info_list[i] local p = room:NewPlayer() p.seat = _jp["seat"] @@ -143,15 +144,15 @@ function M:FillPlayBackData(pd_data) -- p.self_user = DataManager.SelfUser -- else if p.seat == 1 then room.self_player = p end - local u = User.new() - u.account_id = pid - p.self_user = u - u.nick_name = _jp["nick"] - u.head_url = _jp["portrait"] - u.sex = _jp["sex"] + local u = User.new() + u.account_id = pid + p.self_user = u + u.nick_name = _jp["nick"] + u.head_url = _jp["portrait"] + u.sex = _jp["sex"] -- end p.self_user.host_ip = p.self_user.host_ip - local _hand_card = _jp["hand_card"] + local _hand_card = _jp["hand_card"] p.card_list = _hand_card --room.self_player.card_list = _hand_card table.sort(_hand_card, ViewUtil.HandCardSort) @@ -164,7 +165,8 @@ function M:FillPlayBackData(pd_data) room:AddPlayer(p) end + room.cmdList = pd_data["cmdList"] end -return M \ No newline at end of file +return M diff --git a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/MJPlayerSelfCardInfoView.lua b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/MJPlayerSelfCardInfoView.lua index d8501f87..68453705 100644 --- a/fk101/lua_probject/extend_project/extend/majiang/hongzhong/MJPlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/extend_project/extend/majiang/hongzhong/MJPlayerSelfCardInfoView.lua @@ -134,8 +134,8 @@ function M:__OnDragEnd(context) local card = button.data local _room = DataManager.CurrenRoom - -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)//and card.card_item ~= 412 - if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat ) then + -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) + if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 412) then self._mainView:OutCard(card.card_item) button.touchable = false self.outcard_button = button diff --git a/fk101/lua_probject/main_project/main/majiang/HuTipView.lua b/fk101/lua_probject/main_project/main/majiang/HuTipView.lua index 372c55ca..f84175e9 100644 --- a/fk101/lua_probject/main_project/main/majiang/HuTipView.lua +++ b/fk101/lua_probject/main_project/main/majiang/HuTipView.lua @@ -39,6 +39,7 @@ function M:init() local width = self._view.width local m_width = self._main_view._view.width local m_height = self._main_view._view.height + self._view:SetScale(1.5,1.5) -- 初始位置 self._view.x = 0 self._view.y = 0.675 * m_height diff --git a/fk101/lua_probject/main_project/main/majiang/MJMainView.lua b/fk101/lua_probject/main_project/main/majiang/MJMainView.lua index 621fb687..c4be7e19 100644 --- a/fk101/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/fk101/lua_probject/main_project/main/majiang/MJMainView.lua @@ -144,9 +144,10 @@ function M:InitXiPai() local offset = get_offset(self._full_offset) - self._xipaiPanel.width = GRoot.inst.width - (offset * 2) - self._xipaiPanel.height = GRoot.inst.height - self._xipaiPanel.x = offset + -- self._xipaiPanel.width = GRoot.inst.width - (offset * 2) + -- self._xipaiPanel.height = GRoot.inst.height + self._xipaiPanel.x = 2532 + self._xipaiPanel.y = 0 self._handAnimCtr=self._xipaiPanel:GetController("anim") self._handAnimCtr.selectedIndex=0 @@ -161,9 +162,10 @@ function M:InitXiPai1() local offset = get_offset(self._full_offset) - self._xipaiPanel1.width = GRoot.inst.width - (offset * 2) - self._xipaiPanel1.height = GRoot.inst.height - self._xipaiPanel1.x = offset + -- self._xipaiPanel1.width = GRoot.inst.width - (offset * 2) + -- self._xipaiPanel1.height = GRoot.inst.height + self._xipaiPanel.x = (GRoot.inst.width-self._xipaiPanel.width)/2 + self._xipaiPanel.y = GRoot.inst.height-self._xipaiPanel1.height self._handAnimCtr1=self._xipaiPanel1:GetController("anim1") self._handAnimCtr1.selectedIndex=0 diff --git a/fk101/lua_probject/main_project/main/majiang/MJPlayBackView.lua b/fk101/lua_probject/main_project/main/majiang/MJPlayBackView.lua index 25f24dea..e8e363da 100644 --- a/fk101/lua_probject/main_project/main/majiang/MJPlayBackView.lua +++ b/fk101/lua_probject/main_project/main/majiang/MJPlayBackView.lua @@ -110,7 +110,8 @@ end function M:ChangeTextSpeed() local str1 = self._play and self._speed or "" self._view:GetChild("panel_record"):GetChild("tex_speed").text = str1 - local str2 = not self._play and (self._playFoward and "播放暂停" or "回退暂停") or self._playFoward and (self._speed == 1 and "播放" or "快进") or (self._speed == 1 and "回退" or "快退") + local str2 = not self._play and (self._playFoward and "播放暂停" or "回退暂停") or + self._playFoward and (self._speed == 1 and "播放" or "快进") or (self._speed == 1 and "回退" or "快退") self._view:GetChild("panel_record"):GetChild("tex_2").text = str2 local str3 = self._play and "倍速度" or "" self._view:GetChild("panel_record"):GetChild("tex_1").text = str3 diff --git a/fk101/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/fk101/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index 85d74c7e..c53acca5 100644 --- a/fk101/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/fk101/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -158,10 +158,10 @@ function M:UpdateHandCard(getcard, mp) local _room = DataManager.CurrenRoom local people_num = _room.room_config.people_num local pos = ViewUtil.GetPos(_room.self_player.seat, _player.seat, people_num) - local gap = (pos == 3 and people_num == 4 or pos == 2 and people_num == 2) and 15 or 45 + local gap = (pos == 3 and people_num == 4 or pos == 2 and people_num == 2) and 38 or 45 local offset = getcard and (i == _player.hand_left_count - 1 and gap or 0) -- local offset = getcard and (i == _player.hand_left_count - 1 and 15 or 0) - ViewUtil.CardPos(obj, self._area_handcard_list, oder, i, offset) + ViewUtil.CardPos(obj, self._area_handcard_list, oder, i, {offset=offset}) --改变左右两边的手牌的x值 if self._current_card_type == 2 and (oder == AreaOderType.down_up or oder == AreaOderType.up_down) then @@ -193,7 +193,7 @@ function M:UpdateHandCard(getcard, mp) local offset = getcard and (i == _player.hand_left_count - 1 and 0 or 0) - ViewUtil.CardPos(obj, self._area_handcard_list, oder, i, offset) + ViewUtil.CardPos(obj, self._area_handcard_list, oder, i, {offset=offset}) --改变左右两边的手牌的x值 if self._current_card_type == 2 and (oder == AreaOderType.down_up or oder == AreaOderType.up_down) then @@ -307,7 +307,7 @@ function M:UpdateOutCardList(outcard, card_item, cursor) end ViewUtil.CardPos(obj, self._area_outcard_list, oder, col) - ViewUtil.CardPos(obj, self._area_outcard_list, multi_oder, row) + ViewUtil.CardPos(obj, self._area_outcard_list, multi_oder, row,{gup=15}) if self._current_card_type == 2 then self:adjust3dOutPut(obj, self._area_outcard_list, oder, num, i) diff --git a/fk101/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/fk101/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index cd0402b4..82e6a6a0 100644 --- a/fk101/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -56,7 +56,7 @@ function M:init() end function M:setHandCardPos(btn_card, i, getcard) - btn_card.x = i * btn_card.width * 1.05 + (getcard and 20 or 0) + btn_card.x = 71 + i * btn_card.width + (getcard and 38 or 0) end function M:UpdateHandCard(getcard,mp) @@ -96,7 +96,7 @@ function M:UpdateHandCard(getcard,mp) local btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card"..b3d) - btn_card:SetScale(1.05,1.05) + -- btn_card:SetScale(1.05, 1.05) -- btn_card.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. tem_card) self:fillCard(btn_card,"201_",tem_card) self:setHandCardPos(btn_card, i, i == #cards - 1 and getcard) @@ -134,7 +134,7 @@ function M:UpdateHandCard(getcard,mp) local mp_card = UIPackage.CreateObject("Main_Majiang", "Mp_self_card"..b3d) -- mp_card.icon = UIPackage.GetItemURL("Main_Majiang", "202_" .. cards[i+1]) self:fillCard(mp_card,"202_",cards[i+1]) - mp_card:SetScale(1.05,1.05) + -- mp_card:SetScale(1.05, 1.05) -- mp_card.x = i * mp_card.width + (i == #cards - 1 and getcard and 20 or 0) self:setHandCardPos(mp_card, i, i == #cards - 1 and getcard) _lit:AddChild(mp_card) diff --git a/fk101/lua_probject/main_project/main/majiang/MJSettingViewNew.lua b/fk101/lua_probject/main_project/main/majiang/MJSettingViewNew.lua index 4e455f6f..d70e1d8e 100644 --- a/fk101/lua_probject/main_project/main/majiang/MJSettingViewNew.lua +++ b/fk101/lua_probject/main_project/main/majiang/MJSettingViewNew.lua @@ -21,6 +21,7 @@ function MJSettingViewNew.new(blur_view, show_dialect) self.cd_time = 0 self._btn_dismiss_room_enable = true self._full = true + self._full_offset = false self._anim_pop = 2 self._close_zone = true self._show_dialect = show_dialect diff --git a/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png b/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png index e078dbbb..85f03107 100644 Binary files a/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png and b/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes b/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes index f8239774..8d46756e 100644 Binary files a/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes and b/fk101/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0.png b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0.png new file mode 100644 index 00000000..e9e3f5bc Binary files /dev/null and b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_1.png b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_1.png new file mode 100644 index 00000000..b1e41936 Binary files /dev/null and b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_1.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_2.png b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_2.png new file mode 100644 index 00000000..130c8d22 Binary files /dev/null and b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_2.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_3.png b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_3.png new file mode 100644 index 00000000..f2379c3f Binary files /dev/null and b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_atlas0_3.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_fui.bytes b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_fui.bytes new file mode 100644 index 00000000..c16641ab Binary files /dev/null and b/fk101/qyq_new_unity/Assets/ART/base/ui/Main_Majiang_fui.bytes differ diff --git a/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_atlas0.png b/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_atlas0.png index ab4b6654..78256ea4 100644 Binary files a/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_atlas0.png and b/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_atlas0.png differ diff --git a/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_fui.bytes b/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_fui.bytes index 0e96c4ac..51849c74 100644 Binary files a/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_fui.bytes and b/fk101/qyq_new_unity/Assets/ART/extend/zipai/weimaque/ui/Extend_Poker_WeiMaQue_fui.bytes differ diff --git a/fk101/wb_new_ui/.objs/metas/3z9lj55v/jokmky.info b/fk101/wb_new_ui/.objs/metas/3z9lj55v/jokmky.info new file mode 100644 index 00000000..71b90956 --- /dev/null +++ b/fk101/wb_new_ui/.objs/metas/3z9lj55v/jokmky.info @@ -0,0 +1,13 @@ +{ + "objectStatus": { + "n104_ni5n": { + "hidden": true + }, + "n109_ni5n": { + "hidden": true + }, + "n47_pue4": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info b/fk101/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info index f893ff4d..9e26dfee 100644 --- a/fk101/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info +++ b/fk101/wb_new_ui/.objs/metas/m7iejg46/kwi0hme.info @@ -1,7 +1 @@ -{ - "objectStatus": { - "n2_l0gd": { - "locked": true - } - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/fk101/wb_new_ui/assets/Common/Gcm_Window_Full.xml b/fk101/wb_new_ui/assets/Common/Gcm_Window_Full.xml index f4c533b1..33be89af 100644 --- a/fk101/wb_new_ui/assets/Common/Gcm_Window_Full.xml +++ b/fk101/wb_new_ui/assets/Common/Gcm_Window_Full.xml @@ -7,7 +7,7 @@ - + diff --git a/fk101/wb_new_ui/assets/Common/UIPanel.xml b/fk101/wb_new_ui/assets/Common/UIPanel.xml index 568e630c..036c0bd6 100644 --- a/fk101/wb_new_ui/assets/Common/UIPanel.xml +++ b/fk101/wb_new_ui/assets/Common/UIPanel.xml @@ -1,17 +1,19 @@ - + - + + + - + - + diff --git a/fk101/wb_new_ui/assets/Main_Majiang/Btn_chat.xml b/fk101/wb_new_ui/assets/Main_Majiang/Btn_chat.xml index 83a75e87..f40fa208 100644 --- a/fk101/wb_new_ui/assets/Main_Majiang/Btn_chat.xml +++ b/fk101/wb_new_ui/assets/Main_Majiang/Btn_chat.xml @@ -3,8 +3,8 @@ - - + +