You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

579 lines
19 KiB

  1. -- local MJSelectRadioCompnent = require("luaScript.Views.CreateRoom.Compnent.MJSelectRadioCompnent")
  2. -- local MJGroupCompnent = require("luaScript.Views.CreateRoom.Compnent.MJGroupCompnent")
  3. -- local MJCheckBoxCompnent = require("luaScript.Views.CreateRoom.Compnent.MJCheckBoxCompnent")
  4. -- local MJWanFa=MJFramework.ImportWanFa("luaScript.SubGameDefine.MaJiang.MJWanFa")
  5. local CreateRoomItemBase=require("luaScript.Views.CreateRoom.CreateRoomItemBase")
  6. local MJCreateRoomItem=class("luzhouguiCreateRoomItem",CreateRoomItemBase)
  7. local SELECT_COLOR = cc.c4b(213,46,11,255)
  8. local NON_SELECT_COLOR = cc.c4b(21,99,97,255)
  9. function MJCreateRoomItem:ctor(defaultValues)
  10. MJCreateRoomItem.super.ctor(self, defaultValues, "luzhoumj_room.json")
  11. local ui = loadUI("res/ui/ui_chuangjian/mj_createroom_luzhou.ui");
  12. self.ui = ui;
  13. self:addChild(ui);
  14. self.JuShuRadioManager = import("luaScript.Tools.RadioManager"):new();
  15. --房费
  16. self.PayRadioManager = import("luaScript.Tools.RadioManager"):new();
  17. --人数
  18. self.RenShuRadioManager = import("luaScript.Tools.RadioManager"):new();
  19. --封顶
  20. self.FengDingCheckBoxManager = import("luaScript.Tools.RadioManager"):new();
  21. --鬼牌
  22. self.GuiNumCheckBoxManager = import("luaScript.Tools.RadioManager"):new();
  23. --玩法
  24. self.WanFaCheckBoxManager = import("luaScript.Tools.CheckBoxManager"):new();
  25. --低分加分
  26. self.DiFenJiaFenCheckBoxManager = import("luaScript.Tools.RadioManager"):new();
  27. -- 其他选项
  28. self.otherCheckBoxManager = import("luaScript.Tools.CheckBoxManager"):new()
  29. self:onHideCestView() -- 隐藏cest的界面
  30. end
  31. function MJCreateRoomItem:onHideCestView()
  32. if self.ui.Items.Button_pay0_tips then
  33. self.ui.Items.Button_pay0_tips:setVisible(false)
  34. end
  35. if self.ui.Items.Button_pay1_tips then
  36. self.ui.Items.Button_pay1_tips:setVisible(false)
  37. end
  38. if self.ui.Items.ImageView_pay0_tips then
  39. self.ui.Items.ImageView_pay0_tips:setVisible(false)
  40. end
  41. if self.ui.Items.ImageView_pay1_tips then
  42. self.ui.Items.ImageView_pay1_tips:setVisible(false)
  43. end
  44. end
  45. function MJCreateRoomItem:onShowCestView()
  46. if self.ui.Items.Text_pay0 then
  47. self.ui.Items.Text_pay0:setText("免费")
  48. end
  49. if self.ui.Items.Text_pay1 then
  50. self.ui.Items.Text_pay1:setText("自费")
  51. end
  52. if self.ui.Items.Button_pay0_tips then
  53. self.ui.Items.Button_pay0_tips:setVisible(true)
  54. end
  55. if self.ui.Items.Button_pay1_tips then
  56. self.ui.Items.Button_pay1_tips:setVisible(true)
  57. end
  58. if self.ui.Items.ImageView_pay0_tips then
  59. self.ui.Items.ImageView_pay0_tips:setVisible(false)
  60. end
  61. if self.ui.Items.Button_pay0_tips then
  62. self.ui.Items.Button_pay0_tips:registerClick(function()
  63. if self.ui.Items.ImageView_pay0_tips then
  64. local isVisible = not self.ui.Items.ImageView_pay0_tips:isVisible()
  65. self.ui.Items.ImageView_pay0_tips:setVisible(isVisible)
  66. end
  67. end)
  68. end
  69. if self.ui.Items.ImageView_pay1_tips then
  70. self.ui.Items.ImageView_pay1_tips:setVisible(false)
  71. end
  72. if self.ui.Items.Button_pay1_tips then
  73. self.ui.Items.Button_pay1_tips:registerClick(function()
  74. if self.ui.Items.ImageView_pay1_tips then
  75. local isVisible = not self.ui.Items.ImageView_pay1_tips:isVisible()
  76. self.ui.Items.ImageView_pay1_tips:setVisible(isVisible)
  77. end
  78. end)
  79. end
  80. end
  81. --根据局数获取房费
  82. function MJCreateRoomItem:getCreateRoomCost(jushu)
  83. if self.cost then
  84. local costInfo = self.cost[jushu]
  85. if costInfo then
  86. local payMode = self.PayRadioManager:getResult()
  87. if payMode == 0 then
  88. return costInfo.roomCard or 0
  89. elseif payMode == 1 then
  90. return costInfo.roomCardAA or 0
  91. end
  92. end
  93. end
  94. return 0
  95. end
  96. function MJCreateRoomItem:onEnter()
  97. MJCreateRoomItem.super.onEnter(self)
  98. -- 整理不同局数对应的房卡消耗
  99. local payTypes={}
  100. local gameConfig = app.user:getGameConfig(GAME_IDS.LuZhouMJ)--app.gameId);
  101. if gameConfig then
  102. local arrGameRound = toNumberArray(",")(gameConfig.gameRound)
  103. local arrRequireCards = toNumberArray(",")(gameConfig.requireCards)
  104. local arrRequireCardsAA = toNumberArray(",")(gameConfig.AArequireCards)
  105. for idx, gameRound in ipairs(arrGameRound) do
  106. payTypes[gameRound] =
  107. {
  108. roomCard = arrRequireCards[idx],
  109. roomCardAA = arrRequireCardsAA[idx],
  110. }
  111. end
  112. end
  113. self.cost = payTypes
  114. -- 玩家选择局数后,更新房卡消耗
  115. --[[local function updateCost(gameRound)
  116. local costInfo = payTypes[gameRound]
  117. if costInfo then
  118. self.ui.Items.Text_FangZhu:setText(tostring(costInfo.requireCards or 0))
  119. self.ui.Items.Text_AAPay:setText(tostring(costInfo.requireCardsAA or 0))
  120. end
  121. end --]]
  122. --[[-- 局数 jushu
  123. if self.JuShuRadioManager then
  124. self.JuShuRadioManager:addItem(self.ui.Items.CheckBox_1, 8); -- 6局
  125. self.JuShuRadioManager:addItem(self.ui.Items.CheckBox_2, 12); -- 10局
  126. self.JuShuRadioManager:addItem(self.ui.Items.CheckBox_3, 20); -- 16局
  127. local gamenumDefault = self:getDefaultValue("totalgamenum")
  128. local jushuDefault = self:getDefaultValue("jushu")
  129. local defaultValue = gamenumDefault or jushuDefault or 8
  130. self.JuShuRadioManager:setDefault(defaultValue);
  131. --self.JuShuRadioManager:setCallback(updateCost);
  132. --updateCost(defaultValue)
  133. end --]]
  134. -- 房费
  135. if self.PayRadioManager then
  136. self.PayRadioManager:addItem(self.ui.Items.CheckBox_FangZhu, 0); -- 房主支付
  137. self.PayRadioManager:addItem(self.ui.Items.CheckBox_AAPay, 1); -- AA支付
  138. --self.PayRadioManager:addItem(self.ui.Items.CheckBox_WinFinal, 2); -- 大赢家支付
  139. local default = self:getDefaultValue("deductRule") or 0
  140. self.PayRadioManager:setDefault(default)
  141. --通知创建界面更新显示
  142. local function dispatchUpdateCost()
  143. app:dispatchEvent({name = "onChangePayMode"})
  144. end
  145. self.PayRadioManager:setCallback(dispatchUpdateCost);
  146. self:setDefaultTextColor(self.PayRadioManager,"Text_pay")
  147. --self:updataTextColor(self.PayRadioManager,"Text_pay","radioBox",{0,1})
  148. end
  149. -- 人数
  150. if self.RenShuRadioManager then
  151. self.RenShuRadioManager:addItem(self.ui.Items.CheckBox_playerCount_4, 0); -- 快速开局
  152. self.RenShuRadioManager:addItem(self.ui.Items.CheckBox_playerCount_3, 4); -- 满4人开
  153. self.RenShuRadioManager:addItem(self.ui.Items.CheckBox_playerCount_2, 3); -- 满3人开
  154. self.RenShuRadioManager:addItem(self.ui.Items.CheckBox_playerCount_1, 2); -- 满2人开
  155. local defaultValue = self:getDefaultValue("playnum") or 0
  156. local isfaststart = self:getDefaultValue("isfaststart") or 1
  157. --2人时显示低分加分
  158. local function renShuCallBack(value)
  159. if value == 3 or value == 4 then
  160. self.ui.Items.Layout_DiFenJiaFen:setVisible(false)
  161. self.ui.Items.ImageView_DFJF:setVisible(false)
  162. else
  163. self.ui.Items.Layout_DiFenJiaFen:setVisible(true)
  164. end
  165. self.ui.Items.Layout_1:requestDoLayout()
  166. self.ui.Items.Layout_1:doLayout();
  167. end
  168. if isfaststart==1 then
  169. self.RenShuRadioManager:setDefault(0);
  170. renShuCallBack(0)
  171. else
  172. self.RenShuRadioManager:setDefault(defaultValue);
  173. renShuCallBack(defaultValue)
  174. end
  175. self:setDefaultTextColor(self.RenShuRadioManager,"Text_player")
  176. self:updataTextColor(self.RenShuRadioManager,"Text_player","radioBox",{0,4,3,2})
  177. self.RenShuRadioManager:setCallback(renShuCallBack);
  178. end
  179. --快速成局说明
  180. self.ui.Items.ImageView_KSCJ:setVisible(false)
  181. self.ui.Items.Button_KSCJ:registerClick(function()
  182. self.ui.Items.ImageView_KSCJ:setVisible(not self.ui.Items.ImageView_KSCJ:isVisible())
  183. end)
  184. --低分加分说明
  185. self.ui.Items.ImageView_DFJF:setVisible(false)
  186. self.ui.Items.Button_DFJF:registerClick(function()
  187. self.ui.Items.ImageView_DFJF:setVisible(not self.ui.Items.ImageView_DFJF:isVisible())
  188. end)
  189. -- 封顶
  190. if self.FengDingCheckBoxManager then
  191. self.FengDingCheckBoxManager:addItem(self.ui.Items.CheckBox_40Ke, 5); -- 40颗
  192. self.FengDingCheckBoxManager:addItem(self.ui.Items.CheckBox_80Ke, 6); -- 80颗
  193. local default = self:getDefaultValue("limitfan") or 6
  194. self.FengDingCheckBoxManager:setDefault(default)
  195. --40颗时可选5颗起胡
  196. local function keShuCallBack(value)
  197. if value == 5 then
  198. self.ui.Items.CheckBox_HuFan:setEnabled(true)
  199. elseif value == 6 then
  200. self.ui.Items.CheckBox_HuFan:setSelectedState(false)
  201. self.ui.Items.Text_HuFan:setTextColor(NON_SELECT_COLOR)
  202. self.ui.Items.CheckBox_HuFan:setEnabled(false)
  203. end
  204. end
  205. keShuCallBack(default)
  206. self:setDefaultTextColor(self.FengDingCheckBoxManager,"Text_limit")
  207. self:updataTextColor(self.FengDingCheckBoxManager,"Text_limit","radioBox",{5,6})
  208. self.FengDingCheckBoxManager:setCallback(keShuCallBack);
  209. end
  210. -- 鬼牌
  211. if self.GuiNumCheckBoxManager then
  212. self.GuiNumCheckBoxManager:addItem(self.ui.Items.CheckBox_4Gui, 4); -- 4鬼
  213. self.GuiNumCheckBoxManager:addItem(self.ui.Items.CheckBox_8Gui, 8); -- 8鬼
  214. self.GuiNumCheckBoxManager:addItem(self.ui.Items.CheckBox_12Gui, 12); -- 12鬼
  215. local default = self:getDefaultValue("laizinum") or 12
  216. self.GuiNumCheckBoxManager:setDefault(default)
  217. self:setDefaultTextColor(self.GuiNumCheckBoxManager,"Text_gui")
  218. self:updataTextColor(self.GuiNumCheckBoxManager,"Text_gui","radioBox",{4,8,12})
  219. end
  220. --玩法
  221. if self.WanFaCheckBoxManager then
  222. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_BaoJiao, "baojiao", 1, 0)
  223. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_XiQian, "xiqian", 1, 0)
  224. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_GuoZhangHu, "guozhangjiafan", 1, 0)
  225. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_TouZhuang, "toujiazhuang", 1, 0)
  226. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_TingPai, "tingpai", 1, 0)
  227. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_GDHZ, "isoutredcard", 1, 0)
  228. self.WanFaCheckBoxManager:addItem(self.ui.Items.CheckBox_HuFan, "hufan", 2, 0)--5颗起胡 字段"hufan", 40封顶时可选,选中取值为2,不选取值为0
  229. local baojiao = self:getDefaultValue("baojiao") or 1
  230. local xiqian = self:getDefaultValue("xiqian") or 0
  231. local guozhangjiafan = self:getDefaultValue("guozhangjiafan") or 1
  232. local toujiazhuang = self:getDefaultValue("toujiazhuang") or 0
  233. local tingpai = self:getDefaultValue("tingpai") or 1
  234. local isoutredcard = self:getDefaultValue("isoutredcard") or 0
  235. local hufan = self:getDefaultValue("hufan") or 0
  236. local selecteds = {}
  237. if baojiao==1 then
  238. table.insert(selecteds,"baojiao")
  239. end
  240. if xiqian==1 then
  241. table.insert(selecteds,"xiqian")
  242. end
  243. if guozhangjiafan==1 then
  244. table.insert(selecteds,"guozhangjiafan")
  245. end
  246. if toujiazhuang==1 then
  247. table.insert(selecteds,"toujiazhuang")
  248. end
  249. if tingpai==1 then
  250. table.insert(selecteds,"tingpai")
  251. end
  252. if isoutredcard==1 then
  253. table.insert(selecteds,"isoutredcard")
  254. end
  255. if hufan==2 then
  256. table.insert(selecteds,"hufan")
  257. end
  258. self.WanFaCheckBoxManager:setDefault(selecteds)
  259. self:setDefaultTextColor()
  260. self:updataTextColor(self.WanFaCheckBoxManager,"","checkBox",{})
  261. end
  262. self.curJFBS = self:getDefaultValue("baseMulti") or 1;
  263. -- 低分加分
  264. if self.DiFenJiaFenCheckBoxManager then
  265. self.DiFenJiaFenCheckBoxManager:addItem(self.ui.Items.CheckBox_BuJiaFen, 0);-- 不加分
  266. self.DiFenJiaFenCheckBoxManager:addItem(self.ui.Items.CheckBox_JiaFen, 1); -- 加分
  267. local default = self:getDefaultValue("diFenLimit") or 0
  268. if default > 0 then
  269. default = 1
  270. end
  271. self.DiFenJiaFenCheckBoxManager:setDefault(default)
  272. --self:setDefaultTextColor(self.DiFenJiaFenCheckBoxManager,"Text_difenjiadi")
  273. end
  274. --小于多少分
  275. self._txtLimitScore = self.ui.Items.Text_limitScore
  276. local lstMin, lsMax = 5, 40
  277. self.Slider_limitScore = self.ui.Items.Slider_limitScore
  278. self.Slider_limitScore:addEventListener(function ( sender, eventType)
  279. if eventType == 0 then
  280. local per = sender:getPercent()
  281. self.limitScore = math.floor(lstMin + (lsMax-lstMin)/100 * per)
  282. self.curJFBS = self.curJFBS or 1
  283. self._txtLimitScore:setString(string.format("%d", self.limitScore * math.ceil(self.curJFBS)))
  284. end
  285. end)
  286. -- default
  287. self.limitScore = self:getDefaultValue("diFenLimit") or 10
  288. if self.limitScore == 0 then
  289. self.limitScore = 5
  290. elseif self.curJFBS > 0 then
  291. self.limitScore = self.limitScore/math.ceil(self.curJFBS)
  292. end
  293. self._txtLimitScore:setString(string.format("%d", tonumber(self.limitScore)))
  294. local lastlsPer = (self.limitScore-lstMin)/(lsMax-lstMin)*100
  295. self.Slider_limitScore:setPercent(lastlsPer)
  296. --加多少分
  297. self._txtAddScore = self.ui.Items.Text_addScore
  298. local asMin, asMax = 5, 40
  299. self.sliderAddScore = self.ui.Items.Slider_addScore
  300. self.sliderAddScore:addEventListener(function ( sender, eventType)
  301. if eventType == 0 then
  302. local per = sender:getPercent()
  303. self.addScore = math.floor(asMin + (asMax-asMin)/100 * per)
  304. self.curJFBS = self.curJFBS or 1
  305. self._txtAddScore:setString(string.format("%d", self.addScore*math.ceil(self.curJFBS)))
  306. end
  307. end)
  308. -- default
  309. self.addScore = self:getDefaultValue("diFenAdd") or 5
  310. if self.addScore == 0 then
  311. self.addScore = 5
  312. elseif self.curJFBS > 0 then
  313. self.addScore = self.addScore/math.ceil(self.curJFBS)
  314. end
  315. self._txtAddScore:setString(string.format("%d", tonumber(self.addScore)))
  316. local lastfaPer = (self.addScore-asMin)/(asMax-asMin)*100
  317. self.sliderAddScore:setPercent(lastfaPer)
  318. self:initLayoutEvent()
  319. self:initOtherCheckBoxManager()
  320. self:initJiFenBeiShu()
  321. end
  322. -- 面板的点击事件,点击面板后,隐藏所有提示
  323. function MJCreateRoomItem:initLayoutEvent()
  324. self.ui.Items.Layout_1:registerClick(function()
  325. local buttons = {
  326. {buttonName = "Button_KSCJ", tipsName = "ImageView_KSCJ"},
  327. {buttonName = "Button_JFBS", tipsName = "ImageView_JFBS"},
  328. {buttonName = "Button_DFJF", tipsName = "ImageView_DFJF"},
  329. };
  330. -- 隐藏其他提示信息
  331. for k, v in ipairs(buttons) do
  332. local tipsNode = self.ui.Items[v.tipsName]
  333. tipsNode:setVisible(false)
  334. end
  335. end)
  336. end
  337. ---
  338. -- 初始化其他选项
  339. -- @return
  340. --
  341. function MJCreateRoomItem:initOtherCheckBoxManager ()
  342. if not self.otherCheckBoxManager then
  343. return
  344. end
  345. self.otherCheckBoxManager:addItem(self.ui.Items.CheckBox_ForbidProp, "forbidProp", 1, 0)--屏蔽快捷语与道具
  346. self.otherCheckBoxManager:addItem(self.ui.Items.CheckBox_ForbidVoice, "forbidVoice", 1, 0)--屏蔽语音
  347. local forbidProp = self:getDefaultValue("forbidProp") or 0
  348. local forbidVoice = self:getDefaultValue("forbidVoice") or 0
  349. local defaults = {}
  350. if forbidProp > 0 then
  351. table.insert(defaults, "forbidProp")
  352. end
  353. if forbidVoice == 1 then
  354. table.insert(defaults, "forbidVoice")
  355. end
  356. self.otherCheckBoxManager:setDefault(defaults)
  357. end
  358. -- 初始化积分倍数
  359. function MJCreateRoomItem:initJiFenBeiShu()
  360. self.ui.Items.Button_jia:registerClick(handler(self, self.onClickAdd))
  361. self.ui.Items.Button_jian:registerClick(handler(self, self.onClickJian))
  362. self.curJFBS = self:getDefaultValue("baseMulti") or 1;
  363. self:updateJiFenBeiShu()
  364. --积分倍数说明
  365. self.ui.Items.ImageView_JFBS:setVisible(false)
  366. self.ui.Items.Button_JFBS:registerClick(function()
  367. self.ui.Items.ImageView_JFBS:setVisible(not self.ui.Items.ImageView_JFBS:isVisible())
  368. end)
  369. -- self.ui.Items.Layout_JiFenBeiShu:setVisible(false)
  370. end
  371. --更新积分倍数
  372. function MJCreateRoomItem:updateJiFenBeiShu()
  373. self.curJFBS = self.curJFBS >= 1.0 and math.floor(self.curJFBS) or self.curJFBS;
  374. self.ui.Items.Text_jifen:setText(self.curJFBS)
  375. self.ui.Items.Button_jia:setEnabled(self.curJFBS ~= 100)
  376. self.ui.Items.Button_jian:setEnabled(self.curJFBS ~= 0.1)
  377. self._txtLimitScore:setString(string.format("%d", self.limitScore * math.ceil(self.curJFBS)))
  378. self._txtAddScore:setString(string.format("%d", self.addScore*math.ceil(self.curJFBS)))
  379. end
  380. --按钮加
  381. function MJCreateRoomItem:onClickAdd()
  382. playBtnEffect()
  383. if not self.curJFBS then
  384. return
  385. end
  386. if self.curJFBS >= 1.0 then
  387. self.curJFBS = self.curJFBS + 1.0
  388. else
  389. self.curJFBS = self.curJFBS + 0.1
  390. end
  391. if self.curJFBS >= 100 then
  392. self.curJFBS = 100;
  393. end
  394. self:updateJiFenBeiShu()
  395. end
  396. --按钮减
  397. function MJCreateRoomItem:onClickJian()
  398. playBtnEffect()
  399. if not self.curJFBS then
  400. return
  401. end
  402. if self.curJFBS <= 1.0 then
  403. self.curJFBS = self.curJFBS - 0.1
  404. else
  405. self.curJFBS = self.curJFBS - 1.0
  406. end
  407. if self.curJFBS <= 0.1 then
  408. self.curJFBS = 0.1
  409. end
  410. self:updateJiFenBeiShu()
  411. end
  412. --设置选中值默认颜色
  413. function MJCreateRoomItem:setDefaultTextColor(radio,text)
  414. if radio then
  415. local index = radio:getResult()
  416. local defaultText = string.format(text.."%d",index)
  417. self.ui.Items[defaultText]:setTextColor(SELECT_COLOR)
  418. end
  419. local result = self.WanFaCheckBoxManager:getResult2()
  420. if result.baojiao == 1 then
  421. self.ui.Items.Text_BaoJiao:setTextColor(SELECT_COLOR)
  422. end
  423. if result.xiqian == 1 then
  424. self.ui.Items.Text_XiQian:setTextColor(SELECT_COLOR)
  425. end
  426. end
  427. --点击checkBox时,改变其text的颜色
  428. function MJCreateRoomItem:updataTextColor(radio,text,boxType,valueTab)
  429. local function updataRadioTextColor()
  430. if boxType == "radioBox" then
  431. local index = radio:getResult()
  432. for k,value in pairs(valueTab) do
  433. local item = string.format(text.."%d",value)
  434. self.ui.Items[item]:setTextColor(NON_SELECT_COLOR)
  435. if value == index then
  436. self.ui.Items[item]:setTextColor(SELECT_COLOR)
  437. end
  438. end
  439. elseif boxType == "checkBox" then
  440. local result = self.WanFaCheckBoxManager:getResult2()
  441. if result.baojiao == 1 then
  442. self.ui.Items.Text_BaoJiao:setTextColor(SELECT_COLOR)
  443. else
  444. self.ui.Items.Text_BaoJiao:setTextColor(NON_SELECT_COLOR)
  445. end
  446. if result.xiqian == 1 then
  447. self.ui.Items.Text_XiQian:setTextColor(SELECT_COLOR)
  448. else
  449. self.ui.Items.Text_XiQian:setTextColor(NON_SELECT_COLOR)
  450. end
  451. end
  452. end
  453. radio:setCallback(updataRadioTextColor);
  454. end
  455. function MJCreateRoomItem:getRuleResult()
  456. local game_num = self.JuShuRadioManager:getResult()
  457. local payMode = self.PayRadioManager:getResult()
  458. local playnum = self.RenShuRadioManager:getResult()
  459. local isfaststart = playnum==0 and 1 or 0
  460. playnum = playnum==0 and 4 or playnum
  461. local limitfan = self.FengDingCheckBoxManager:getResult()
  462. local laizinum = self.GuiNumCheckBoxManager:getResult()
  463. local wanFaResult = self.WanFaCheckBoxManager:getResult2()
  464. local baojiao = wanFaResult.baojiao
  465. local xiqian = wanFaResult.xiqian
  466. local guozhangjiafan = wanFaResult.guozhangjiafan
  467. local toujiazhuang = wanFaResult.toujiazhuang
  468. local tingpai = wanFaResult.tingpai
  469. local isoutredcard = wanFaResult.isoutredcard
  470. local hufan = wanFaResult.hufan
  471. local difenjiadi = self.DiFenJiaFenCheckBoxManager:getResult()
  472. local diFenLimit = 0
  473. local diFenAdd = 0
  474. if difenjiadi > 0 and (playnum == 2 or isfaststart == 1) then
  475. diFenLimit = tonumber(self._txtLimitScore:getText())
  476. diFenAdd = tonumber(self._txtAddScore:getText())
  477. end
  478. local other = self.otherCheckBoxManager:getResult2()
  479. local forbidProp = other["forbidProp"]
  480. local forbidVoice = other["forbidVoice"]
  481. self.defaultValus =
  482. {
  483. gamerule = 1,
  484. totalgamenum = game_num,
  485. deductRule = payMode,
  486. playnum = playnum,
  487. isfaststart = isfaststart,
  488. limitfan = limitfan,
  489. laizinum = laizinum,
  490. baojiao = baojiao,
  491. xiqian = xiqian,
  492. guozhangjiafan = guozhangjiafan,
  493. toujiazhuang = toujiazhuang,
  494. tingpai = tingpai,
  495. isoutredcard = isoutredcard,
  496. hufan = hufan,
  497. diFenLimit = diFenLimit,
  498. diFenAdd = diFenAdd,
  499. forbidProp = forbidProp,
  500. forbidVoice = forbidVoice,
  501. baseMulti = self.curJFBS,
  502. }
  503. -- 保存玩家的选择
  504. self:saveDefaultValues()
  505. local strGameInfo = json.encode(self.defaultValus);
  506. return game_num, strGameInfo
  507. end
  508. return MJCreateRoomItem