梭哈同步修复资源引用跑得快
parent
a61888e8dd
commit
c5e9fa47fd
|
|
@ -56,6 +56,7 @@ function M:FillList(numbers)
|
||||||
|
|
||||||
self._viewList_allNumbers:SetVirtual()
|
self._viewList_allNumbers:SetVirtual()
|
||||||
self.familyType.selectedIndex = 4
|
self.familyType.selectedIndex = 4
|
||||||
|
self.lastType = 1
|
||||||
self._viewList_allNumbers.itemRenderer = function(index, obj)
|
self._viewList_allNumbers.itemRenderer = function(index, obj)
|
||||||
local i = index + 1
|
local i = index + 1
|
||||||
obj:GetController('lev').selectedIndex = numbers[i].lev - 1
|
obj:GetController('lev').selectedIndex = numbers[i].lev - 1
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
local FamilyNumberRecord = {}
|
||||||
|
|
||||||
|
local M = FamilyNumberRecord
|
||||||
|
|
||||||
|
function FamilyNumberRecord.New(root)
|
||||||
|
setmetatable(M, { __index = root })
|
||||||
|
local self = setmetatable({}, { __index = M })
|
||||||
|
|
||||||
|
self.familyType.selectedIndex = 5
|
||||||
|
self.lastType = 1
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -4,6 +4,7 @@ local GroupGameSettingView = import(".NewGroup.MngView.GroupGameSettingView_jain
|
||||||
|
|
||||||
---无窗口
|
---无窗口
|
||||||
local FamilyAllNumbers = import(".Family.FamilyAllNumbers")
|
local FamilyAllNumbers = import(".Family.FamilyAllNumbers")
|
||||||
|
local FamilyNumberRecord = import(".Family.FamilyNumberRecord")
|
||||||
---
|
---
|
||||||
FamilyView = {}
|
FamilyView = {}
|
||||||
|
|
||||||
|
|
@ -102,6 +103,10 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
-------绑定成员战绩按钮
|
||||||
|
view:GetChild('btn_family_record').onClick:Set(function()
|
||||||
|
self._child_familyNumberRecord = FamilyNumberRecord.New(self)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShareWx()
|
function M:ShareWx()
|
||||||
|
|
@ -128,7 +133,7 @@ end
|
||||||
|
|
||||||
function M:AllNumber()
|
function M:AllNumber()
|
||||||
self.lastType = 1
|
self.lastType = 1
|
||||||
local familyAllNumbers = FamilyAllNumbers.new(self)
|
self._child_familyAllNumbers = FamilyAllNumbers.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
local MainRightPanelView = import('.MainRightPanelView')
|
local MainRightPanelView = import('.MainRightPanelView')
|
||||||
local PlayerInfoView = import('.PlayerInfoView_copy')
|
local PlayerInfoView = import('.PlayerInfoView')
|
||||||
local ChatView = import('.ChatView')
|
local ChatView = import('.ChatView')
|
||||||
local DismissRoomWindow = import('.DismissRoomWindow')
|
local DismissRoomWindow = import('.DismissRoomWindow')
|
||||||
local SettingView = import('.SettingView')
|
local SettingView = import('.SettingView')
|
||||||
|
|
|
||||||
|
|
@ -24,46 +24,182 @@ function SettingView.new(blur_view)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
|
|
||||||
BaseWindow.init(self, url)
|
BaseWindow.init(self, url)
|
||||||
|
|
||||||
local view = self._view
|
local view = self._view
|
||||||
local slider_sound = view:GetChild('slider_vedio_sound')
|
local slider_sound = view:GetChild('slider_sound')
|
||||||
local slider_music = view:GetChild('slider_vedio_music')
|
local slider_music = view:GetChild('slider_music')
|
||||||
local btn_music = view:GetChild('btn_vedio_music')
|
-- local btn_music = view:GetChild('btn_music')
|
||||||
local btn_sound = view:GetChild('btn_vedio_sound')
|
-- local btn_sound = view:GetChild('btn_sound')
|
||||||
|
|
||||||
|
-- btn_music.selected = (GameApplication.Instance.MusicValue < 5 and false or true)
|
||||||
|
slider_sound.value = GameApplication.Instance.SoundValue
|
||||||
|
slider_music.value = GameApplication.Instance.MusicValue
|
||||||
|
-- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true
|
||||||
|
|
||||||
|
slider_music.onChanged:Add(
|
||||||
|
function()
|
||||||
|
GameApplication.Instance.MusicValue = slider_music.value
|
||||||
|
-- btn_music.selected = GameApplication.Instance.MusicValue < 5 and false or true
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
slider_sound.onChanged:Add(
|
||||||
|
function()
|
||||||
|
GameApplication.Instance.SoundValue = slider_sound.value
|
||||||
|
-- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- btn_sound.onChanged:Add(
|
||||||
|
-- function()
|
||||||
|
-- GameApplication.Instance.SoundValue = btn_sound.selected and 50 or 0
|
||||||
-- slider_sound.value = GameApplication.Instance.SoundValue
|
-- slider_sound.value = GameApplication.Instance.SoundValue
|
||||||
|
-- end
|
||||||
|
-- )
|
||||||
|
|
||||||
|
-- btn_music.onChanged:Add(
|
||||||
|
-- function()
|
||||||
|
-- GameApplication.Instance.MusicValue = btn_music.selected and 50 or 0
|
||||||
-- slider_music.value = GameApplication.Instance.MusicValue
|
-- slider_music.value = GameApplication.Instance.MusicValue
|
||||||
|
-- end
|
||||||
|
-- )
|
||||||
|
|
||||||
slider_music.onChanged:Add(function()
|
self._stateController = view:GetController('state')
|
||||||
-- GameApplication.Instance.MusicValue = slider_music.value
|
self.cd_time_text = view:GetChild('n35')
|
||||||
-- btn_music.selected = false
|
|
||||||
-- GameApplication.Instance.MusicMute = false;
|
|
||||||
end)
|
|
||||||
|
|
||||||
slider_sound.onChanged:Add(function()
|
local _btn_quit = view:GetChild('btn_quit')
|
||||||
-- GameApplication.Instance.SoundValue = slider_sound.value
|
if _btn_quit then
|
||||||
-- btn_sound.selected = false
|
_btn_quit.onClick:Set(
|
||||||
-- GameApplication.Instance.SoundMute = false;
|
function()
|
||||||
end)
|
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出游戏?', MsgWindow.MsgMode.OkAndCancel)
|
||||||
|
_curren_msg.onOk:Add(
|
||||||
|
function()
|
||||||
|
Application.Quit()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
_curren_msg:Show()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
btn_sound.onClick:Add(function()
|
local _btn_logout = view:GetChild('btn_logout')
|
||||||
-- GameApplication.Instance.SoundMute = btn_sound.selected;
|
if _btn_logout then
|
||||||
end)
|
_btn_logout.onClick:Add(
|
||||||
|
function()
|
||||||
btn_music.onClick:Add(function()
|
local _curren_msg = MsgWindow.new(self._root_view, '您是否退出当前账号?', MsgWindow.MsgMode.OkAndCancel)
|
||||||
-- GameApplication.Instance.MusicMute = btn_music.selected;
|
_curren_msg.onOk:Add(
|
||||||
end)
|
function()
|
||||||
|
PlayerPrefs.DeleteKey('session_id')
|
||||||
local _btn_logout = self._view:GetChild('btn_closeRoom')
|
PlayerPrefs.Save()
|
||||||
_btn_logout.onClick:Set(function()
|
RestartGame()
|
||||||
if self._blur_view.dismiss_room_cd_time > 0 then
|
end
|
||||||
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
|
)
|
||||||
else
|
_curren_msg:Show()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
local _btn_dismiss_room = view:GetChild('btn_dismiss_room')
|
||||||
|
self._btn_dismiss_room = _btn_dismiss_room
|
||||||
|
if _btn_dismiss_room then
|
||||||
|
_btn_dismiss_room.onClick:Add(
|
||||||
|
function()
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
_gamectr:AskDismissRoom()
|
_gamectr:AskDismissRoom()
|
||||||
|
self:Destroy()
|
||||||
end
|
end
|
||||||
end)
|
)
|
||||||
|
end
|
||||||
|
-- local btn_close = self._view:GetChild("btn_close")
|
||||||
|
-- if btn_close then
|
||||||
|
-- btn_close.onClick:Add(function( ... )
|
||||||
|
|
||||||
|
-- end)
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
--赋值bg_config
|
||||||
|
function M:GetBGConfig()
|
||||||
|
return TableBG.GetBGConfig()
|
||||||
|
end
|
||||||
|
--获得背景
|
||||||
|
function M:GetBgByGameId(game_id)
|
||||||
|
return TableBG.GetTableBG(game_id)
|
||||||
|
end
|
||||||
|
--显示背景选项,并加载背景
|
||||||
|
function M:FillBgSection(cb, game_id, default_bg, bg_config)
|
||||||
|
local view = self._view
|
||||||
|
local lst_bg = view:GetChild('lst_bg')
|
||||||
|
local ctr_bg = view:GetController('bg')
|
||||||
|
bg_config = bg_config or self:GetBGConfig()
|
||||||
|
for i = 1, #bg_config do
|
||||||
|
local config = bg_config[i]
|
||||||
|
local item = lst_bg:AddItemFromPool()
|
||||||
|
item.icon = config.thumb
|
||||||
|
--printlog("显示背景选项,并加载背景",item.icon)
|
||||||
|
item.data = config
|
||||||
|
if i > 6 then
|
||||||
|
ctr_bg:AddPage(i - 1)
|
||||||
|
end
|
||||||
|
item.onClick:Add(
|
||||||
|
function(index)
|
||||||
|
cb(config.url,i)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
self._game_id = game_id
|
||||||
|
self._default_bg = default_bg
|
||||||
|
self._bg = self:GetBgByGameId(game_id)
|
||||||
|
if self._bg > 0 then
|
||||||
|
lst_bg.selectedIndex = self._bg - 1
|
||||||
|
else
|
||||||
|
lst_bg.selectedIndex = default_bg - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Show()
|
||||||
|
self._stateController.selectedIndex = self.stateIndex
|
||||||
|
BaseWindow.Show(self)
|
||||||
|
if self.cd_coroutine ~= nil then
|
||||||
|
coroutine.stop(self.cd_coroutine)
|
||||||
|
end
|
||||||
|
if self._stateController.selectedIndex == 2 and self.cd_time_text ~= nil then
|
||||||
|
self.cd_coroutine =
|
||||||
|
coroutine.start(
|
||||||
|
function()
|
||||||
|
while (self.cd_time > 0) do
|
||||||
|
self:SetCanDissroom(false)
|
||||||
|
self.cd_time = self.cd_time - 1
|
||||||
|
self.cd_time = math.max(0, self.cd_time)
|
||||||
|
self.cd_time_text.text = tostring(math.ceil(self.cd_time))
|
||||||
|
if self.cd_time > 0 then
|
||||||
|
coroutine.wait(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self:SetCanDissroom(self._btn_dismiss_room_enable)
|
||||||
|
self.cd_time_text.text = ''
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
local bg_id = self._view:GetController('bg').selectedIndex + 1
|
||||||
|
if self._bg ~= bg_id then
|
||||||
|
self._bg = bg_id
|
||||||
|
TableBG.SaveTableBG(self._game_id, self._bg)
|
||||||
|
end
|
||||||
|
BaseWindow.Destroy(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:SetCanDissroom(enable)
|
||||||
|
self._btn_dismiss_room.enabled = enable
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:SetBtnDismissRoomEnable(enable)
|
||||||
|
self._btn_dismiss_room_enable = enable
|
||||||
|
self:SetCanDissroom(enable)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1367,6 +1367,16 @@ function M:UpdateRound(round)
|
||||||
self._text_maxRound.text = string.format("/%s局", total_round)
|
self._text_maxRound.text = string.format("/%s局", total_round)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- function M:InitPlayerInfoView()
|
||||||
|
-- self._player_info = {}
|
||||||
|
-- local _player_info = self._player_info
|
||||||
|
-- for i = 1, self._room.room_config.people_num do
|
||||||
|
-- local tem = self._view:GetChild(string.format("player_info%d_%d", i, (self._state.selectedIndex % 2) + 1))
|
||||||
|
-- _player_info[i] = PlayerInfoView.new(tem, self)
|
||||||
|
-- tem.visible = false
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
-- function M:GetSoundFileName(type, num, isNewBout)
|
-- function M:GetSoundFileName(type, num, isNewBout)
|
||||||
-- local fileName
|
-- local fileName
|
||||||
-- if isNewBout then
|
-- if isNewBout then
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ local M = PKSettingView
|
||||||
function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle)
|
function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle)
|
||||||
setmetatable(SettingView, { __index = BaseWindow })
|
setmetatable(SettingView, { __index = BaseWindow })
|
||||||
setmetatable(M, { __index = SettingView })
|
setmetatable(M, { __index = SettingView })
|
||||||
|
-- setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = 'PKSettingView'
|
self.class = 'PKSettingView'
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
|
|
@ -74,10 +75,15 @@ function M:init(url)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:Show()
|
function M:Show()
|
||||||
-- SettingView.Show(self)
|
BaseWindow.Show(self)
|
||||||
-- -- self:showSettingOption()
|
-- self:showSettingOption()
|
||||||
-- end
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
BaseWindow.Destroy(self)
|
||||||
|
-- self:showSettingOption()
|
||||||
|
end
|
||||||
|
|
||||||
-- 显示设置界面按钮
|
-- 显示设置界面按钮
|
||||||
function M:showSettingOption()
|
function M:showSettingOption()
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ local M = PKSettingView
|
||||||
function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle)
|
function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle)
|
||||||
setmetatable(SettingView, { __index = BaseWindow })
|
setmetatable(SettingView, { __index = BaseWindow })
|
||||||
setmetatable(M, { __index = SettingView })
|
setmetatable(M, { __index = SettingView })
|
||||||
|
-- setmetatable(M, { __index = BaseWindow })
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
self.class = 'PKSettingView'
|
self.class = 'PKSettingView'
|
||||||
self._currenIndex = 0
|
self._currenIndex = 0
|
||||||
|
|
@ -32,82 +33,57 @@ function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url)
|
function M:init(url)
|
||||||
SettingView.init(self, url)
|
BaseWindow.init(self, url)
|
||||||
-- -- show_type:1隐藏所有 2隐藏解散和换牌 3隐藏返回和换牌
|
|
||||||
-- -- 设置界面有换牌功能的,需要在mainview中重写方法UpdateCard
|
|
||||||
-- self._view:GetController('type').selectedIndex = self._show_type
|
|
||||||
-- -- show_type1玩法的换牌功能
|
|
||||||
-- if self._show_type == 1 then
|
|
||||||
-- local room = DataManager.CurrenRoom
|
|
||||||
-- local c1 = self._view:GetController('paimian')
|
|
||||||
-- local user_id = DataManager.SelfUser.account_id
|
|
||||||
-- local json_data = Utils.LoadLocalFile(user_id .. room.game_id .. 'pai')
|
|
||||||
-- if json_data == nil then
|
|
||||||
-- local _gamectr = self._gamectr
|
|
||||||
-- c1.selectedIndex = 0
|
|
||||||
-- else
|
|
||||||
-- local _data = json.decode(json_data)
|
|
||||||
-- local pai = _data['pai']
|
|
||||||
|
|
||||||
-- c1.selectedIndex = pai
|
local view = self._view
|
||||||
-- end
|
local slider_sound = view:GetChild('slider_vedio_sound')
|
||||||
|
local slider_music = view:GetChild('slider_vedio_music')
|
||||||
|
local btn_music = view:GetChild('btn_vedio_music')
|
||||||
|
local btn_sound = view:GetChild('btn_vedio_sound')
|
||||||
|
|
||||||
|
-- slider_sound.value = GameApplication.Instance.SoundValue
|
||||||
|
-- slider_music.value = GameApplication.Instance.MusicValue
|
||||||
|
|
||||||
-- c1.onChanged:Set(
|
slider_music.onChanged:Add(function()
|
||||||
-- function()
|
-- GameApplication.Instance.MusicValue = slider_music.value
|
||||||
-- if self.__changePokerCallBack then
|
-- btn_music.selected = false
|
||||||
-- self.__changePokerCallBack(c1.selectedIndex)
|
-- GameApplication.Instance.MusicMute = false;
|
||||||
-- end
|
end)
|
||||||
-- --点击换牌按钮后保存当前游戏的牌
|
|
||||||
-- local user_id = DataManager.SelfUser.account_id
|
|
||||||
-- local _data = {}
|
|
||||||
-- _data['pai'] = c1.selectedIndex
|
|
||||||
-- local key = user_id .. room.game_id .. 'pai'
|
|
||||||
-- Utils.SaveLocalFile(key, json.encode(_data))
|
|
||||||
-- end
|
|
||||||
-- )
|
|
||||||
|
|
||||||
-- local card_size = self._view:GetController('card_size')
|
slider_sound.onChanged:Add(function()
|
||||||
-- json_data = Utils.LoadLocalFile(user_id .. room.game_id .. 'cardsize')
|
-- GameApplication.Instance.SoundValue = slider_sound.value
|
||||||
-- if json_data == nil then
|
-- btn_sound.selected = false
|
||||||
-- local _gamectr = self._gamectr
|
-- GameApplication.Instance.SoundMute = false;
|
||||||
-- card_size.selectedIndex = 1
|
end)
|
||||||
-- else
|
|
||||||
-- local _data = json.decode(json_data)
|
|
||||||
-- local cardsize = _data['cardsize']
|
|
||||||
|
|
||||||
-- card_size.selectedIndex = cardsize
|
btn_sound.onClick:Add(function()
|
||||||
-- end
|
-- GameApplication.Instance.SoundMute = btn_sound.selected;
|
||||||
|
end)
|
||||||
|
|
||||||
-- card_size.onChanged:Set(
|
btn_music.onClick:Add(function()
|
||||||
-- function()
|
-- GameApplication.Instance.MusicMute = btn_music.selected;
|
||||||
-- if self.__changePokerSizeCallBack then
|
end)
|
||||||
-- self.__changePokerSizeCallBack(card_size.selectedIndex)
|
|
||||||
-- end
|
|
||||||
-- --点击换牌按钮后保存当前游戏的牌
|
|
||||||
-- local user_id = DataManager.SelfUser.account_id
|
|
||||||
-- local _data = {}
|
|
||||||
-- _data['cardsize'] = card_size.selectedIndex
|
|
||||||
-- local key = user_id .. room.game_id .. 'cardsize'
|
|
||||||
-- Utils.SaveLocalFile(key, json.encode(_data))
|
|
||||||
-- end
|
|
||||||
-- )
|
|
||||||
|
|
||||||
-- self._view:GetChild('btn_close').onClick:Add(
|
local _btn_logout = self._view:GetChild('btn_closeRoom')
|
||||||
-- function(...)
|
_btn_logout.onClick:Set(function()
|
||||||
-- self:Destroy()
|
if self._blur_view.dismiss_room_cd_time > 0 then
|
||||||
-- end
|
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
|
||||||
-- )
|
else
|
||||||
-- end
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
-- if self.isjiesan then
|
_gamectr:AskDismissRoom()
|
||||||
-- self._view:GetChild('n82').visible = false
|
end
|
||||||
-- end
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:Show()
|
function M:Show()
|
||||||
-- SettingView.Show(self)
|
BaseWindow.Show(self)
|
||||||
-- -- self:showSettingOption()
|
-- self:showSettingOption()
|
||||||
-- end
|
end
|
||||||
|
|
||||||
|
function M:Destroy()
|
||||||
|
BaseWindow.Destroy(self)
|
||||||
|
-- self:showSettingOption()
|
||||||
|
end
|
||||||
|
|
||||||
-- 显示设置界面按钮
|
-- 显示设置界面按钮
|
||||||
function M:showSettingOption()
|
function M:showSettingOption()
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 331 KiB After Width: | Height: | Size: 333 KiB |
Binary file not shown.
Loading…
Reference in New Issue