From 7288db46be9c0a071b908ec5f4ac89bc6456b0b5 Mon Sep 17 00:00:00 2001 From: lingmeng <2029049582@qq.com> Date: Mon, 29 Dec 2025 20:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=8E=A9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=A9=E6=B3=95=EF=BC=8C=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=8E=A9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/Controller/GroupMgrController.lua | 1 + .../Game/Controller/LoginController.lua | 3 +- lua_probject/base_project/Game/IGameInfo.lua | 90 +++++++++-- .../base_project/Game/View/FamilyViewZuo.lua | 91 +++++++++-- .../Game/View/FamilyZuo/FamilyGamePlay.lua | 143 ++++++++++++++++++ .../View/FamilyZuo/FamilyPlayListView.lua | 10 ++ .../FamilyZuo/ManagerChild_GamePlayView.lua | 36 ++--- .../FamilyZuo/ManagerChild_PlayerView.lua | 17 +-- .../base_project/Game/View/ViewUtil.lua | 15 ++ .../base_project/table/Table_Error_code.lua | 2 +- .../extend/majiang/fuzhou/EXGameInfo.lua | 83 ++++------ .../extend/poker/duoduo/EXGameInfo.lua | 10 +- .../extend/poker/runfast/EXGameInfo.lua | 7 +- .../assets/Common/buttons/Btn_CheckBox.xml | 13 +- .../Common/buttons/Btn_CheckBoxWithText.xml | 13 ++ .../assets/Common/buttons/Btn_Choose.xml | 15 ++ .../Common/buttons/Btn_ChooseWithText.xml | 13 ++ .../assets/Common/buttons/Btn_ScrollText.xml | 4 +- .../Common/buttons/Btn_TextWithCheckBox.xml | 13 ++ .../Common/buttons/Btn_TextWithChoose.xml | 11 ++ .../assets/Common/images/bg_common_di.png | Bin 0 -> 1332486 bytes .../assets/Common/images/checkBox_down.png | Bin 0 -> 4144 bytes .../assets/Common/images/checkBox_up.png | Bin 0 -> 3188 bytes .../assets/Common/images/choose_down.png | Bin 0 -> 4378 bytes wb_new_ui/assets/Common/images/choose_up.png | Bin 0 -> 1944 bytes wb_new_ui/assets/Common/package.xml | 10 ++ .../Family/FamilyGamePlay/FamilyGamePlay.xml | 23 +++ .../component/Child_GamePlayChild_Left.xml | 17 +++ .../component/Child_GamePlayLeft.xml | 21 +++ .../component/GamePlayChild_TypePage.xml | 35 +++++ .../image/bg_gamePlay_gameDown.png | Bin 0 -> 718 bytes .../FamilyGamePlay/image/bg_gamePlay_left.png | Bin 0 -> 259164 bytes .../image/bg_line_gamePlay_gameUp.png | Bin 0 -> 245 bytes .../FamilyGamePlay/image/btn_close2.png | Bin 0 -> 5416 bytes wb_new_ui/assets/Family/Main_zuo.xml | 4 +- .../Main_zuo/component/comp_playDetail.xml | 12 +- .../btn_close1.png} | Bin .../assets/Family/fontType1/FamilyFont1.fnt | 39 +++++ .../assets/Family/fontType1/image/主.png | Bin 0 -> 3745 bytes .../assets/Family/fontType1/image/作.png | Bin 0 -> 5126 bytes .../assets/Family/fontType1/image/克.png | Bin 0 -> 5061 bytes .../assets/Family/fontType1/image/历.png | Bin 0 -> 5570 bytes .../assets/Family/fontType1/image/史.png | Bin 0 -> 5731 bytes .../assets/Family/fontType1/image/同.png | Bin 0 -> 5232 bytes .../assets/Family/fontType1/image/员.png | Bin 0 -> 5914 bytes .../assets/Family/fontType1/image/地.png | Bin 0 -> 6085 bytes .../assets/Family/fontType1/image/基.png | Bin 0 -> 6019 bytes .../assets/Family/fontType1/image/子.png | Bin 0 -> 3813 bytes .../assets/Family/fontType1/image/字.png | Bin 0 -> 4445 bytes .../assets/Family/fontType1/image/将.png | Bin 0 -> 7351 bytes .../assets/Family/fontType1/image/小.png | Bin 0 -> 4244 bytes .../assets/Family/fontType1/image/局.png | Bin 0 -> 5538 bytes .../assets/Family/fontType1/image/屋.png | Bin 0 -> 6407 bytes .../assets/Family/fontType1/image/录.png | Bin 0 -> 6510 bytes .../assets/Family/fontType1/image/得.png | Bin 0 -> 7005 bytes .../assets/Family/fontType1/image/快.png | Bin 0 -> 6741 bytes .../assets/Family/fontType1/image/成.png | Bin 0 -> 6636 bytes .../assets/Family/fontType1/image/战.png | Bin 0 -> 6698 bytes .../assets/Family/fontType1/image/扑.png | Bin 0 -> 5009 bytes .../assets/Family/fontType1/image/排.png | Bin 0 -> 6000 bytes .../assets/Family/fontType1/image/操.png | Bin 0 -> 7784 bytes .../assets/Family/fontType1/image/斗.png | Bin 0 -> 4444 bytes .../assets/Family/fontType1/image/本.png | Bin 0 -> 5734 bytes .../assets/Family/fontType1/image/桌.png | Bin 0 -> 5704 bytes .../assets/Family/fontType1/image/止.png | Bin 0 -> 3214 bytes .../assets/Family/fontType1/image/牌.png | Bin 0 -> 6511 bytes .../assets/Family/fontType1/image/理.png | Bin 0 -> 6196 bytes .../assets/Family/fontType1/image/禁.png | Bin 0 -> 7392 bytes .../assets/Family/fontType1/image/管.png | Bin 0 -> 6059 bytes .../assets/Family/fontType1/image/组.png | Bin 0 -> 6156 bytes .../assets/Family/fontType1/image/统.png | Bin 0 -> 7139 bytes .../assets/Family/fontType1/image/绩.png | Bin 0 -> 8035 bytes .../assets/Family/fontType1/image/置.png | Bin 0 -> 4745 bytes .../assets/Family/fontType1/image/胡.png | Bin 0 -> 5971 bytes .../assets/Family/fontType1/image/行.png | Bin 0 -> 5212 bytes .../assets/Family/fontType1/image/计.png | Bin 0 -> 4310 bytes .../assets/Family/fontType1/image/记.png | Bin 0 -> 5069 bytes .../assets/Family/fontType1/image/设.png | Bin 0 -> 7067 bytes .../assets/Family/fontType1/image/跑.png | Bin 0 -> 6654 bytes .../assets/Family/fontType1/image/速.png | Bin 0 -> 7476 bytes .../assets/Family/fontType1/image/麻.png | Bin 0 -> 7094 bytes .../assets/Family/fontType1/image/黑.png | Bin 0 -> 6674 bytes wb_new_ui/assets/Family/package.xml | 49 +++++- wb_new_ui/assets/Hotupdate/Version.xml | 2 +- .../Info_Poker_DuoDuo/Label_Detail_Play.xml | 78 +++++----- wb_new_ui/assets/Login/Main.xml | 2 +- .../mgr/component/play_set/panel_play_set.xml | 2 +- .../ART/base/Family/ui/Family_atlas0.png | Bin 1214569 -> 1548175 bytes .../ART/base/Family/ui/Family_atlas0_1.png | Bin 3741572 -> 3668234 bytes .../ART/base/Family/ui/Family_atlas0_2.png | Bin 1706660 -> 1713397 bytes .../ART/base/Family/ui/Family_atlas0_5.png | Bin 430110 -> 825817 bytes .../ART/base/Family/ui/Family_fui.bytes | Bin 162835 -> 170459 bytes .../ART/base/common/ui/Common_atlas0.png | Bin 4073277 -> 4074423 bytes .../ART/base/common/ui/Common_atlas0_1.png | Bin 3176371 -> 3174596 bytes .../ART/base/common/ui/Common_fui.bytes | Bin 338445 -> 340739 bytes .../Assets/ART/base/login/ui/Login_fui.bytes | Bin 28613 -> 28613 bytes .../ART/base/newgroup/ui/NewGroup_fui.bytes | Bin 263757 -> 263757 bytes .../duoduo/ui/Info_Poker_DuoDuo_fui.bytes | Bin 39756 -> 39886 bytes .../base/embed/ui/Hotupdate_fui.bytes | Bin 4233 -> 4233 bytes 99 files changed, 703 insertions(+), 181 deletions(-) create mode 100644 lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua create mode 100644 wb_new_ui/assets/Common/buttons/Btn_CheckBoxWithText.xml create mode 100644 wb_new_ui/assets/Common/buttons/Btn_Choose.xml create mode 100644 wb_new_ui/assets/Common/buttons/Btn_ChooseWithText.xml create mode 100644 wb_new_ui/assets/Common/buttons/Btn_TextWithCheckBox.xml create mode 100644 wb_new_ui/assets/Common/buttons/Btn_TextWithChoose.xml create mode 100644 wb_new_ui/assets/Common/images/bg_common_di.png create mode 100644 wb_new_ui/assets/Common/images/checkBox_down.png create mode 100644 wb_new_ui/assets/Common/images/checkBox_up.png create mode 100644 wb_new_ui/assets/Common/images/choose_down.png create mode 100644 wb_new_ui/assets/Common/images/choose_up.png create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/FamilyGamePlay.xml create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/component/Child_GamePlayChild_Left.xml create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/component/Child_GamePlayLeft.xml create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/component/GamePlayChild_TypePage.xml create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/image/bg_gamePlay_gameDown.png create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/image/bg_gamePlay_left.png create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/image/bg_line_gamePlay_gameUp.png create mode 100644 wb_new_ui/assets/Family/FamilyGamePlay/image/btn_close2.png rename wb_new_ui/assets/Family/{Main_zuo/image/btn_close2.png => SameImage/btn_close1.png} (100%) create mode 100644 wb_new_ui/assets/Family/fontType1/FamilyFont1.fnt create mode 100644 wb_new_ui/assets/Family/fontType1/image/主.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/作.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/克.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/历.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/史.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/同.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/员.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/地.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/基.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/子.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/字.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/将.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/小.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/局.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/屋.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/录.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/得.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/快.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/成.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/战.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/扑.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/排.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/操.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/斗.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/本.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/桌.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/止.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/牌.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/理.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/禁.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/管.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/组.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/统.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/绩.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/置.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/胡.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/行.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/计.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/记.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/设.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/跑.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/速.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/麻.png create mode 100644 wb_new_ui/assets/Family/fontType1/image/黑.png diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index c6726d63..d3870929 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -233,6 +233,7 @@ end -- 添加玩法 function M:OnEvtAddPlay(evt_data) local group = DataManager.groups:get(self.groupId) + evt_data.gameType = ExtendManager.GetGameData(evt_data.gameId).gameType group:addPlay(evt_data) local pid = evt_data.id DispatchEvent(self._dispatcher, GroupMgrEvent.AddPlay, pid) diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index 075a0c70..e08f819d 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -15,7 +15,8 @@ end local _LocalConfigAllGame = { -- 10, 33, -- 90, - 66,22,90 + -- 22, + 66,90 } local FilterGame = function(games) diff --git a/lua_probject/base_project/Game/IGameInfo.lua b/lua_probject/base_project/Game/IGameInfo.lua index a5a6cbc7..e7bd553e 100644 --- a/lua_probject/base_project/Game/IGameInfo.lua +++ b/lua_probject/base_project/Game/IGameInfo.lua @@ -21,10 +21,45 @@ function M:SelectedCardNum() end function M:SelectedConfigData() - return {} + local data = {} + local com_editSetting = self.gl_view:GetModeData().data._config:GetChild("com_editSetting") + + self.cGps = com_editSetting:GetController("cGps") + self.cTuoguan = com_editSetting:GetController("cTuoguan") + -- GPS设置 + local dis = 0 + if self.cGps.selectedIndex == 0 then + dis = 100 + elseif self.cGps.selectedIndex == 1 then + dis = 500 + elseif self.cGps.selectedIndex == 2 then + dis = 0 + end + data.GPSDetection = dis + + -- 托管 + local time = 0 + if self.cTuoguan.selectedIndex == 1 then + time = 30 + elseif self.cTuoguan.selectedIndex == 2 then + time = 60 + elseif self.cTuoguan.selectedIndex == 3 then + time = 120 + end + data.tuoguan_active_time = time + + --其余默认值 + data.isNonnegative = 1 + data.hp_no_limit = 0 + data.tuoguan = true + data.tuoguan_active_timeIndex = self.cTuoguan.selectedIndex + data.tuoguan_result_type = 1 + + return data end function M:FillData() + end function M:ShowRoomPrice(ctype) @@ -58,14 +93,6 @@ function M:ShowVariablePrice(ctype) tex_price.text = price end end - - -- 显示房主支付、aa支付的价格,tex_aa/tex_owner - -- local tex_aa = self._config:GetChild("tex_aa") - -- local tex_owner = self._config:GetChild("tex_owner") - -- local opt = self._config:GetController("round").selectedIndex - -- local price = self._game_data[string.format("pay%s_%s", opt + 1, self._maxPlayer)] - -- tex_aa.text = math.ceil(price / self._maxPlayer) - -- tex_owner.text = price end function M:SetDefault() @@ -126,4 +153,49 @@ function M:LoadConfigOneInfo(data, hpdata, name) return returnString end +function M:GetHpData() + local hpData = {} + -- 通用设置 + local com_editSetting = self._config:GetChild("com_editSetting") + + local cJiesan = com_editSetting:GetController("cJiesan") + local cGongneng = com_editSetting:GetController("cGongneng") + local cChat = com_editSetting:GetController("cChat") + local cMisslie = com_editSetting:GetController("cMisslie") + + -- 解散 + hpData.JieShan = cJiesan.selectedIndex + 1 + -- 功能 + hpData.GongNeng = cGongneng.selectedIndex + 1 + -- 开启聊天 + hpData.BanChat = cChat.selectedIndex + -- 开启表情互动 + hpData.BanMissile = cMisslie.selectedIndex + + --一下是大联盟数据,全部采取默认值 + hpData.type = 1 + hpData.rewards_val = 100 + hpData.anchou_rewards_val = 100 + hpData.xipai_rewards_val = 100 + hpData.rewards_type = 1 + hpData.xipai_rewardType = 3 + hpData.anchou_rewardType = 3 + hpData.rewardValueType = 1 + hpData.anchou_rewardValueType = 1 + hpData.xipai_rewardValueType = 1 + hpData.limitPlay = 1000 + hpData.limitloot = 0 + hpData.limitInRoom = 0 + hpData.limitPump = 0 + hpData.basePump = 0 + hpData.robot_room = 0 + hpData.tex_times_room = 1000 + hpData.times = 1000 + hpData.rewards_list = {} + hpData.rewards_list.cb_proportion = 0 + hpData.rewards_list.UpperLimit = 0 + hpData.rewards_list.UpperLimitReward = 0 + return hpData +end + return M diff --git a/lua_probject/base_project/Game/View/FamilyViewZuo.lua b/lua_probject/base_project/Game/View/FamilyViewZuo.lua index e71ac06d..30b2d435 100644 --- a/lua_probject/base_project/Game/View/FamilyViewZuo.lua +++ b/lua_probject/base_project/Game/View/FamilyViewZuo.lua @@ -93,7 +93,7 @@ function M:FamilyTableRenderer(index, obj) local roomList = self._group.rooms local tmp local showDeatilFct = function() - + end if index < #playList then -- 默认玩法,开桌子之类的 tmp = playList[index + 1] @@ -105,8 +105,11 @@ function M:FamilyTableRenderer(index, obj) end) end obj:GetChild('icon').onClick:Set(function(context) - self:ClickTableShowDetail(context,{type =1}) + self:ClickTableShowDetail({ type = 1, info = tmp, index = index }) end) + if self._view:GetController('showPlayDetail').selectedIndex == 1 then + self:ClickTableShowDetail({ type = 1, info = tmp, index = index }) + end elseif index - #playList < #roomList then --存在的桌子 local roomInfo = roomList[index - #playList + 1] tmp = self._group:getPlay(roomInfo.pid) @@ -122,13 +125,16 @@ function M:FamilyTableRenderer(index, obj) btn:GetController('zuo').selectedIndex = 0 btn:GetChild("btn_head").icon = "ui://Family/icon_luozuo" btn.onClick:Set(function(context) - self:ClickJoinRoom(context, tmp, roomInfo) + self:ClickJoinRoom(context, roomInfo) end) end end obj:GetChild('icon').onClick:Set(function(context) - self:ClickTableShowDetail(context,{type =2,info=roomInfo}) + self:ClickTableShowDetail({ type = 2, info = roomInfo, index = index }) end) + if self._view:GetController('showPlayDetail').selectedIndex == 1 then + self:ClickTableShowDetail({ type = 2, info = roomInfo, index = index }) + end end obj:GetController('playerNum').selectedIndex = tmp.maxPlayers - 2 obj:GetChild('text_playName').text = tmp.name @@ -209,19 +215,83 @@ function M:ClickMachRoom(context, playinfo) ) end -function M:ClickTableShowDetail(context,data) +--点击桌子查看信息 +function M:ClickTableShowDetail(data) local data = data or {} if data.type then - if data.type == 1 then - - elseif data.type == 2 then + self._view:GetController('showPlayDetail').selectedIndex = 1 + local detailView = self._view:GetChild('comp_playDetail') + local detailType = detailView:GetController('type') + local tableIcon = self._viewList_tableList:GetChildAt(data.index):GetChild('icon') + local gxy = tableIcon:LocalToGlobal(Vector2.New(tableIcon.width, tableIcon.height) / 2) + detailView.xy = self._view:GlobalToLocal(gxy) - Vector2.New(detailView.width / 2, detailView.height) + local playinfo = data.info + detailView:GetChild('btn_createRoom').onClick:Set(function(context) + self:ClickMachRoom(context, data.info) + end) + + detailView:GetChild('btn_joinRoom').onClick:Set(function(context) + self:ClickJoinRoom(context, data.info) + end) + + detailView:GetChild('btn_inviteRoom').onClick:Set(function(context) + ViewUtil:ErrorTip("暂时还未联通微信") + end) + + detailView:GetChild('btn_delRoom').onClick:Set(function(context) + self:JieSanRomm(self._group.id,data.info.id) + end) + + if data.type == 1 then + detailType.selectedIndex = 0 + elseif data.type == 2 then + local stype = 1 + if self._group.lev and self._group.lev == 1 then + stype = stype + 2 + end + if playinfo.plist and #playinfo.plist > 0 and playinfo.plist[1].aid == DataManager.SelfUser.account_id then + stype = stype + 1 + end + playinfo = self._group:getPlay(playinfo.pid) + detailType.selectedIndex = stype end + detailView:GetChild('text_playDetail').text = ExtendManager.GetExtendConfig(playinfo.gameId):GetGameInfo() + :LoadConfigToDetail(playinfo.config, playinfo.hpData) end end +--点击解散房间 +function M:JieSanRomm(groupId, roomId) + local _curren_msg = + MsgWindow.new( + self._root_view, + '确定要解散该房间吗?', + MsgWindow.MsgMode.OkAndCancel + ) + _curren_msg.onOk:Add( + function() + ViewUtil.ShowModalWait2(self._root_view) + local fgCtr = ControllerManager.GetController(NewGroupController) + + fgCtr:FG_RemoveRoom( + groupId, + roomId, + function(res) + ViewUtil.CloseModalWait2() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') + return + end + end + ) + end + ) + _curren_msg:Show() +end + --点击桌子进入游戏 -function M:ClickJoinRoom(context, playinfo, room) +function M:ClickJoinRoom(context, room) local group = DataManager.CurrenGroup local roomCtr = ControllerManager.GetController(RoomController) roomCtr:PublicJoinRoom( @@ -243,7 +313,8 @@ function M:ClickJoinRoom(context, playinfo, room) else UpdateBeat:Remove(self.OnUpdate, self) FamilyView.lastId = group.id - ViewManager.ChangeView(ViewManager.View_Main, playinfo.gameId, { _flag_showTip = true }) + ViewManager.ChangeView(ViewManager.View_Main, self._group:getPlay(room.pid).gameId, + { _flag_showTip = true }) ViewUtil.CloseModalWait2() end end, diff --git a/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua b/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua new file mode 100644 index 00000000..fff2f2a9 --- /dev/null +++ b/lua_probject/base_project/Game/View/FamilyZuo/FamilyGamePlay.lua @@ -0,0 +1,143 @@ +local FamilyGamePlayView = {} + +local M = FamilyGamePlayView + +function FamilyGamePlayView.new(data, callback) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) + self.class = "FamilyGamePlayView" + self._data = data or {} + self._callback = callback + self._close_destroy = true + self._full = true + self._full_offset = false + self:init("ui://Family/FamilyGamePlay") + return self +end + +function M:init(url) + getmetatable(M).__index.init(self, url) + + local view = self._view + self._viewList_left = view:GetChild('list_left') + self._viewList_left.itemRenderer = handler(self, self.GameTypeRenderer) + self._viewList_left.onClickItem:Set(handler(self, self.GameTypeClick)) + + self._viewComp_GameList = view:GetChild('page').component + self._viewList_GameList = self._viewComp_GameList:GetChild('list_left') + self._viewList_GameList.itemRenderer = handler(self, self.GameListRenderer) + self._viewList_GameList.onClickItem:Set(handler(self, self.GameListClick)) + + self.orderList = { { name = "麻将", list = {} }, { name = "扑克", list = {} }, { name = "字牌", list = {} } } + + self._viewComp_GameList:GetChild('btn_confirm').onClick:Set(handler(self, self.ClickCreate)) + + self:FillData() +end + +--创建玩法大分类-- +function M:GameTypeRenderer(index, obj) + local info = self.orderList[index + 1] + obj:GetChild('text_down').text = info.name + obj:GetChild('text_up').text = info.name +end + +function M:GameTypeClick(context) + self._viewList_GameList.numItems = #self.orderList[context.sender.selectedIndex + 1].list +end + +--玩法列表-- +function M:GameListRenderer(index, obj) + local info = self.orderList[self._viewList_left.selectedIndex + 1].list[index + 1] + obj.text = info.name +end + +function M:GameListClick(context) + local info = self.orderList[self._viewList_left.selectedIndex + 1].list[context.sender.selectedIndex + 1] + local mode = ExtendManager.GetExtendConfig(info.game_id):GetGameInfo() + ViewUtil.LoadPage(self._viewComp_GameList:GetChild('page'), mode:GetPageURL(), function(view) + mode._config = view + mode:FillData() + if self._data.playInfo then + mode:LoadConfigData(json.decode(self._data.playInfo.config)) + end + end) +end + +----------------- + +--点击创建玩法 +function M:ClickCreate() + ViewUtil.ShowModalWait2(self._root_view) + local fgCtr = ControllerManager.GetController(NewGroupController) + local group = DataManager.CurrenGroup + local info = self.orderList[self._viewList_left.selectedIndex + 1].list[self._viewList_GameList.selectedIndex + 1] + local mod = ExtendManager.GetExtendConfig(info.game_id):GetGameInfo() + local _data = mod:SelectedConfigData() + local hpData = mod:GetHpData() + _data.game_id = info.game_id + self.table_color = 0 + local functionName = self._data.playInfo and fgCtr.FG_UpdatePlay or fgCtr.FG_AddPlay + functionName(fgCtr, group.id, info.game_id, _data, info.name, hpData, 1, group.type, self.table_color, + function(res) + if self._is_destroy then + return + end + ViewUtil.CloseModalWait2() + + if res.ReturnCode == 0 then + ViewUtil.ErrorTip(-1, "添加玩法成功") + if self._callback then + self._callback() + end + self:Destroy() + else + ViewUtil.ErrorTip(res.ReturnCode, "添加玩法失败!") + end + end) +end + +function M:FillData() + local games = DataManager.SelfUser.games + local playInfo = self._data.playInfo + local selectType = 0 + local selectGame = 0 + local chooseGameId + if playInfo then + selectType = playInfo.gameType - 1 + chooseGameId = playInfo.gameId + end + for i, v in ipairs(games) do + if chooseGameId == v.game_id then + selectGame = #self.orderList[v.gameType].list + end + table.insert(self.orderList[v.gameType].list, v) + end + self._viewList_left.numItems = #self.orderList + self._viewList_left.selectedIndex = selectType + self._viewList_GameList.numItems = #self.orderList[selectType + 1].list + self._viewList_GameList.selectedIndex = selectGame + if #self.orderList[selectType + 1].list > 0 then + self:GameListClick({ sender = { selectedIndex = selectGame } }) + end + + + self:Show() +end + +-- 打开窗口 +function M:Show() + getmetatable(M).__index.Show(self) +end + +-- 关闭窗口 +function M:Close() + getmetatable(M).__index.Close(self) +end + +-- 销毁窗口 +function M:Destroy() + getmetatable(M).__index.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/FamilyZuo/FamilyPlayListView.lua b/lua_probject/base_project/Game/View/FamilyZuo/FamilyPlayListView.lua index 604a1135..90f6e90d 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/FamilyPlayListView.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/FamilyPlayListView.lua @@ -1,3 +1,5 @@ +local FamilyManagerView = import(".FamilyManagerView") + local FamilyPlayListView = {} local M = FamilyPlayListView @@ -15,9 +17,17 @@ end function M:init(url) getmetatable(M).__index.init(self,url) + local view = self._view + + view:GetChild('btn_addPlay').onClick:Set(handler(self,self.AddPlayClick)) + self:FillData() end +function M:AddPlayClick() + FamilyManagerView.new({frsitIndex=2}) +end + function M:FillData() self:Show() end diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_GamePlayView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_GamePlayView.lua index 215fc729..0802b138 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_GamePlayView.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_GamePlayView.lua @@ -1,4 +1,5 @@ local GroupGameSettingView = import("..NewGroup.MngView.GroupGameSettingView_jaingxi") +local FamilyGamePlay = import(".FamilyGamePlay") local ManagerChild_GamePlayView = {} @@ -20,21 +21,13 @@ function M:init(url) return end local page = root._view:GetChild('page') - self:LoadPage(page, url, function(view) + ViewUtil.LoadPage(page, url, function(view) local group = DataManager.CurrenGroup self._view = view view:GetChild('list_gameName').itemRenderer = handler(self, self.GamePlayRenderer) view:GetChild('list_gameName').onClickItem:Set(handler(self, self.GamePlayClick)) view:GetChild('btn_addPlay').onClick:Set(function() - local tem = GroupGameSettingView.new(self.blur_view, group.id, 0, nil, function(play) - group:addPlay(play) - if #DataManager.CurrenGroup.playList == 1 then - self:FillData() - else - view:GetChild('list_gameName').numItems = #DataManager.CurrenGroup.playList - end - end) - tem:Show() + FamilyGamePlay.new({},handler(self,self.FillData)) end) view:GetChild('btn_delPlay').onClick:Set(function() local fgCtr = ControllerManager.GetController(NewGroupController) @@ -59,28 +52,13 @@ function M:init(url) _curren_msg:Show() end) view:GetChild('btn_updatePlay').onClick:Set(function() - + FamilyGamePlay.new({playInfo = DataManager.CurrenGroup.playList[view:GetChild('list_gameName').selectedIndex + 1]},handler(self,self.FillData)) end) self:FillData() end) end ---确保页面加载后再渲染初始化数据 -function M:LoadPage(loader, url, callback) - loader.url = url - - if loader.component then - callback(loader.component) - else - FrameTimer.New(function() - if loader.component then - callback(loader.component) - end - end, 1):Start() - end -end - function M:GamePlayRenderer(index, obj) obj.text = DataManager.CurrenGroup.playList[index + 1].name end @@ -102,7 +80,11 @@ end function M:FillData() local playList = DataManager.CurrenGroup.playList local view = self._view - view:GetChild('list_gameName').numItems = #playList + if view:GetChild('list_gameName').numItems == #playList then + view:GetChild('list_gameName'):RefreshVirtualList() + else + view:GetChild('list_gameName').numItems = #playList + end if #playList > 0 then view:GetChild('list_gameName').selectedIndex = 0 self:GamePlayClick() diff --git a/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_PlayerView.lua b/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_PlayerView.lua index f534656d..c30df99d 100644 --- a/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_PlayerView.lua +++ b/lua_probject/base_project/Game/View/FamilyZuo/ManagerChild_PlayerView.lua @@ -19,7 +19,7 @@ function M:init(url) end ViewUtil.ShowModalWait2() local page = root._view:GetChild('page') - self:LoadPage(page, url, function(view) + ViewUtil.LoadPage(page, url, function(view) self._view = view view:GetController('page').onChanged:Set(handler(self, self.PageChanged)) view:GetChild('list_menber').itemRenderer = handler(self, self.MenberItemRenderer) @@ -28,21 +28,6 @@ function M:init(url) end) end ---确保页面加载后再渲染初始化数据 -function M:LoadPage(loader, url, callback) - loader.url = url - - if loader.component then - callback(loader.component) - else - FrameTimer.New(function() - if loader.component then - callback(loader.component) - end - end, 1):Start() - end -end - function M:MenberItemRenderer(index, obj) local numberInfo = self._fillData[index + 1] if not self._fillType or self._fillType == 1 then diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index 8e169ee8..9223c876 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -430,3 +430,18 @@ function ViewUtil.__openWx() GameApplication.Instance:WXOnlyOpen(1, function(...) end) end + +--确保页面加载后再渲染初始化数据 +function ViewUtil.LoadPage(loader, url, callback) + loader.url = url + + if loader.component then + callback(loader.component) + else + FrameTimer.New(function() + if loader.component then + callback(loader.component) + end + end, 1):Start() + end +end diff --git a/lua_probject/base_project/table/Table_Error_code.lua b/lua_probject/base_project/table/Table_Error_code.lua index e99f51bf..e2bc1159 100644 --- a/lua_probject/base_project/table/Table_Error_code.lua +++ b/lua_probject/base_project/table/Table_Error_code.lua @@ -38,7 +38,7 @@ Table_Error_code_Map = { [28] = { id = 28, note = "多次登录失败,禁止登录,请过段时间再次尝试" }, -- [101] = { id = 101, note = "请检查您的网络设置" }, --请检查您的网络设置,暂时注释 [102] = { id = 102, note = "网络连接超时" }, - [500] = { id = 500, note = "" }, + -- [500] = { id = 500, note = "" }, [999] = { id = 999, note = "未知错误" }, [17] = { id = 17, note = "奖券不足" }, [53] = { id = 53, note = "与桌上玩家IP相同,进入房间失败" }, diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index bd0c1319..5f9b0d3a 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -38,66 +38,35 @@ function M:FillData() com_editSetting:GetController("oneRound").selectedIndex = 0 end end) - -- if oldGameVersion == 2 then - -- self._config:GetController("xipai").selectedIndex = 0 +end - -- self.xipaiValueText = self._config:GetChild('xipaifen') - -- self.xipaiValueText.text = 1 - -- self.xipaiValue = 1 +function M:FillDataNew() + self._maxPlayer = 4 -- 默认玩家人数 + self._roundChoice = 3 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_FuZhou/Label_Detail_83") - -- self.anchouValueText = self._config:GetChild('anchoufen') - -- self.anchouValueText.text = 1 - -- self.anchouValue = 1 + local jiangmaSlider = self._config:GetChild("n92") + jiangmaSlider.onChanged:Set(function() + self._config:GetChild("n93").text = string.format("奖%s马", Mathf.Round(jiangmaSlider.value) * 2) + end) - -- local btn_cr = self._config:GetChild('sdsrbtn') - -- btn_cr.onClick:Set( - -- function() - -- local gniv = GroupNumberInputView_Game.new(nil, function(num) - -- local value = limit - -- if otype == 1 then - -- value = value + ad2d(num) - -- elseif otype == -1 then - -- value = value - ad2d(num) - -- else - -- value = ad2d(num) - -- end + local com_editSetting = self._config:GetChild("com_editSetting") - -- if value < 0 then - -- ViewUtil.ErrorTip(1, "输入数据异常!") - -- end + com_editSetting:GetController("cGps").selectedIndex = 2 - -- self.xipaiValueText.text = value / 1000 - -- self.xipaiValue = value / 1000 - -- end, 3, nil) - -- gniv:Show() - -- end - -- ) - - - -- local btn_cr2 = self._config:GetChild('anchoubtn') - -- btn_cr2.onClick:Set( - -- function() - -- local gniv = GroupNumberInputView_Game.new(nil, function(num) - -- local value = limit - -- if otype == 1 then - -- value = value + ad2d(num) - -- elseif otype == -1 then - -- value = value - ad2d(num) - -- else - -- value = ad2d(num) - -- end - - -- if value < 0 then - -- ViewUtil.ErrorTip(1, "输入数据异常!") - -- end - - -- self.anchouValueText.text = value / 1000 - -- self.anchouValue = value / 1000 - -- end, 3, nil) - -- gniv:Show() - -- end - -- ) - -- end + local ctr_round = self._config:GetController("round") + if ctr_round.selectedIndex == 0 then + com_editSetting:GetController("oneRound").selectedIndex = 1 + else + com_editSetting:GetController("oneRound").selectedIndex = 0 + end + self._config:GetController("round").onChanged:Set(function() + if ctr_round.selectedIndex == 0 then + com_editSetting:GetController("oneRound").selectedIndex = 1 + else + com_editSetting:GetController("oneRound").selectedIndex = 0 + end + end) end local _help_url = "ui://Info_MJ_FuZhou/Com_help" @@ -120,6 +89,10 @@ function M:GetPlayList() return _play_list end +function M:GetPageURL() + return "ui://Info_MJ_FuZhou/Label_Detail_83" +end + function M:SelectedConfigData() local _config = self._config local round = _config:GetController("round").selectedIndex + 1 diff --git a/lua_probject/extend_project/extend/poker/duoduo/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/duoduo/EXGameInfo.lua index 62d94db6..062dd7fa 100644 --- a/lua_probject/extend_project/extend/poker/duoduo/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/duoduo/EXGameInfo.lua @@ -16,11 +16,13 @@ function EXGameInfo.new(blur_view) end function M:FillData(view, index) + getmetatable(M).__index:FillData(view, index) self._maxPlayer = 2 -- 默认玩家人数 self._roundChoice = 5 -- 回合选项数 -- if oldGameVersion == 1 then - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_DuoDuo/Label_Detail_Play") + + self._config = UIPackage.CreateObjectFromURL(self:GetPageURL()) local com_editSetting = self._config:GetChild("com_editSetting") @@ -79,6 +81,10 @@ function M:GetIconUrl1() return _icon_url1 end +function M:GetPageURL() + return "ui://Info_Poker_DuoDuo/Label_Detail_Play" +end + local _play_list = { "15张玩法", "16张玩法" } function M:GetPlayList() return _play_list @@ -158,6 +164,7 @@ function M:LoadConfigData(data) end function M:SelectedConfigData() + local _data = getmetatable(M).__index:SelectedConfigData() local _config = self._config local round = _config:GetController("round").selectedIndex local handcard = _config:GetController("handcard").selectedIndex @@ -207,7 +214,6 @@ function M:SelectedConfigData() end ---- - local _data = {} _data["account_id"] = DataManager.SelfUser.Id -- _data["AA"] = AA -- _data["willBeOut"] = willBeOut + 1 diff --git a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua index 973ce45f..c5a62d24 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua @@ -20,7 +20,8 @@ function M:FillData(view, index) self._roundChoice = 5 -- 回合选项数 -- if oldGameVersion == 1 then - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_RunFastNew/Label_Detail_Play") + -- self._config = UIPackage.CreateObjectFromURL(self:GetPageURL()) + local com_editSetting = self._config:GetChild("com_editSetting") @@ -79,6 +80,10 @@ function M:GetIconUrl1() return _icon_url1 end +function M:GetPageURL() + return "ui://Info_Poker_RunFastNew/Label_Detail_Play" +end + local _play_list = { "15张玩法", "16张玩法" } function M:GetPlayList() return _play_list diff --git a/wb_new_ui/assets/Common/buttons/Btn_CheckBox.xml b/wb_new_ui/assets/Common/buttons/Btn_CheckBox.xml index 34eb1713..731f0de0 100644 --- a/wb_new_ui/assets/Common/buttons/Btn_CheckBox.xml +++ b/wb_new_ui/assets/Common/buttons/Btn_CheckBox.xml @@ -1,10 +1,15 @@ - - + + - + + - + + + + +