倍数修改100

master
罗家炜 2025-06-19 23:51:18 +08:00
parent 08fa583c33
commit 866ca2e5d6
22 changed files with 2213 additions and 2416 deletions

View File

@ -179,7 +179,7 @@ local function __fillRoomItem(self, index, item, room)
room_item:SetPlay(play) room_item:SetPlay(play)
-- local str="(人数:".. room.maxPlayers -- local str="(人数:".. room.maxPlayers
-- if room.limitInRoom then -- if room.limitInRoom then
-- str=str.." 限制积分:"..room.limitInRoom/1000 ..")" -- str=str.." 限制积分:"..room.limitInRoom/100 ..")"
-- else -- else
-- str=str..")" -- str=str..")"
-- end -- end
@ -187,7 +187,7 @@ local function __fillRoomItem(self, index, item, room)
local str = "" local str = ""
if room.limitInRoom then if room.limitInRoom then
str = str .. room.limitInRoom / 1000 str = str .. room.limitInRoom / 100
end end
if room.round == nil then if room.round == nil then
@ -247,7 +247,7 @@ local function __fillRoomItem(self, index, item, room)
if p.hp then if p.hp then
local str1 = "积分:" local str1 = "积分:"
local hp = p.hp / 1000 local hp = p.hp / 100
p_head.text_score.text = str1 .. hp p_head.text_score.text = str1 .. hp
end end
else else
@ -299,7 +299,7 @@ local function __fillRoomItem(self, index, item, room)
riv:GetChild('tex_room_name').text = play.game_name riv:GetChild('tex_room_name').text = play.game_name
riv:GetController("mengzhu").selectedIndex = 1 riv:GetController("mengzhu").selectedIndex = 1
printlog("tex_room_name:") printlog("tex_room_name:")
if self.curGroup.lev==1 then if self.curGroup.lev == 1 then
riv:GetController("mengzhu").selectedIndex = 0 riv:GetController("mengzhu").selectedIndex = 0
local jiesannum = riv:GetChild("jiesan_input") local jiesannum = riv:GetChild("jiesan_input")
riv:GetChild("btn_jiesan").onClick:Set( riv:GetChild("btn_jiesan").onClick:Set(
@ -342,7 +342,7 @@ local function __fillRoomItem(self, index, item, room)
local r = {} local r = {}
exconfig:FillRoomConfig(r, data) exconfig:FillRoomConfig(r, data)
local gameStr = "" 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 riv:GetChild("wafashuoming").text = gameStr
self:InitRoomInfoView() self:InitRoomInfoView()
@ -577,7 +577,7 @@ local function __fillRoomData(self)
end end
local totalNum = 1 local totalNum = 1
if hp.tex_times_room then if hp.tex_times_room then
totalNum = hp.tex_times_room / 1000 totalNum = hp.tex_times_room / 100
end end
for i = 1, totalNum do for i = 1, totalNum do
@ -637,7 +637,7 @@ local function __fillRoomData(self)
local totalNum = 1 local totalNum = 1
if hp and hp.tex_times_room then if hp and hp.tex_times_room then
totalNum = hp.tex_times_room / 1000 totalNum = hp.tex_times_room / 100
end end
for j = 1, totalNum do for j = 1, totalNum do
self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i] self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i]
@ -1065,17 +1065,17 @@ function M:InitView(url)
-- ) -- )
-- self._view:GetChild('player_diamond').text = self.curGroup.diamo -- self._view:GetChild('player_diamond').text = self.curGroup.diamo
local btn_refreshbg = self._view:GetChild("btn_refreshbg").onClick:Set(function () local btn_refreshbg = self._view:GetChild("btn_refreshbg").onClick:Set(function()
if self._view:GetController("bgchange").selectedIndex==0 then if self._view:GetController("bgchange").selectedIndex == 0 then
Utils.SaveLocalFile( DataManager.SelfUser.account_id.."bgflag",2) Utils.SaveLocalFile(DataManager.SelfUser.account_id .. "bgflag", 2)
self._view:GetController("bgchange").selectedIndex = 1 self._view:GetController("bgchange").selectedIndex = 1
else else
Utils.SaveLocalFile( DataManager.SelfUser.account_id.."bgflag",1) Utils.SaveLocalFile(DataManager.SelfUser.account_id .. "bgflag", 1)
self._view:GetController("bgchange").selectedIndex = 0 self._view:GetController("bgchange").selectedIndex = 0
end 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 self._view:GetController("bgchange").selectedIndex = 1
else else
self._view:GetController("bgchange").selectedIndex = 0 self._view:GetController("bgchange").selectedIndex = 0

View File

@ -8,15 +8,15 @@ local GroupMngFagPackView = {}
local M = GroupMngFagPackView local M = GroupMngFagPackView
function GroupMngFagPackView.new(gid, blur_view,ctrNum,uid) function GroupMngFagPackView.new(gid, blur_view, ctrNum, uid)
setmetatable(M, {__index = BaseWindow}) setmetatable(M, { __index = BaseWindow })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "GroupMngFagPackView" self.class = "GroupMngFagPackView"
self._close_destroy = true self._close_destroy = true
self.group_id = gid self.group_id = gid
self.blur_view = blur_view self.blur_view = blur_view
self.ctrNum=ctrNum self.ctrNum = ctrNum
self.shouyiData = {} self.shouyiData = {}
self.uid = uid self.uid = uid
self:init("ui://NewGroup/Win_bxx") self:init("ui://NewGroup/Win_bxx")
@ -25,9 +25,8 @@ function GroupMngFagPackView.new(gid, blur_view,ctrNum,uid)
end end
function M:FillView() function M:FillView()
self.Ctr = self._view:GetController("ctr")
self.Ctr=self._view:GetController("ctr") self.Ctr.selectedIndex = 1
self.Ctr.selectedIndex=1
self.lst_bxx = self._view:GetChild('bxx_list') self.lst_bxx = self._view:GetChild('bxx_list')
self.lst_bxx:SetVirtual() self.lst_bxx:SetVirtual()
@ -39,15 +38,15 @@ function M:FillView()
self.lst_bxx.onClickItem:Add( self.lst_bxx.onClickItem:Add(
function(pas) function(pas)
if self.currentSelectItem == pas.data then return end if self.currentSelectItem == pas.data then return end
local name=pas.data.icon local name = pas.data.icon
self.currentGameItemName=name self.currentGameItemName = name
self.lst_bxx.numItems=self.ctrNum self.lst_bxx.numItems = self.ctrNum
end end
) )
self.playerJF=self._view:GetChild('tex_player') self.playerJF = self._view:GetChild('tex_player')
self.bankJF=self._view:GetChild('tex_bank') self.bankJF = self._view:GetChild('tex_bank')
self.ctr_page = self._view:GetController("type") self.ctr_page = self._view:GetController("type")
self.ctr_page.onChanged:Set(function() self.ctr_page.onChanged:Set(function()
@ -67,46 +66,41 @@ function M:FillView()
end) end)
self._view:GetChild("btn_bankinfo").onClick:Set(function() self._view:GetChild("btn_bankinfo").onClick:Set(function()
local gtlv = GroupBankLogView.new(self.blur_view, self.group_id,self.uid) local gtlv = GroupBankLogView.new(self.blur_view, self.group_id, self.uid)
gtlv:Show() gtlv:Show()
end) end)
local btn_cr = self._view:GetChild('btn_qd') local btn_cr = self._view:GetChild('btn_qd')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView.new(nil, function(num) local gniv = GroupNumberInputView.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_SAVEBankInfo(self.group_id, value,self.uid ,function(res1) fgCtr:FG_SAVEBankInfo(self.group_id, value, self.uid, function(res1)
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
pt(res1) pt(res1)
if (res1.ReturnCode == 0) then if (res1.ReturnCode == 0) then
self:SetBank(res1.Data.hp,res1.Data.b_hp) self:SetBank(res1.Data.hp, res1.Data.b_hp)
ViewUtil.ErrorTip(100011000,"积分存取成功!") ViewUtil.ErrorTip(100011000, "积分存取成功!")
else else
ViewUtil.ErrorTip(res1.ReturnCode,"存取积分失败!") ViewUtil.ErrorTip(res1.ReturnCode, "存取积分失败!")
end end
end) end)
end, 0, nil) end, 0, nil)
gniv:Show() gniv:Show()
end end
) )
@ -114,49 +108,45 @@ function M:FillView()
local btn_qc = self._view:GetChild('btn_qc') local btn_qc = self._view:GetChild('btn_qc')
btn_qc.onClick:Set( btn_qc.onClick:Set(
function() function()
local gniv = GroupNumberInputView.new(nil, function(num) local gniv = GroupNumberInputView.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_TakeBankInfo(self.group_id, value,self.uid, function(res1) fgCtr:FG_TakeBankInfo(self.group_id, value, self.uid, function(res1)
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
pt(res1) pt(res1)
if (res1.ReturnCode == 0) then if (res1.ReturnCode == 0) then
self:SetBank(res1.Data.hp,res1.Data.b_hp) self:SetBank(res1.Data.hp, res1.Data.b_hp)
ViewUtil.ErrorTip(100011000,"积分取出成功!") ViewUtil.ErrorTip(100011000, "积分取出成功!")
else else
ViewUtil.ErrorTip(res1.ReturnCode,"获取积分失败!") ViewUtil.ErrorTip(res1.ReturnCode, "获取积分失败!")
end end
end) end)
end, 0, nil) end, 0, nil)
gniv:Show() gniv:Show()
end end
) )
--------------------------- ---------------------------
self._view:GetChild("btn_take_log").onClick:Set(function() self._view:GetChild("btn_take_log").onClick:Set(function()
local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id,self.uid) local gtlv = GroupTakeLogView.new(self.blur_view, self.group_id, self.uid)
gtlv:Show() gtlv:Show()
end) end)
self._view:GetChild("btn_hp_info").onClick:Set(function() self._view:GetChild("btn_hp_info").onClick:Set(function()
local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id,self.uid) local grlv = GroupRewardsLogView.new(self.blur_view, self.group_id, self.uid)
grlv:Show() grlv:Show()
end) end)
self._view:GetChild("btn_take").onClick:Set(function() self._view:GetChild("btn_take").onClick:Set(function()
@ -166,7 +156,7 @@ function M:FillView()
return return
end end
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid,function(res) fgCtr:FG_TakeHp(self.group_id, ad2d(num), self.uid, function(res)
if num == 0 then if num == 0 then
ViewUtil.ErrorTip(nil, "提取值必须大于0") ViewUtil.ErrorTip(nil, "提取值必须大于0")
return return
@ -184,37 +174,30 @@ function M:FillView()
--self:initBankData() --self:initBankData()
self:initShouyiData() self:initShouyiData()
self.lst_bxx.numItems=self.ctrNum self.lst_bxx.numItems = self.ctrNum
end end
function M:initBankData() function M:initBankData()
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetBankInfo(self.group_id, self.uid,function(res) fgCtr:FG_GetBankInfo(self.group_id, self.uid, function(res)
pt(res) pt(res)
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
if res.ReturnCode ~= 0 then if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败") ViewUtil.ErrorTip(res.ReturnCode, "获取银行数据失败")
else else
self:SetBank(res.Data.total_hp,res.Data.bank_hp) self:SetBank(res.Data.total_hp, res.Data.bank_hp)
self.Ctr.selectedIndex=0 self.Ctr.selectedIndex = 0
end end
end) end)
end end
function M:initShouyiData() function M:initShouyiData()
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
self.shouyiData = {} self.shouyiData = {}
self._view:GetChild("tex_total").text = 0 self._view:GetChild("tex_total").text = 0
local fgCtr = ControllerManager.GetController(NewGroupController) 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() ViewUtil.CloseModalWait()
if res.ReturnCode ~= 0 then if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败") ViewUtil.ErrorTip(res.ReturnCode, "获取保险箱数据失败")
@ -226,7 +209,7 @@ function M:initShouyiData()
self._view:GetChild("tex_total").text = d2ad(data.day_rewad) self._view:GetChild("tex_total").text = d2ad(data.day_rewad)
--self._view:GetChild("tex_totalshouyi").text = 0 --self._view:GetChild("tex_totalshouyi").text = 0
self._total_hp = data.total_hp self._total_hp = data.total_hp
self.Ctr.selectedIndex=1 self.Ctr.selectedIndex = 1
end end
end) end)
end end
@ -235,56 +218,39 @@ function M:SetCallback(callback)
self.callback = callback self.callback = callback
end end
function M:SetBank(totalHp, bankHp)
function M:SetBank(totalHp,bankHp) self.playerJF.text = totalHp / 100
self.playerJF.text=totalHp/1000 self.bankJF.text = bankHp / 100
self.bankJF.text=bankHp/1000
end end
function M:fillGameItem(index, item) function M:fillGameItem(index, item)
if index~=0 then if index ~= 0 then
item.icon="ui://NewGroup/button_cqg" item.icon = "ui://NewGroup/button_cqg"
if self.currentGameItemName==nil then if self.currentGameItemName == nil then
item.icon="ui://NewGroup/button_cqg_xz" item.icon = "ui://NewGroup/button_cqg_xz"
end end
else else
item.icon="ui://NewGroup/button_sjjl" item.icon = "ui://NewGroup/button_sjjl"
end end
if self.currentGameItemName==item.icon then if self.currentGameItemName == item.icon then
item.icon=item.icon.."_xz" item.icon = item.icon .. "_xz"
if index~=0 then if index ~= 0 then
self:initBankData() self:initBankData()
else else
self:initShouyiData() self:initShouyiData()
end end
end end
end end
-- 销毁窗口 -- 销毁窗口
function M:Destroy(remove_map) function M:Destroy(remove_map)
if self.callback then if self.callback then
self.callback() self.callback()
end end
BaseWindow.Destroy(self,remove_map) BaseWindow.Destroy(self, remove_map)
ImageLoad.Clear(self.class) ImageLoad.Clear(self.class)
end end

View File

@ -227,7 +227,7 @@ function M:FillFagData()
local tex_times_room = panel_play_set:GetChild("tex_times_room") local tex_times_room = panel_play_set:GetChild("tex_times_room")
if hpData and hpData.tex_times_room then 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 else
tex_times_room.text = 1 tex_times_room.text = 1
end end
@ -492,7 +492,7 @@ function M:FillFagData()
play.config = json.encode(_data) play.config = json.encode(_data)
play.hp_times = self.hpData.times play.hp_times = self.hpData.times
play.maxPlayers = _data.maxPlayers 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 play.maxRound = res.Data.maxRound
ViewUtil.ShowBannerOnScreenCenter("添加玩法成功") ViewUtil.ShowBannerOnScreenCenter("添加玩法成功")
self.callback(play) self.callback(play)
@ -533,7 +533,7 @@ function M:FillFagData()
play.config = json.encode(_data) play.config = json.encode(_data)
play.hp_times = self.hpData.times play.hp_times = self.hpData.times
play.maxPlayers = _data.maxPlayers 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 play.maxRound = res.Data.maxRound
self.callback(play) self.callback(play)
self:Destroy() self:Destroy()

View File

@ -67,7 +67,7 @@ function M:GetRewardsData()
self._view:GetChild('btn_piliang').onClick:Set(function() self._view:GetChild('btn_piliang').onClick:Set(function()
local gfiv = GroupNumberInputView.new(self._root_view, function(num) 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), local msg_win = MsgWindow.new(nil, string.format("是否设定所有玩法奖励为%s", num),
MsgWindow.MsgMode.OkAndCancel, nil, false) 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 local input_type1 = data.xipai_rewardValueType == 1 and 0 or 3
obj:GetChild("btn_set1").onClick:Set(function() obj:GetChild("btn_set1").onClick:Set(function()
local gfiv = GroupNumberInputView.new(self._root_view, function(num) local gfiv = GroupNumberInputView.new(self._root_view, function(num)
local tem = num * 1000 local tem = num * 100
if data.xipai_rewardValueType == 2 then if data.xipai_rewardValueType == 2 then
tem = ad2d(tem) tem = ad2d(tem)
end end
if tem / 1000 > data.xipai_max_value then if tem / 100 > data.xipai_max_value then
ViewUtil.ErrorTip(nil, "输入值超过上限") ViewUtil.ErrorTip(nil, "输入值超过上限")
return return
-- elseif tem < data.cur_value then -- 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 local input_type2 = data.anchou_rewardValueType == 1 and 0 or 3
obj:GetChild("btn_set2").onClick:Set(function() obj:GetChild("btn_set2").onClick:Set(function()
local gfiv = GroupNumberInputView.new(self._root_view, function(num) local gfiv = GroupNumberInputView.new(self._root_view, function(num)
local tem = num * 1000 local tem = num * 100
if data.anchou_rewardValueType == 2 then if data.anchou_rewardValueType == 2 then
tem = ad2d(tem) tem = ad2d(tem)
end end

View File

@ -22,25 +22,25 @@ ViewUtil = {
} }
} }
function ViewUtil.GetPos(self_seat,seat,people_num) function ViewUtil.GetPos(self_seat, seat, people_num)
if self_seat == 0 then return seat end if self_seat == 0 then return seat end
local cur_seat = self_seat local cur_seat = self_seat
local tem = seat - (cur_seat - 1) 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 return tem
end end
-- 隐藏手机号 -- 隐藏手机号
function ViewUtil.phone_hide(phone) 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 end
-- 隐藏身份证 -- 隐藏身份证
function ViewUtil.identity_hide(identity) 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 end
local modal_wait_win =nil local modal_wait_win = nil
-- local modal_wait_win_url = "ui://Common/GlobalModalWaiting" -- local modal_wait_win_url = "ui://Common/GlobalModalWaiting"
function ViewUtil.ShowModalWait(blur_view, title) function ViewUtil.ShowModalWait(blur_view, title)
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
@ -51,14 +51,14 @@ function ViewUtil.CloseModalWait()
ModalWaitingWindow.CloseModal() ModalWaitingWindow.CloseModal()
end end
local _defaultTooltipWin =nil local _defaultTooltipWin = nil
local function __waittips(obj) local function __waittips(obj)
_defaultTooltipWin:Dispose() _defaultTooltipWin:Dispose()
_defaultTooltipWin = nil _defaultTooltipWin = nil
end end
local _tip_timer local _tip_timer
local function __ShowTips(msg,time) local function __ShowTips(msg, time)
time = time or 2 time = time or 2
if _defaultTooltipWin then if _defaultTooltipWin then
_tip_timer:Stop() _tip_timer:Stop()
@ -72,24 +72,24 @@ local function __ShowTips(msg,time)
_defaultTooltipWin:MakeFullScreen() _defaultTooltipWin:MakeFullScreen()
_tip_timer = Timer.New(function() _tip_timer = Timer.New(function()
__waittips() __waittips()
end,time,1,true) end, time, 1, true)
_tip_timer:Start() _tip_timer:Start()
end end
function ViewUtil.ErrorTip(code,tip,time) function ViewUtil.ErrorTip(code, tip, time)
if(Table_Error_code_Map[code]~=nil) then if (Table_Error_code_Map[code] ~= nil) then
__ShowTips(string.format("%s",Table_Error_code_Map[code].note), time) __ShowTips(string.format("%s", Table_Error_code_Map[code].note), time)
else else
__ShowTips(tip,time) __ShowTips(tip, time)
end end
end end
function ViewUtil.ErrorMsg(_root_view,code,tip,url) function ViewUtil.ErrorMsg(_root_view, code, tip, url)
local msg = tip local msg = tip
if(Table_Error_code_Map[code]~=nil) then if (Table_Error_code_Map[code] ~= nil) then
msg = string.format("%s",Table_Error_code_Map[code].note) msg = string.format("%s", Table_Error_code_Map[code].note)
end 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() _curren_msg:Show()
end end
@ -109,7 +109,7 @@ function ViewUtil.ShowBannerOnScreenCenter(msg, s)
ViewUtil._banner = banner ViewUtil._banner = banner
local timer = Timer.New(function() local timer = Timer.New(function()
banner:Dispose() banner:Dispose()
end,time,1,true) end, time, 1, true)
timer:Start() timer:Start()
end end
@ -117,36 +117,31 @@ function ViewUtil.PlaySoundBg()
GameApplication.Instance:PlayMuisc("base/common/sound/bgmusic1.mp3") GameApplication.Instance:PlayMuisc("base/common/sound/bgmusic1.mp3")
end end
function ViewUtil.HandCardSort(a,b) function ViewUtil.HandCardSort(a, b)
local sort_a = a local sort_a = a
local sort_b = b 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 if b >= 400 then sort_b = sort_b - 1000 end
return sort_a<sort_b return sort_a < sort_b
end end
function ViewUtil.HandCardSort2(a,b) function ViewUtil.HandCardSort2(a, b)
a=tonumber(string.sub(a,2)) a = tonumber(string.sub(a, 2))
b=tonumber(string.sub(b,2)) b = tonumber(string.sub(b, 2))
--print(a) --print(a)
--print(b) --print(b)
return a < b return a < b
end end
function ViewUtil.HandCardSort3(a, b)
function ViewUtil.HandCardSort3(a,b)
local sort_a = a[1] or 101 local sort_a = a[1] or 101
local sort_b = b[1] or 101 local sort_b = b[1] or 101
return sort_a<sort_b return sort_a < sort_b
end end
function ViewUtil.CardPos(obj, area, oder, index, offset, isAdd)
function ViewUtil.CardPos(obj, area, oder, index, offset,isAdd)
offset = offset or 0 offset = offset or 0
if oder == AreaOderType.left_right then if oder == AreaOderType.left_right then
obj.x = index * obj.width + offset obj.x = index * obj.width + offset
@ -156,7 +151,7 @@ function ViewUtil.CardPos(obj, area, oder, index, offset,isAdd)
obj.x = (area.width - obj.width) - index * obj.width - offset obj.x = (area.width - obj.width) - index * obj.width - offset
elseif oder == AreaOderType.down_up then elseif oder == AreaOderType.down_up then
if isAdd then if isAdd then
obj.y = area.height - obj.height - index * obj.height*1.5 - offset obj.y = area.height - obj.height - index * obj.height * 1.5 - offset
else else
obj.y = area.height - obj.height - index * obj.height - offset obj.y = area.height - obj.height - index * obj.height - offset
end end
@ -174,6 +169,7 @@ function ViewUtil.PlayMuisc(group, path)
end end
GameApplication.Instance:PlayMuisc(group, path) GameApplication.Instance:PlayMuisc(group, path)
end end
function ViewUtil.PlaySound(group, path) function ViewUtil.PlaySound(group, path)
if group ~= _current_group then if group ~= _current_group then
if _current_group then if _current_group then
@ -226,18 +222,18 @@ end
-- 数据转换成3位小数 data to a decimal -- 数据转换成3位小数 data to a decimal
function d2ad(data) function d2ad(data)
return data / 1000 return data / 100
end end
-- 3位小数转换成数据 a decimal to data -- 3位小数转换成数据 a decimal to data
function ad2d(decimal) function ad2d(decimal)
return decimal * 1000 return decimal * 100
end end
-- 获取gps -- 获取gps
function get_gps(callback) function get_gps(callback)
if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then 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) Utils.LocalAddress(function(result, latitude, longitude)
if not result or (latitude == 0 and longitude == 0) then return end if not result or (latitude == 0 and longitude == 0) then return end
DataManager.SelfUser.location = Location.new(tostring(longitude) .. "," .. tostring(latitude)) DataManager.SelfUser.location = Location.new(tostring(longitude) .. "," .. tostring(latitude))
@ -255,8 +251,7 @@ function get_gps(callback)
end end
--依据宽度截断字符 --依据宽度截断字符
function ViewUtil.stringEllipsis(szText,size,full) function ViewUtil.stringEllipsis(szText, size, full)
full = full or false full = full or false
size = size or 4 size = size or 4
--截断结果 --截断结果
@ -267,7 +262,7 @@ function ViewUtil.stringEllipsis(szText,size,full)
local i = 1 local i = 1
local char_count = 0 local char_count = 0
while true do while true do
local cur = string.sub(szText,i,i) local cur = string.sub(szText, i, i)
local byte = string.byte(cur) local byte = string.byte(cur)
if byte == nil then if byte == nil then
break break
@ -282,9 +277,7 @@ function ViewUtil.stringEllipsis(szText,size,full)
i = i + 3 i = i + 3
char_count = char_count + 1 char_count = char_count + 1
elseif byte ~= 32 then elseif byte ~= 32 then
if string.byte('A') <= byte and byte <= string.byte('Z') then if string.byte('A') <= byte and byte <= string.byte('Z') then
char_count = char_count + 1 char_count = char_count + 1
else else
char_count = char_count + 0.5 char_count = char_count + 0.5
@ -297,9 +290,9 @@ function ViewUtil.stringEllipsis(szText,size,full)
end end
if i ~= 1 then if i ~= 1 then
szResult = string.sub(szText, 1, i-1) szResult = string.sub(szText, 1, i - 1)
if(bOK) then if (bOK) then
szResult = szResult.."..." szResult = szResult .. "..."
end end
end end
return szResult return szResult

View File

@ -4,8 +4,8 @@ local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/majiang/changsha/ui/Info_MJ_ChangSha") UIPackage.AddPackage("extend/majiang/changsha/ui/Info_MJ_ChangSha")
@ -15,49 +15,44 @@ end
function M:FillData() function M:FillData()
self._maxPlayer = 4 -- 默认玩家人数 self._maxPlayer = 4 -- 默认玩家人数
self._roundChoice = 4 -- 回合选项数 self._roundChoice = 4 -- 回合选项数
if oldGameVersion==1 then if oldGameVersion == 1 then
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room")
else else
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room_yueyang") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ChangSha/Cgm_create_room_yueyang")
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -65,37 +60,30 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
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() function M:GetHelpUrl()
return _help_url return _help_url
end end
@ -110,7 +98,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list ={} --{"长沙麻将","三人长沙","二人长沙"} local _play_list = {} --{"长沙麻将","三人长沙","二人长沙"}
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -118,7 +106,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController("round").selectedIndex + 1 --== 0 and 1 or 2 local round = _config:GetController("round").selectedIndex + 1 --== 0 and 1 or 2
self._maxPlayer = _config:GetController("play_list").selectedIndex+2 self._maxPlayer = _config:GetController("play_list").selectedIndex + 2
local zhuangxian = _config:GetChild("btn_zhuangxian").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 piaofen = _config:GetChild("btn_piaofen").selected and true or false
@ -137,7 +125,8 @@ function M:SelectedConfigData()
local niao_type = _config:GetController("niao").selectedIndex local niao_type = _config:GetController("niao").selectedIndex
local niao_num = _config:GetController("niao_num").selectedIndex local niao_num = _config:GetController("niao_num").selectedIndex
local niao_db_num = _config:GetController("niao_db_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 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 piao_niao = _config:GetChild("btn_piao_niao").selected
local two_pair = _config:GetChild("btn_two_pair").selected local two_pair = _config:GetChild("btn_two_pair").selected
local no_jiang = _config:GetChild("btn_no_jiang").selected local no_jiang = _config:GetChild("btn_no_jiang").selected
@ -148,42 +137,42 @@ function M:SelectedConfigData()
local banyiquan = _config:GetChild("btn_banyiquan").selected local banyiquan = _config:GetChild("btn_banyiquan").selected
local menqing = _config:GetChild("btn_menqing").selected local menqing = _config:GetChild("btn_menqing").selected
local fengding_score=0 local fengding_score = 0
if _config:GetController("fengding") then if _config:GetController("fengding") then
fengding_score=_config:GetController("fengding").selectedIndex fengding_score = _config:GetController("fengding").selectedIndex
end end
local piao_niao1=0 local piao_niao1 = 0
if _config:GetController('piao') then if _config:GetController('piao') then
piao_niao1=_config:GetController('piao').selectedIndex piao_niao1 = _config:GetController('piao').selectedIndex
end end
local piao1=false local piao1 = false
local piao2=false local piao2 = false
local piao3=false local piao3 = false
local piao_niao_opt=0 local piao_niao_opt = 0
if piao_niao1==2 then if piao_niao1 == 2 then
piao_niao_opt=_config:GetController("piaofen").selectedIndex piao_niao_opt = _config:GetController("piaofen").selectedIndex
end end
local xi_pai=false local xi_pai = false
local xi_paifen=0 local xi_paifen = 0
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai=_config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
local niaofen_opt=0 local niaofen_opt = 0
local niaofen_score=1 local niaofen_score = 1
local difen_score=1 local difen_score = 1
local kai_gong=0 local kai_gong = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
niaofen_opt=_config:GetController("niaoadd").selectedIndex niaofen_opt = _config:GetController("niaoadd").selectedIndex
niaofen_score= tonumber(_config:GetController("niaodf").selectedPage) niaofen_score = tonumber(_config:GetController("niaodf").selectedPage)
difen_score= tonumber(_config:GetController("jcdifen").selectedPage) difen_score = tonumber(_config:GetController("jcdifen").selectedPage)
kai_gong=_config:GetController("kaigang").selectedIndex kai_gong = _config:GetController("kaigang").selectedIndex
end end
--------- ---------
local _data = {} local _data = {}
_data["opt"] = round _data["opt"] = round
_data["maxPlayers"] = self._maxPlayer _data["maxPlayers"] = self._maxPlayer
@ -205,14 +194,14 @@ function M:SelectedConfigData()
_data["niao_type"] = niao_type _data["niao_type"] = niao_type
if oldGameVersion==1 then if oldGameVersion == 1 then
_data["niao"] = niao _data["niao"] = niao
else else
_data["niao"] = tonumber(_config:GetController("niao_num").selectedPage) _data["niao"] = tonumber(_config:GetController("niao_num").selectedPage)
end end
if oldGameVersion==1 then if oldGameVersion == 1 then
_data["piao_niao"] = piao_niao _data["piao_niao"] = piao_niao
else else
_data["piao_niao"] = piao_niao1 _data["piao_niao"] = piao_niao1
@ -231,36 +220,35 @@ function M:SelectedConfigData()
_data['piao2'] = piao2 _data['piao2'] = piao2
_data['piao3'] = piao3 _data['piao3'] = piao3
auto_piao=false auto_piao = false
if piao_niao1==2 then if piao_niao1 == 2 then
if piao1 or piao2 or piao3 then if piao1 or piao2 or piao3 then
auto_piao=true auto_piao = true
end end
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
_data['auto_piao'] = auto_piao _data['auto_piao'] = auto_piao
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
_data['piao_niao_opt'] = piao_niao_opt _data['piao_niao_opt'] = piao_niao_opt
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
if oldGameVersion==2 then if oldGameVersion == 2 then
_data['niaofen_opt'] = niaofen_opt _data['niaofen_opt'] = niaofen_opt
_data['niaofen_score'] = niaofen_score _data['niaofen_score'] = niaofen_score
_data['difen_score'] = difen_score _data['difen_score'] = difen_score
_data['kai_gong'] = kai_gong _data['kai_gong'] = kai_gong
end end
@ -268,13 +256,11 @@ function M:SelectedConfigData()
return _data return _data
end end
function M:LoadConfigData(data) function M:LoadConfigData(data)
pt(data) pt(data)
local _config = self._config local _config = self._config
_config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1 _config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1
_config:GetController("play_list").selectedIndex = data.maxPlayers-2 _config:GetController("play_list").selectedIndex = data.maxPlayers - 2
_config:GetChild("btn_zhuangxian").selected = data.zhuangxian _config:GetChild("btn_zhuangxian").selected = data.zhuangxian
_config:GetChild("btn_zimo").selected = data.zimo _config:GetChild("btn_zimo").selected = data.zimo
@ -292,13 +278,14 @@ function M:LoadConfigData(data)
_config:GetController("niao").selectedIndex = data.niao_type _config:GetController("niao").selectedIndex = data.niao_type
if oldGameVersion==1 then 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_num").selectedIndex = data.niao_type ~= 0 and 0 or
(data.niao == 4 and 1 or (data.niao == 6 and 2 or 0))
else else
_config:GetController("niao_num").selectedIndex=data.niao/2-1 _config:GetController("niao_num").selectedIndex = data.niao / 2 - 1
end end
_config:GetController("niao_db_num").selectedIndex = data.niao_type ~= 1 and 0 or (data.niao == 1 and 0 or 1) _config:GetController("niao_db_num").selectedIndex = data.niao_type ~= 1 and 0 or (data.niao == 1 and 0 or 1)
if oldGameVersion==1 then if oldGameVersion == 1 then
_config:GetChild("btn_piao_niao").selected = data.piao_niao _config:GetChild("btn_piao_niao").selected = data.piao_niao
end end
_config:GetChild("btn_two_pair").selected = data.two_pair _config:GetChild("btn_two_pair").selected = data.two_pair
@ -311,40 +298,38 @@ function M:LoadConfigData(data)
_config:GetChild("btn_menqing").selected = data.menqing or false _config:GetChild("btn_menqing").selected = data.menqing or false
if _config:GetController("fengding") then if _config:GetController("fengding") then
_config:GetController("fengding").selectedIndex=data.fengding_score _config:GetController("fengding").selectedIndex = data.fengding_score
end end
if _config:GetController("piao") then if _config:GetController("piao") then
_config:GetController("piao").selectedIndex=data.piao_niao _config:GetController("piao").selectedIndex = data.piao_niao
_config:GetChild('pf1').selected=data.piao1 _config:GetChild('pf1').selected = data.piao1
_config:GetChild('pf2').selected=data.piao2 _config:GetChild('pf2').selected = data.piao2
_config:GetChild('pf3').selected=data.piao3 _config:GetChild('pf3').selected = data.piao3
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if _config:GetController("piaofen") then if _config:GetController("piaofen") then
_config:GetController("piaofen").selectedIndex=data.piao_niao_opt _config:GetController("piaofen").selectedIndex = data.piao_niao_opt
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 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
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
end
return M return M

View File

@ -4,8 +4,8 @@ local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/majiang/gejiu/ui/Info_MJ_GeJiu") UIPackage.AddPackage("extend/majiang/gejiu/ui/Info_MJ_GeJiu")
return self return self
@ -16,43 +16,38 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_GeJiu/Cgm_create_room") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_GeJiu/Cgm_create_room")
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -60,36 +55,30 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
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() function M:GetHelpUrl()
return _help_url return _help_url
end end
@ -104,7 +93,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list ={} local _play_list = {}
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -112,20 +101,20 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController("round").selectedIndex + 1 local round = _config:GetController("round").selectedIndex + 1
local people = _config:GetController("play_list").selectedIndex+2 local people = _config:GetController("play_list").selectedIndex + 2
local fengding=_config:GetController("fengding").selectedIndex local fengding = _config:GetController("fengding").selectedIndex
local wanfa=_config:GetController("wanfa").selectedIndex local wanfa = _config:GetController("wanfa").selectedIndex
local qiduijiafan=_config:GetChild("btn_qidui").selected local qiduijiafan = _config:GetChild("btn_qidui").selected
local shoudailongjiafan=_config:GetChild("btn_shoudailong").selected local shoudailongjiafan = _config:GetChild("btn_shoudailong").selected
local loudilongjiafan=_config:GetChild("btn_loudilong").selected local loudilongjiafan = _config:GetChild("btn_loudilong").selected
local bunengchi=_config:GetChild("btn_bunengchi").selected local bunengchi = _config:GetChild("btn_bunengchi").selected
local doudizhu=_config:GetChild("btn_doudizhu").selected local doudizhu = _config:GetChild("btn_doudizhu").selected
local doudizhufanbei=_config:GetChild("btn_doudizhufanbei").selected local doudizhufanbei = _config:GetChild("btn_doudizhufanbei").selected
local xi_pai=false local xi_pai = false
local xi_paifen=0 local xi_paifen = 0
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai=_config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -145,15 +134,15 @@ function M:SelectedConfigData()
_data["doudizhufanbei"] = doudizhufanbei _data["doudizhufanbei"] = doudizhufanbei
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
@ -163,8 +152,8 @@ function M:LoadConfigData(data)
--printlog("加载房间配置=========>>>") --printlog("加载房间配置=========>>>")
--pt(data) --pt(data)
local _config = self._config local _config = self._config
_config:GetController("round").selectedIndex = data.opt -1 _config:GetController("round").selectedIndex = data.opt - 1
_config:GetController("play_list").selectedIndex = data.maxPlayers-2 _config:GetController("play_list").selectedIndex = data.maxPlayers - 2
_config:GetController("fengding").selectedIndex = data.fengding _config:GetController("fengding").selectedIndex = data.fengding
@ -179,22 +168,16 @@ function M:LoadConfigData(data)
_config:GetChild("btn_doudizhufanbei").selected = data.doudizhufanbei _config:GetChild("btn_doudizhufanbei").selected = data.doudizhufanbei
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end
end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/majiang/hongzhong/ui/Info_MJ_HongZhong") UIPackage.AddPackage("extend/majiang/hongzhong/ui/Info_MJ_HongZhong")
return self return self
@ -14,48 +14,43 @@ function M:FillData()
self._maxPlayer = 4 -- 默认玩家人数 self._maxPlayer = 4 -- 默认玩家人数
self._roundChoice = 4 -- 回合选项数 self._roundChoice = 4 -- 回合选项数
if oldGameVersion==1 then if oldGameVersion == 1 then
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room")
else else
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room_yueyang") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_HongZhong/Cgm_create_room_yueyang")
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -64,37 +59,30 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
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() function M:GetHelpUrl()
return _help_url return _help_url
end end
@ -109,7 +97,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {}--{"红中麻将","三人红中","二人红中"} local _play_list = {} --{"红中麻将","三人红中","二人红中"}
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -117,7 +105,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController("round").selectedIndex + 1 local round = _config:GetController("round").selectedIndex + 1
local people = _config:GetController("play_list").selectedIndex+2 local people = _config:GetController("play_list").selectedIndex + 2
local qiangkong = _config:GetChild("btn_qgh").selected and true or false local qiangkong = _config:GetChild("btn_qgh").selected and true or false
local qiangkong_niao = _config:GetChild("btn_qghjm").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 seven_pair = _config:GetChild("btn_qidui").selected and true or false
@ -132,16 +120,16 @@ function M:SelectedConfigData()
local wuguizhuopaojiabei = _config:GetChild("btn_wuhongzhongzuobaofanbei").selected local wuguizhuopaojiabei = _config:GetChild("btn_wuhongzhongzuobaofanbei").selected
---------- ----------
local piao_niao1=0 local piao_niao1 = 0
if _config:GetController('piao') then if _config:GetController('piao') then
piao_niao1=_config:GetController('piao').selectedIndex piao_niao1 = _config:GetController('piao').selectedIndex
end end
local piao1=false local piao1 = false
local piao2=false local piao2 = false
local piao3=false local piao3 = false
local piao_niao_opt=0 local piao_niao_opt = 0
if piao_niao1==2 then if piao_niao1 == 2 then
piao_niao_opt=_config:GetController("piaofen").selectedIndex piao_niao_opt = _config:GetController("piaofen").selectedIndex
end end
@ -150,12 +138,12 @@ function M:SelectedConfigData()
laizi4_hu = _config:GetChild("btn_sihongzhong").selected laizi4_hu = _config:GetChild("btn_sihongzhong").selected
end end
local hz_hu =false local hz_hu = false
if _config:GetChild("btn_wuhongzhong") then if _config:GetChild("btn_wuhongzhong") then
hz_hu = _config:GetChild("btn_wuhongzhong").selected hz_hu = _config:GetChild("btn_wuhongzhong").selected
end end
local wuguijiabei =false local wuguijiabei = false
if _config:GetChild("btn_wuhongzhongzimo") then if _config:GetChild("btn_wuhongzhongzimo") then
wuguijiabei = _config:GetChild("btn_wuhongzhongzimo").selected wuguijiabei = _config:GetChild("btn_wuhongzhongzimo").selected
end end
@ -165,19 +153,19 @@ function M:SelectedConfigData()
dianpaohu = _config:GetChild("btn_dianpaohu").selected dianpaohu = _config:GetChild("btn_dianpaohu").selected
end end
local di_fen=false local di_fen = false
if _config:GetController('difen') then if _config:GetController('difen') then
di_fen=_config:GetController('difen').selectedIndex di_fen = _config:GetController('difen').selectedIndex
end end
local xi_pai=false local xi_pai = false
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai=_config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
local fengding_score=0 local fengding_score = 0
if _config:GetController("fengding") then if _config:GetController("fengding") then
fengding_score=_config:GetController("fengding").selectedIndex fengding_score = _config:GetController("fengding").selectedIndex
end end
---------- ----------
@ -190,7 +178,7 @@ function M:SelectedConfigData()
_data["qiangkong"] = qiangkong _data["qiangkong"] = qiangkong
_data["qiangkong_niao"] = not qiangkong and false or qiangkong_niao _data["qiangkong_niao"] = not qiangkong and false or qiangkong_niao
_data["niao"] = niao_type _data["niao"] = niao_type
if oldGameVersion==1 then if oldGameVersion == 1 then
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
else else
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
@ -201,7 +189,7 @@ function M:SelectedConfigData()
_data["laizi8"] = laizi _data["laizi8"] = laizi
_data["AA"] = aa _data["AA"] = aa
if oldGameVersion==1 then if oldGameVersion == 1 then
_data["piao_niao"] = piao_niao _data["piao_niao"] = piao_niao
else else
_data["piao_niao"] = piao_niao1 _data["piao_niao"] = piao_niao1
@ -218,24 +206,24 @@ function M:SelectedConfigData()
_data['di_fen'] = di_fen _data['di_fen'] = di_fen
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
auto_piao=false auto_piao = false
if piao_niao==2 then if piao_niao == 2 then
if piao1 or piao2 or piao3 then if piao1 or piao2 or piao3 then
auto_piao=true auto_piao = true
end end
end end
_data['auto_piao'] = auto_piao _data['auto_piao'] = auto_piao
_data['piao_niao_opt'] = piao_niao_opt _data['piao_niao_opt'] = piao_niao_opt
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
_data["fengding_score"] = fengding_score _data["fengding_score"] = fengding_score
_data["wuguizhuopaojiabei"] = wuguizhuopaojiabei _data["wuguizhuopaojiabei"] = wuguizhuopaojiabei
@ -246,8 +234,8 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config local _config = self._config
_config:GetController("round").selectedIndex = data.opt-1 _config:GetController("round").selectedIndex = data.opt - 1
_config:GetController("play_list").selectedIndex = data.maxPlayers-2 _config:GetController("play_list").selectedIndex = data.maxPlayers - 2
_config:GetChild("btn_qgh").selected = data.qiangkong _config:GetChild("btn_qgh").selected = data.qiangkong
_config:GetChild("btn_qghjm").selected = data.qiangkong_niao _config:GetChild("btn_qghjm").selected = data.qiangkong_niao
_config:GetChild("btn_qidui").selected = data.qidui _config:GetChild("btn_qidui").selected = data.qidui
@ -262,7 +250,7 @@ function M:LoadConfigData(data)
_config:GetChild("btn_laizi").selected = data.laizi8 _config:GetChild("btn_laizi").selected = data.laizi8
_config:GetController("Cost").selectedIndex = data.AA or 0 _config:GetController("Cost").selectedIndex = data.AA or 0
if oldGameVersion==1 then if oldGameVersion == 1 then
_config:GetChild("btn_piao_niao").selected = data.piao_niao _config:GetChild("btn_piao_niao").selected = data.piao_niao
end end
_config:GetController("jiangma").selectedIndex = data.jiangma _config:GetController("jiangma").selectedIndex = data.jiangma
@ -270,45 +258,43 @@ function M:LoadConfigData(data)
_config:GetChild("btn_dianpaohu").selected = data.dianpaohu _config:GetChild("btn_dianpaohu").selected = data.dianpaohu
if _config:GetController("piao") then if _config:GetController("piao") then
_config:GetController("piao").selectedIndex=data.piao_niao _config:GetController("piao").selectedIndex = data.piao_niao
_config:GetChild('pf1').selected=data.piao1 _config:GetChild('pf1').selected = data.piao1
_config:GetChild('pf2').selected=data.piao2 _config:GetChild('pf2').selected = data.piao2
_config:GetChild('pf3').selected=data.piao3 _config:GetChild('pf3').selected = data.piao3
end end
if _config:GetChild("btn_sihongzhong") then if _config:GetChild("btn_sihongzhong") then
_config:GetChild("btn_sihongzhong").selected=data.laizi4_hu _config:GetChild("btn_sihongzhong").selected = data.laizi4_hu
_config:GetChild("btn_wuhongzhong").selected=data.hz_hu _config:GetChild("btn_wuhongzhong").selected = data.hz_hu
_config:GetChild("btn_wuhongzhongzimo").selected=data.wuguijiabei _config:GetChild("btn_wuhongzhongzimo").selected = data.wuguijiabei
end end
if _config:GetController("difen") then if _config:GetController("difen") then
_config:GetController("difen").selectedIndex=data.di_fen _config:GetController("difen").selectedIndex = data.di_fen
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if _config:GetController("piaofen") then if _config:GetController("piaofen") then
_config:GetController("piaofen").selectedIndex=data.piao_niao_opt _config:GetController("piaofen").selectedIndex = data.piao_niao_opt
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
if _config:GetController("fengding") then if _config:GetController("fengding") then
_config:GetController("fengding").selectedIndex=data.fengding_score _config:GetController("fengding").selectedIndex = data.fengding_score
end end
_config:GetChild("btn_wuhongzhongzuobaofanbei").selected=data.wuguizhuopaojiabei _config:GetChild("btn_wuhongzhongzuobaofanbei").selected = data.wuguizhuopaojiabei
end
end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/majiang/zhuanzhuan/ui/Info_MJ_ZhuanZhuan") UIPackage.AddPackage("extend/majiang/zhuanzhuan/ui/Info_MJ_ZhuanZhuan")
return self return self
@ -14,49 +14,44 @@ function M:FillData()
self._maxPlayer = 4 -- 默认玩家人数 self._maxPlayer = 4 -- 默认玩家人数
self._roundChoice = 4 -- 回合选项数 self._roundChoice = 4 -- 回合选项数
if oldGameVersion==1 then if oldGameVersion == 1 then
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room")
else else
self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room") self._config = UIPackage.CreateObjectFromURL("ui://Info_MJ_ZhuanZhuan/Cgm_create_room")
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -64,38 +59,30 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
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() function M:GetHelpUrl()
return _help_url return _help_url
end end
@ -110,7 +97,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {}--{"红中麻将","三人红中","二人红中"} local _play_list = {} --{"红中麻将","三人红中","二人红中"}
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -118,7 +105,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController("round").selectedIndex + 1 local round = _config:GetController("round").selectedIndex + 1
local people = _config:GetController("play_list").selectedIndex+2 local people = _config:GetController("play_list").selectedIndex + 2
local niao_type = _config:GetController("NiaoType").selectedIndex + 1 local niao_type = _config:GetController("NiaoType").selectedIndex + 1
local zha_ma = _config:GetController("zha").selectedIndex + 1 local zha_ma = _config:GetController("zha").selectedIndex + 1
@ -141,10 +128,10 @@ function M:SelectedConfigData()
-- end -- end
local xi_pai=false local xi_pai = false
local xi_paifen=0 local xi_paifen = 0
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai=_config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
-- local fengding_score=0 -- local fengding_score=0
@ -161,10 +148,10 @@ function M:SelectedConfigData()
local buzhong = _config:GetChild("btn_buzhongsuanquanzhong").selected local buzhong = _config:GetChild("btn_buzhongsuanquanzhong").selected
local zhuangxian = _config:GetChild("btn_zhuangxiansuanfen").selected local zhuangxian = _config:GetChild("btn_zhuangxiansuanfen").selected
local qgdp =_config:GetController("qianggang").selectedIndex local qgdp = _config:GetController("qianggang").selectedIndex
local qianggang_dianpao=false local qianggang_dianpao = false
if qgdp==1 then if qgdp == 1 then
qianggang_dianpao=true qianggang_dianpao = true
end end
---------- ----------
@ -173,7 +160,7 @@ function M:SelectedConfigData()
_data["maxPlayers"] = people _data["maxPlayers"] = people
_data["niao"] = niao_type _data["niao"] = niao_type
if oldGameVersion==1 then if oldGameVersion == 1 then
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
else else
_data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma) _data["niao_opt"] = niao_type == 2 and 1 or (niao_type == 3 and wo_niao or zha_ma)
@ -210,15 +197,15 @@ function M:SelectedConfigData()
-- _data['auto_piao'] = auto_piao -- _data['auto_piao'] = auto_piao
-- _data['piao_niao_opt'] = piao_niao_opt -- _data['piao_niao_opt'] = piao_niao_opt
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
--_data["fengding_score"] = fengding_score --_data["fengding_score"] = fengding_score
return _data return _data
@ -226,21 +213,21 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config local _config = self._config
_config:GetController("round").selectedIndex = data.opt -1 -- == 1 and 0 or 1 _config:GetController("round").selectedIndex = data.opt - 1 -- == 1 and 0 or 1
_config:GetController("play_list").selectedIndex = data.maxPlayers-2 _config:GetController("play_list").selectedIndex = data.maxPlayers - 2
_config:GetChild("btn_qidui").selected = data.qidui _config:GetChild("btn_qidui").selected = data.qidui
_config:GetChild("btn_zhuangxiansuanfen").selected = data.zhuangxian _config:GetChild("btn_zhuangxiansuanfen").selected = data.zhuangxian
_config:GetChild("btn_hongzhong").selected = data.laizi _config:GetChild("btn_hongzhong").selected = data.laizi
_config:GetChild("btn_wuzhong").selected=data.hz_hu _config:GetChild("btn_wuzhong").selected = data.hz_hu
_config:GetChild("btn_dianpaohu").selected=data.dianpao _config:GetChild("btn_dianpaohu").selected = data.dianpao
_config:GetChild("btn_bihu").selected=data.bi_hu _config:GetChild("btn_bihu").selected = data.bi_hu
--_config:GetChild("btn_buzhongsuanquanzhong").selected=data.buzhong --_config:GetChild("btn_buzhongsuanquanzhong").selected=data.buzhong
if data.qianggang_dianpao==true then if data.qianggang_dianpao == true then
_config:GetController("qianggang").selectedIndex=1 _config:GetController("qianggang").selectedIndex = 1
else else
_config:GetController("qianggang").selectedIndex=0 _config:GetController("qianggang").selectedIndex = 0
end end
_config:GetController("NiaoType").selectedIndex = data.niao - 1 _config:GetController("NiaoType").selectedIndex = data.niao - 1
@ -250,11 +237,11 @@ function M:LoadConfigData(data)
_config:GetController("wowoniao").selectedIndex = data.niao_opt - 1 _config:GetController("wowoniao").selectedIndex = data.niao_opt - 1
end end
_config:GetController("wowoniao").selectedIndex=data.niao_opt_score-1 _config:GetController("wowoniao").selectedIndex = data.niao_opt_score - 1
_config:GetController("Cost").selectedIndex = data.AA or 0 _config:GetController("Cost").selectedIndex = data.AA or 0
_config:GetChild("btn_piao_niao").selected=data.piao_niao _config:GetChild("btn_piao_niao").selected = data.piao_niao
-- if _config:GetController("piao") then -- if _config:GetController("piao") then
-- _config:GetController("piao").selectedIndex=data.piao_niao -- _config:GetController("piao").selectedIndex=data.piao_niao
@ -266,26 +253,24 @@ function M:LoadConfigData(data)
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
-- if _config:GetController("piaofen") then -- if _config:GetController("piaofen") then
-- _config:GetController("piaofen").selectedIndex=data.piao_niao_opt -- _config:GetController("piaofen").selectedIndex=data.piao_niao_opt
-- end -- end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
-- if _config:GetController("fengding") then -- if _config:GetController("fengding") then
-- _config:GetController("fengding").selectedIndex=data.fengding_score -- _config:GetController("fengding").selectedIndex=data.fengding_score
-- end -- end
end
end
return M return M

View File

@ -7,8 +7,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/poker/chuntian/ui/Info_Poker_ChunTian") UIPackage.AddPackage("extend/poker/chuntian/ui/Info_Poker_ChunTian")
return self return self
@ -23,77 +23,64 @@ function M:FillData(view, index)
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 0, nil) end, 0, nil)
gniv:Show() gniv:Show()
end end
) )
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = "ui://Info_Poker_ChunTian/Com_help" local _help_url = "ui://Info_Poker_ChunTian/Com_help"
@ -111,7 +98,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"单QKA2","去掉234"} local _play_list = { "单QKA2", "去掉234" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -134,18 +121,17 @@ function M:LoadConfigData(data)
_config:GetController("sigeAziranchun").selectedIndex = data.sigeAziranchun _config:GetController("sigeAziranchun").selectedIndex = data.sigeAziranchun
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:SelectedConfigData() function M:SelectedConfigData()
@ -165,7 +151,7 @@ function M:SelectedConfigData()
-----洗牌 -----洗牌
local xi_pai=false local xi_pai = false
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -188,15 +174,15 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
end end

View File

@ -53,8 +53,8 @@ function M:FillData(view, index)
ViewUtil.ErrorTip(1, "输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text = value / 1000 self.xipaiValueText.text = value / 100
self.xipaiValue = value / 1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
@ -78,8 +78,8 @@ function M:FillData(view, index)
ViewUtil.ErrorTip(1, "输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text = value / 1000 self.anchouValueText.text = value / 100
self.anchouValue = value / 1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
@ -194,11 +194,11 @@ function M:LoadConfigData(data)
if oldGameVersion == 2 then if oldGameVersion == 2 then
self.xipaiValueText.text = data.xi_pai_score / 1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue = data.xi_pai_score / 1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text = data.an_chou_score / 1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue = data.an_chou_score / 1000 self.anchouValue = data.an_chou_score / 100
end end
end end
@ -291,8 +291,8 @@ function M:SelectedConfigData()
an_chou_score = self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score * 1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score * 1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
end end

View File

@ -7,8 +7,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = "EXGameInfo" self.class = "EXGameInfo"
UIPackage.AddPackage("extend/poker/sanqianfen/ui/Info_Poker_SanQianFen") UIPackage.AddPackage("extend/poker/sanqianfen/ui/Info_Poker_SanQianFen")
return self return self
@ -18,7 +18,7 @@ function M:FillData(view, index)
self._maxPlayer = 3 -- 默认玩家人数 self._maxPlayer = 3 -- 默认玩家人数
self._roundChoice = 5 -- 回合选项数 self._roundChoice = 5 -- 回合选项数
if oldGameVersion==1 then if oldGameVersion == 1 then
self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen")
else else
self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen") self._config = UIPackage.CreateObjectFromURL("ui://Info_Poker_SanQianFen/Creat_SanQianFen")
@ -50,8 +50,8 @@ function M:FillData(view, index)
-- ViewUtil.ErrorTip(1,"输入数据异常!") -- ViewUtil.ErrorTip(1,"输入数据异常!")
-- end -- end
-- self.xipaiValueText.text=value/1000 -- self.xipaiValueText.text=value/100
-- self.xipaiValue=value/1000 -- self.xipaiValue=value/100
-- end, 0, nil) -- end, 0, nil)
-- gniv:Show() -- gniv:Show()
@ -82,7 +82,6 @@ function M:FillData(view, index)
piao.selectedIndex = 0 piao.selectedIndex = 0
end end
end) end)
end end
local _help_url = "ui://Info_Poker_SanQianFen/Com_help" local _help_url = "ui://Info_Poker_SanQianFen/Com_help"
@ -100,7 +99,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"15张玩法","16张玩法"} local _play_list = { "15张玩法", "16张玩法" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -130,7 +129,6 @@ function M:LoadConfigData(data)
_config:GetChild("planelack").selected = false _config:GetChild("planelack").selected = false
_config:GetChild("Threelack").selected = false _config:GetChild("Threelack").selected = false
else else
_config:GetChild("sandaidan").selected = false _config:GetChild("sandaidan").selected = false
@ -163,15 +161,15 @@ function M:LoadConfigData(data)
end end
if _config:GetChild("fourBeltThree") then if _config:GetChild("fourBeltThree") then
_config:GetChild("fourBeltThree").selected=data.fourDaiTwo _config:GetChild("fourBeltThree").selected = data.fourDaiTwo
end end
if _config:GetChild("fourBeltTwo") then if _config:GetChild("fourBeltTwo") then
_config:GetChild("fourBeltTwo").selected=data.fourDaiThree _config:GetChild("fourBeltTwo").selected = data.fourDaiThree
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
@ -179,7 +177,6 @@ function M:LoadConfigData(data)
-- self.xipaiValueText.text=data.xi_pai_score -- self.xipaiValueText.text=data.xi_pai_score
-- self.xipaiValue=data.xi_pai_score -- self.xipaiValue=data.xi_pai_score
-- end -- end
end end
function M:SelectedConfigData() function M:SelectedConfigData()
@ -206,17 +203,17 @@ function M:SelectedConfigData()
local fs = _config:GetChild("fan_sprint").selected and 1 or 0 local fs = _config:GetChild("fan_sprint").selected and 1 or 0
----- -----
local fourDaiTwo=false local fourDaiTwo = false
if _config:GetChild("fourBeltThree") then if _config:GetChild("fourBeltThree") then
fourDaiTwo = _config:GetChild("fourBeltThree").selected fourDaiTwo = _config:GetChild("fourBeltThree").selected
end end
local fourDaiThree=false local fourDaiThree = false
if _config:GetChild("fourBeltTwo") then if _config:GetChild("fourBeltTwo") then
fourDaiThree = _config:GetChild("fourBeltTwo").selected fourDaiThree = _config:GetChild("fourBeltTwo").selected
end end
local xi_pai=false local xi_pai = false
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -259,7 +256,6 @@ function M:SelectedConfigData()
_data["planelack"] = 0 _data["planelack"] = 0
_data["threelack"] = 0 _data["threelack"] = 0
else else
if sandaidan == 1 then if sandaidan == 1 then
_data["planelack"] = 0 _data["planelack"] = 0
_data["threelack"] = 0 _data["threelack"] = 0
@ -271,9 +267,9 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
end end
_data['xi_pai_score'] = xi_pai_score _data['xi_pai_score'] = xi_pai_score

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Extend_Poker_ChangdeWHZ') UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Extend_Poker_ChangdeWHZ')
UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Info_Poker_ChangdeWHZ') UIPackage.AddPackage('extend/zipai/changdepaohuzi/ui/Info_Poker_ChangdeWHZ')
@ -16,74 +16,64 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_ChangdeWHZ/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_ChangdeWHZ/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
self._config:GetChild("xipai").visible=false self._config:GetChild("xipai").visible = false
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
@ -191,6 +181,7 @@ function M:FillData()
end end
) )
end end
local _help_url = 'ui://Info_Poker_ChangdeWHZ/Com_help' local _help_url = 'ui://Info_Poker_ChangdeWHZ/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -206,7 +197,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"全名堂","红黑点","多红多番"} local _play_list = { "全名堂", "红黑点", "多红多番" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -214,7 +205,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local wanfa_C = _config:GetController('btn_Controller').selectedIndex 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 Cost = _config:GetController('Cost').selectedIndex
local tun = _config:GetController('tun').selectedIndex local tun = _config:GetController('tun').selectedIndex
local fengding = _config:GetController('fengding').selectedIndex local fengding = _config:GetController('fengding').selectedIndex
@ -267,8 +258,8 @@ function M:SelectedConfigData()
_data['qupai'] = false _data['qupai'] = false
end end
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -276,16 +267,16 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
return _data return _data
@ -327,19 +318,19 @@ function M:LoadConfigData(data)
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype) IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu') local people = self._config:GetController('renshu')
@ -350,4 +341,5 @@ function M:OnChangeOption(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa')
@ -16,52 +16,45 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
--self._config:GetChild("xipai").visible=false --self._config:GetChild("xipai").visible=false
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help' local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -77,19 +70,18 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController('round').selectedIndex+1 --局数 local round = _config:GetController('round').selectedIndex + 1 --局数
local Cost = _config:GetController('Cost').selectedIndex local Cost = _config:GetController('Cost').selectedIndex
local renshu = _config:GetController('renshu').selectedIndex+2 --人数 local renshu = _config:GetController('renshu').selectedIndex + 2 --人数
local shoupai = _config:GetController('shoupai').selectedIndex --手牌 local shoupai = _config:GetController('shoupai').selectedIndex --手牌
local choupai = _config:GetController('choupai').selectedIndex --抽牌 local choupai = _config:GetController('choupai').selectedIndex --抽牌
local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 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 tiandihu = _config:GetChild('btn_tiandihu').selected
local honghu = _config:GetChild('btn_honghu').selected local honghu = _config:GetChild('btn_honghu').selected
@ -103,10 +95,10 @@ function M:SelectedConfigData()
if shoupai==1 then if shoupai == 1 then
hunum=0 hunum = 0
end end
if shoupai==0 and hunum==0 then if shoupai == 0 and hunum == 0 then
_config:GetController('hunum').selectedIndex = 1 _config:GetController('hunum').selectedIndex = 1
end end
@ -133,8 +125,8 @@ function M:SelectedConfigData()
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
--xi_pai = _config:GetChild("xipai").selected --xi_pai = _config:GetChild("xipai").selected
xi_pai = true xi_pai = true
@ -142,12 +134,12 @@ function M:SelectedConfigData()
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
return _data return _data
end end
@ -163,7 +155,7 @@ function M:LoadConfigData(data)
_config:GetController('choupai').selectedIndex = data.choupai --抽牌 _config:GetController('choupai').selectedIndex = data.choupai --抽牌
_config:GetController('hunum').selectedIndex = data.hunum --起胡息 _config:GetController('hunum').selectedIndex = data.hunum --起胡息
_config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打1:10,2:20,3:50 _config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打1:10,2:20,3:50
_config:GetController('fengding').selectedIndex = data.fengding-1 _config:GetController('fengding').selectedIndex = data.fengding - 1
_config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡 _config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡
_config:GetChild('btn_honghu').selected = data.honghu --红胡 _config:GetChild('btn_honghu').selected = data.honghu --红胡
@ -176,12 +168,12 @@ function M:LoadConfigData(data)
_config:GetChild('btn_mingwei').selected = data.mingwei --明偎 _config:GetChild('btn_mingwei').selected = data.mingwei --明偎
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype) IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu') local people = self._config:GetController('renshu')
@ -192,4 +184,5 @@ function M:OnChangeOption(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa')
@ -16,52 +16,45 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
--self._config:GetChild("xipai").visible=false --self._config:GetChild("xipai").visible=false
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help' local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -77,12 +70,11 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController('round').selectedIndex+1 --局数 local round = _config:GetController('round').selectedIndex + 1 --局数
local Cost = _config:GetController('Cost').selectedIndex local Cost = _config:GetController('Cost').selectedIndex
local renshu = _config:GetController('renshu').selectedIndex+2 --人数 local renshu = _config:GetController('renshu').selectedIndex + 2 --人数
local shoupai = _config:GetController('shoupai').selectedIndex --手牌 local shoupai = _config:GetController('shoupai').selectedIndex --手牌
local choupai = _config:GetController('choupai').selectedIndex --抽牌 local choupai = _config:GetController('choupai').selectedIndex --抽牌
local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15 local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15
@ -102,10 +94,10 @@ function M:SelectedConfigData()
if shoupai==1 then if shoupai == 1 then
hunum=0 hunum = 0
end end
if shoupai==0 and hunum==0 then if shoupai == 0 and hunum == 0 then
_config:GetController('hunum').selectedIndex = 1 _config:GetController('hunum').selectedIndex = 1
end end
@ -131,8 +123,8 @@ function M:SelectedConfigData()
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
--xi_pai = _config:GetChild("xipai").selected --xi_pai = _config:GetChild("xipai").selected
xi_pai = true xi_pai = true
@ -140,12 +132,12 @@ function M:SelectedConfigData()
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
return _data return _data
end end
@ -172,12 +164,12 @@ function M:LoadConfigData(data)
_config:GetChild('btn_kahu').selected = data.kahu --卡胡 _config:GetChild('btn_kahu').selected = data.kahu --卡胡
_config:GetChild('btn_mingwei').selected = data.mingwei --明偎 _config:GetChild('btn_mingwei').selected = data.mingwei --明偎
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype) IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu') local people = self._config:GetController('renshu')
@ -188,4 +180,5 @@ function M:OnChangeOption(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/fulushou/ui/Info_Poker_FuLuShou') UIPackage.AddPackage('extend/zipai/fulushou/ui/Info_Poker_FuLuShou')
return self return self
@ -15,47 +15,42 @@ function M:FillData()
self._maxPlayer = 3 -- 默认玩家人数 self._maxPlayer = 3 -- 默认玩家人数
self._roundChoice = 2 -- 回合选项数 self._roundChoice = 2 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FuLuShou/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FuLuShou/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -63,35 +58,29 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_FuLuShou/Com_help' local _help_url = 'ui://Info_Poker_FuLuShou/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -115,25 +104,25 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 local round = _config:GetController('round').selectedIndex == 0 and 1 or 2
local renshu = _config:GetController('play_list').selectedIndex +2 local renshu = _config:GetController('play_list').selectedIndex + 2
local xuan_zhuang=_config:GetController('zhuangjia').selectedIndex local xuan_zhuang = _config:GetController('zhuangjia').selectedIndex
local piao=_config:GetController('piao').selectedIndex local piao = _config:GetController('piao').selectedIndex
local piao1=false local piao1 = false
local piao2=false local piao2 = false
local piao3=false local piao3 = false
local piao4=false local piao4 = false
if piao==3 then if piao == 3 then
piao1=_config:GetChild('pf1').selected and true or false piao1 = _config:GetChild('pf1').selected and true or false
piao2=_config:GetChild('pf2').selected and true or false piao2 = _config:GetChild('pf2').selected and true or false
piao3=_config:GetChild('pf3').selected and true or false piao3 = _config:GetChild('pf3').selected and true or false
piao4=_config:GetChild('pf4').selected and true or false piao4 = _config:GetChild('pf4').selected and true or false
end end
local fen_diejia=_config:GetController('fen').selectedIndex local fen_diejia = _config:GetController('fen').selectedIndex
local qing_zui_hu=_config:GetController('qinzuihu').selectedIndex local qing_zui_hu = _config:GetController('qinzuihu').selectedIndex
local gang_zhao_liu_xi=_config:GetChild('gangzhao').selected and true or false 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 special_peng_peng_hu = _config:GetChild('pengpenghu').selected and true or false
local piao_fen = _config:GetController('piaofen').selectedIndex local piao_fen = _config:GetController('piaofen').selectedIndex
@ -162,24 +151,24 @@ function M:SelectedConfigData()
end end
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
@ -188,14 +177,14 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config 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('round').selectedIndex = data.opt == 1 and 0 or 1
_config:GetController('zhuangjia').selectedIndex= data.xuan_zhuang _config:GetController('zhuangjia').selectedIndex = data.xuan_zhuang
_config:GetController('piao').selectedIndex= data.piao _config:GetController('piao').selectedIndex = data.piao
_config:GetChild('pf1').selected=data.piao1 _config:GetChild('pf1').selected = data.piao1
_config:GetChild('pf2').selected=data.piao2 _config:GetChild('pf2').selected = data.piao2
_config:GetChild('pf3').selected=data.piao3 _config:GetChild('pf3').selected = data.piao3
_config:GetChild('pf4').selected=data.piao4 _config:GetChild('pf4').selected = data.piao4
if (data.piao_fen == 1) then if (data.piao_fen == 1) then
_config:GetController('piaofen').selectedIndex = 0 _config:GetController('piaofen').selectedIndex = 0
@ -209,24 +198,23 @@ function M:LoadConfigData(data)
_config:GetController('fen').selectedIndex= data.fen_diejia _config:GetController('fen').selectedIndex = data.fen_diejia
_config:GetController('qinzuihu').selectedIndex= data.qing_zui_hu _config:GetController('qinzuihu').selectedIndex = data.qing_zui_hu
_config:GetChild('gangzhao').selected = data.gang_zhao_liu_xi _config:GetChild('gangzhao').selected = data.gang_zhao_liu_xi
_config:GetChild('pengpenghu').selected= data.special_peng_peng_hu _config:GetChild('pengpenghu').selected = data.special_peng_peng_hu
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
@ -235,9 +223,10 @@ function M:OnChangeOption(ctype)
local play_list = self._config:GetController('play_list') local play_list = self._config:GetController('play_list')
play_list.onChanged:Add( play_list.onChanged:Add(
function() function()
self._maxPlayer = play_list.selectedIndex +2 self._maxPlayer = play_list.selectedIndex + 2
self:ShowVariablePrice(ctype) self:ShowVariablePrice(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/hsrunbeard/ui/Info_Poker_HSRunBeard') UIPackage.AddPackage('extend/zipai/hsrunbeard/ui/Info_Poker_HSRunBeard')
@ -23,10 +23,10 @@ function M:FillData()
local btn_jian1 = self._config:GetChild('btn_jian1') local btn_jian1 = self._config:GetChild('btn_jian1')
local btn_jia2 = self._config:GetChild('btn_jia2') local btn_jia2 = self._config:GetChild('btn_jia2')
local btn_jian2 = self._config:GetChild('btn_jian2') local btn_jian2 = self._config:GetChild('btn_jian2')
local fS=self._config:GetChild('btn_round8'):GetChild("title") local fS = self._config:GetChild('btn_round8'):GetChild("title")
fS.text="1局" fS.text = "1局"
fS=self._config:GetChild('btn_round16'):GetChild("title") fS = self._config:GetChild('btn_round16'):GetChild("title")
fS.text="8局" fS.text = "8局"
btn_jia.onClick:Set( btn_jia.onClick:Set(
function() function()
if self._config:GetController('tun').selectedIndex ~= 5 then if self._config:GetController('tun').selectedIndex ~= 5 then
@ -61,7 +61,6 @@ function M:FillData()
function() function()
local cur_tun = tonumber(self._config:GetChild("shu1").text) local cur_tun = tonumber(self._config:GetChild("shu1").text)
if cur_tun < 15 then if cur_tun < 15 then
cur_tun = cur_tun + 1 cur_tun = cur_tun + 1
self._config:GetChild("shu1").text = tostring(cur_tun) self._config:GetChild("shu1").text = tostring(cur_tun)
@ -79,7 +78,6 @@ function M:FillData()
function() function()
local cur_tun = tonumber(self._config:GetChild("shu1").text) local cur_tun = tonumber(self._config:GetChild("shu1").text)
if cur_tun > 1 then if cur_tun > 1 then
cur_tun = cur_tun - 1 cur_tun = cur_tun - 1
self._config:GetChild("shu1").text = tostring(cur_tun) self._config:GetChild("shu1").text = tostring(cur_tun)
@ -126,49 +124,42 @@ function M:FillData()
) )
if oldGameVersion ==1 then if oldGameVersion == 1 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValue=1 self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_HSRunBeard/Com_help' local _help_url = 'ui://Info_Poker_HSRunBeard/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -184,7 +175,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"三人玩法","二人玩法"} local _play_list = { "三人玩法", "二人玩法" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -209,7 +200,7 @@ function M:SelectedConfigData()
local tianhu = _config:GetController('tianhu').selectedIndex local tianhu = _config:GetController('tianhu').selectedIndex
local dihu = _config:GetController('dihu').selectedIndex local dihu = _config:GetController('dihu').selectedIndex
local haihu = _config:GetController('haihu').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 qupai = _config:GetController('qupai').selectedIndex
local dhdf = 0 local dhdf = 0
local _data = {} local _data = {}
@ -244,7 +235,6 @@ function M:SelectedConfigData()
_data['jhd'] = _config:GetController('jhd').selectedIndex _data['jhd'] = _config:GetController('jhd').selectedIndex
_data['dhdf'] = dhdf _data['dhdf'] = dhdf
elseif wanfa_C == 2 then 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['tianhu'] = tianhu
@ -258,8 +248,8 @@ function M:SelectedConfigData()
_data['qupai'] = qupai _data['qupai'] = qupai
end end
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -267,9 +257,9 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
end end
_data['xi_pai_score'] = xi_pai_score _data['xi_pai_score'] = xi_pai_score
@ -280,10 +270,10 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config 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('round').selectedIndex = data.opt == 1 and 0 or 1
_config:GetController('Cost').selectedIndex = data.AA _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.hh = data.hh == nil and 1 or data.hh
data.dh = data.dh == nil and 1 or data.dh 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('tinghu').selectedIndex = data.tinghu
_config:GetController('Back').selectedIndex = data.back _config:GetController('Back').selectedIndex = data.back
_config:GetController('yuan').selectedIndex = data.yuan _config:GetController('yuan').selectedIndex = data.yuan
elseif data.mode == 2 then elseif data.mode == 2 then
_config:GetChild("shu1").text = tostring(data.tun) _config:GetChild("shu1").text = tostring(data.tun)
local btn_jian1 = _config:GetChild("btn_jian1") local btn_jian1 = _config:GetChild("btn_jian1")
@ -341,7 +329,6 @@ function M:LoadConfigData(data)
_config:GetController('dhdf').selectedIndex = data.dhdf _config:GetController('dhdf').selectedIndex = data.dhdf
elseif data.mode == 3 then elseif data.mode == 3 then
_config:GetController('haihu').selectedIndex = data.haihu _config:GetController('haihu').selectedIndex = data.haihu
_config:GetController('tinghu').selectedIndex = data.tinghu _config:GetController('tinghu').selectedIndex = data.tinghu
_config:GetController('tianhu').selectedIndex = data.tianhu _config:GetController('tianhu').selectedIndex = data.tianhu
@ -356,12 +343,12 @@ function M:LoadConfigData(data)
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score self.xipaiValueText.text = data.xi_pai_score
self.xipaiValue=data.xi_pai_score self.xipaiValue = data.xi_pai_score
end end
end end
@ -371,9 +358,10 @@ function M:OnChangeOption(ctype)
local play_list = self._config:GetController('play_list') local play_list = self._config:GetController('play_list')
play_list.onChanged:Add( play_list.onChanged:Add(
function() function()
self._maxPlayer = play_list.selectedIndex +2 self._maxPlayer = play_list.selectedIndex + 2
self:ShowVariablePrice(ctype) self:ShowVariablePrice(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/runbeard/ui/Extend_Poker_RunBeard') UIPackage.AddPackage('extend/zipai/runbeard/ui/Extend_Poker_RunBeard')
UIPackage.AddPackage('extend/zipai/runbeard/ui/Info_Poker_RunBeard') UIPackage.AddPackage('extend/zipai/runbeard/ui/Info_Poker_RunBeard')
@ -16,79 +16,68 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_RunBeard/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_RunBeard/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
--self._config:GetChild("xipai").visible=false --self._config:GetChild("xipai").visible=false
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
@ -194,6 +183,7 @@ function M:FillData()
-- end -- end
-- ) -- )
end end
local _help_url = 'ui://Info_Poker_RunBeard/Com_help' local _help_url = 'ui://Info_Poker_RunBeard/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -209,7 +199,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"多红多番","红黑点","全名堂"} local _play_list = { "多红多番", "红黑点", "全名堂" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -217,7 +207,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local wanfa_C = _config:GetController('btn_Controller').selectedIndex 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 Cost = _config:GetController('Cost').selectedIndex
local tun = _config:GetController('tun').selectedIndex local tun = _config:GetController('tun').selectedIndex
local fengding = _config:GetController('fengding').selectedIndex local fengding = _config:GetController('fengding').selectedIndex
@ -245,9 +235,9 @@ function M:SelectedConfigData()
local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡
local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红
local qupai=0 local qupai = 0
if renshu==2 then if renshu == 2 then
qupai=_config:GetController('qupai').selectedIndex qupai = _config:GetController('qupai').selectedIndex
end end
-- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false
local _data = {} local _data = {}
@ -273,7 +263,6 @@ function M:SelectedConfigData()
_data['daxiaozi'] = daxiaozi _data['daxiaozi'] = daxiaozi
_data['hongheihu'] = hongheihu _data['hongheihu'] = hongheihu
_data['yidianhu'] = yidianhu _data['yidianhu'] = yidianhu
elseif wanfa_C == 1 then elseif wanfa_C == 1 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['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶
@ -295,8 +284,8 @@ function M:SelectedConfigData()
-- _data['qupai'] = false -- _data['qupai'] = false
-- end -- end
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -304,15 +293,15 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
end end
@ -344,13 +333,11 @@ function M:LoadConfigData(data)
_config:GetController('daxiaozi').selectedIndex = data.daxiaozi _config:GetController('daxiaozi').selectedIndex = data.daxiaozi
_config:GetController('hongheihu').selectedIndex = data.hongheihu _config:GetController('hongheihu').selectedIndex = data.hongheihu
_config:GetController('yidianhu').selectedIndex = data.yidianhu _config:GetController('yidianhu').selectedIndex = data.yidianhu
elseif data.mode == 2 then elseif data.mode == 2 then
_config:GetController('tun').selectedIndex = data.tun _config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding _config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('duizifu').selectedIndex = data.duizifu _config:GetController('duizifu').selectedIndex = data.duizifu
elseif data.mode == 3 then elseif data.mode == 3 then
_config:GetController('tun').selectedIndex = data.tun _config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding _config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('tuanyuan').selectedIndex = data.tuanyuan _config:GetController('tuanyuan').selectedIndex = data.tuanyuan
@ -368,19 +355,19 @@ function M:LoadConfigData(data)
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype) IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu') local people = self._config:GetController('renshu')
@ -391,4 +378,5 @@ function M:OnChangeOption(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/shihuka/ui/Extend_Poker_ShiHuKa') UIPackage.AddPackage('extend/zipai/shihuka/ui/Extend_Poker_ShiHuKa')
UIPackage.AddPackage('extend/zipai/shihuka/ui/Info_Poker_ShiHuKa') UIPackage.AddPackage('extend/zipai/shihuka/ui/Info_Poker_ShiHuKa')
@ -16,53 +16,45 @@ function M:FillData()
self._roundChoice = 3 -- 回合选项数 self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_ShiHuKa/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_ShiHuKa/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
--self._config:GetChild("xipai").visible=false --self._config:GetChild("xipai").visible=false
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_ShiHuKa/Com_help' local _help_url = 'ui://Info_Poker_ShiHuKa/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -78,7 +70,7 @@ function M:GetIconUrl1()
return _icon_url1 return _icon_url1
end end
local _play_list = {"多红多番","红黑点","全名堂"} local _play_list = { "多红多番", "红黑点", "全名堂" }
function M:GetPlayList() function M:GetPlayList()
return _play_list return _play_list
end end
@ -86,7 +78,7 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local wanfa_C = _config:GetController('btn_Controller').selectedIndex 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 Cost = _config:GetController('Cost').selectedIndex
local tun = _config:GetController('tun').selectedIndex local tun = _config:GetController('tun').selectedIndex
local fengding = _config:GetController('fengding').selectedIndex local fengding = _config:GetController('fengding').selectedIndex
@ -114,9 +106,9 @@ function M:SelectedConfigData()
local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡 local hongheihu = _config:GetController('hongheihu').selectedIndex --红黑胡
local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红 local yidianhu = _config:GetController('yidianhu').selectedIndex --一点红
local qupai=0 local qupai = 0
if renshu==2 then if renshu == 2 then
qupai=_config:GetController('qupai').selectedIndex qupai = _config:GetController('qupai').selectedIndex
end end
-- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false -- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false
local _data = {} local _data = {}
@ -142,7 +134,6 @@ function M:SelectedConfigData()
_data['daxiaozi'] = daxiaozi _data['daxiaozi'] = daxiaozi
_data['hongheihu'] = hongheihu _data['hongheihu'] = hongheihu
_data['yidianhu'] = yidianhu _data['yidianhu'] = yidianhu
elseif wanfa_C == 1 then elseif wanfa_C == 1 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['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶 _data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶
@ -164,8 +155,8 @@ function M:SelectedConfigData()
-- _data['qupai'] = false -- _data['qupai'] = false
-- end -- end
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
@ -173,15 +164,15 @@ function M:SelectedConfigData()
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
end end
@ -213,13 +204,11 @@ function M:LoadConfigData(data)
_config:GetController('daxiaozi').selectedIndex = data.daxiaozi _config:GetController('daxiaozi').selectedIndex = data.daxiaozi
_config:GetController('hongheihu').selectedIndex = data.hongheihu _config:GetController('hongheihu').selectedIndex = data.hongheihu
_config:GetController('yidianhu').selectedIndex = data.yidianhu _config:GetController('yidianhu').selectedIndex = data.yidianhu
elseif data.mode == 2 then elseif data.mode == 2 then
_config:GetController('tun').selectedIndex = data.tun _config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding _config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('duizifu').selectedIndex = data.duizifu _config:GetController('duizifu').selectedIndex = data.duizifu
elseif data.mode == 3 then elseif data.mode == 3 then
_config:GetController('tun').selectedIndex = data.tun _config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding _config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('tuanyuan').selectedIndex = data.tuanyuan _config:GetController('tuanyuan').selectedIndex = data.tuanyuan
@ -237,19 +226,19 @@ function M:LoadConfigData(data)
end end
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype) IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu') local people = self._config:GetController('renshu')
@ -260,4 +249,5 @@ function M:OnChangeOption(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ')
return self return self
@ -15,47 +15,42 @@ function M:FillData()
self._roundChoice = 2 -- 回合选项数 self._roundChoice = 2 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text=1 self.xipaiValueText.text = 1
self.xipaiValue=1 self.xipaiValue = 1
self.anchouValueText=self._config:GetChild('anchoufen') self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text=1 self.anchouValueText.text = 1
self.anchouValue=1 self.anchouValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
@ -63,34 +58,29 @@ function M:FillData()
local btn_cr2 = self._config:GetChild('anchoubtn') local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.onClick:Set( btn_cr2.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.anchouValueText.text=value/1000 self.anchouValueText.text = value / 100
self.anchouValue=value/1000 self.anchouValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help' local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -114,18 +104,18 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 local round = _config:GetController('round').selectedIndex == 0 and 1 or 2
local renshu = _config:GetController('play_list').selectedIndex +2 local renshu = _config:GetController('play_list').selectedIndex + 2
local kawai=_config:GetController('kawai').selectedIndex local kawai = _config:GetController('kawai').selectedIndex
local piao=_config:GetController('piao').selectedIndex local piao = _config:GetController('piao').selectedIndex
local first_rand_zhuang=_config:GetChild('suijizhuang').selected and true or false local first_rand_zhuang = _config:GetChild('suijizhuang').selected and true or false
local zhuang_di_hu=_config:GetController('zdihu').selectedIndex local zhuang_di_hu = _config:GetController('zdihu').selectedIndex
local hao_config=_config:GetController('hao').selectedIndex local hao_config = _config:GetController('hao').selectedIndex
local hao_jiabei=_config:GetController('jiabei').selectedIndex local hao_jiabei = _config:GetController('jiabei').selectedIndex
local ming_tang=_config:GetController('mingtang').selectedIndex local ming_tang = _config:GetController('mingtang').selectedIndex
local qupai=0 local qupai = 0
if renshu==2 then if renshu == 2 then
qupai=_config:GetController('qupai').selectedIndex qupai = _config:GetController('qupai').selectedIndex
end end
local _data = {} local _data = {}
@ -140,24 +130,24 @@ function M:SelectedConfigData()
_data['first_rand_zhuang'] = first_rand_zhuang _data['first_rand_zhuang'] = first_rand_zhuang
_data['qupai'] = qupai _data['qupai'] = qupai
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
local an_chou_score=0 local an_chou_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
an_chou_score=self.anchouValue an_chou_score = self.anchouValue
end end
_data['xi_pai_score'] = xi_pai_score*1000 _data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score*1000 _data['an_chou_score'] = an_chou_score * 100
return _data return _data
end end
@ -165,29 +155,28 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config 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('round').selectedIndex = data.opt == 1 and 0 or 1
_config:GetController('kawai').selectedIndex=data.kawai _config:GetController('kawai').selectedIndex = data.kawai
_config:GetController('piao').selectedIndex=data.piao _config:GetController('piao').selectedIndex = data.piao
_config:GetChild('suijizhuang').selected =data.first_rand_zhuang _config:GetChild('suijizhuang').selected = data.first_rand_zhuang
_config:GetController('zdihu').selectedIndex=data.zhuang_di_hu _config:GetController('zdihu').selectedIndex = data.zhuang_di_hu
_config:GetController('hao').selectedIndex=data.hao_config _config:GetController('hao').selectedIndex = data.hao_config
_config:GetController('jiabei').selectedIndex=data.hao_jiabei _config:GetController('jiabei').selectedIndex = data.hao_jiabei
_config:GetController('mingtang').selectedIndex=data.ming_tang _config:GetController('mingtang').selectedIndex = data.ming_tang
_config:GetController('qupai').selectedIndex=data.qupai _config:GetController('qupai').selectedIndex = data.qupai
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score/1000 self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue=data.xi_pai_score/1000 self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text=data.an_chou_score/1000 self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue=data.an_chou_score/1000 self.anchouValue = data.an_chou_score / 100
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
@ -196,9 +185,10 @@ function M:OnChangeOption(ctype)
local play_list = self._config:GetController('play_list') local play_list = self._config:GetController('play_list')
play_list.onChanged:Add( play_list.onChanged:Add(
function() function()
self._maxPlayer = play_list.selectedIndex +2 self._maxPlayer = play_list.selectedIndex + 2
self:ShowVariablePrice(ctype) self:ShowVariablePrice(ctype)
end end
) )
end end
return M return M

View File

@ -3,8 +3,8 @@ local EXGameInfo = {}
local M = EXGameInfo local M = EXGameInfo
function EXGameInfo.new(blur_view) function EXGameInfo.new(blur_view)
setmetatable(M, {__index = IGameInfo}) setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo' self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ') UIPackage.AddPackage('extend/zipai/yueyangwaihuzi/ui/Info_Poker_YueYangWHZ')
return self return self
@ -15,48 +15,42 @@ function M:FillData()
self._roundChoice = 2 -- 回合选项数 self._roundChoice = 2 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room') self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_YueYangWHZ/Cgm_create_room')
if oldGameVersion ==1 then if oldGameVersion == 1 then
self._config:GetController("xipai").selectedIndex=0 self._config:GetController("xipai").selectedIndex = 0
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex=1 self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText=self._config:GetChild('xipaifen') self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValue=1 self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn') local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set( btn_cr.onClick:Set(
function() function()
local gniv = GroupNumberInputView_Game.new(nil, function(num) local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit local value = limit
if otype == 1 then if otype == 1 then
value = value + ad2d(num) value = value + ad2d(num)
elseif otype == - 1 then elseif otype == -1 then
value = value - ad2d(num) value = value - ad2d(num)
else else
value = ad2d(num) value = ad2d(num)
end end
if value < 0 then if value < 0 then
ViewUtil.ErrorTip(1,"输入数据异常!") ViewUtil.ErrorTip(1, "输入数据异常!")
end end
self.xipaiValueText.text=value/1000 self.xipaiValueText.text = value / 100
self.xipaiValue=value/1000 self.xipaiValue = value / 100
end, 3, nil) end, 3, nil)
gniv:Show() gniv:Show()
end end
) )
end end
end end
local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help' local _help_url = 'ui://Info_Poker_YueYangWHZ/Com_help'
function M:GetHelpUrl() function M:GetHelpUrl()
return _help_url return _help_url
@ -80,18 +74,18 @@ end
function M:SelectedConfigData() function M:SelectedConfigData()
local _config = self._config local _config = self._config
local round = _config:GetController('round').selectedIndex == 0 and 1 or 2 local round = _config:GetController('round').selectedIndex == 0 and 1 or 2
local renshu = _config:GetController('play_list').selectedIndex +2 local renshu = _config:GetController('play_list').selectedIndex + 2
local kawai=_config:GetController('kawai').selectedIndex local kawai = _config:GetController('kawai').selectedIndex
local piao=_config:GetController('piao').selectedIndex local piao = _config:GetController('piao').selectedIndex
local first_rand_zhuang=_config:GetChild('suijizhuang').selected and true or false local first_rand_zhuang = _config:GetChild('suijizhuang').selected and true or false
local zhuang_di_hu=_config:GetController('zdihu').selectedIndex local zhuang_di_hu = _config:GetController('zdihu').selectedIndex
local hao_config=_config:GetController('hao').selectedIndex local hao_config = _config:GetController('hao').selectedIndex
local hao_jiabei=_config:GetController('jiabei').selectedIndex local hao_jiabei = _config:GetController('jiabei').selectedIndex
local ming_tang=_config:GetController('mingtang').selectedIndex local ming_tang = _config:GetController('mingtang').selectedIndex
local qupai=0 local qupai = 0
if renshu==2 then if renshu == 2 then
qupai=_config:GetController('qupai').selectedIndex qupai = _config:GetController('qupai').selectedIndex
end end
local _data = {} local _data = {}
@ -106,17 +100,17 @@ function M:SelectedConfigData()
_data['first_rand_zhuang'] = first_rand_zhuang _data['first_rand_zhuang'] = first_rand_zhuang
_data['qupai'] = qupai _data['qupai'] = qupai
local xi_pai=false local xi_pai = false
if oldGameVersion ==2 then if oldGameVersion == 2 then
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected xi_pai = _config:GetChild("xipai").selected
end end
end end
_data['xi_pai'] = xi_pai _data['xi_pai'] = xi_pai
local xi_pai_score=0 local xi_pai_score = 0
if oldGameVersion==2 then if oldGameVersion == 2 then
xi_pai_score=self.xipaiValue xi_pai_score = self.xipaiValue
end end
_data['xi_pai_score'] = xi_pai_score _data['xi_pai_score'] = xi_pai_score
@ -127,26 +121,25 @@ end
function M:LoadConfigData(data) function M:LoadConfigData(data)
local _config = self._config 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('round').selectedIndex = data.opt == 1 and 0 or 1
_config:GetController('kawai').selectedIndex=data.kawai _config:GetController('kawai').selectedIndex = data.kawai
_config:GetController('piao').selectedIndex=data.piao _config:GetController('piao').selectedIndex = data.piao
_config:GetChild('suijizhuang').selected =data.first_rand_zhuang _config:GetChild('suijizhuang').selected = data.first_rand_zhuang
_config:GetController('zdihu').selectedIndex=data.zhuang_di_hu _config:GetController('zdihu').selectedIndex = data.zhuang_di_hu
_config:GetController('hao').selectedIndex=data.hao_config _config:GetController('hao').selectedIndex = data.hao_config
_config:GetController('jiabei').selectedIndex=data.hao_jiabei _config:GetController('jiabei').selectedIndex = data.hao_jiabei
_config:GetController('mingtang').selectedIndex=data.ming_tang _config:GetController('mingtang').selectedIndex = data.ming_tang
_config:GetController('qupai').selectedIndex=data.qupai _config:GetController('qupai').selectedIndex = data.qupai
if _config:GetChild("xipai") then if _config:GetChild("xipai") then
_config:GetChild("xipai").selected=data.xi_pai _config:GetChild("xipai").selected = data.xi_pai
end end
if oldGameVersion==2 then if oldGameVersion == 2 then
self.xipaiValueText.text=data.xi_pai_score self.xipaiValueText.text = data.xi_pai_score
self.xipaiValue=data.xi_pai_score self.xipaiValue = data.xi_pai_score
end end
end end
function M:OnChangeOption(ctype) function M:OnChangeOption(ctype)
@ -155,9 +148,10 @@ function M:OnChangeOption(ctype)
local play_list = self._config:GetController('play_list') local play_list = self._config:GetController('play_list')
play_list.onChanged:Add( play_list.onChanged:Add(
function() function()
self._maxPlayer = play_list.selectedIndex +2 self._maxPlayer = play_list.selectedIndex + 2
self:ShowVariablePrice(ctype) self:ShowVariablePrice(ctype)
end end
) )
end end
return M return M

View File

@ -71,7 +71,7 @@
<relation target="" sidePair="center-center%"/> <relation target="" sidePair="center-center%"/>
<Button title="抽水:" titleFontSize="20"/> <Button title="抽水:" titleFontSize="20"/>
</component> </component>
<list id="n125_mpll" name="lst_rewards" xy="268,154" size="905,141" group="n140_ozaz" touchable="false" lineGap="10" defaultItem="ui://m7iejg46mpllhv5" align="center"> <list id="n125_mpll" name="lst_rewards" xy="268,154" size="905,141" group="n140_ozaz" lineGap="10" defaultItem="ui://m7iejg46mpllhv5" align="center">
<item/> <item/>
</list> </list>
<group id="n140_ozaz" name="n140" xy="90,109" size="1083,186"/> <group id="n140_ozaz" name="n140" xy="90,109" size="1083,186"/>