From 866ca2e5d642b728dee4a42b1cc2a47d398deb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Thu, 19 Jun 2025 23:51:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=8D=E6=95=B0=E4=BF=AE=E6=94=B9100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/View/NewGroup/GroupInfoView.lua | 46 +- .../View/NewGroup/GroupMngFagPackView.lua | 368 ++++++------- .../NewGroup/MngView/GroupGameSettingView.lua | 6 +- .../MngView/GroupPartnerRewardsView.lua | 8 +- .../base_project/Game/View/ViewUtil.lua | 163 +++--- .../extend/majiang/changsha/EXGameInfo.lua | 517 +++++++++--------- .../extend/majiang/gejiu/EXGameInfo.lua | 247 ++++----- .../extend/majiang/hongzhong/EXGameInfo.lua | 364 ++++++------ .../extend/majiang/zhuanzhuan/EXGameInfo.lua | 335 ++++++------ .../extend/poker/chuntian/EXGameInfo.lua | 220 ++++---- .../extend/poker/runfast/EXGameInfo.lua | 20 +- .../extend/poker/sanqianfen/EXGameInfo.lua | 204 ++++--- .../zipai/changdepaohuzi/EXGameInfo.lua | 242 ++++---- .../extend/zipai/fanpaofa/EXGameInfo.lua | 207 ++++--- .../extend/zipai/fanpaofa_bak2/EXGameInfo.lua | 201 ++++--- .../extend/zipai/fulushou/EXGameInfo.lua | 279 +++++----- .../extend/zipai/hsrunbeard/EXGameInfo.lua | 194 +++---- .../extend/zipai/runbeard/EXGameInfo.lua | 332 ++++++----- .../extend/zipai/shihuka/EXGameInfo.lua | 210 ++++--- .../zipai/yueyangwaihuzi/EXGameInfo.lua | 256 +++++---- .../zipai/yueyangwaihuzi_bak/EXGameInfo.lua | 208 ++++--- .../NewGroup/mgr/component/game/panel_fag.xml | 2 +- 22 files changed, 2213 insertions(+), 2416 deletions(-) diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 1c124f94..8dba0818 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -179,7 +179,7 @@ local function __fillRoomItem(self, index, item, room) room_item:SetPlay(play) -- local str="(人数:".. room.maxPlayers -- if room.limitInRoom then - -- str=str.." 限制积分:"..room.limitInRoom/1000 ..")" + -- str=str.." 限制积分:"..room.limitInRoom/100 ..")" -- else -- str=str..")" -- end @@ -187,7 +187,7 @@ local function __fillRoomItem(self, index, item, room) local str = "" if room.limitInRoom then - str = str .. room.limitInRoom / 1000 + str = str .. room.limitInRoom / 100 end if room.round == nil then @@ -247,7 +247,7 @@ local function __fillRoomItem(self, index, item, room) if p.hp then local str1 = "积分:" - local hp = p.hp / 1000 + local hp = p.hp / 100 p_head.text_score.text = str1 .. hp end else @@ -299,7 +299,7 @@ local function __fillRoomItem(self, index, item, room) riv:GetChild('tex_room_name').text = play.game_name riv:GetController("mengzhu").selectedIndex = 1 printlog("tex_room_name:") - if self.curGroup.lev==1 then + if self.curGroup.lev == 1 then riv:GetController("mengzhu").selectedIndex = 0 local jiesannum = riv:GetChild("jiesan_input") riv:GetChild("btn_jiesan").onClick:Set( @@ -339,12 +339,12 @@ local function __fillRoomItem(self, index, item, room) end local exconfig = ExtendManager.GetExtendConfig(play.gameId) local data = json.decode(play.config) - local r = {} - exconfig:FillRoomConfig(r, data) + local r = {} + exconfig:FillRoomConfig(r, data) local gameStr = "" - gameStr = "["..play.name.."]"..string.gsub(r.room_config:GetDes(), "\r", "") + gameStr = "[" .. play.name .. "]" .. string.gsub(r.room_config:GetDes(), "\r", "") riv:GetChild("wafashuoming").text = gameStr - + self:InitRoomInfoView() riv:GetChild('btn_enter').onClick:Set( function() @@ -577,7 +577,7 @@ local function __fillRoomData(self) end local totalNum = 1 if hp.tex_times_room then - totalNum = hp.tex_times_room / 1000 + totalNum = hp.tex_times_room / 100 end for i = 1, totalNum do @@ -637,7 +637,7 @@ local function __fillRoomData(self) local totalNum = 1 if hp and hp.tex_times_room then - totalNum = hp.tex_times_room / 1000 + totalNum = hp.tex_times_room / 100 end for j = 1, totalNum do self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i] @@ -1035,7 +1035,7 @@ function M:InitView(url) -- end -- ) - + self._view:GetChild('tex_id').text = "ID:" .. self.curGroup.id self._view:GetChild('tex_name').text = self.curGroup.name @@ -1065,22 +1065,22 @@ function M:InitView(url) -- ) -- self._view:GetChild('player_diamond').text = self.curGroup.diamo - local btn_refreshbg = self._view:GetChild("btn_refreshbg").onClick:Set(function () - if self._view:GetController("bgchange").selectedIndex==0 then - Utils.SaveLocalFile( DataManager.SelfUser.account_id.."bgflag",2) + local btn_refreshbg = self._view:GetChild("btn_refreshbg").onClick:Set(function() + if self._view:GetController("bgchange").selectedIndex == 0 then + Utils.SaveLocalFile(DataManager.SelfUser.account_id .. "bgflag", 2) self._view:GetController("bgchange").selectedIndex = 1 else - Utils.SaveLocalFile( DataManager.SelfUser.account_id.."bgflag",1) + Utils.SaveLocalFile(DataManager.SelfUser.account_id .. "bgflag", 1) self._view:GetController("bgchange").selectedIndex = 0 - end + end end) - if Utils.LoadLocalFile(DataManager.SelfUser.account_id.."bgflag") == "2" then + if Utils.LoadLocalFile(DataManager.SelfUser.account_id .. "bgflag") == "2" then self._view:GetController("bgchange").selectedIndex = 1 else - self._view:GetController("bgchange").selectedIndex = 0 + self._view:GetController("bgchange").selectedIndex = 0 end - + self._view:GetController('alliance').selectedIndex = self.curGroup.type == 2 and 1 or 0 self.ctr_newmail = self._view:GetController('new_mail') @@ -1144,7 +1144,7 @@ function M:InitView(url) self.roomItems = {} self.lst_room = self._view:GetChild('lst_room') self.lst_room:SetVirtual() - + self.lst_room.itemRenderer = function(index, item) __fillRoomItem(self, index, item) end @@ -1320,9 +1320,9 @@ function M:InitView(url) self.mng_view_Player:Show() end) self._view:GetChild('btn_gerenxinxi2').onClick:Set(function() - -- if not self.mng_view_Player then - self.mng_view_Player = GroupShowMemberInfoView.new(self.curGroup.id, self.curGroup) - -- end + -- if not self.mng_view_Player then + self.mng_view_Player = GroupShowMemberInfoView.new(self.curGroup.id, self.curGroup) + -- end self.mng_view_Player:Show() end) diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua index 067a0189..c1c75ef5 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMngFagPackView.lua @@ -1,4 +1,4 @@ --- 能量包 +-- 能量包 local GroupTakeLogView = import(".MngView.GroupTakeLogView") local GroupRewardsLogView = import(".MngView.GroupRewardsLogView") local GroupNumberInputView = import(".MngView.GroupNumberInputView") @@ -8,49 +8,48 @@ local GroupMngFagPackView = {} local M = GroupMngFagPackView -function GroupMngFagPackView.new(gid, blur_view,ctrNum,uid) - setmetatable(M, {__index = BaseWindow}) - local self = setmetatable({}, {__index = M}) +function GroupMngFagPackView.new(gid, blur_view, ctrNum, uid) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) - self.class = "GroupMngFagPackView" - self._close_destroy = true - self.group_id = gid - self.blur_view = blur_view - self.ctrNum=ctrNum + self.class = "GroupMngFagPackView" + self._close_destroy = true + self.group_id = gid + self.blur_view = blur_view + self.ctrNum = ctrNum self.shouyiData = {} self.uid = uid - self:init("ui://NewGroup/Win_bxx") - self:FillView() - return self + self:init("ui://NewGroup/Win_bxx") + self:FillView() + return self end function M:FillView() - - self.Ctr=self._view:GetController("ctr") - self.Ctr.selectedIndex=1 - + self.Ctr = self._view:GetController("ctr") + self.Ctr.selectedIndex = 1 + self.lst_bxx = self._view:GetChild('bxx_list') - self.lst_bxx:SetVirtual() - self.lst_bxx.itemRenderer = function(index, item) - self:fillGameItem(index, item) - end - - + self.lst_bxx:SetVirtual() + self.lst_bxx.itemRenderer = function(index, item) + self:fillGameItem(index, item) + end + + self.lst_bxx.onClickItem:Add( - function(pas) - if self.currentSelectItem == pas.data then return end - local name=pas.data.icon - self.currentGameItemName=name - self.lst_bxx.numItems=self.ctrNum - end - ) - - - self.playerJF=self._view:GetChild('tex_player') - self.bankJF=self._view:GetChild('tex_bank') - + function(pas) + if self.currentSelectItem == pas.data then return end + local name = pas.data.icon + self.currentGameItemName = name + self.lst_bxx.numItems = self.ctrNum + end + ) + + + self.playerJF = self._view:GetChild('tex_player') + self.bankJF = self._view:GetChild('tex_bank') + self.ctr_page = self._view:GetController("type") - self.ctr_page.onChanged:Set(function() + self.ctr_page.onChanged:Set(function() if self.ctr_page.selectedIndex == 0 then if self.shouyiData.day_rewad then self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad) @@ -64,228 +63,195 @@ function M:FillView() self._view:GetChild("tex_total").text = d2ad(self.shouyiData.day_rewad_2) end end - end) + end) self._view:GetChild("btn_bankinfo").onClick:Set(function() - local gtlv = GroupBankLogView.new(self.blur_view, self.group_id,self.uid) - gtlv:Show() - end) - - local btn_cr = self._view:GetChild('btn_qd') - btn_cr.onClick:Set( - function() - - local gniv = GroupNumberInputView.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 - - ViewUtil.ShowModalWait() - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_SAVEBankInfo(self.group_id, value,self.uid ,function(res1) - ViewUtil.CloseModalWait() - pt(res1) - if (res1.ReturnCode == 0) then - self:SetBank(res1.Data.hp,res1.Data.b_hp) - ViewUtil.ErrorTip(100011000,"积分存取成功!") - else - ViewUtil.ErrorTip(res1.ReturnCode,"存取积分失败!") - end - end) - - end, 0, nil) - gniv:Show() - - - end - ) - - + local gtlv = GroupBankLogView.new(self.blur_view, self.group_id, self.uid) + gtlv:Show() + end) + + local btn_cr = self._view:GetChild('btn_qd') + btn_cr.onClick:Set( + function() + local gniv = GroupNumberInputView.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 + + ViewUtil.ShowModalWait() + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_SAVEBankInfo(self.group_id, value, self.uid, function(res1) + ViewUtil.CloseModalWait() + pt(res1) + if (res1.ReturnCode == 0) then + self:SetBank(res1.Data.hp, res1.Data.b_hp) + ViewUtil.ErrorTip(100011000, "积分存取成功!") + else + ViewUtil.ErrorTip(res1.ReturnCode, "存取积分失败!") + end + end) + end, 0, nil) + gniv:Show() + end + ) + + local btn_qc = self._view:GetChild('btn_qc') - btn_qc.onClick:Set( - function() - - local gniv = GroupNumberInputView.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 - - ViewUtil.ShowModalWait() - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_TakeBankInfo(self.group_id, value,self.uid, function(res1) - ViewUtil.CloseModalWait() - pt(res1) - if (res1.ReturnCode == 0) then - self:SetBank(res1.Data.hp,res1.Data.b_hp) - ViewUtil.ErrorTip(100011000,"积分取出成功!") - else - ViewUtil.ErrorTip(res1.ReturnCode,"获取积分失败!") - end - end) - - end, 0, nil) - gniv:Show() - - end - ) - - + btn_qc.onClick:Set( + function() + local gniv = GroupNumberInputView.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 + + ViewUtil.ShowModalWait() + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_TakeBankInfo(self.group_id, value, self.uid, function(res1) + ViewUtil.CloseModalWait() + pt(res1) + if (res1.ReturnCode == 0) then + self:SetBank(res1.Data.hp, res1.Data.b_hp) + ViewUtil.ErrorTip(100011000, "积分取出成功!") + else + ViewUtil.ErrorTip(res1.ReturnCode, "获取积分失败!") + end + end) + end, 0, nil) + gniv:Show() + end + ) + + --------------------------- - self._view:GetChild("btn_take_log").onClick:Set(function() - local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id,self.uid) - gtlv:Show() - end) - self._view:GetChild("btn_hp_info").onClick:Set(function() - local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id,self.uid) - grlv:Show() - end) - self._view:GetChild("btn_take").onClick:Set(function() - local gniv = GroupNumberInputView.new(self.blur_view, function(num) + self._view:GetChild("btn_take_log").onClick:Set(function() + local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id, self.uid) + gtlv:Show() + end) + self._view:GetChild("btn_hp_info").onClick:Set(function() + local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id, self.uid) + grlv:Show() + end) + self._view:GetChild("btn_take").onClick:Set(function() + local gniv = GroupNumberInputView.new(self.blur_view, function(num) if ad2d(num) > self._total_hp then ViewUtil.ErrorTip(nil, "奖励池积分不足") return end - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid,function(res) - if num == 0 then - ViewUtil.ErrorTip(nil, "提取值必须大于0") - return - end - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败") - else - self._total_hp = res.Data.r_hp - self._view:GetChild("tex_left").text = d2ad(self._total_hp) - end - end) - end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp") - gniv:Show() - end) + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid, function(res) + if num == 0 then + ViewUtil.ErrorTip(nil, "提取值必须大于0") + return + end + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "提取能量包失败") + else + self._total_hp = res.Data.r_hp + self._view:GetChild("tex_left").text = d2ad(self._total_hp) + end + end) + end, 1, d2ad(self._total_hp), "ui://NewGroup/Win_TakeHp") + gniv:Show() + end) - --self:initBankData() + --self:initBankData() self:initShouyiData() - self.lst_bxx.numItems=self.ctrNum + self.lst_bxx.numItems = self.ctrNum end - - function M:initBankData() ViewUtil.ShowModalWait() - local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetBankInfo(self.group_id, self.uid,function(res) + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_GetBankInfo(self.group_id, self.uid, function(res) pt(res) ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败") else - self:SetBank(res.Data.total_hp,res.Data.bank_hp) - self.Ctr.selectedIndex=0 - + self:SetBank(res.Data.total_hp, res.Data.bank_hp) + self.Ctr.selectedIndex = 0 end - end) end - - - function M:initShouyiData() ViewUtil.ShowModalWait() self.shouyiData = {} self._view:GetChild("tex_total").text = 0 local fgCtr = ControllerManager.GetController(NewGroupController) - fgCtr:FG_GetTakeInfo(self.group_id,self.uid ,function(res) + fgCtr:FG_GetTakeInfo(self.group_id, self.uid, function(res) ViewUtil.CloseModalWait() - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败") - else - local data = res.Data + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败") + else + local data = res.Data self.ctr_page.selectedIndex = 0 self.shouyiData = data self._view:GetChild("tex_left").text = d2ad(data.total_hp) self._view:GetChild("tex_total").text = d2ad(data.day_rewad) --self._view:GetChild("tex_totalshouyi").text = 0 self._total_hp = data.total_hp - self.Ctr.selectedIndex=1 + self.Ctr.selectedIndex = 1 end end) end function M:SetCallback(callback) - self.callback = callback + self.callback = callback end - -function M:SetBank(totalHp,bankHp) - self.playerJF.text=totalHp/1000 - self.bankJF.text=bankHp/1000 +function M:SetBank(totalHp, bankHp) + self.playerJF.text = totalHp / 100 + self.bankJF.text = bankHp / 100 end - - function M:fillGameItem(index, item) - if index~=0 then - item.icon="ui://NewGroup/button_cqg" - if self.currentGameItemName==nil then - item.icon="ui://NewGroup/button_cqg_xz" + if index ~= 0 then + item.icon = "ui://NewGroup/button_cqg" + if self.currentGameItemName == nil then + item.icon = "ui://NewGroup/button_cqg_xz" end else - item.icon="ui://NewGroup/button_sjjl" + item.icon = "ui://NewGroup/button_sjjl" end - - - if self.currentGameItemName==item.icon then - item.icon=item.icon.."_xz" - if index~=0 then + + + if self.currentGameItemName == item.icon then + item.icon = item.icon .. "_xz" + if index ~= 0 then self:initBankData() else self:initShouyiData() end end - - - end - - - - - - - - - - - -- 销毁窗口 function M:Destroy(remove_map) - if self.callback then - self.callback() - end - BaseWindow.Destroy(self,remove_map) - ImageLoad.Clear(self.class) + if self.callback then + self.callback() + end + BaseWindow.Destroy(self, remove_map) + ImageLoad.Clear(self.class) end -return M \ No newline at end of file +return M diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua index 4370dccc..b319125d 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua @@ -227,7 +227,7 @@ function M:FillFagData() local tex_times_room = panel_play_set:GetChild("tex_times_room") if hpData and hpData.tex_times_room then - tex_times_room.text = hpData.tex_times_room / 1000 + tex_times_room.text = hpData.tex_times_room / 100 else tex_times_room.text = 1 end @@ -492,7 +492,7 @@ function M:FillFagData() play.config = json.encode(_data) play.hp_times = self.hpData.times play.maxPlayers = _data.maxPlayers - play.roomNum = self.hpData.tex_times_room / 1000 + play.roomNum = self.hpData.tex_times_room / 100 play.maxRound = res.Data.maxRound ViewUtil.ShowBannerOnScreenCenter("添加玩法成功") self.callback(play) @@ -533,7 +533,7 @@ function M:FillFagData() play.config = json.encode(_data) play.hp_times = self.hpData.times play.maxPlayers = _data.maxPlayers - play.roomNum = self.hpData.tex_times_room / 1000 + play.roomNum = self.hpData.tex_times_room / 100 play.maxRound = res.Data.maxRound self.callback(play) self:Destroy() diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua index 928704a3..ed0e779b 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupPartnerRewardsView.lua @@ -67,7 +67,7 @@ function M:GetRewardsData() self._view:GetChild('btn_piliang').onClick:Set(function() local gfiv = GroupNumberInputView.new(self._root_view, function(num) - local tem = num * 1000 + local tem = num * 100 local msg_win = MsgWindow.new(nil, string.format("是否设定所有玩法奖励为%s?", num), MsgWindow.MsgMode.OkAndCancel, nil, false) @@ -211,12 +211,12 @@ function M:OnRenderRewardsItem(index, obj) local input_type1 = data.xipai_rewardValueType == 1 and 0 or 3 obj:GetChild("btn_set1").onClick:Set(function() local gfiv = GroupNumberInputView.new(self._root_view, function(num) - local tem = num * 1000 + local tem = num * 100 if data.xipai_rewardValueType == 2 then tem = ad2d(tem) end - if tem / 1000 > data.xipai_max_value then + if tem / 100 > data.xipai_max_value then ViewUtil.ErrorTip(nil, "输入值超过上限") return -- elseif tem < data.cur_value then @@ -275,7 +275,7 @@ function M:OnRenderRewardsItem(index, obj) local input_type2 = data.anchou_rewardValueType == 1 and 0 or 3 obj:GetChild("btn_set2").onClick:Set(function() local gfiv = GroupNumberInputView.new(self._root_view, function(num) - local tem = num * 1000 + local tem = num * 100 if data.anchou_rewardValueType == 2 then tem = ad2d(tem) end diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index 80269338..c9022325 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -2,45 +2,45 @@ ViewUtil = { Num_Converted = { "一", "二", "三", "四" }, Sex_Chat = { - "man", - "woman" + "man", + "woman" }, - + Fix_Msg_Chat = { - "大家好,很高兴见到各位!", - "和你合作太愉快了!", - "快点啊,我等的花儿都谢了!", - "你丫的牌打得也忒好了", - "不要吵了不要吵了,吵什么吵啊,专心打牌", - "怎么又断线了,网络这么差!", - "各位,真不好意思啊,我得离开一会", - "不要走,决战到天亮!", - "你是妹妹,还是哥哥啊?", - "我们交个朋友吧,能不能告诉我你的联系方法", - "再见了,我会想念大家的", - "不好意思临时有事,申请解散!" - } + "大家好,很高兴见到各位!", + "和你合作太愉快了!", + "快点啊,我等的花儿都谢了!", + "你丫的牌打得也忒好了", + "不要吵了不要吵了,吵什么吵啊,专心打牌", + "怎么又断线了,网络这么差!", + "各位,真不好意思啊,我得离开一会", + "不要走,决战到天亮!", + "你是妹妹,还是哥哥啊?", + "我们交个朋友吧,能不能告诉我你的联系方法", + "再见了,我会想念大家的", + "不好意思临时有事,申请解散!" + } } -function ViewUtil.GetPos(self_seat,seat,people_num) +function ViewUtil.GetPos(self_seat, seat, people_num) if self_seat == 0 then return seat end local cur_seat = self_seat local tem = seat - (cur_seat - 1) - if (tem <= 0) then tem = tem +people_num end + if (tem <= 0) then tem = tem + people_num end return tem end -- 隐藏手机号 function ViewUtil.phone_hide(phone) - return string.sub(phone,1,3).."****"..string.sub(phone,8) + return string.sub(phone, 1, 3) .. "****" .. string.sub(phone, 8) end -- 隐藏身份证 function ViewUtil.identity_hide(identity) - return string.sub(identity,1,8).."****"..string.sub(identity,13) + return string.sub(identity, 1, 8) .. "****" .. string.sub(identity, 13) end -local modal_wait_win =nil +local modal_wait_win = nil -- local modal_wait_win_url = "ui://Common/GlobalModalWaiting" function ViewUtil.ShowModalWait(blur_view, title) ViewUtil.CloseModalWait() @@ -51,14 +51,14 @@ function ViewUtil.CloseModalWait() ModalWaitingWindow.CloseModal() end -local _defaultTooltipWin =nil +local _defaultTooltipWin = nil local function __waittips(obj) _defaultTooltipWin:Dispose() _defaultTooltipWin = nil end local _tip_timer -local function __ShowTips(msg,time) +local function __ShowTips(msg, time) time = time or 2 if _defaultTooltipWin then _tip_timer:Stop() @@ -72,24 +72,24 @@ local function __ShowTips(msg,time) _defaultTooltipWin:MakeFullScreen() _tip_timer = Timer.New(function() __waittips() - end,time,1,true) + end, time, 1, true) _tip_timer:Start() end -function ViewUtil.ErrorTip(code,tip,time) - if(Table_Error_code_Map[code]~=nil) then - __ShowTips(string.format("%s",Table_Error_code_Map[code].note), time) +function ViewUtil.ErrorTip(code, tip, time) + if (Table_Error_code_Map[code] ~= nil) then + __ShowTips(string.format("%s", Table_Error_code_Map[code].note), time) else - __ShowTips(tip,time) + __ShowTips(tip, time) end end -function ViewUtil.ErrorMsg(_root_view,code,tip,url) +function ViewUtil.ErrorMsg(_root_view, code, tip, url) local msg = tip - if(Table_Error_code_Map[code]~=nil) then - msg = string.format("%s",Table_Error_code_Map[code].note) + if (Table_Error_code_Map[code] ~= nil) then + msg = string.format("%s", Table_Error_code_Map[code].note) end - local _curren_msg = MsgWindow.new(_root_view, msg, MsgWindow.MsgMode.OnlyOk,url) + local _curren_msg = MsgWindow.new(_root_view, msg, MsgWindow.MsgMode.OnlyOk, url) _curren_msg:Show() end @@ -106,10 +106,10 @@ function ViewUtil.ShowBannerOnScreenCenter(msg, s) banner:GetChild("tex_tip").text = msg GRoot.inst:AddChild(banner) banner:Center() - ViewUtil._banner = banner + ViewUtil._banner = banner local timer = Timer.New(function() banner:Dispose() - end,time,1,true) + end, time, 1, true) timer:Start() end @@ -117,51 +117,46 @@ function ViewUtil.PlaySoundBg() GameApplication.Instance:PlayMuisc("base/common/sound/bgmusic1.mp3") end -function ViewUtil.HandCardSort(a,b) +function ViewUtil.HandCardSort(a, b) local sort_a = a local sort_b = b - if a >= 400 then sort_a = sort_a -1000 end + if a >= 400 then sort_a = sort_a - 1000 end if b >= 400 then sort_b = sort_b - 1000 end - return sort_a>>",prefix,ct) + --printlog("get_majiang_prefix===>>>",prefix,ct) return prefix end @@ -226,18 +222,18 @@ end -- 数据转换成3位小数 data to a decimal function d2ad(data) - return data / 1000 + return data / 100 end -- 3位小数转换成数据 a decimal to data function ad2d(decimal) - return decimal * 1000 + return decimal * 100 end -- 获取gps function get_gps(callback) if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then - local s,e = pcall(function() + local s, e = pcall(function() Utils.LocalAddress(function(result, latitude, longitude) if not result or (latitude == 0 and longitude == 0) then return end DataManager.SelfUser.location = Location.new(tostring(longitude) .. "," .. tostring(latitude)) @@ -255,36 +251,33 @@ function get_gps(callback) end --依据宽度截断字符 -function ViewUtil.stringEllipsis(szText,size,full) - +function ViewUtil.stringEllipsis(szText, size, full) full = full or false size = size or 4 --截断结果 local szResult = "..." --完成判断 local bOK = false - + local i = 1 local char_count = 0 while true do - local cur = string.sub(szText,i,i) + local cur = string.sub(szText, i, i) local byte = string.byte(cur) if byte == nil then break end if char_count >= size and full == false then - bOK = true + bOK = true break end if byte > 128 then i = i + 3 char_count = char_count + 1 - elseif byte ~= 32 then - + elseif byte ~= 32 then if string.byte('A') <= byte and byte <= string.byte('Z') then - char_count = char_count + 1 else char_count = char_count + 0.5 @@ -295,12 +288,12 @@ function ViewUtil.stringEllipsis(szText,size,full) char_count = char_count + 0.5 end end - + if i ~= 1 then - szResult = string.sub(szText, 1, i-1) - if(bOK) then - szResult = szResult.."..." + szResult = string.sub(szText, 1, i - 1) + if (bOK) then + szResult = szResult .. "..." end end return szResult -end \ No newline at end of file +end diff --git a/lua_probject/extend_project/extend/majiang/changsha/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/changsha/EXGameInfo.lua index 927e50da..c4f1e4d4 100644 --- a/lua_probject/extend_project/extend/majiang/changsha/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/changsha/EXGameInfo.lua @@ -4,347 +4,332 @@ local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) - self.class = "EXGameInfo" - - UIPackage.AddPackage("extend/majiang/changsha/ui/Info_MJ_ChangSha") - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = "EXGameInfo" + + UIPackage.AddPackage("extend/majiang/changsha/ui/Info_MJ_ChangSha") + 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_ChangSha/Cgm_create_room") else self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room_yueyang") end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=0 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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.xipaiValueText.text = 1 + 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - - end - ) + 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 - ) - + 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) end - -end +end -local _help_url= "ui://Info_MJ_ChangSha/Com_help" +local _help_url = "ui://Info_MJ_ChangSha/Com_help" function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_MJ_ChangSha/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_MJ_ChangSha/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 --== 0 and 1 or 2 - self._maxPlayer = _config:GetController("play_list").selectedIndex+2 + local _config = self._config + local round = _config:GetController("round").selectedIndex + 1 --== 0 and 1 or 2 + self._maxPlayer = _config:GetController("play_list").selectedIndex + 2 - local zhuangxian = _config:GetChild("btn_zhuangxian").selected and true or false - -- local piaofen = _config:GetChild("btn_piaofen").selected and true or false - local zimo = _config:GetChild("btn_zimo").selected and true or false - local AA = _config:GetController("Cost").selectedIndex - -- local liuliushun = _config:GetChild("btn_liuliushun").selected and true or false - -- local queyise = _config:GetChild("btn_queyise").selected and true or false - -- local banbanhu = _config:GetChild("btn_banbanhu").selected and true or false - -- local dasixi = _config:GetChild("btn_dasixi").selected and true or false - local jiejiegao = _config:GetChild("btn_jiejiegao").selected and true or false - local santong = _config:GetChild("btn_santong").selected and true or false - local yizhihua = _config:GetChild("btn_yizhihua").selected and true or false - local zhongtusixi = _config:GetChild("btn_zhongtusixi").selected and true or false - local zhongtuliuliushun = _config:GetChild("btn_zhongtuliuliushun").selected and true or false + local zhuangxian = _config:GetChild("btn_zhuangxian").selected and true or false + -- local piaofen = _config:GetChild("btn_piaofen").selected and true or false + local zimo = _config:GetChild("btn_zimo").selected and true or false + local AA = _config:GetController("Cost").selectedIndex + -- local liuliushun = _config:GetChild("btn_liuliushun").selected and true or false + -- local queyise = _config:GetChild("btn_queyise").selected and true or false + -- local banbanhu = _config:GetChild("btn_banbanhu").selected and true or false + -- local dasixi = _config:GetChild("btn_dasixi").selected and true or false + local jiejiegao = _config:GetChild("btn_jiejiegao").selected and true or false + local santong = _config:GetChild("btn_santong").selected and true or false + local yizhihua = _config:GetChild("btn_yizhihua").selected and true or false + local zhongtusixi = _config:GetChild("btn_zhongtusixi").selected and true or false + local zhongtuliuliushun = _config:GetChild("btn_zhongtuliuliushun").selected and true or false - local niao_type = _config:GetController("niao").selectedIndex - local niao_num = _config:GetController("niao_num").selectedIndex - local niao_db_num = _config:GetController("niao_db_num").selectedIndex - local niao = niao_type == 1 and (niao_db_num == 0 and 1 or 2) or (niao_type == 0 and (niao_num == 0 and 2 or (niao_num == 1 and 4 or 6)) or 2) - local piao_niao = _config:GetChild("btn_piao_niao").selected - local two_pair = _config:GetChild("btn_two_pair").selected - local no_jiang = _config:GetChild("btn_no_jiang").selected - local four_win = _config:GetChild("btn_four_win").selected - local native_hu = _config:GetChild("btn_native_hu").selected - local queyimen = _config:GetChild("btn_queyimen").selected - local fengding = _config:GetChild("btn_fengding").selected - local banyiquan = _config:GetChild("btn_banyiquan").selected - local menqing = _config:GetChild("btn_menqing").selected - - local fengding_score=0 - if _config:GetController("fengding") then - fengding_score=_config:GetController("fengding").selectedIndex - end - - local piao_niao1=0 + local niao_type = _config:GetController("niao").selectedIndex + local niao_num = _config:GetController("niao_num").selectedIndex + local niao_db_num = _config:GetController("niao_db_num").selectedIndex + local niao = niao_type == 1 and (niao_db_num == 0 and 1 or 2) or + (niao_type == 0 and (niao_num == 0 and 2 or (niao_num == 1 and 4 or 6)) or 2) + local piao_niao = _config:GetChild("btn_piao_niao").selected + local two_pair = _config:GetChild("btn_two_pair").selected + local no_jiang = _config:GetChild("btn_no_jiang").selected + local four_win = _config:GetChild("btn_four_win").selected + local native_hu = _config:GetChild("btn_native_hu").selected + local queyimen = _config:GetChild("btn_queyimen").selected + local fengding = _config:GetChild("btn_fengding").selected + local banyiquan = _config:GetChild("btn_banyiquan").selected + local menqing = _config:GetChild("btn_menqing").selected + + local fengding_score = 0 + if _config:GetController("fengding") then + fengding_score = _config:GetController("fengding").selectedIndex + end + + 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 xi_pai=false - local xi_paifen=0 + 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 xi_pai = false + local xi_paifen = 0 if _config:GetChild("xipai") then - xi_pai=_config:GetChild("xipai").selected + xi_pai = _config:GetChild("xipai").selected end - - local niaofen_opt=0 - local niaofen_score=1 - local difen_score=1 - local kai_gong=0 - if oldGameVersion==2 then - niaofen_opt=_config:GetController("niaoadd").selectedIndex - niaofen_score= tonumber(_config:GetController("niaodf").selectedPage) - difen_score= tonumber(_config:GetController("jcdifen").selectedPage) - kai_gong=_config:GetController("kaigang").selectedIndex + + local niaofen_opt = 0 + local niaofen_score = 1 + local difen_score = 1 + local kai_gong = 0 + if oldGameVersion == 2 then + niaofen_opt = _config:GetController("niaoadd").selectedIndex + niaofen_score = tonumber(_config:GetController("niaodf").selectedPage) + difen_score = tonumber(_config:GetController("jcdifen").selectedPage) + kai_gong = _config:GetController("kaigang").selectedIndex end - ---------- - local _data = {} - _data["opt"] = round - _data["maxPlayers"] = self._maxPlayer - _data["zhuangxian"] = zhuangxian - _data["zimo"] = zimo - _data["AA"] = AA - -- _data["piaofen"] = piaofen - -- _data["liuliushun"] = liuliushun - -- _data["queyise"] = queyise - -- _data["banbanhu"] = banbanhu - -- _data["dasixi"] = dasixi - _data["jiejiegao"] = jiejiegao - _data["santong"] = santong - _data["yizhihua"] = yizhihua - _data["zhongtusixi"] = zhongtusixi - _data["zhongtuliuliushun"] = zhongtuliuliushun + --------- + local _data = {} + _data["opt"] = round + _data["maxPlayers"] = self._maxPlayer - _data["niao_type"] = niao_type - - - if oldGameVersion==1 then + _data["zhuangxian"] = zhuangxian + _data["zimo"] = zimo + _data["AA"] = AA + -- _data["piaofen"] = piaofen + -- _data["liuliushun"] = liuliushun + -- _data["queyise"] = queyise + -- _data["banbanhu"] = banbanhu + -- _data["dasixi"] = dasixi + _data["jiejiegao"] = jiejiegao + _data["santong"] = santong + _data["yizhihua"] = yizhihua + _data["zhongtusixi"] = zhongtusixi + _data["zhongtuliuliushun"] = zhongtuliuliushun + + _data["niao_type"] = niao_type + + + if oldGameVersion == 1 then _data["niao"] = niao else _data["niao"] = tonumber(_config:GetController("niao_num").selectedPage) end - - - if oldGameVersion==1 then + + + if oldGameVersion == 1 then _data["piao_niao"] = piao_niao else _data["piao_niao"] = piao_niao1 end - _data["two_pair"] = two_pair - _data["no_jiang"] = no_jiang - _data["four_win"] = four_win - _data["native_hu"] = native_hu - _data["queyimen"] = queyimen - _data["fengding"] = fengding - _data["banyiquan"] = banyiquan - _data["menqing"] = menqing + _data["two_pair"] = two_pair + _data["no_jiang"] = no_jiang + _data["four_win"] = four_win + _data["native_hu"] = native_hu + _data["queyimen"] = queyimen + _data["fengding"] = fengding + _data["banyiquan"] = banyiquan + _data["menqing"] = menqing _data["fengding_score"] = fengding_score --_data['piao'] = piao _data['piao1'] = piao1 _data['piao2'] = piao2 _data['piao3'] = piao3 - - auto_piao=false - if piao_niao1==2 then + + auto_piao = false + if piao_niao1 == 2 then if piao1 or piao2 or piao3 then - auto_piao=true + auto_piao = true end end - - if oldGameVersion==2 then + + if oldGameVersion == 2 then _data['auto_piao'] = auto_piao end - + _data['xi_pai'] = xi_pai _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 - - if oldGameVersion==2 then + + _data['xi_pai_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 + + if oldGameVersion == 2 then _data['niaofen_opt'] = niaofen_opt _data['niaofen_score'] = niaofen_score _data['difen_score'] = difen_score _data['kai_gong'] = kai_gong - end - + pt(_data) - return _data -end - - + return _data +end function M:LoadConfigData(data) pt(data) - local _config = self._config - _config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1 - _config:GetController("play_list").selectedIndex = data.maxPlayers-2 + local _config = self._config + _config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1 + _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 - _config:GetChild("btn_zhuangxian").selected = data.zhuangxian - _config:GetChild("btn_zimo").selected = data.zimo - _config:GetController("Cost").selectedIndex = data.AA - -- _config:GetChild("btn_piaofen").selected = data.piaofen - -- _config:GetChild("btn_liuliushun").selected = data.liuliushun - -- _config:GetChild("btn_queyise").selected = data.queyise - -- _config:GetChild("btn_banbanhu").selected = data.banbanhu - -- _config:GetChild("btn_dasixi").selected = data.dasixi - _config:GetChild("btn_jiejiegao").selected = data.jiejiegao - _config:GetChild("btn_santong").selected = data.santong - _config:GetChild("btn_yizhihua").selected = data.yizhihua - _config:GetChild("btn_zhongtusixi").selected = data.zhongtusixi - _config:GetChild("btn_zhongtuliuliushun").selected = data.zhongtuliuliushun + _config:GetChild("btn_zhuangxian").selected = data.zhuangxian + _config:GetChild("btn_zimo").selected = data.zimo + _config:GetController("Cost").selectedIndex = data.AA + -- _config:GetChild("btn_piaofen").selected = data.piaofen + -- _config:GetChild("btn_liuliushun").selected = data.liuliushun + -- _config:GetChild("btn_queyise").selected = data.queyise + -- _config:GetChild("btn_banbanhu").selected = data.banbanhu + -- _config:GetChild("btn_dasixi").selected = data.dasixi + _config:GetChild("btn_jiejiegao").selected = data.jiejiegao + _config:GetChild("btn_santong").selected = data.santong + _config:GetChild("btn_yizhihua").selected = data.yizhihua + _config:GetChild("btn_zhongtusixi").selected = data.zhongtusixi + _config:GetChild("btn_zhongtuliuliushun").selected = data.zhongtuliuliushun - _config:GetController("niao").selectedIndex = data.niao_type - - if oldGameVersion==1 then - _config:GetController("niao_num").selectedIndex = data.niao_type ~= 0 and 0 or (data.niao == 4 and 1 or (data.niao == 6 and 2 or 0)) + _config:GetController("niao").selectedIndex = data.niao_type + + if oldGameVersion == 1 then + _config:GetController("niao_num").selectedIndex = data.niao_type ~= 0 and 0 or + (data.niao == 4 and 1 or (data.niao == 6 and 2 or 0)) else - _config:GetController("niao_num").selectedIndex=data.niao/2-1 + _config:GetController("niao_num").selectedIndex = data.niao / 2 - 1 end - _config:GetController("niao_db_num").selectedIndex = data.niao_type ~= 1 and 0 or (data.niao == 1 and 0 or 1) - if oldGameVersion==1 then + _config:GetController("niao_db_num").selectedIndex = data.niao_type ~= 1 and 0 or (data.niao == 1 and 0 or 1) + if oldGameVersion == 1 then _config:GetChild("btn_piao_niao").selected = data.piao_niao end - _config:GetChild("btn_two_pair").selected = data.two_pair - _config:GetChild("btn_no_jiang").selected = data.no_jiang - _config:GetChild("btn_four_win").selected = data.four_win - _config:GetChild("btn_native_hu").selected = data.native_hu - _config:GetChild("btn_queyimen").selected = data.queyimen - _config:GetChild("btn_fengding").selected = data.fengding or false - _config:GetChild("btn_banyiquan").selected = data.banyiquan or false - _config:GetChild("btn_menqing").selected = data.menqing or false - - if _config:GetController("fengding") then - _config:GetController("fengding").selectedIndex=data.fengding_score - end - - 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("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:GetChild("btn_two_pair").selected = data.two_pair + _config:GetChild("btn_no_jiang").selected = data.no_jiang + _config:GetChild("btn_four_win").selected = data.four_win + _config:GetChild("btn_native_hu").selected = data.native_hu + _config:GetChild("btn_queyimen").selected = data.queyimen + _config:GetChild("btn_fengding").selected = data.fengding or false + _config:GetChild("btn_banyiquan").selected = data.banyiquan or false + _config:GetChild("btn_menqing").selected = data.menqing or false - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 + if _config:GetController("fengding") then + _config:GetController("fengding").selectedIndex = data.fengding_score end - - if oldGameVersion==2 then - _config:GetController("niaoadd").selectedIndex=data.niaofen_opt or 0 - _config:GetController("niaodf").selectedIndex=data.niaofen_score-1 - _config:GetController("jcdifen").selectedIndex=data.difen_score-1 - _config:GetController("kaigang").selectedIndex=data.kai_gong + + 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 - - end - -return M - \ No newline at end of file + + 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 oldGameVersion == 2 then + _config:GetController("niaoadd").selectedIndex = data.niaofen_opt or 0 + _config:GetController("niaodf").selectedIndex = data.niaofen_score - 1 + _config:GetController("jcdifen").selectedIndex = data.difen_score - 1 + _config:GetController("kaigang").selectedIndex = data.kai_gong + end +end + +return M diff --git a/lua_probject/extend_project/extend/majiang/gejiu/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/gejiu/EXGameInfo.lua index ffea1e1c..4647d5df 100644 --- a/lua_probject/extend_project/extend/majiang/gejiu/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/gejiu/EXGameInfo.lua @@ -4,137 +4,126 @@ local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) - self.class = "EXGameInfo" - UIPackage.AddPackage("extend/majiang/gejiu/ui/Info_MJ_GeJiu") - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = "EXGameInfo" + UIPackage.AddPackage("extend/majiang/gejiu/ui/Info_MJ_GeJiu") + return self end function M:FillData() - self._maxPlayer = 4 -- 默认玩家人数 - self._roundChoice = 3 -- 回合选项数 - self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_GeJiu/Cgm_create_room") + self._maxPlayer = 4 -- 默认玩家人数 + self._roundChoice = 3 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_GeJiu/Cgm_create_room") - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=0 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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.xipaiValueText.text = 1 + 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - - end - ) + 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 - ) - + 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) end -end +end -local _help_url= "ui://Info_MJ_GeJiu/Com_help" +local _help_url = "ui://Info_MJ_GeJiu/Com_help" function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_MJ_GeJiu/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_MJ_GeJiu/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 fengding=_config:GetController("fengding").selectedIndex - local wanfa=_config:GetController("wanfa").selectedIndex - local qiduijiafan=_config:GetChild("btn_qidui").selected - local shoudailongjiafan=_config:GetChild("btn_shoudailong").selected - local loudilongjiafan=_config:GetChild("btn_loudilong").selected - local bunengchi=_config:GetChild("btn_bunengchi").selected - local doudizhu=_config:GetChild("btn_doudizhu").selected - local doudizhufanbei=_config:GetChild("btn_doudizhufanbei").selected - local xi_pai=false - local xi_paifen=0 + local _config = self._config + local round = _config:GetController("round").selectedIndex + 1 + local people = _config:GetController("play_list").selectedIndex + 2 + + local fengding = _config:GetController("fengding").selectedIndex + local wanfa = _config:GetController("wanfa").selectedIndex + local qiduijiafan = _config:GetChild("btn_qidui").selected + local shoudailongjiafan = _config:GetChild("btn_shoudailong").selected + local loudilongjiafan = _config:GetChild("btn_loudilong").selected + local bunengchi = _config:GetChild("btn_bunengchi").selected + local doudizhu = _config:GetChild("btn_doudizhu").selected + local doudizhufanbei = _config:GetChild("btn_doudizhufanbei").selected + local xi_pai = false + local xi_paifen = 0 if _config:GetChild("xipai") then - xi_pai=_config:GetChild("xipai").selected + xi_pai = _config:GetChild("xipai").selected end - + ------ - local _data = {} - _data["opt"] = round - _data["maxPlayers"] = people - + local _data = {} + _data["opt"] = round + _data["maxPlayers"] = people + _data["fengding"] = fengding _data["wanfa"] = wanfa _data["qiduijiafan"] = qiduijiafan @@ -144,31 +133,31 @@ function M:SelectedConfigData() _data["doudizhu"] = doudizhu _data["doudizhufanbei"] = doudizhufanbei _data['xi_pai'] = xi_pai - - 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 - return _data -end + return _data +end function M:LoadConfigData(data) --printlog("加载房间配置=========>>>") --pt(data) - local _config = self._config - _config:GetController("round").selectedIndex = data.opt -1 - _config:GetController("play_list").selectedIndex = data.maxPlayers-2 - - + local _config = self._config + _config:GetController("round").selectedIndex = data.opt - 1 + _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 + + _config:GetController("fengding").selectedIndex = data.fengding - + _config:GetController("wanfa").selectedIndex = data.wanfa _config:GetChild("btn_qidui").selected = data.qiduijiafan _config:GetChild("btn_shoudailong").selected = data.shoudailongjiafan @@ -178,23 +167,17 @@ function M:LoadConfigData(data) _config:GetChild("btn_doudizhu").selected = data.doudizhu _config:GetChild("btn_doudizhufanbei").selected = data.doudizhufanbei - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai end - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + 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/1000 - self.anchouValue=data.an_chou_score/1000 + self.anchouValueText.text = data.an_chou_score / 100 + self.anchouValue = data.an_chou_score / 100 end - - end +end - - - - -return M - \ No newline at end of file +return M diff --git a/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua index 213c36ec..7b0623c7 100644 --- a/lua_probject/extend_project/extend/majiang/hongzhong/EXGameInfo.lua +++ b/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,98 +59,91 @@ 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 @@ -164,51 +152,51 @@ function M:SelectedConfigData() if _config:GetChild("btn_dianpaohu") then dianpaohu = _config:GetChild("btn_dianpaohu").selected end - - local di_fen=false + + 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 @@ -217,98 +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 - - _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: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/lua_probject/extend_project/extend/majiang/zhuanzhuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/zhuanzhuan/EXGameInfo.lua index b487f7ad..44dc7d99 100644 --- a/lua_probject/extend_project/extend/majiang/zhuanzhuan/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/zhuanzhuan/EXGameInfo.lua @@ -3,135 +3,122 @@ 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/zhuanzhuan/ui/Info_MJ_ZhuanZhuan") - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = "EXGameInfo" + UIPackage.AddPackage("extend/majiang/zhuanzhuan/ui/Info_MJ_ZhuanZhuan") + 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_ZhuanZhuan/Cgm_create_room") else self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room") end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=0 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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.xipaiValueText.text = 1 + 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - - end - ) + 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 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_ZhuanZhuan/Com_help" +local _help_url = "ui://Info_MJ_ZhuanZhuan/Com_help" function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_MJ_ZhuanZhuan/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_MJ_ZhuanZhuan/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 niao_type = _config:GetController("NiaoType").selectedIndex + 1 - local zha_ma = _config:GetController("zha").selectedIndex + 1 - local wo_niao = _config:GetController("wowoniao").selectedIndex + 1 - local aa = _config:GetController("Cost").selectedIndex - + local _config = self._config + local round = _config:GetController("round").selectedIndex + 1 + local people = _config:GetController("play_list").selectedIndex + 2 + + 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 aa = _config:GetController("Cost").selectedIndex + local piao_niao = _config:GetChild("btn_piao_niao").selected ---------- -- local piao_niao1=0 -- if _config:GetController('piao') then -- piao_niao1=_config:GetController('piao').selectedIndex - -- end + -- end -- local piao1=false -- local piao2=false -- local piao3=false @@ -139,68 +126,68 @@ function M:SelectedConfigData() -- if piao_niao1==2 then -- piao_niao_opt=_config:GetController("piaofen").selectedIndex -- end - - - local xi_pai=false - local xi_paifen=0 + + + local xi_pai = false + local xi_paifen = 0 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 dianpao = _config:GetChild("btn_dianpaohu").selected - local seven_pair = _config:GetChild("btn_qidui").selected - local laizi = _config:GetChild("btn_hongzhong").selected - local bi_hu = _config:GetChild("btn_bihu").selected - local hz_hu = _config:GetChild("btn_wuzhong").selected - local buzhong = _config:GetChild("btn_buzhongsuanquanzhong").selected - local zhuangxian = _config:GetChild("btn_zhuangxiansuanfen").selected - - local qgdp =_config:GetController("qianggang").selectedIndex - local qianggang_dianpao=false - if qgdp==1 then - qianggang_dianpao=true + -- end + + + local dianpao = _config:GetChild("btn_dianpaohu").selected + local seven_pair = _config:GetChild("btn_qidui").selected + local laizi = _config:GetChild("btn_hongzhong").selected + local bi_hu = _config:GetChild("btn_bihu").selected + local hz_hu = _config:GetChild("btn_wuzhong").selected + local buzhong = _config:GetChild("btn_buzhongsuanquanzhong").selected + local zhuangxian = _config:GetChild("btn_zhuangxiansuanfen").selected + + local qgdp = _config:GetController("qianggang").selectedIndex + local qianggang_dianpao = false + if qgdp == 1 then + qianggang_dianpao = true end ---------- - local _data = {} - _data["opt"] = round - _data["maxPlayers"] = people - - _data["niao"] = niao_type - if oldGameVersion==1 then + local _data = {} + _data["opt"] = round + _data["maxPlayers"] = people + + _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["zhuangxian"] = zhuangxian - _data["qidui"] = seven_pair + _data["qidui"] = seven_pair _data["hz_hu"] = hz_hu _data["dianpao"] = dianpao _data["bi_hu"] = bi_hu - _data["laizi"] = laizi + _data["laizi"] = laizi _data["qianggang_dianpao"] = qianggang_dianpao - - _data["AA"] = aa - + + _data["AA"] = aa + _data["piao_niao"] = piao_niao - + -- _data['piao1'] = piao1 -- _data['piao2'] = piao2 -- _data['piao3'] = piao3 - _data['xi_pai'] = xi_pai - + _data['xi_pai'] = xi_pai + -- auto_piao=false -- if piao_niao==2 then -- if piao1 or piao2 or piao3 then @@ -209,83 +196,81 @@ function M:SelectedConfigData() -- 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 - return _data -end + return _data +end function M:LoadConfigData(data) - local _config = self._config - _config:GetController("round").selectedIndex = data.opt -1 -- == 1 and 0 or 1 - _config:GetController("play_list").selectedIndex = data.maxPlayers-2 - - _config:GetChild("btn_qidui").selected = data.qidui - _config:GetChild("btn_zhuangxiansuanfen").selected = data.zhuangxian - _config:GetChild("btn_hongzhong").selected = data.laizi - _config:GetChild("btn_wuzhong").selected=data.hz_hu - _config:GetChild("btn_dianpaohu").selected=data.dianpao - _config:GetChild("btn_bihu").selected=data.bi_hu - --_config:GetChild("btn_buzhongsuanquanzhong").selected=data.buzhong - - if data.qianggang_dianpao==true then - _config:GetController("qianggang").selectedIndex=1 - else - _config:GetController("qianggang").selectedIndex=0 - end - - _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 -- == 1 and 0 or 1 + _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 + + _config:GetChild("btn_qidui").selected = data.qidui + _config:GetChild("btn_zhuangxiansuanfen").selected = data.zhuangxian + _config:GetChild("btn_hongzhong").selected = data.laizi + _config:GetChild("btn_wuzhong").selected = data.hz_hu + _config:GetChild("btn_dianpaohu").selected = data.dianpao + _config:GetChild("btn_bihu").selected = data.bi_hu + --_config:GetChild("btn_buzhongsuanquanzhong").selected=data.buzhong + + if data.qianggang_dianpao == true then + _config:GetController("qianggang").selectedIndex = 1 + else + _config:GetController("qianggang").selectedIndex = 0 + end + + _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:GetController("Cost").selectedIndex = data.AA or 0 + + _config:GetChild("btn_piao_niao").selected = data.piao_niao - _config:GetController("wowoniao").selectedIndex=data.niao_opt_score-1 - - _config:GetController("Cost").selectedIndex = data.AA or 0 - - _config:GetChild("btn_piao_niao").selected=data.piao_niao - -- 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("xipai") then - _config:GetChild("xipai").selected=data.xi_pai + + + + 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 - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 + 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 - - end - -return M - \ No newline at end of file +end + +return M diff --git a/lua_probject/extend_project/extend/poker/chuntian/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/chuntian/EXGameInfo.lua index aecc0c4e..0c17945e 100644 --- a/lua_probject/extend_project/extend/poker/chuntian/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/chuntian/EXGameInfo.lua @@ -7,93 +7,80 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = "EXGameInfo" UIPackage.AddPackage("extend/poker/chuntian/ui/Info_Poker_ChunTian") return self end function M:FillData(view, index) - self._maxPlayer = 4 -- 默认玩家人数 + self._maxPlayer = 4 -- 默认玩家人数 self._roundChoice = 5 -- 回合选项数 - - - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_ChunTian/Cgm_create_room") - - - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=0 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 0, nil) - gniv:Show() - - + self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_ChunTian/Cgm_create_room") + + + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 0 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + 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 value = limit + if otype == 1 then + value = value + ad2d(num) + elseif otype == -1 then + value = value - ad2d(num) + else + value = ad2d(num) 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 - + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 0, 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end end local _help_url = "ui://Info_Poker_ChunTian/Com_help" @@ -111,7 +98,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"单QKA2","去掉234"} +local _play_list = { "单QKA2", "去掉234" } function M:GetPlayList() return _play_list end @@ -122,9 +109,9 @@ function M:LoadConfigData(data) _config:GetController("Cost").selectedIndex = data.AA == 0 and 0 or 1 _config:GetController("player_num").selectedIndex = data.maxPlayers - 2 - _config:GetController("selectDiqu").selectedIndex = data.selectDiqu - _config:GetController("youdabida").selectedIndex = data.youdabida - _config:GetController("baodanbida").selectedIndex = data.baodanbida + _config:GetController("selectDiqu").selectedIndex = data.selectDiqu + _config:GetController("youdabida").selectedIndex = data.youdabida + _config:GetController("baodanbida").selectedIndex = data.baodanbida _config:GetController("sandaier").selectedIndex = data.sandaier _config:GetController("sidaiyi").selectedIndex = data.sidaiyi @@ -132,20 +119,19 @@ function M:LoadConfigData(data) _config:GetController("shachunfanbei").selectedIndex = data.shachunfanbei _config:GetController("ziranchunfanbei").selectedIndex = data.ziranchunfanbei _config:GetController("sigeAziranchun").selectedIndex = data.sigeAziranchun - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 - end - + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + 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 end function M:SelectedConfigData() @@ -157,20 +143,20 @@ function M:SelectedConfigData() local youdabida = _config:GetController("youdabida").selectedIndex local baodanbida = _config:GetController("baodanbida").selectedIndex local sandaier = _config:GetController("sandaier").selectedIndex - local sidaiyi = _config:GetController("sidaiyi").selectedIndex - local fanchun = _config:GetController("fanchun").selectedIndex - local shachunfanbei = _config:GetController("shachunfanbei").selectedIndex + local sidaiyi = _config:GetController("sidaiyi").selectedIndex + local fanchun = _config:GetController("fanchun").selectedIndex + local shachunfanbei = _config:GetController("shachunfanbei").selectedIndex local ziranchunfanbei = _config:GetController("ziranchunfanbei").selectedIndex local sigeAziranchun = _config:GetController("sigeAziranchun").selectedIndex - -----洗牌 - - local xi_pai=false - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end - - ---- + -----洗牌 + + local xi_pai = false + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end + + ---- local _data = {} _data["account_id"] = DataManager.SelfUser.Id _data["opt"] = round + 1 @@ -185,19 +171,19 @@ function M:SelectedConfigData() _data["shachunfanbei"] = shachunfanbei _data["ziranchunfanbei"] = ziranchunfanbei _data["sigeAziranchun"] = sigeAziranchun - - _data['xi_pai'] = xi_pai - - 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'] = xi_pai + + 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 * 100 + _data['an_chou_score'] = an_chou_score * 100 + return _data end diff --git a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua index 5e954803..1d351ea8 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua @@ -53,8 +53,8 @@ function M:FillData(view, index) 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 @@ -78,8 +78,8 @@ function M:FillData(view, index) 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 @@ -194,11 +194,11 @@ function M:LoadConfigData(data) if oldGameVersion == 2 then - self.xipaiValueText.text = data.xi_pai_score / 1000 - self.xipaiValue = data.xi_pai_score / 1000 + self.xipaiValueText.text = data.xi_pai_score / 100 + self.xipaiValue = data.xi_pai_score / 100 - self.anchouValueText.text = data.an_chou_score / 1000 - self.anchouValue = data.an_chou_score / 1000 + self.anchouValueText.text = data.an_chou_score / 100 + self.anchouValue = data.an_chou_score / 100 end end @@ -291,8 +291,8 @@ function M:SelectedConfigData() 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 return _data end diff --git a/lua_probject/extend_project/extend/poker/sanqianfen/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/sanqianfen/EXGameInfo.lua index 3478f206..6a52532a 100644 --- a/lua_probject/extend_project/extend/poker/sanqianfen/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/sanqianfen/EXGameInfo.lua @@ -7,70 +7,70 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = "EXGameInfo" UIPackage.AddPackage("extend/poker/sanqianfen/ui/Info_Poker_SanQianFen") return self end function M:FillData(view, index) - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 5 -- 回合选项数 - - if oldGameVersion==1 then - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") - else - self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") - end - - - -- if oldGameVersion==2 then - -- self._config:GetController("xipai").selectedIndex=0 - - -- self.xipaiValueText=self._config:GetChild('xipaifen') - -- self.xipaiValue=1 - - -- local btn_cr = self._config:GetChild('sdsrbtn') + + if oldGameVersion == 1 then + self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") + else + self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") + end + + + -- if oldGameVersion==2 then + -- self._config:GetController("xipai").selectedIndex=0 + + -- self.xipaiValueText=self._config:GetChild('xipaifen') + -- self.xipaiValue=1 + + -- 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 - - -- if value < 0 then - -- ViewUtil.ErrorTip(1,"输入数据异常!") - -- end - - -- self.xipaiValueText.text=value/1000 - -- self.xipaiValue=value/1000 - - -- end, 0, nil) - -- gniv:Show() - - + + -- 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.xipaiValueText.text=value/100 + -- self.xipaiValue=value/100 + + -- end, 0, nil) + -- gniv:Show() + + -- end -- ) - - -- end - - - + + -- end + + + self._config:GetChild("people_2").onClick:Set(function() self._config:GetController("rule").selectedIndex = 0 end) local piao = self._config:GetController("piao") local daniao = self._config:GetController("daniao") - + piao.onChanged:Add(function() if piao.selectedIndex ~= 0 then daniao.selectedIndex = 0 @@ -82,7 +82,6 @@ function M:FillData(view, index) piao.selectedIndex = 0 end end) - end local _help_url = "ui://Info_Poker_SanQianFen/Com_help" @@ -100,7 +99,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"15张玩法","16张玩法"} +local _play_list = { "15张玩法", "16张玩法" } function M:GetPlayList() return _play_list end @@ -130,7 +129,6 @@ function M:LoadConfigData(data) _config:GetChild("planelack").selected = false _config:GetChild("Threelack").selected = false - else _config:GetChild("sandaidan").selected = false @@ -151,7 +149,7 @@ function M:LoadConfigData(data) else _config:GetChild("boom_add").selected = false end - + _config:GetChild("ThreeA").selected = data.threeA == 1 and true or false if data.piao ~= nil then @@ -161,25 +159,24 @@ function M:LoadConfigData(data) if data.daniao ~= nil then _config:GetController("daniao").selectedIndex = data.daniao end - - if _config:GetChild("fourBeltThree") then - _config:GetChild("fourBeltThree").selected=data.fourDaiTwo - end - - if _config:GetChild("fourBeltTwo") then - _config:GetChild("fourBeltTwo").selected=data.fourDaiThree - end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - - -- if oldGameVersion==2 then - -- self.xipaiValueText.text=data.xi_pai_score - -- self.xipaiValue=data.xi_pai_score - -- end - + + if _config:GetChild("fourBeltThree") then + _config:GetChild("fourBeltThree").selected = data.fourDaiTwo + end + + if _config:GetChild("fourBeltTwo") then + _config:GetChild("fourBeltTwo").selected = data.fourDaiThree + end + + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end + + + -- if oldGameVersion==2 then + -- self.xipaiValueText.text=data.xi_pai_score + -- self.xipaiValue=data.xi_pai_score + -- end end function M:SelectedConfigData() @@ -205,27 +202,27 @@ function M:SelectedConfigData() local ba = _config:GetChild("boom_add").selected and 1 or 0 local fs = _config:GetChild("fan_sprint").selected and 1 or 0 - ----- - local fourDaiTwo=false - if _config:GetChild("fourBeltThree") then - fourDaiTwo = _config:GetChild("fourBeltThree").selected - end - - local fourDaiThree=false - if _config:GetChild("fourBeltTwo") then - fourDaiThree = _config:GetChild("fourBeltTwo").selected - end - - local xi_pai=false - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end + ----- + local fourDaiTwo = false + if _config:GetChild("fourBeltThree") then + fourDaiTwo = _config:GetChild("fourBeltThree").selected + end + + local fourDaiThree = false + if _config:GetChild("fourBeltTwo") then + fourDaiThree = _config:GetChild("fourBeltTwo").selected + end + + local xi_pai = false + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end local k_score = _config:GetController("jiang").selectedIndex local score_type = _config:GetController("pai").selectedIndex - - ---- + + ---- local _data = {} _data["account_id"] = DataManager.SelfUser.Id _data["opt"] = round + 1 @@ -246,20 +243,19 @@ function M:SelectedConfigData() _data["sandaidan"] = sandaidan _data["ba"] = ba _data["fs"] = fs - - _data["fourDaiTwo"] = fourDaiTwo - _data["fourDaiThree"] = fourDaiThree - _data["score_510k"] = k_score - _data["score_510k_type"] = score_type + _data["fourDaiTwo"] = fourDaiTwo + _data["fourDaiThree"] = fourDaiThree + + _data["score_510k"] = k_score + _data["score_510k_type"] = score_type + - if willBeOut == 1 then -- body _data["planelack"] = 0 _data["threelack"] = 0 else - if sandaidan == 1 then _data["planelack"] = 0 _data["threelack"] = 0 @@ -268,16 +264,16 @@ function M:SelectedConfigData() _data["threelack"] = threelack end end - - _data['xi_pai'] = xi_pai - - local xi_pai_score=0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue - end - - _data['xi_pai_score'] = xi_pai_score - + + _data['xi_pai'] = xi_pai + + local xi_pai_score = 0 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + end + + _data['xi_pai_score'] = xi_pai_score + return _data end diff --git a/lua_probject/extend_project/extend/zipai/changdepaohuzi/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/changdepaohuzi/EXGameInfo.lua index f9256127..db365d29 100644 --- a/lua_probject/extend_project/extend/zipai/changdepaohuzi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/changdepaohuzi/EXGameInfo.lua @@ -3,8 +3,8 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Extend_Poker_ChangdeWHZ') UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Info_Poker_ChangdeWHZ') @@ -12,93 +12,83 @@ function EXGameInfo.new(blur_view) end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_ChangdeWHZ/Cgm_create_room') - - if oldGameVersion ==1 then - self._config:GetChild("xipai").visible=false - end - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - self.xipaiValue=1 + if oldGameVersion == 1 then + self._config:GetChild("xipai").visible = false + end - 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + 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 value = limit + if otype == 1 then + value = value + ad2d(num) + elseif otype == -1 then + value = value - ad2d(num) + else + value = ad2d(num) 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() - - + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") end - ) - end - - + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end + + local btn_jia = self._config:GetChild('btn_jia') local btn_jian = self._config:GetChild('btn_jian') local btn_jia1 = self._config:GetChild('btn_jia1') local btn_jian1 = self._config:GetChild('btn_jian1') local btn_jia2 = self._config:GetChild('btn_jia2') local btn_jian2 = self._config:GetChild('btn_jian2') - -- local fS=self._config:GetChild('btn_round8'):GetChild("title") - -- fS.text="1局" - -- fS=self._config:GetChild('btn_round16'):GetChild("title") - -- fS.text="8局" + -- local fS=self._config:GetChild('btn_round8'):GetChild("title") + -- fS.text="1局" + -- fS=self._config:GetChild('btn_round16'):GetChild("title") + -- fS.text="8局" btn_jia.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then @@ -191,6 +181,7 @@ function M:FillData() end ) end + local _help_url = 'ui://Info_Poker_ChangdeWHZ/Com_help' function M:GetHelpUrl() return _help_url @@ -206,7 +197,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"全名堂","红黑点","多红多番"} +local _play_list = { "全名堂", "红黑点", "多红多番" } function M:GetPlayList() return _play_list end @@ -214,7 +205,7 @@ end function M:SelectedConfigData() local _config = self._config local wanfa_C = _config:GetController('btn_Controller').selectedIndex - local round = _config:GetController('round').selectedIndex+1 --== 0 and 1 or 2 + local round = _config:GetController('round').selectedIndex + 1 --== 0 and 1 or 2 local Cost = _config:GetController('Cost').selectedIndex local tun = _config:GetController('tun').selectedIndex local fengding = _config:GetController('fengding').selectedIndex @@ -232,30 +223,30 @@ function M:SelectedConfigData() local dihu = _config:GetController('dihu').selectedIndex local haihu = _config:GetController('haihu').selectedIndex local renshu = _config:GetController('renshu').selectedIndex == 0 and 2 or 3 - -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false + -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false local _data = {} - _data['opt'] = round -- 1 2 8局 16 局 + _data['opt'] = round -- 1 2 8局 16 局 _data['mode'] = wanfa_C + 1 -- 1 全名堂 2 红黑点 3 多红多番 _data['AA'] = Cost _data['maxPlayers'] = renshu if wanfa_C == 0 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 - _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 - _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 - _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 - _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 + _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 + _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 + _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 + _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 _data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选 - _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 - _data['siqi'] = siqi -- 四七红 0 不选 1 选 - _data['back'] = back -- 四七红 0 不选 1 选 - _data['yuan'] = yuan -- 四七红 0 不选 1 选 + _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 + _data['siqi'] = siqi -- 四七红 0 不选 1 选 + _data['back'] = back -- 四七红 0 不选 1 选 + _data['yuan'] = yuan -- 四七红 0 不选 1 选 elseif wanfa_C == 1 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 - _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 + _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 elseif wanfa_C == 2 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 + _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 _data['tianhu'] = tianhu _data['dihu'] = dihu _data['haihu'] = haihu @@ -266,28 +257,28 @@ function M:SelectedConfigData() if renshu == 2 then _data['qupai'] = false end - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end - end - _data['xi_pai'] = xi_pai + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end + end - local xi_pai_score=0 - local an_chou_score=0 + _data['xi_pai'] = xi_pai - 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 + local xi_pai_score = 0 + local an_chou_score = 0 - _data['xi_pai'] = xi_pai + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + an_chou_score = self.anchouValue + end + + _data['xi_pai_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 + + _data['xi_pai'] = xi_pai return _data end @@ -325,21 +316,21 @@ function M:LoadConfigData(data) if data.maxPlayers == 2 then --_config:GetController('qupai').selectedIndex = data.qupai == true and 1 or 0 end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 - 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 end + function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') @@ -350,4 +341,5 @@ function M:OnChangeOption(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameInfo.lua index 69ea9a41..18ae6cc5 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameInfo.lua @@ -3,8 +3,8 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') @@ -12,56 +12,49 @@ function EXGameInfo.new(blur_view) end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room') - - if oldGameVersion ==1 then - --self._config:GetChild("xipai").visible=false - end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - self.xipaiValue=1 + if oldGameVersion == 1 then + --self._config:GetChild("xipai").visible=false + 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 - - if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") - end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + self.xipaiValue = 1 + + + + 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 - ) - - end + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end end + local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help' function M:GetHelpUrl() return _help_url @@ -77,36 +70,35 @@ function M:GetIconUrl1() return _icon_url1 end - function M:SelectedConfigData() - local _config = self._config - local round = _config:GetController('round').selectedIndex+1 --局数 - local Cost = _config:GetController('Cost').selectedIndex - local renshu = _config:GetController('renshu').selectedIndex+2 --人数 - local shoupai = _config:GetController('shoupai').selectedIndex --手牌 - local choupai = _config:GetController('choupai').selectedIndex --抽牌 - local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 + local _config = self._config + local round = _config:GetController('round').selectedIndex + 1 --局数 + local Cost = _config:GetController('Cost').selectedIndex + local renshu = _config:GetController('renshu').selectedIndex + 2 --人数 + local shoupai = _config:GetController('shoupai').selectedIndex --手牌 + local choupai = _config:GetController('choupai').selectedIndex --抽牌 + local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 - local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15 + local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15 - local fengding = _config:GetController('fengding').selectedIndex+1 --多少起胡 0:6,1:10,2:15 + local fengding = _config:GetController('fengding').selectedIndex + 1 --多少起胡 0:6,1:10,2:15 --名堂-- - local tiandihu = _config:GetChild('btn_tiandihu').selected - local honghu = _config:GetChild('btn_honghu').selected - local shisanhong = _config:GetChild('btn_shisanhong').selected - local wuhu = _config:GetChild('btn_wuhu').selected - local yidianhong = _config:GetChild('btn_yidianhong').selected - local yikuaibian = _config:GetChild('btn_yikuaibian').selected - local haidihu = _config:GetChild('btn_haidihu').selected - local kahu = _config:GetChild('btn_kahu').selected - local mingwei = _config:GetChild('btn_mingwei').selected + local tiandihu = _config:GetChild('btn_tiandihu').selected + local honghu = _config:GetChild('btn_honghu').selected + local shisanhong = _config:GetChild('btn_shisanhong').selected + local wuhu = _config:GetChild('btn_wuhu').selected + local yidianhong = _config:GetChild('btn_yidianhong').selected + local yikuaibian = _config:GetChild('btn_yikuaibian').selected + local haidihu = _config:GetChild('btn_haidihu').selected + local kahu = _config:GetChild('btn_kahu').selected + local mingwei = _config:GetChild('btn_mingwei').selected - if shoupai==1 then - hunum=0 - end - if shoupai==0 and hunum==0 then + if shoupai == 1 then + hunum = 0 + end + if shoupai == 0 and hunum == 0 then _config:GetController('hunum').selectedIndex = 1 end @@ -115,73 +107,73 @@ function M:SelectedConfigData() _data['opt'] = round -- 1 2 8局 16 局 _data['AA'] = Cost _data['maxPlayers'] = renshu - _data['mode'] = round --模式: - _data['shoupai'] = shoupai --手牌 - _data["choupai"] = choupai --抽牌 - _data['hunum'] = hunum --胡息计算 - _data['daniao'] = daniao --打鸟 - _data['tiandihu'] = tiandihu --天地胡 - _data['honghu'] = honghu --红胡 - _data['shisanhong'] = shisanhong --十三红 - _data['wuhu'] = wuhu --乌胡 + _data['mode'] = round --模式: + _data['shoupai'] = shoupai --手牌 + _data["choupai"] = choupai --抽牌 + _data['hunum'] = hunum --胡息计算 + _data['daniao'] = daniao --打鸟 + _data['tiandihu'] = tiandihu --天地胡 + _data['honghu'] = honghu --红胡 + _data['shisanhong'] = shisanhong --十三红 + _data['wuhu'] = wuhu --乌胡 _data['yidianhong'] = yidianhong --一点红 _data['yikuaibian'] = yikuaibian --一块扁 - _data['haidiliao'] = haidihu --海底胡 - _data['kahu'] = kahu --卡胡 - _data['mingwei'] = mingwei --明偎 + _data['haidiliao'] = haidihu --海底胡 + _data['kahu'] = kahu --卡胡 + _data['mingwei'] = mingwei --明偎 _data['fengding'] = fengding - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - --xi_pai = _config:GetChild("xipai").selected + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + --xi_pai = _config:GetChild("xipai").selected xi_pai = true - end - end + end + end - _data['xi_pai'] = xi_pai - local xi_pai_score=0 + _data['xi_pai'] = xi_pai + local xi_pai_score = 0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue - end - _data['xi_pai_score'] = xi_pai_score*1000 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + end + _data['xi_pai_score'] = xi_pai_score * 100 return _data end function M:LoadConfigData(data) local _config = self._config - -- data.mode=3 + -- data.mode=3 _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 _config:GetController('shoupai').selectedIndex = data.shoupai --手牌 _config:GetController('choupai').selectedIndex = data.choupai --抽牌 - _config:GetController('hunum').selectedIndex = data.hunum --起胡息 - _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打,1:10,2:20,3:50 - _config:GetController('fengding').selectedIndex = data.fengding-1 + _config:GetController('hunum').selectedIndex = data.hunum --起胡息 + _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打,1:10,2:20,3:50 + _config:GetController('fengding').selectedIndex = data.fengding - 1 - _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 - _config:GetChild('btn_honghu').selected = data.honghu --红胡 + _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 + _config:GetChild('btn_honghu').selected = data.honghu --红胡 _config:GetChild('btn_shisanhong').selected = data.shisanhong --十三红 - _config:GetChild('btn_wuhu').selected = data.wuhu --乌胡 + _config:GetChild('btn_wuhu').selected = data.wuhu --乌胡 _config:GetChild('btn_yidianhong').selected = data.yidianhong --一点红 _config:GetChild('btn_yikuaibian').selected = data.yikuaibian --一块扁 - _config:GetChild('btn_haidihu').selected = data.haidihu --海底胡 - _config:GetChild('btn_kahu').selected = data.kahu --卡胡 - _config:GetChild('btn_mingwei').selected = data.mingwei --明偎 + _config:GetChild('btn_haidihu').selected = data.haidihu --海底胡 + _config:GetChild('btn_kahu').selected = data.kahu --卡胡 + _config:GetChild('btn_mingwei').selected = data.mingwei --明偎 - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 - end - + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score / 100 + self.xipaiValue = data.xi_pai_score / 100 + end end + function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') @@ -192,4 +184,5 @@ function M:OnChangeOption(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua index 1969f2d8..24f51466 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa_bak2/EXGameInfo.lua @@ -3,8 +3,8 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') @@ -12,56 +12,49 @@ function EXGameInfo.new(blur_view) end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room') - - if oldGameVersion ==1 then - --self._config:GetChild("xipai").visible=false - end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - self.xipaiValue=1 + if oldGameVersion == 1 then + --self._config:GetChild("xipai").visible=false + 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 - - if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") - end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + self.xipaiValue = 1 + + + + 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 - ) - - end + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end end + local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help' function M:GetHelpUrl() return _help_url @@ -77,35 +70,34 @@ function M:GetIconUrl1() return _icon_url1 end - function M:SelectedConfigData() - local _config = self._config - local round = _config:GetController('round').selectedIndex+1 --局数 - local Cost = _config:GetController('Cost').selectedIndex - local renshu = _config:GetController('renshu').selectedIndex+2 --人数 - local shoupai = _config:GetController('shoupai').selectedIndex --手牌 - local choupai = _config:GetController('choupai').selectedIndex --抽牌 - local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 + local _config = self._config + local round = _config:GetController('round').selectedIndex + 1 --局数 + local Cost = _config:GetController('Cost').selectedIndex + local renshu = _config:GetController('renshu').selectedIndex + 2 --人数 + local shoupai = _config:GetController('shoupai').selectedIndex --手牌 + local choupai = _config:GetController('choupai').selectedIndex --抽牌 + local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 - local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15 + local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15 --名堂-- - local tiandihu = _config:GetChild('btn_tiandihu').selected - local honghu = _config:GetChild('btn_honghu').selected - local shisanhong = _config:GetChild('btn_shisanhong').selected - local wuhu = _config:GetChild('btn_wuhu').selected - local yidianhong = _config:GetChild('btn_yidianhong').selected - local yikuaibian = _config:GetChild('btn_yikuaibian').selected - local haidihu = _config:GetChild('btn_haidihu').selected - local kahu = _config:GetChild('btn_kahu').selected - local mingwei = _config:GetChild('btn_mingwei').selected + local tiandihu = _config:GetChild('btn_tiandihu').selected + local honghu = _config:GetChild('btn_honghu').selected + local shisanhong = _config:GetChild('btn_shisanhong').selected + local wuhu = _config:GetChild('btn_wuhu').selected + local yidianhong = _config:GetChild('btn_yidianhong').selected + local yikuaibian = _config:GetChild('btn_yikuaibian').selected + local haidihu = _config:GetChild('btn_haidihu').selected + local kahu = _config:GetChild('btn_kahu').selected + local mingwei = _config:GetChild('btn_mingwei').selected - if shoupai==1 then - hunum=0 - end - if shoupai==0 and hunum==0 then + if shoupai == 1 then + hunum = 0 + end + if shoupai == 0 and hunum == 0 then _config:GetController('hunum').selectedIndex = 1 end @@ -114,70 +106,70 @@ function M:SelectedConfigData() _data['opt'] = round -- 1 2 8局 16 局 _data['AA'] = Cost _data['maxPlayers'] = renshu - _data['shoupai'] = shoupai --手牌 - _data["choupai"] = choupai --抽牌 - _data['hunum'] = hunum --胡息计算 - _data['daniao'] = daniao --打鸟 - _data['tiandihu'] = tiandihu --天地胡 - _data['honghu'] = honghu --红胡 - _data['shisanhong'] = shisanhong --十三红 - _data['wuhu'] = wuhu --乌胡 + _data['shoupai'] = shoupai --手牌 + _data["choupai"] = choupai --抽牌 + _data['hunum'] = hunum --胡息计算 + _data['daniao'] = daniao --打鸟 + _data['tiandihu'] = tiandihu --天地胡 + _data['honghu'] = honghu --红胡 + _data['shisanhong'] = shisanhong --十三红 + _data['wuhu'] = wuhu --乌胡 _data['yidianhong'] = yidianhong --一点红 _data['yikuaibian'] = yikuaibian --一块扁 - _data['haidiliao'] = haidihu --海底胡 - _data['kahu'] = kahu --卡胡 - _data['mingwei'] = mingwei --明偎 + _data['haidiliao'] = haidihu --海底胡 + _data['kahu'] = kahu --卡胡 + _data['mingwei'] = mingwei --明偎 - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - --xi_pai = _config:GetChild("xipai").selected + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + --xi_pai = _config:GetChild("xipai").selected xi_pai = true - end - end + end + end - _data['xi_pai'] = xi_pai - local xi_pai_score=0 + _data['xi_pai'] = xi_pai + local xi_pai_score = 0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue - end - _data['xi_pai_score'] = xi_pai_score*1000 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + end + _data['xi_pai_score'] = xi_pai_score * 100 return _data end function M:LoadConfigData(data) local _config = self._config - -- data.mode=3 + -- data.mode=3 _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 _config:GetController('shoupai').selectedIndex = data.shoupai --手牌 _config:GetController('choupai').selectedIndex = data.choupai --抽牌 - _config:GetController('hunum').selectedIndex = data.hunum --起胡息 - _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打,1:10,2:20,3:50 + _config:GetController('hunum').selectedIndex = data.hunum --起胡息 + _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打,1:10,2:20,3:50 - _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 - _config:GetChild('btn_honghu').selected = data.honghu --红胡 + _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 + _config:GetChild('btn_honghu').selected = data.honghu --红胡 _config:GetChild('btn_shisanhong').selected = data.shisanhong --十三红 - _config:GetChild('btn_wuhu').selected = data.wuhu --乌胡 + _config:GetChild('btn_wuhu').selected = data.wuhu --乌胡 _config:GetChild('btn_yidianhong').selected = data.yidianhong --一点红 _config:GetChild('btn_yikuaibian').selected = data.yikuaibian --一块扁 - _config:GetChild('btn_haidihu').selected = data.haidihu --海底胡 - _config:GetChild('btn_kahu').selected = data.kahu --卡胡 - _config:GetChild('btn_mingwei').selected = data.mingwei --明偎 - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 - end + _config:GetChild('btn_haidihu').selected = data.haidihu --海底胡 + _config:GetChild('btn_kahu').selected = data.kahu --卡胡 + _config:GetChild('btn_mingwei').selected = data.mingwei --明偎 + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score / 100 + self.xipaiValue = data.xi_pai_score / 100 + end end + function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') @@ -188,4 +180,5 @@ function M:OnChangeOption(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/fulushou/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/fulushou/EXGameInfo.lua index 8a7e3e96..2910a7e9 100644 --- a/lua_probject/extend_project/extend/zipai/fulushou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/fulushou/EXGameInfo.lua @@ -3,144 +3,133 @@ 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/zipai/fulushou/ui/Info_Poker_FuLuShou') - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = 'EXGameInfo' + UIPackage.AddPackage('extend/zipai/fulushou/ui/Info_Poker_FuLuShou') + return self end function M:FillData() printlog("jefe fulushou") - self._maxPlayer = 3 -- 默认玩家人数 - self._roundChoice = 2 -- 回合选项数 - self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FuLuShou/Cgm_create_room') - if oldGameVersion ==1 then - self._config:GetController("xipai").selectedIndex=0 + self._maxPlayer = 3 -- 默认玩家人数 + self._roundChoice = 2 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FuLuShou/Cgm_create_room') + if oldGameVersion == 1 then + self._config:GetController("xipai").selectedIndex = 0 end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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 = 1 + + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + 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 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.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( + 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.anchouValueText.text=value/1000 - self.anchouValue=value/1000 - + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) end - end + local _help_url = 'ui://Info_Poker_FuLuShou/Com_help' function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_Poker_FuLuShou/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_Poker_FuLuShou/icon1" function M:GetIconUrl1() - return _icon_url1 + return _icon_url1 end --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 == 0 and 1 or 2 - local renshu = _config:GetController('play_list').selectedIndex +2 - - local xuan_zhuang=_config:GetController('zhuangjia').selectedIndex - local piao=_config:GetController('piao').selectedIndex - local piao1=false - local piao2=false - local piao3=false - local piao4=false - if piao==3 then - piao1=_config:GetChild('pf1').selected and true or false - piao2=_config:GetChild('pf2').selected and true or false - piao3=_config:GetChild('pf3').selected and true or false - piao4=_config:GetChild('pf4').selected and true or false + local _config = self._config + local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 + local renshu = _config:GetController('play_list').selectedIndex + 2 + + local xuan_zhuang = _config:GetController('zhuangjia').selectedIndex + local piao = _config:GetController('piao').selectedIndex + local piao1 = false + local piao2 = false + local piao3 = false + local piao4 = false + if piao == 3 then + piao1 = _config:GetChild('pf1').selected and true or false + piao2 = _config:GetChild('pf2').selected and true or false + piao3 = _config:GetChild('pf3').selected and true or false + piao4 = _config:GetChild('pf4').selected and true or false end - local fen_diejia=_config:GetController('fen').selectedIndex - - local qing_zui_hu=_config:GetController('qinzuihu').selectedIndex - local gang_zhao_liu_xi=_config:GetChild('gangzhao').selected and true or false - local special_peng_peng_hu=_config:GetChild('pengpenghu').selected and true or false - + local fen_diejia = _config:GetController('fen').selectedIndex + + local qing_zui_hu = _config:GetController('qinzuihu').selectedIndex + local gang_zhao_liu_xi = _config:GetChild('gangzhao').selected and true or false + local special_peng_peng_hu = _config:GetChild('pengpenghu').selected and true or false + local piao_fen = _config:GetController('piaofen').selectedIndex - - - local _data = {} - _data['opt'] = round -- 1 2 8局 16 局 - _data['maxPlayers'] = renshu + + + local _data = {} + _data['opt'] = round -- 1 2 8局 16 局 + _data['maxPlayers'] = renshu _data['xuan_zhuang'] = xuan_zhuang _data['piao'] = piao _data['piao1'] = piao1 @@ -160,42 +149,42 @@ function M:SelectedConfigData() elseif (piao_fen == 3) then _data["piao_fen"] = 5 end - - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then + + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then xi_pai = _config:GetChild("xipai").selected end end _data['xi_pai'] = xi_pai - - 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 - - - return _data + + _data['xi_pai_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 + + + return _data end function M:LoadConfigData(data) - local _config = self._config + local _config = self._config - _config:GetController('play_list').selectedIndex = data.maxPlayers -2 - _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 - _config:GetController('zhuangjia').selectedIndex= data.xuan_zhuang - _config:GetController('piao').selectedIndex= data.piao - _config:GetChild('pf1').selected=data.piao1 - _config:GetChild('pf2').selected=data.piao2 - _config:GetChild('pf3').selected=data.piao3 - _config:GetChild('pf4').selected=data.piao4 + _config:GetController('play_list').selectedIndex = data.maxPlayers - 2 + _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 + _config:GetController('zhuangjia').selectedIndex = data.xuan_zhuang + _config:GetController('piao').selectedIndex = data.piao + _config:GetChild('pf1').selected = data.piao1 + _config:GetChild('pf2').selected = data.piao2 + _config:GetChild('pf3').selected = data.piao3 + _config:GetChild('pf4').selected = data.piao4 if (data.piao_fen == 1) then _config:GetController('piaofen').selectedIndex = 0 @@ -207,37 +196,37 @@ function M:LoadConfigData(data) _config:GetController('piaofen').selectedIndex = 3 end - - - _config:GetController('fen').selectedIndex= data.fen_diejia - _config:GetController('qinzuihu').selectedIndex= data.qing_zui_hu + + _config:GetController('fen').selectedIndex = data.fen_diejia + + _config:GetController('qinzuihu').selectedIndex = data.qing_zui_hu _config:GetChild('gangzhao').selected = data.gang_zhao_liu_xi - _config:GetChild('pengpenghu').selected= data.special_peng_peng_hu - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + _config:GetChild('pengpenghu').selected = data.special_peng_peng_hu - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + 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 - end function M:OnChangeOption(ctype) - IGameInfo.OnChangeOption(self, ctype) + IGameInfo.OnChangeOption(self, ctype) - local play_list = self._config:GetController('play_list') - play_list.onChanged:Add( - function() - self._maxPlayer = play_list.selectedIndex +2 - self:ShowVariablePrice(ctype) - end - ) + local play_list = self._config:GetController('play_list') + play_list.onChanged:Add( + function() + self._maxPlayer = play_list.selectedIndex + 2 + self:ShowVariablePrice(ctype) + end + ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/hsrunbeard/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/hsrunbeard/EXGameInfo.lua index c8b19643..0f21d8e3 100644 --- a/lua_probject/extend_project/extend/zipai/hsrunbeard/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/hsrunbeard/EXGameInfo.lua @@ -3,19 +3,19 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/hsrunbeard/ui/Info_Poker_HSRunBeard') - + return self end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 2 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_HSRunBeard/Cgm_create_room') - + local btn_jia = self._config:GetChild('btn_jia') local btn_jian = self._config:GetChild('btn_jian') @@ -23,10 +23,10 @@ function M:FillData() local btn_jian1 = self._config:GetChild('btn_jian1') local btn_jia2 = self._config:GetChild('btn_jia2') local btn_jian2 = self._config:GetChild('btn_jian2') - local fS=self._config:GetChild('btn_round8'):GetChild("title") - fS.text="1局" - fS=self._config:GetChild('btn_round16'):GetChild("title") - fS.text="8局" + local fS = self._config:GetChild('btn_round8'):GetChild("title") + fS.text = "1局" + fS = self._config:GetChild('btn_round16'):GetChild("title") + fS.text = "8局" btn_jia.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then @@ -61,7 +61,6 @@ function M:FillData() function() local cur_tun = tonumber(self._config:GetChild("shu1").text) if cur_tun < 15 then - cur_tun = cur_tun + 1 self._config:GetChild("shu1").text = tostring(cur_tun) @@ -79,7 +78,6 @@ function M:FillData() function() local cur_tun = tonumber(self._config:GetChild("shu1").text) if cur_tun > 1 then - cur_tun = cur_tun - 1 self._config:GetChild("shu1").text = tostring(cur_tun) @@ -124,51 +122,44 @@ function M:FillData() end end ) - - if oldGameVersion ==1 then - self._config:GetController("xipai").selectedIndex=0 - end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValue=1 - - 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 - - if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") - end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + + if oldGameVersion == 1 then + self._config:GetController("xipai").selectedIndex = 0 + end + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValue = 1 + + 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 - ) - - end - - + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end end + local _help_url = 'ui://Info_Poker_HSRunBeard/Com_help' function M:GetHelpUrl() return _help_url @@ -184,7 +175,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"三人玩法","二人玩法"} +local _play_list = { "三人玩法", "二人玩法" } function M:GetPlayList() return _play_list end @@ -209,31 +200,31 @@ function M:SelectedConfigData() local tianhu = _config:GetController('tianhu').selectedIndex local dihu = _config:GetController('dihu').selectedIndex local haihu = _config:GetController('haihu').selectedIndex - local renshu = _config:GetController('play_list').selectedIndex +2 + local renshu = _config:GetController('play_list').selectedIndex + 2 local qupai = _config:GetController('qupai').selectedIndex local dhdf = 0 local _data = {} _data['opt'] = round -- 1 2 8局 16 局 - _data['mode'] = 2 -- 1 全名堂 2 红黑点 3 多红多番 + _data['mode'] = 2 -- 1 全名堂 2 红黑点 3 多红多番 _data['AA'] = Cost _data['maxPlayers'] = renshu if wanfa_C == 0 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 - _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 - _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 - _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 - _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 + _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 + _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 + _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 + _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 _data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选 - _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 - _data['siqi'] = siqi -- 四七红 0 不选 1 选 - _data['back'] = back -- 四七红 0 不选 1 选 - _data['yuan'] = yuan -- 四七红 0 不选 1 选 + _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 + _data['siqi'] = siqi -- 四七红 0 不选 1 选 + _data['back'] = back -- 四七红 0 不选 1 选 + _data['yuan'] = yuan -- 四七红 0 不选 1 选 elseif wanfa_C == 1 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 - _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 + _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 _data['hh'] = _config:GetController('hh').selectedIndex _data['dh'] = _config:GetController('dh').selectedIndex @@ -244,7 +235,6 @@ function M:SelectedConfigData() _data['jhd'] = _config:GetController('jhd').selectedIndex _data['dhdf'] = dhdf - elseif wanfa_C == 2 then _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 _data['tianhu'] = tianhu @@ -257,33 +247,33 @@ function M:SelectedConfigData() if renshu == 2 then _data['qupai'] = qupai end - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end - end - - _data['xi_pai'] = xi_pai - - local xi_pai_score=0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue - end - - _data['xi_pai_score'] = xi_pai_score - + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end + end + + _data['xi_pai'] = xi_pai + + local xi_pai_score = 0 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue + end + + _data['xi_pai_score'] = xi_pai_score + return _data end function M:LoadConfigData(data) local _config = self._config - _config:GetController('play_list').selectedIndex = data.maxPlayers -2 + _config:GetController('play_list').selectedIndex = data.maxPlayers - 2 _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA - _config:GetController('renshu').selectedIndex = data.maxPlayers -2 + _config:GetController('renshu').selectedIndex = data.maxPlayers - 2 data.hh = data.hh == nil and 1 or data.hh data.dh = data.dh == nil and 1 or data.dh @@ -307,9 +297,7 @@ function M:LoadConfigData(data) _config:GetController('tinghu').selectedIndex = data.tinghu _config:GetController('Back').selectedIndex = data.back _config:GetController('yuan').selectedIndex = data.yuan - elseif data.mode == 2 then - _config:GetChild("shu1").text = tostring(data.tun) local btn_jian1 = _config:GetChild("btn_jian1") @@ -338,10 +326,9 @@ function M:LoadConfigData(data) _config:GetController('hd').selectedIndex = data.hd _config:GetController('wd').selectedIndex = data.wd _config:GetController('jhd').selectedIndex = data.jhd - + _config:GetController('dhdf').selectedIndex = data.dhdf elseif data.mode == 3 then - _config:GetController('haihu').selectedIndex = data.haihu _config:GetController('tinghu').selectedIndex = data.tinghu _config:GetController('tianhu').selectedIndex = data.tianhu @@ -354,15 +341,15 @@ function M:LoadConfigData(data) if data.maxPlayers == 2 then _config:GetController('qupai').selectedIndex = data.qupai end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score - self.xipaiValue=data.xi_pai_score - end + + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end + + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score + self.xipaiValue = data.xi_pai_score + end end function M:OnChangeOption(ctype) @@ -371,9 +358,10 @@ function M:OnChangeOption(ctype) local play_list = self._config:GetController('play_list') play_list.onChanged:Add( function() - self._maxPlayer = play_list.selectedIndex +2 + self._maxPlayer = play_list.selectedIndex + 2 self:ShowVariablePrice(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/runbeard/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/runbeard/EXGameInfo.lua index a6aee365..cf46a624 100644 --- a/lua_probject/extend_project/extend/zipai/runbeard/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/runbeard/EXGameInfo.lua @@ -3,8 +3,8 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/runbeard/ui/Extend_Poker_RunBeard') UIPackage.AddPackage('extend/zipai/runbeard/ui/Info_Poker_RunBeard') @@ -12,96 +12,85 @@ function EXGameInfo.new(blur_view) end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_RunBeard/Cgm_create_room') - - if oldGameVersion ==1 then - --self._config:GetChild("xipai").visible=false - end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - self.xipaiValue=1 + if oldGameVersion == 1 then + --self._config:GetChild("xipai").visible=false + end - 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 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.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + 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 value = limit + if otype == 1 then + value = value + ad2d(num) + elseif otype == -1 then + value = value - ad2d(num) + else + value = ad2d(num) 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() - - + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") end - ) - - end - + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 / 100 + self.anchouValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end + + local btn_jia = self._config:GetChild('btn_jia') local btn_jian = self._config:GetChild('btn_jian') local btn_jia1 = self._config:GetChild('btn_jia1') local btn_jian1 = self._config:GetChild('btn_jian1') --local btn_jia2 = self._config:GetChild('btn_jia2') local btn_jian2 = self._config:GetChild('btn_jian2') - -- local fS=self._config:GetChild('btn_round8'):GetChild("title") - -- fS.text="1局" - -- fS=self._config:GetChild('btn_round16'):GetChild("title") - -- fS.text="8局" + -- local fS=self._config:GetChild('btn_round8'):GetChild("title") + -- fS.text="1局" + -- fS=self._config:GetChild('btn_round16'):GetChild("title") + -- fS.text="8局" btn_jia.onClick:Set( function() if self._config:GetController('tun').selectedIndex ~= 5 then @@ -162,38 +151,39 @@ function M:FillData() end end ) - + --btn_jia2.onClick:Set( - -- function() - -- if self._config:GetController('tun').selectedIndex ~= 5 then - -- self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1 - -- end - -- if self._config:GetController('tun').selectedIndex == 5 then - -- btn_jia2.touchable = false - -- btn_jia2.grayed = true - -- end - -- if self._config:GetController('tun').selectedIndex > 0 then - -- btn_jian2.touchable = true - -- btn_jian2.grayed = false - -- end - -- end - -- ) - -- btn_jian2.onClick:Set( - -- function() - -- if self._config:GetController('tun').selectedIndex ~= 0 then - -- self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1 - -- end - -- if self._config:GetController('tun').selectedIndex == 0 then - -- btn_jian2.touchable = false - -- btn_jian2.grayed = true - -- end - -- if self._config:GetController('tun').selectedIndex < 5 then - -- btn_jia2.touchable = true - -- btn_jia2.grayed = false - -- end - -- end - -- ) + -- function() + -- if self._config:GetController('tun').selectedIndex ~= 5 then + -- self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1 + -- end + -- if self._config:GetController('tun').selectedIndex == 5 then + -- btn_jia2.touchable = false + -- btn_jia2.grayed = true + -- end + -- if self._config:GetController('tun').selectedIndex > 0 then + -- btn_jian2.touchable = true + -- btn_jian2.grayed = false + -- end + -- end + -- ) + -- btn_jian2.onClick:Set( + -- function() + -- if self._config:GetController('tun').selectedIndex ~= 0 then + -- self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1 + -- end + -- if self._config:GetController('tun').selectedIndex == 0 then + -- btn_jian2.touchable = false + -- btn_jian2.grayed = true + -- end + -- if self._config:GetController('tun').selectedIndex < 5 then + -- btn_jia2.touchable = true + -- btn_jia2.grayed = false + -- end + -- end + -- ) end + local _help_url = 'ui://Info_Poker_RunBeard/Com_help' function M:GetHelpUrl() return _help_url @@ -209,7 +199,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"多红多番","红黑点","全名堂"} +local _play_list = { "多红多番", "红黑点", "全名堂" } function M:GetPlayList() return _play_list end @@ -217,7 +207,7 @@ end function M:SelectedConfigData() local _config = self._config local wanfa_C = _config:GetController('btn_Controller').selectedIndex - local round = _config:GetController('round').selectedIndex+1 --== 0 and 1 or 2 + local round = _config:GetController('round').selectedIndex + 1 --== 0 and 1 or 2 local Cost = _config:GetController('Cost').selectedIndex local tun = _config:GetController('tun').selectedIndex local fengding = _config:GetController('fengding').selectedIndex @@ -237,22 +227,22 @@ function M:SelectedConfigData() local haihu = _config:GetController('haihu').selectedIndex local renshu = _config:GetController('renshu').selectedIndex == 0 and 2 or 3 - local qixihu = _config:GetController('qixihu').selectedIndex --起息胡 - local weipai = _config:GetController('weipai').selectedIndex --偎牌 + local qixihu = _config:GetController('qixihu').selectedIndex --起息胡 + local weipai = _config:GetController('weipai').selectedIndex --偎牌 local xidouble30 = _config:GetController('xidouble30').selectedIndex --30息胡翻倍 - local zimo = _config:GetController('zimo').selectedIndex --自摸加3 - local daxiaozi = _config:GetController('daxiaozi').selectedIndex --大小胡 - local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 - local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 + local zimo = _config:GetController('zimo').selectedIndex --自摸加3 + local daxiaozi = _config:GetController('daxiaozi').selectedIndex --大小胡 + local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 + local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 - local qupai=0 - if renshu==2 then - qupai=_config:GetController('qupai').selectedIndex - end + local qupai = 0 + if renshu == 2 then + qupai = _config:GetController('qupai').selectedIndex + end -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false local _data = {} --wanfa_C=2 - _data['opt'] = round -- 1 2 8局 16 局 + _data['opt'] = round -- 1 2 8局 16 局 _data['mode'] = wanfa_C + 1 -- 1 全名堂 2 红黑点 3 多红多番 _data['AA'] = Cost _data['maxPlayers'] = renshu @@ -273,59 +263,58 @@ function M:SelectedConfigData() _data['daxiaozi'] = daxiaozi _data['hongheihu'] = hongheihu _data['yidianhu'] = yidianhu - elseif wanfa_C == 1 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 - _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 + _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 elseif wanfa_C == 2 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 - _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 - _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 - _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 - _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 + _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 + _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 + _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 + _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 _data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选 - _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 - _data['siqi'] = siqi -- 四七红 0 不选 1 选 - _data['back'] = back -- 四七红 0 不选 1 选 - _data['yuan'] = yuan -- 四七红 0 不选 1 选 + _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 + _data['siqi'] = siqi -- 四七红 0 不选 1 选 + _data['back'] = back -- 四七红 0 不选 1 选 + _data['yuan'] = yuan -- 四七红 0 不选 1 选 end - -- if renshu == 2 then - -- _data['qupai'] = false - -- end - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end - end + -- if renshu == 2 then + -- _data['qupai'] = false + -- end - _data['xi_pai'] = xi_pai + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end + end + + _data['xi_pai'] = xi_pai + + 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 * 100 + _data['an_chou_score'] = an_chou_score * 100 - 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 - return _data end function M:LoadConfigData(data) local _config = self._config - -- data.mode=3 + -- data.mode=3 _config:GetController('btn_Controller').selectedIndex = data.mode - 1 _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 - - + + if data.mode == 1 then _config:GetController('haihu').selectedIndex = 0 @@ -344,13 +333,11 @@ function M:LoadConfigData(data) _config:GetController('daxiaozi').selectedIndex = data.daxiaozi _config:GetController('hongheihu').selectedIndex = data.hongheihu _config:GetController('yidianhu').selectedIndex = data.yidianhu - elseif data.mode == 2 then _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('duizifu').selectedIndex = data.duizifu elseif data.mode == 3 then - _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('tuanyuan').selectedIndex = data.tuanyuan @@ -366,21 +353,21 @@ function M:LoadConfigData(data) if data.maxPlayers == 2 then --_config:GetController('qupai').selectedIndex = data.qupai == true and 1 or 0 end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 - 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 end + function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') @@ -391,4 +378,5 @@ function M:OnChangeOption(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/shihuka/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/shihuka/EXGameInfo.lua index 408d2030..15fee978 100644 --- a/lua_probject/extend_project/extend/zipai/shihuka/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/shihuka/EXGameInfo.lua @@ -3,8 +3,8 @@ local EXGameInfo = {} local M = EXGameInfo function EXGameInfo.new(blur_view) - setmetatable(M, {__index = IGameInfo}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) self.class = 'EXGameInfo' UIPackage.AddPackage('extend/zipai/shihuka/ui/Extend_Poker_ShiHuKa') UIPackage.AddPackage('extend/zipai/shihuka/ui/Info_Poker_ShiHuKa') @@ -12,57 +12,49 @@ function EXGameInfo.new(blur_view) end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 + self._maxPlayer = 3 -- 默认玩家人数 self._roundChoice = 3 -- 回合选项数 self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_ShiHuKa/Cgm_create_room') - - if oldGameVersion ==1 then - --self._config:GetChild("xipai").visible=false - end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - self.xipaiValue=1 + if oldGameVersion == 1 then + --self._config:GetChild("xipai").visible=false + 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 - - if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") - end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + self.xipaiValue = 1 + + + + 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 - ) - - end - - + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) + end end + local _help_url = 'ui://Info_Poker_ShiHuKa/Com_help' function M:GetHelpUrl() return _help_url @@ -78,7 +70,7 @@ function M:GetIconUrl1() return _icon_url1 end -local _play_list = {"多红多番","红黑点","全名堂"} +local _play_list = { "多红多番", "红黑点", "全名堂" } function M:GetPlayList() return _play_list end @@ -86,7 +78,7 @@ end function M:SelectedConfigData() local _config = self._config local wanfa_C = _config:GetController('btn_Controller').selectedIndex - local round = _config:GetController('round').selectedIndex+1 --== 0 and 1 or 2 + local round = _config:GetController('round').selectedIndex + 1 --== 0 and 1 or 2 local Cost = _config:GetController('Cost').selectedIndex local tun = _config:GetController('tun').selectedIndex local fengding = _config:GetController('fengding').selectedIndex @@ -106,22 +98,22 @@ function M:SelectedConfigData() local haihu = _config:GetController('haihu').selectedIndex local renshu = _config:GetController('renshu').selectedIndex == 0 and 2 or 3 - local qixihu = _config:GetController('qixihu').selectedIndex --起息胡 - local weipai = _config:GetController('weipai').selectedIndex --偎牌 + local qixihu = _config:GetController('qixihu').selectedIndex --起息胡 + local weipai = _config:GetController('weipai').selectedIndex --偎牌 local xidouble30 = _config:GetController('xidouble30').selectedIndex --30息胡翻倍 - local zimo = _config:GetController('zimo').selectedIndex --自摸加3 - local daxiaozi = _config:GetController('daxiaozi').selectedIndex --大小胡 - local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 - local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 + local zimo = _config:GetController('zimo').selectedIndex --自摸加3 + local daxiaozi = _config:GetController('daxiaozi').selectedIndex --大小胡 + local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 + local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 - local qupai=0 - if renshu==2 then - qupai=_config:GetController('qupai').selectedIndex - end + local qupai = 0 + if renshu == 2 then + qupai = _config:GetController('qupai').selectedIndex + end -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false local _data = {} --wanfa_C=2 - _data['opt'] = round -- 1 2 8局 16 局 + _data['opt'] = round -- 1 2 8局 16 局 _data['mode'] = wanfa_C + 1 -- 1 全名堂 2 红黑点 3 多红多番 _data['AA'] = Cost _data['maxPlayers'] = renshu @@ -142,59 +134,58 @@ function M:SelectedConfigData() _data['daxiaozi'] = daxiaozi _data['hongheihu'] = hongheihu _data['yidianhu'] = yidianhu - elseif wanfa_C == 1 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 - _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 + _data['duizifu'] = duizifu -- 对子胡 0 不选 1 选 elseif wanfa_C == 2 then - _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 - _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 - _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 - _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 - _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 - _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 + _data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5 + _data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶 + _data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选 + _data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选 + _data['shuahou'] = shuahou -- 耍猴 0 不选 1 选 + _data['huangfan'] = huangfan -- 黄番 0 不选 1 选 _data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选 - _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 - _data['siqi'] = siqi -- 四七红 0 不选 1 选 - _data['back'] = back -- 四七红 0 不选 1 选 - _data['yuan'] = yuan -- 四七红 0 不选 1 选 + _data['tinghu'] = tinghu -- 听胡 0 不选 1 选 + _data['siqi'] = siqi -- 四七红 0 不选 1 选 + _data['back'] = back -- 四七红 0 不选 1 选 + _data['yuan'] = yuan -- 四七红 0 不选 1 选 end - -- if renshu == 2 then - -- _data['qupai'] = false - -- end - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then - xi_pai = _config:GetChild("xipai").selected - end - end + -- if renshu == 2 then + -- _data['qupai'] = false + -- end - _data['xi_pai'] = xi_pai + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then + xi_pai = _config:GetChild("xipai").selected + end + end + + _data['xi_pai'] = xi_pai + + 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 * 100 + _data['an_chou_score'] = an_chou_score * 100 - 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 - return _data end function M:LoadConfigData(data) local _config = self._config - -- data.mode=3 + -- data.mode=3 _config:GetController('btn_Controller').selectedIndex = data.mode - 1 _config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1 _config:GetController('Cost').selectedIndex = data.AA _config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1 - - + + if data.mode == 1 then _config:GetController('haihu').selectedIndex = 0 @@ -213,13 +204,11 @@ function M:LoadConfigData(data) _config:GetController('daxiaozi').selectedIndex = data.daxiaozi _config:GetController('hongheihu').selectedIndex = data.hongheihu _config:GetController('yidianhu').selectedIndex = data.yidianhu - elseif data.mode == 2 then _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('duizifu').selectedIndex = data.duizifu elseif data.mode == 3 then - _config:GetController('tun').selectedIndex = data.tun _config:GetController('fengding').selectedIndex = data.fengding _config:GetController('tuanyuan').selectedIndex = data.tuanyuan @@ -235,21 +224,21 @@ function M:LoadConfigData(data) if data.maxPlayers == 2 then --_config:GetController('qupai').selectedIndex = data.qupai == true and 1 or 0 end - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + end - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 - 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 end + function M:OnChangeOption(ctype) IGameInfo.OnChangeOption(self, ctype) local people = self._config:GetController('renshu') @@ -260,4 +249,5 @@ function M:OnChangeOption(ctype) end ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXGameInfo.lua index 2e5ef647..edcb4254 100644 --- a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXGameInfo.lua @@ -3,134 +3,124 @@ 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/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = 'EXGameInfo' + UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') + return self end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 - self._roundChoice = 2 -- 回合选项数 - self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') - - if oldGameVersion ==1 then - self._config:GetController("xipai").selectedIndex=0 + self._maxPlayer = 3 -- 默认玩家人数 + self._roundChoice = 2 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') + + if oldGameVersion == 1 then + self._config:GetController("xipai").selectedIndex = 0 end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValueText.text=1 - 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 = 1 + + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValueText.text = 1 + 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 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.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( + 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.anchouValueText.text=value/1000 - self.anchouValue=value/1000 - + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + 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 / 100 + self.anchouValue = value / 100 end, 3, nil) gniv:Show() - - end ) end - end + local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help' function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_Poker_YueYangWHZ/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_Poker_YueYangWHZ/icon1" function M:GetIconUrl1() - return _icon_url1 + return _icon_url1 end --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 == 0 and 1 or 2 - local renshu = _config:GetController('play_list').selectedIndex +2 - - local kawai=_config:GetController('kawai').selectedIndex - local piao=_config:GetController('piao').selectedIndex - local first_rand_zhuang=_config:GetChild('suijizhuang').selected and true or false - local zhuang_di_hu=_config:GetController('zdihu').selectedIndex - local hao_config=_config:GetController('hao').selectedIndex - local hao_jiabei=_config:GetController('jiabei').selectedIndex - local ming_tang=_config:GetController('mingtang').selectedIndex - local qupai=0 - if renshu==2 then - qupai=_config:GetController('qupai').selectedIndex + local _config = self._config + local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 + local renshu = _config:GetController('play_list').selectedIndex + 2 + + local kawai = _config:GetController('kawai').selectedIndex + local piao = _config:GetController('piao').selectedIndex + local first_rand_zhuang = _config:GetChild('suijizhuang').selected and true or false + local zhuang_di_hu = _config:GetController('zdihu').selectedIndex + local hao_config = _config:GetController('hao').selectedIndex + local hao_jiabei = _config:GetController('jiabei').selectedIndex + local ming_tang = _config:GetController('mingtang').selectedIndex + local qupai = 0 + if renshu == 2 then + qupai = _config:GetController('qupai').selectedIndex end - - local _data = {} - _data['opt'] = round -- 1 2 8局 16 局 - _data['maxPlayers'] = renshu + + local _data = {} + _data['opt'] = round -- 1 2 8局 16 局 + _data['maxPlayers'] = renshu _data['kawai'] = kawai _data['piao'] = piao _data['zhuang_di_hu'] = zhuang_di_hu @@ -139,66 +129,66 @@ function M:SelectedConfigData() _data['ming_tang'] = ming_tang _data['first_rand_zhuang'] = first_rand_zhuang _data['qupai'] = qupai - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then xi_pai = _config:GetChild("xipai").selected end end _data['xi_pai'] = xi_pai - - 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 - - return _data + + _data['xi_pai_score'] = xi_pai_score * 100 + _data['an_chou_score'] = an_chou_score * 100 + + return _data end function M:LoadConfigData(data) - local _config = self._config + local _config = self._config - _config:GetController('play_list').selectedIndex = data.maxPlayers -2 - _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 - _config:GetController('kawai').selectedIndex=data.kawai - _config:GetController('piao').selectedIndex=data.piao - _config:GetChild('suijizhuang').selected =data.first_rand_zhuang - _config:GetController('zdihu').selectedIndex=data.zhuang_di_hu - _config:GetController('hao').selectedIndex=data.hao_config - _config:GetController('jiabei').selectedIndex=data.hao_jiabei - _config:GetController('mingtang').selectedIndex=data.ming_tang - _config:GetController('qupai').selectedIndex=data.qupai - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai - end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score/1000 - self.xipaiValue=data.xi_pai_score/1000 + _config:GetController('play_list').selectedIndex = data.maxPlayers - 2 + _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 + _config:GetController('kawai').selectedIndex = data.kawai + _config:GetController('piao').selectedIndex = data.piao + _config:GetChild('suijizhuang').selected = data.first_rand_zhuang + _config:GetController('zdihu').selectedIndex = data.zhuang_di_hu + _config:GetController('hao').selectedIndex = data.hao_config + _config:GetController('jiabei').selectedIndex = data.hao_jiabei + _config:GetController('mingtang').selectedIndex = data.ming_tang + _config:GetController('qupai').selectedIndex = data.qupai - self.anchouValueText.text=data.an_chou_score/1000 - self.anchouValue=data.an_chou_score/1000 + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai + 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 - end function M:OnChangeOption(ctype) - IGameInfo.OnChangeOption(self, ctype) + IGameInfo.OnChangeOption(self, ctype) - local play_list = self._config:GetController('play_list') - play_list.onChanged:Add( - function() - self._maxPlayer = play_list.selectedIndex +2 - self:ShowVariablePrice(ctype) - end - ) + local play_list = self._config:GetController('play_list') + play_list.onChanged:Add( + function() + self._maxPlayer = play_list.selectedIndex + 2 + self:ShowVariablePrice(ctype) + end + ) end + return M diff --git a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/EXGameInfo.lua b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/EXGameInfo.lua index 6e1b0011..b8bb68bd 100644 --- a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/EXGameInfo.lua @@ -3,100 +3,94 @@ 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/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') - return self + setmetatable(M, { __index = IGameInfo }) + local self = setmetatable({}, { __index = M }) + self.class = 'EXGameInfo' + UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') + return self end function M:FillData() - self._maxPlayer = 3 -- 默认玩家人数 - self._roundChoice = 2 -- 回合选项数 - self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') - - if oldGameVersion ==1 then - self._config:GetController("xipai").selectedIndex=0 + self._maxPlayer = 3 -- 默认玩家人数 + self._roundChoice = 2 -- 回合选项数 + self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') + + if oldGameVersion == 1 then + self._config:GetController("xipai").selectedIndex = 0 end - - if oldGameVersion==2 then - self._config:GetController("xipai").selectedIndex=1 - - self.xipaiValueText=self._config:GetChild('xipaifen') - self.xipaiValue=1 - + + if oldGameVersion == 2 then + self._config:GetController("xipai").selectedIndex = 1 + + self.xipaiValueText = self._config:GetChild('xipaifen') + self.xipaiValue = 1 + 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 - - if value < 0 then - ViewUtil.ErrorTip(1,"输入数据异常!") - end - - self.xipaiValueText.text=value/1000 - self.xipaiValue=value/1000 - - end, 3, nil) - gniv:Show() - - - end - ) - + 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 + + if value < 0 then + ViewUtil.ErrorTip(1, "输入数据异常!") + end + + self.xipaiValueText.text = value / 100 + self.xipaiValue = value / 100 + end, 3, nil) + gniv:Show() + end + ) end - end + local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help' function M:GetHelpUrl() - return _help_url + return _help_url end local _icon_url = "ui://Info_Poker_YueYangWHZ/icon" function M:GetIconUrl() - return _icon_url + return _icon_url end local _icon_url1 = "ui://Info_Poker_YueYangWHZ/icon1" function M:GetIconUrl1() - return _icon_url1 + return _icon_url1 end --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 == 0 and 1 or 2 - local renshu = _config:GetController('play_list').selectedIndex +2 - - local kawai=_config:GetController('kawai').selectedIndex - local piao=_config:GetController('piao').selectedIndex - local first_rand_zhuang=_config:GetChild('suijizhuang').selected and true or false - local zhuang_di_hu=_config:GetController('zdihu').selectedIndex - local hao_config=_config:GetController('hao').selectedIndex - local hao_jiabei=_config:GetController('jiabei').selectedIndex - local ming_tang=_config:GetController('mingtang').selectedIndex - local qupai=0 - if renshu==2 then - qupai=_config:GetController('qupai').selectedIndex + local _config = self._config + local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 + local renshu = _config:GetController('play_list').selectedIndex + 2 + + local kawai = _config:GetController('kawai').selectedIndex + local piao = _config:GetController('piao').selectedIndex + local first_rand_zhuang = _config:GetChild('suijizhuang').selected and true or false + local zhuang_di_hu = _config:GetController('zdihu').selectedIndex + local hao_config = _config:GetController('hao').selectedIndex + local hao_jiabei = _config:GetController('jiabei').selectedIndex + local ming_tang = _config:GetController('mingtang').selectedIndex + local qupai = 0 + if renshu == 2 then + qupai = _config:GetController('qupai').selectedIndex end - - local _data = {} - _data['opt'] = round -- 1 2 8局 16 局 - _data['maxPlayers'] = renshu + + local _data = {} + _data['opt'] = round -- 1 2 8局 16 局 + _data['maxPlayers'] = renshu _data['kawai'] = kawai _data['piao'] = piao _data['zhuang_di_hu'] = zhuang_di_hu @@ -105,59 +99,59 @@ function M:SelectedConfigData() _data['ming_tang'] = ming_tang _data['first_rand_zhuang'] = first_rand_zhuang _data['qupai'] = qupai - - local xi_pai=false - if oldGameVersion ==2 then - if _config:GetChild("xipai") then + + local xi_pai = false + if oldGameVersion == 2 then + if _config:GetChild("xipai") then xi_pai = _config:GetChild("xipai").selected end end _data['xi_pai'] = xi_pai - - local xi_pai_score=0 - if oldGameVersion==2 then - xi_pai_score=self.xipaiValue + + local xi_pai_score = 0 + if oldGameVersion == 2 then + xi_pai_score = self.xipaiValue end - + _data['xi_pai_score'] = xi_pai_score - - return _data + + return _data end function M:LoadConfigData(data) - local _config = self._config + local _config = self._config - _config:GetController('play_list').selectedIndex = data.maxPlayers -2 - _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 - _config:GetController('kawai').selectedIndex=data.kawai - _config:GetController('piao').selectedIndex=data.piao - _config:GetChild('suijizhuang').selected =data.first_rand_zhuang - _config:GetController('zdihu').selectedIndex=data.zhuang_di_hu - _config:GetController('hao').selectedIndex=data.hao_config - _config:GetController('jiabei').selectedIndex=data.hao_jiabei - _config:GetController('mingtang').selectedIndex=data.ming_tang - _config:GetController('qupai').selectedIndex=data.qupai - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected=data.xi_pai + _config:GetController('play_list').selectedIndex = data.maxPlayers - 2 + _config:GetController('round').selectedIndex = data.opt == 1 and 0 or 1 + _config:GetController('kawai').selectedIndex = data.kawai + _config:GetController('piao').selectedIndex = data.piao + _config:GetChild('suijizhuang').selected = data.first_rand_zhuang + _config:GetController('zdihu').selectedIndex = data.zhuang_di_hu + _config:GetController('hao').selectedIndex = data.hao_config + _config:GetController('jiabei').selectedIndex = data.hao_jiabei + _config:GetController('mingtang').selectedIndex = data.ming_tang + _config:GetController('qupai').selectedIndex = data.qupai + + if _config:GetChild("xipai") then + _config:GetChild("xipai").selected = data.xi_pai end - - if oldGameVersion==2 then - self.xipaiValueText.text=data.xi_pai_score - self.xipaiValue=data.xi_pai_score + + if oldGameVersion == 2 then + self.xipaiValueText.text = data.xi_pai_score + self.xipaiValue = data.xi_pai_score end - end function M:OnChangeOption(ctype) - IGameInfo.OnChangeOption(self, ctype) + IGameInfo.OnChangeOption(self, ctype) - local play_list = self._config:GetController('play_list') - play_list.onChanged:Add( - function() - self._maxPlayer = play_list.selectedIndex +2 - self:ShowVariablePrice(ctype) - end - ) + local play_list = self._config:GetController('play_list') + play_list.onChanged:Add( + function() + self._maxPlayer = play_list.selectedIndex + 2 + self:ShowVariablePrice(ctype) + end + ) end + return M diff --git a/wb_new_ui/assets/NewGroup/mgr/component/game/panel_fag.xml b/wb_new_ui/assets/NewGroup/mgr/component/game/panel_fag.xml index 929444fb..ffc6646b 100644 --- a/wb_new_ui/assets/NewGroup/mgr/component/game/panel_fag.xml +++ b/wb_new_ui/assets/NewGroup/mgr/component/game/panel_fag.xml @@ -71,7 +71,7 @@