盟主观战可以查看双方

master
罗家炜 2025-06-21 22:58:29 +08:00
parent 61fc680b4a
commit af006a117c
5 changed files with 178 additions and 179 deletions

View File

@ -25,34 +25,33 @@ end
function M:InitView()
self._view = UIPackage.CreateObjectFromURL("ui://NewGroup/View_GroupStat")
self.record_data = {} --回放数据
self.player_record_data = {} --指定玩家的回放数据
self.qid = 0 --查询玩家id
self.lst_record_find = self._view:GetChild("lst_record_find")
self.lst_record_find:SetVirtual()
self.record_data = {} --回放数据
self.player_record_data = {} --指定玩家的回放数据
self.qid = 0 --查询玩家id
self.lst_record_find = self._view:GetChild("lst_record_find")
self.lst_record_find:SetVirtual()
self.lst_record_find.itemRenderer = function(index, obj)
self:OnRenderRecordItem1(index, obj)
end
self.lst_record = self._view:GetChild("lst_record")
self.lst_record:SetVirtual()
self.lst_record:SetVirtual()
self.lst_record.itemRenderer = function(index, obj)
self:OnRenderRecordItem(index, obj)
end
self.lst_record.scrollPane.onPullUpRelease:Set(function()
self:GetRecordData(self.lst_record.numItems)
self:GetRecordData(self.lst_record.numItems)
end)
self.lst_player_record = self._view:GetChild("lst_player_record")
self.lst_player_record:SetVirtual()
self.lst_player_record:SetVirtual()
self.lst_player_record.itemRenderer = function(index, obj)
self:OnRenderPlayerRecordItem(index, obj)
end
self.lst_player_record.scrollPane.onPullUpRelease:Set(function()
self:GetRecordData(self.lst_player_record.numItems, self.qid)
self:GetRecordData(self.lst_player_record.numItems, self.qid)
end)
self._view:GetChild("btn_search").onClick:Set(function()
@ -75,8 +74,7 @@ function M:InitView()
self.qid = 0
self.player_record_data = {}
self.lst_player_record.numItems = 0
self.isFindCode=false
self.isFindCode = false
end)
end
@ -91,7 +89,7 @@ function M:GetRecordData(index, qid)
return
end
ViewUtil.CloseModalWait()
if res.ReturnCode ~= 0 then
if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
else
local ctr_search = self._view:GetController("search")
@ -120,7 +118,7 @@ function M:FillRecordItem(data, obj)
local room_id = data.room_id
local create_time = data.create_time
local room_type_str = data.game_info.name
local time =tonumber(create_time)
local time = tonumber(create_time)
local room_time_str = os.date("%Y-%m-%d %H:%M:%S", time)
local totalScore = json.decode(data.totalScore)
local hpOnOff = data.hpOnOff
@ -138,22 +136,22 @@ function M:FillRecordItem(data, obj)
player_list[i].house = 0
player_list[i].nick = p.nick
end
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
local play_name = DataManager.groups:get(self.group_id):getPlayName(data.groupPid)
obj:GetChild("tex_time").text = room_time_str
obj:GetChild("tex_roomid").text = room_id
obj:GetChild("tex_times").text = d2ad(data.hp_times)..""
obj:GetChild("tex_roomid").text = room_id
obj:GetChild("tex_times").text = d2ad(data.hp_times) .. ""
obj:GetChild("tex_game").text = play_name
local lst_total = obj:GetChild("lst_total")
lst_total:RemoveChildrenToPool()
local ids = {}
for j=1,#totalScore do
for j = 1, #totalScore do
local titem = lst_total:AddItemFromPool()
local trdata = totalScore[j]
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
titem:GetChild("tex_id").text = trdata.accId and ("ID:"..trdata.accId) or ""
table.insert( ids,trdata.accId )
titem:GetChild("tex_id").text = trdata.accId and ("ID:" .. trdata.accId) or ""
table.insert(ids, trdata.accId)
local score = trdata.score
if trdata.hp == nil then
if hpOnOff == 1 and hpType > 1 then
@ -162,7 +160,7 @@ function M:FillRecordItem(data, obj)
else
score = d2ad(trdata.hp)
end
titem:GetChild("tex_score").text = score
if score >= 0 then
@ -180,24 +178,25 @@ function M:FillRecordItem(data, obj)
obj:GetChild("btn_screenshot").onClick:Set(function()
self:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
end)
end)
obj:GetChild("btn_share").onClick:Set(function()
ShareChatRoom(room_id, tostring(os.time()), data.round, room_type_str, self.group_id, player_list)
end)
end)
obj.onClick:Set(function()
self:OnShowRecordInfo(data,ids)
end)
self:OnShowRecordInfo(data, ids)
end)
end
function M:OnRenderRecordItem(index, obj)
local data = self.record_data[index + 1]
self:FillRecordItem(data, obj)
local data = self.record_data[index + 1]
data.seat = 2 - (index + 1) % 2
self:FillRecordItem(data, obj)
end
function M:OnRenderRecordItem1(index, obj)
local data=self.tempRec[index+1]
self:FillRecordItem(data, obj)
local data = self.tempRec[index + 1]
self:FillRecordItem(data, obj)
end
function M:OnRenderPlayerRecordItem(index, obj)
@ -205,7 +204,6 @@ function M:OnRenderPlayerRecordItem(index, obj)
self:FillRecordItem(data, obj)
end
function M:GetRecordByRoomid()
local qid = self._view:GetChild("tex_id").text
ViewUtil.ShowModalWait()
@ -215,22 +213,22 @@ function M:GetRecordByRoomid()
return
end
ViewUtil.CloseModalWait()
if res.ReturnCode ~= 0 then
if res.ReturnCode ~= 0 then
ViewUtil.ErrorTip(res.ReturnCode, "获取回放数据失败")
else
if not res.Data.is_rec then
ViewUtil.ErrorTip(nil, "没有找到回放")
return
end
self.tempRec=res.Data.rec
self.lst_record_find.numItems = #res.Data.rec
self.tempRec = res.Data.rec
self.lst_record_find.numItems = #res.Data.rec
self._view:GetController("search").selectedIndex = 1
end
end)
end
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore, hpOnOff, hpType)
ViewUtil.ShowModalWait(self._view, "正在分享...")
UIPackage.AddPackage("base/rank/ui/Rank")
local result_view = UIPackage.CreateObjectFromURL("ui://Rank/ResultView")
@ -253,15 +251,15 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
end
item:GetChild("score").text = score
if score < 0 then item:GetController("di").selectedIndex = 1 end
if p.portrait and p.portrait ~= "" then
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function( ... )
load_head_num = load_head_num - 1
end)
if p.portrait and p.portrait ~= "" then
ImageLoad.Load(p.portrait, item:GetChild("n9")._iconObject, self.class, function(...)
load_head_num = load_head_num - 1
end)
else
load_head_num = load_head_num - 1
end
end
coroutine.start(function ( ... )
coroutine.start(function(...)
local left_time = 4
while (true) do
if load_head_num == 0 or left_time == 0 then
@ -279,7 +277,7 @@ function M:OnShareScreenShot(room_id, room_type_str, room_time_str, totalScore,
end)
end
function M:OnShowRecordInfo(rdata,ids)
function M:OnShowRecordInfo(rdata, ids)
local ctr_record = self._view:GetController("record")
ctr_record.selectedIndex = 1
@ -292,21 +290,21 @@ function M:OnShowRecordInfo(rdata,ids)
local hpOnOff = rdata.hpOnOff
local hpType = rdata.game_info.hpType
local play_name = DataManager.groups:get(self.group_id):getPlayName(rdata.groupPid)
for i = 1,round_count do
for i = 1, round_count do
local item = lst_recordInfo:AddItemFromPool()
item:GetChild("tex_num").text = tostring(i)
item:GetChild("tex_game").text = play_name
item:GetChild("tex_times").text = d2ad(rdata.hp_times)..""
item:GetChild("tex_roomid").text = rdata.room_id
local round_score_str = rdata["round_"..i]
item:GetChild("tex_times").text = d2ad(rdata.hp_times) .. ""
item:GetChild("tex_roomid").text = rdata.room_id
local round_score_str = rdata["round_" .. i]
local round_score_item = json.decode(round_score_str)
local lst_total = item:GetChild("lst_total")
lst_total:RemoveChildrenToPool()
for k=1,#round_score_item do
for k = 1, #round_score_item do
local titem = lst_total:AddItemFromPool()
local trdata = round_score_item[k]
titem:GetChild("tex_name").text = ViewUtil.stringEllipsis(trdata.nick)
titem:GetChild("tex_id").text = "ID:".. ids[k]
titem:GetChild("tex_id").text = "ID:" .. ids[k]
local score = trdata.score
if trdata.hp == nil then
if hpOnOff == 1 and hpType > 1 then
@ -315,7 +313,7 @@ function M:OnShowRecordInfo(rdata,ids)
else
score = d2ad(trdata.hp)
end
titem:GetChild("tex_score").text = score
end
@ -325,18 +323,18 @@ function M:OnShowRecordInfo(rdata,ids)
item:GetController("person_num").selectedIndex = 0
end
local btn_play =item:GetChild("btn_play")
local btn_play = item:GetChild("btn_play")
btn_play.onClick:Set(function()
local group = DataManager.groups:get(self.group_id)
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
DataManager.CurrenRoom = room
room.lev = group.lev
room.game_id = game_id
local extend = ExtendManager.GetExtendConfig(game_id)
extend:FillPlayBackData(DataManager.SelfUser.playback[playback_id][i])
if not room.self_player then
room.self_player = room:GetPlayerBySeat(1)
room.self_player = room:GetPlayerBySeat(rdata.seat)
end
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, game_id)
main._currentId = playback_id
@ -349,17 +347,19 @@ function M:OnShowRecordInfo(rdata,ids)
_data["military_id"] = playback_id
_data["round"] = tostring(i)
local loddyCtr1 = ControllerManager.GetController(LoddyController)
loddyCtr1:RequestPlayBack(_data,function(code,data)
loddyCtr1:RequestPlayBack(_data, function(code, data)
ViewUtil.CloseModalWait()
if code == 0 then
if DataManager.SelfUser.playback[playback_id] ~= nil then
DataManager.SelfUser.playback[playback_id][i] = data
else
local playback_data = {}
playback_data[i] = data
DataManager.SelfUser.playback[playback_id] = playback_data
if group.lev == 1 then
DataManager.CurrenRoom.self_player = DataManager.CurrenRoom:GetPlayerBySeat(rdata.seat)
end
-- if DataManager.SelfUser.playback[playback_id] ~= nil then
-- DataManager.SelfUser.playback[playback_id][i] = data
-- else
-- local playback_data = {}
-- playback_data[i] = data
-- DataManager.SelfUser.playback[playback_id] = playback_data
-- end
local main = self:GenaratePlayBack(ViewManager.View_PlayBack, game_id)
main._currentId = playback_id
main._currentRound = i
@ -377,7 +377,7 @@ function M:OnShowRecordInfo(rdata,ids)
end
function M:GenaratePlayBack(id, game_id, ...)
local tem =nil
local tem = nil
local dview_class = nil
if not dview_class then
local exconfig = ExtendManager.GetExtendConfig(game_id)
@ -386,11 +386,11 @@ function M:GenaratePlayBack(id, game_id, ...)
if not dview_class then
return
end
local arg = {...}
local arg = { ... }
tem = dview_class.new(...)
tem.Id = id
tem:Show()
return tem
end
return M
return M

View File

@ -107,31 +107,31 @@ function M:InitView(url)
local tex_time = com_roominfo:GetChild('tex_time')
self._co_timer =
coroutine.start(
function()
tex_time.text = os.date('%m-%d %H:%M')
local _client = ControllerManager.GameNetClinet
if not _client then
return
function()
tex_time.text = os.date('%m-%d %H:%M')
local _client = ControllerManager.GameNetClinet
if not _client then
return
end
local ping = _client:getAveragePingTime()
if not ping then
return
end
local ctr_xh = com_roominfo:GetChild('gcm_xinhao'):GetController('c1')
ping = math.floor(ping / 2)
if ping > 300 then
ping = 300
end
if ping <= 100 then
ctr_xh.selectedIndex = 0
elseif ping <= 300 then
ctr_xh.selectedIndex = 1
else
ctr_xh.selectedIndex = 2
end
coroutine.wait(10)
end
local ping = _client:getAveragePingTime()
if not ping then
return
end
local ctr_xh = com_roominfo:GetChild('gcm_xinhao'):GetController('c1')
ping = math.floor(ping / 2)
if ping > 300 then
ping = 300
end
if ping <= 100 then
ctr_xh.selectedIndex = 0
elseif ping <= 300 then
ctr_xh.selectedIndex = 1
else
ctr_xh.selectedIndex = 2
end
coroutine.wait(10)
end
)
)
end
self._eventmap = {}
@ -308,16 +308,12 @@ function M:CmdBackToLobby()
_curren_msg:Show()
end
function M:GetPos(seat,myseat)
function M:GetPos(seat, myseat)
local my_seat = 1
if myseat == nil then
for i = 1, #self._room.player_list do
if DataManager.SelfUser.account_id == self._room.player_list[i].self_user.account_id then
my_seat = self._room.player_list[i].seat
end
end
if not myseat then
my_seat = self._room.self_player.seat
else
my_seat = myseat
my_seat = myseat
end
return ViewUtil.GetPos(my_seat, seat, self._room.room_config.people_num)
end
@ -351,12 +347,12 @@ function M:ChangeAlpha(...)
end
self._record_alpha =
coroutine.start(
function()
self._record.alpha = 1
coroutine.wait(2)
self._record.alpha = 0.5
end
)
function()
self._record.alpha = 1
coroutine.wait(2)
self._record.alpha = 0.5
end
)
end
function M:Show()

View File

@ -4,7 +4,7 @@ local EXGameInfo = import(".EXGameInfo")
local EXMainView = import(".EXMainView")
local EXGameController = import(".EXGameController")
local EXRoomConfig = import(".EXRoomConfig")
local EXPlayBackView =import(".EXPlayBackView")
local EXPlayBackView = import(".EXPlayBackView")
local MJRoom = require("main.majiang.MJRoom")
local ExtendConfig = {}
@ -13,14 +13,14 @@ local M = ExtendConfig
function ExtendConfig.new()
setmetatable(M, {__index = IExtendConfig})
local self = setmetatable({}, {__index = M})
self.class = "ExtendConfig"
self.extend_id = 22
self._viewMap = {}
self._viewMap[ViewManager.View_Main] = EXMainView
self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView
return self
setmetatable(M, { __index = IExtendConfig })
local self = setmetatable({}, { __index = M })
self.class = "ExtendConfig"
self.extend_id = 22
self._viewMap = {}
self._viewMap[ViewManager.View_Main] = EXMainView
self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView
return self
end
--卸载资源
@ -45,24 +45,24 @@ end
local _ctr_game = nil
function M:GetGameController()
if _ctr_game == nil then
_ctr_game = EXGameController.new()
end
return _ctr_game
if _ctr_game == nil then
_ctr_game = EXGameController.new()
end
return _ctr_game
end
function M:NewRoom()
return MJRoom.new()
end
function M:FillRoomConfig(room,_config)
function M:FillRoomConfig(room, _config)
room.room_config = EXRoomConfig.new(_config)
end
function M:FillRoomData(s2croom)
local room = DataManager.CurrenRoom
local reload = s2croom["reload"]
local room = DataManager.CurrenRoom
local reload = s2croom["reload"]
local _tableInfo = s2croom["tableInfo"]
local _config = _tableInfo["config"]
@ -74,10 +74,10 @@ function M:FillRoomData(s2croom)
if (reload) then
local _reloadInfo = s2croom["reloadInfo"]
local _hand_card = _reloadInfo["hand_card"]
local _hand_card = _reloadInfo["hand_card"]
room.self_player.card_list = _hand_card
table.sort(_hand_card, ViewUtil.HandCardSort)
local active_seat = _reloadInfo["active_seat"]
local bank_seat = _reloadInfo["banker_seat"]
local playing = _reloadInfo["playing"]
@ -88,23 +88,23 @@ function M:FillRoomData(s2croom)
room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"]
room.last_outcard_seat = last_outcard_seat
room.playing = playing
for i=1,#_info_list do
local tem = _info_list[i]
local playerid = tem["playerid"]
local p = room:GetPlayerById(playerid)
local outcard_list = tem["outcard_list"]
p.outcard_list = outcard_list
p.total_score = tem["score"]
p.hand_left_count = tem["card_count"]
p.piao_niao = tem["piao_niao"] or 0
local opcard = tem["opcard"]
for k=1,#opcard do
local op = opcard[k]
local fz = {}
fz.type = op["type"]
fz.card = op["card"]
p.fz_list[#p.fz_list+1] = fz
end
for i = 1, #_info_list do
local tem = _info_list[i]
local playerid = tem["playerid"]
local p = room:GetPlayerById(playerid)
local outcard_list = tem["outcard_list"]
p.outcard_list = outcard_list
p.total_score = tem["score"]
p.hand_left_count = tem["card_count"]
p.piao_niao = tem["piao_niao"] or 0
local opcard = tem["opcard"]
for k = 1, #opcard do
local op = opcard[k]
local fz = {}
fz.type = op["type"]
fz.card = op["card"]
p.fz_list[#p.fz_list + 1] = fz
end
if not playing and room.curren_round > 0 then
self.GetGameController():PlayerReady()
end
@ -128,7 +128,8 @@ function M:FillPlayBackData(pd_data)
room.curren_round = _tableInfo["round"]
local _info_list = _tableInfo["playerData"]
for i = 1,#_info_list do
for i = 1, #_info_list do
local _jp = _info_list[i]
local p = room:NewPlayer()
p.seat = _jp["seat"]
@ -143,15 +144,15 @@ function M:FillPlayBackData(pd_data)
-- p.self_user = DataManager.SelfUser
-- else
if p.seat == 1 then room.self_player = p end
local u = User.new()
u.account_id = pid
p.self_user = u
u.nick_name = _jp["nick"]
u.head_url = _jp["portrait"]
u.sex = _jp["sex"]
local u = User.new()
u.account_id = pid
p.self_user = u
u.nick_name = _jp["nick"]
u.head_url = _jp["portrait"]
u.sex = _jp["sex"]
-- end
p.self_user.host_ip = p.self_user.host_ip
local _hand_card = _jp["hand_card"]
local _hand_card = _jp["hand_card"]
p.card_list = _hand_card
--room.self_player.card_list = _hand_card
table.sort(_hand_card, ViewUtil.HandCardSort)
@ -164,7 +165,8 @@ function M:FillPlayBackData(pd_data)
room:AddPlayer(p)
end
room.cmdList = pd_data["cmdList"]
end
return M
return M

View File

@ -11,8 +11,8 @@ local ExtendConfig = {}
local M = ExtendConfig
function ExtendConfig.new()
setmetatable(M, {__index = IExtendConfig})
local self = setmetatable({}, {__index = M})
setmetatable(M, { __index = IExtendConfig })
local self = setmetatable({}, { __index = M })
self.class = 'ExtendConfig'
self.extend_id = 13
self._viewMap = {}

View File

@ -2,38 +2,38 @@ local MJPlayerCardInfoView = import(".MJPlayerCardInfoView")
local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local TableBG = import('Game.Data.TableBG')
---
---
local M = {}
setmetatable(M,{__index = PlayBackView})
setmetatable(M, { __index = PlayBackView })
local bg_config = {
{id = 1, url = "base/main_majiang/bg/bg1", thumb = "ui://Main_Majiang/b01"}
{ id = 1, url = "base/main_majiang/bg/bg1", thumb = "ui://Main_Majiang/b01" }
}
function M:InitView(url)
UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang")
PlayBackView.InitView(self,url)
PlayBackView.InitView(self, url)
local _view = self._view
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
TableBG.LoadTableBG(1, nil, self._root_view,bg_config)
TableBG.LoadTableBG(1, nil, self._root_view, bg_config)
UpdateBeat:Add(self.OnUpdate,self)
UpdateBeat:Add(self.OnUpdate, self)
end
function M:FillRoomData()
local _room = self._room
if self._player_card_info == nil or #self._player_card_info == 0 then
if self._player_card_info == nil or #self._player_card_info == 0 then
self._player_card_info = {}
local _player_card_info = self._player_card_info
for i = 1, _room.room_config.people_num do
local tem = self._view:GetChild("player_card_info" .. i)
_player_card_info[i] = self:NewMJPlayerCardInfoView(tem,i)
_player_card_info[i] = self:NewMJPlayerCardInfoView(tem, i)
end
end
local list = _room.player_list
for i=1,#list do
for i = 1, #list do
local p = list[i]
local info = self._player_card_info[self:GetPos(p.seat)]
info:SetPlayer(p)
@ -42,7 +42,7 @@ function M:FillRoomData()
self:SetCardBoxPosition()
local list = _room.player_list
for i=1,#list do
for i = 1, #list do
local p = list[i]
local info = self._player_info[self:GetPos(p.seat)]
info._view.visible = true
@ -51,17 +51,17 @@ function M:FillRoomData()
end
function M:SetCardBoxPosition()
local _room = self._room
for i = 1, _room.room_config.people_num do
local tex = self._view:GetChild("cardbox"):GetChild("direction"..i)
local index = _room.self_player.seat + i - 1
index = index > 4 and index - 4 or index
tex.text = self._gamectr:GetPosString(index)
end
local _room = self._room
for i = 1, _room.room_config.people_num do
local tex = self._view:GetChild("cardbox"):GetChild("direction" .. i)
local index = _room.self_player.seat + i - 1
index = index > 4 and index - 4 or index
tex.text = self._gamectr:GetPosString(index)
end
end
function M:NewMJPlayerCardInfoView(view,index)
return MJPlayerCardInfoView.new(view,self)
function M:NewMJPlayerCardInfoView(view, index)
return MJPlayerCardInfoView.new(view, self)
end
function M:NextRecordPlay()
@ -110,7 +110,8 @@ end
function M:ChangeTextSpeed()
local str1 = self._play and self._speed or ""
self._view:GetChild("panel_record"):GetChild("tex_speed").text = str1
local str2 = not self._play and (self._playFoward and "播放暂停" or "回退暂停") or self._playFoward and (self._speed == 1 and "播放" or "快进") or (self._speed == 1 and "回退" or "快退")
local str2 = not self._play and (self._playFoward and "播放暂停" or "回退暂停") or
self._playFoward and (self._speed == 1 and "播放" or "快进") or (self._speed == 1 and "回退" or "快退")
self._view:GetChild("panel_record"):GetChild("tex_2").text = str2
local str3 = self._play and "倍速度" or ""
self._view:GetChild("panel_record"):GetChild("tex_1").text = str3
@ -154,11 +155,11 @@ function M:OnUpdate()
if self._play then
if (self._currentStep == #self.cmdList and self._playFoward) then
self:ChangePlayState(false)
ViewUtil.ErrorTip(nil,"当前已是录像结尾了,再次点击播放按钮可重新播放")
ViewUtil.ErrorTip(nil, "当前已是录像结尾了,再次点击播放按钮可重新播放")
return
elseif (self._currentStep == 0 and not self._playFoward) then
self:ChangePlayState(false)
ViewUtil.ErrorTip(nil,"当前已是录像开头了,再次点击播放按钮可重新播放")
ViewUtil.ErrorTip(nil, "当前已是录像开头了,再次点击播放按钮可重新播放")
return
end
self._timer = self._timer + Time.deltaTime
@ -171,21 +172,21 @@ function M:OnUpdate()
end
end
function M:RemoveCursor()
function M:RemoveCursor()
if self._cursor.parent then
self._cursor.parent:GetController("color").selectedIndex = 0
end
self._cursor:RemoveFromParent()
self._cursor.parent:GetController("color").selectedIndex = 0
end
self._cursor:RemoveFromParent()
end
function M:GetPrefix()
return get_majiang_prefix(DataManager.CurrenRoom.game_id)
return get_majiang_prefix(DataManager.CurrenRoom.game_id)
end
function M:Destroy()
if self._cursor then self._cursor:Dispose() end
UpdateBeat:Remove(self.OnUpdate,self)
UpdateBeat:Remove(self.OnUpdate, self)
PlayBackView.Destroy(self)
end
return M
return M