UIChat:聊天剧情奖励
This commit is contained in:
parent
430ef3c6d7
commit
e206da8ffc
@ -592,6 +592,7 @@ local UIEventNames = {
|
|||||||
EID_FRUIT_SETTLE = id(),
|
EID_FRUIT_SETTLE = id(),
|
||||||
|
|
||||||
EID_DANMU_INPUT_NTF = id(),
|
EID_DANMU_INPUT_NTF = id(),
|
||||||
|
EID_CHAT_STORY_REWARD = id()
|
||||||
}
|
}
|
||||||
|
|
||||||
return UIEventNames
|
return UIEventNames
|
||||||
@ -53,6 +53,9 @@ function StoryData:RegisterNetEvents()
|
|||||||
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_ROLE_STORY_ACK, function(data)
|
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_ROLE_STORY_ACK, function(data)
|
||||||
if data.error == Enum.NetErrorCode.ERROR_OK then
|
if data.error == Enum.NetErrorCode.ERROR_OK then
|
||||||
self:RefreshStoryData(data.story_id)
|
self:RefreshStoryData(data.story_id)
|
||||||
|
if data.story_rewards and #data.story_rewards > 0 then
|
||||||
|
ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.EID_CHAT_STORY_REWARD, data.story_rewards)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_NEW_MAP_CARTOON_ACK, function(data)
|
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_NEW_MAP_CARTOON_ACK, function(data)
|
||||||
@ -126,15 +129,30 @@ function StoryData:GetStateStoryChapterId(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function StoryData:IsRecord(storyId)
|
function StoryData:IsRecord(storyId)
|
||||||
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId]==1 then
|
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId] > 0 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function StoryData:Record(storyId, idx)
|
local STORY_GET_REWARD_TAG = 8
|
||||||
self.data.storyDatas[storyId] = idx
|
function StoryData:IsGetReward(storyId)
|
||||||
ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_ROLE_STORY_REQ, {story_id = {key = storyId, value = idx or 0}})
|
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId] == STORY_GET_REWARD_TAG then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function StoryData:RecordGetReward(storyId)
|
||||||
|
self:Record(storyId, STORY_GET_REWARD_TAG)
|
||||||
|
end
|
||||||
|
|
||||||
|
function StoryData:Record(storyId, val)
|
||||||
|
if self.data.storyDatas[storyId] and val < self.data.storyDatas[storyId] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.data.storyDatas[storyId] = val
|
||||||
|
ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_ROLE_STORY_REQ, {story_id = {key = storyId, value = val or 0}})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
äÌ
|
ÞÛ
|
||||||
login.protoserverproto
|
login.protoserverproto
|
||||||
user.proto"0
|
user.proto"0
|
||||||
|
|
||||||
@ -701,14 +701,15 @@ param_list (
R paramList"o
|
|||||||
SCPlayerBattleRecordAck
|
SCPlayerBattleRecordAck
|
||||||
error (Rerror>
|
error (Rerror>
|
||||||
record_list (2.serverproto.BattleRecordInfoR
|
record_list (2.serverproto.BattleRecordInfoR
|
||||||
recordList"Ž
|
recordList"É
|
||||||
SCPlayerBattleDataChangeNtf(
|
SCPlayerBattleDataChangeNtf(
|
||||||
last_income_time (RlastIncomeTime
|
last_income_time (RlastIncomeTime
|
||||||
map_level (
RmapLevel
|
map_level (
RmapLevel
|
||||||
map_id (
RmapId&
|
map_id (
RmapId&
|
||||||
max_income_time (R
maxIncomeTime?
|
max_income_time (R
maxIncomeTime?
|
||||||
quick_battle (2.serverproto.QuickBattleDataRquickBattle(
|
quick_battle (2.serverproto.QuickBattleDataRquickBattle(
|
||||||
reward_map_count (
RrewardMapCount"
|
reward_map_count (
RrewardMapCount9
|
||||||
|
fruit_income_reward_point (
RfruitIncomeRewardPoint"
|
||||||
CSGetMapRankReq"¨
|
CSGetMapRankReq"¨
|
||||||
SCGetMapRankAck
|
SCGetMapRankAck
|
||||||
error (Rerror
|
error (Rerror
|
||||||
@ -982,10 +983,11 @@ targetName"u
|
|||||||
Story (RStory4
|
Story (RStory4
|
||||||
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
||||||
CSRoleStoryReq4
|
CSRoleStoryReq4
|
||||||
story_id (2.serverproto.KeyValueTypeRstoryId"\
|
story_id (2.serverproto.KeyValueTypeRstoryId"œ
|
||||||
SCRoleStoryAck
|
SCRoleStoryAck
|
||||||
error (Rerror4
|
error (Rerror4
|
||||||
story_id (2.serverproto.KeyValueTypeRstoryId"J
|
story_id (2.serverproto.KeyValueTypeRstoryId>
|
||||||
|
story_rewards (2.serverproto.KeyValueTypeRstoryRewards"J
|
||||||
CSNewMapCartoonReq4
|
CSNewMapCartoonReq4
|
||||||
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
||||||
SCNewMapCartoonAck
|
SCNewMapCartoonAck
|
||||||
@ -2672,4 +2674,66 @@ rewardList"M
|
|||||||
exp (Rexp
|
exp (Rexp
|
||||||
group (Rgroup"O
|
group (Rgroup"O
|
||||||
SCLevelupSummonStartupNtf2
|
SCLevelupSummonStartupNtf2
|
||||||
info (2.serverproto.LevelupSummonInfoRinfobproto3
|
info (2.serverproto.LevelupSummonInfoRinfo"V
|
||||||
|
CSFruitJoinReq
|
||||||
|
uid (Ruid
|
||||||
|
room_no (RroomNo
|
||||||
|
chip_num (RchipNum"ì
|
||||||
|
SCFruitJoinAck
|
||||||
|
uid (Ruid
|
||||||
|
error (Rerror
|
||||||
|
stage (Rstage
|
||||||
|
sec (Rsec
|
||||||
|
my_chip_num (R myChipNum"
|
||||||
|
pool_chip_num (RpoolChipNum@
|
||||||
|
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo:
|
||||||
|
my_bet_info (2.serverproto.FruitSlotInfoR myBetInfo%
|
||||||
|
settle_history (R
settleHistory(
|
||||||
|
curr_award_slots
|
||||||
|
(RcurrAwardSlots(
|
||||||
|
curr_target_slot (RcurrTargetSlotM
|
||||||
|
player_award_rank (2!.serverproto.FruitPlayerAwardInfoRplayerAwardRank"<
|
||||||
|
CSFruitLeaveReq
|
||||||
|
uid (Ruid
|
||||||
|
room_no (RroomNo"9
|
||||||
|
SCFruitLeaveAck
|
||||||
|
uid (Ruid
|
||||||
|
error (Rerror"X
|
||||||
|
CSFruitBetReq
|
||||||
|
uid (Ruid5
|
||||||
|
bet_info (2.serverproto.FruitSlotInfoRbetInfo"ù
|
||||||
|
SCFruitBetAck
|
||||||
|
uid (Ruid
|
||||||
|
error (Rerror
|
||||||
|
my_chip_num (R myChipNum"
|
||||||
|
pool_chip_num (
RpoolChipNum@
|
||||||
|
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo:
|
||||||
|
my_bet_info (2.serverproto.FruitSlotInfoR myBetInfo"ÿ
|
||||||
|
SCFruitSettleNtf
|
||||||
|
uid (Ruid
|
||||||
|
my_chip_num (R myChipNum
|
||||||
|
|
||||||
|
award_type (R awardType$
|
||||||
|
award_chip_num (RawardChipNum
|
||||||
|
award_slots (R
|
||||||
|
awardSlotsB
|
||||||
|
award_chip_info (2.serverproto.FruitSlotInfoR
awardChipInfo%
|
||||||
|
settle_history (R
settleHistory
|
||||||
|
|
||||||
|
start_slot (R startSlot
|
||||||
|
target_slot (R
|
||||||
|
targetSlot(
|
||||||
|
add_reward_point
|
||||||
|
(
RaddRewardPoint"&
|
||||||
|
SCFruitStartBetNtf
|
||||||
|
uid (Ruid"<22>
|
||||||
|
SCFruitSecTickNtf
|
||||||
|
uid (Ruid
|
||||||
|
sec (Rsec"
|
||||||
|
pool_chip_num (
RpoolChipNum@
|
||||||
|
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo"›
|
||||||
|
SCFruitPlayerAwardRankNtf
|
||||||
|
uid (Ruid
|
||||||
|
|
||||||
|
award_type (R awardTypeM
|
||||||
|
player_award_rank (2!.serverproto.FruitPlayerAwardInfoRplayerAwardRankbproto3
|
||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<EFBFBD>Û
|
ÞÛ
|
||||||
login.protoserverproto
|
login.protoserverproto
|
||||||
user.proto"0
|
user.proto"0
|
||||||
|
|
||||||
@ -983,10 +983,11 @@ targetName"u
|
|||||||
Story (RStory4
|
Story (RStory4
|
||||||
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
||||||
CSRoleStoryReq4
|
CSRoleStoryReq4
|
||||||
story_id (2.serverproto.KeyValueTypeRstoryId"\
|
story_id (2.serverproto.KeyValueTypeRstoryId"œ
|
||||||
SCRoleStoryAck
|
SCRoleStoryAck
|
||||||
error (Rerror4
|
error (Rerror4
|
||||||
story_id (2.serverproto.KeyValueTypeRstoryId"J
|
story_id (2.serverproto.KeyValueTypeRstoryId>
|
||||||
|
story_rewards (2.serverproto.KeyValueTypeRstoryRewards"J
|
||||||
CSNewMapCartoonReq4
|
CSNewMapCartoonReq4
|
||||||
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
||||||
SCNewMapCartoonAck
|
SCNewMapCartoonAck
|
||||||
|
|||||||
@ -239,6 +239,10 @@ function UIChatCtr:OnStoryChatFinish()
|
|||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UIChatCtr:GetStoryChatReward(storyId)
|
||||||
|
ManagerContainer.DataMgr.StoryData:Record(storyId, 8)
|
||||||
|
end
|
||||||
|
|
||||||
function UIChatCtr:GetCurrStoryPerformCfgId(storyId)
|
function UIChatCtr:GetCurrStoryPerformCfgId(storyId)
|
||||||
return self.currStoryPerformCfgId
|
return self.currStoryPerformCfgId
|
||||||
end
|
end
|
||||||
|
|||||||
@ -57,6 +57,13 @@ function UIChatView:AddEventListener()
|
|||||||
self:RefreshMessageTab()
|
self:RefreshMessageTab()
|
||||||
self:RefreshChatLayer2(channelId)
|
self:RefreshChatLayer2(channelId)
|
||||||
end)
|
end)
|
||||||
|
ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_CHAT_STORY_REWARD, function(story_rewards)
|
||||||
|
local rewards = {}
|
||||||
|
for k, v in pairs(story_rewards) do
|
||||||
|
table.insert(rewards,{cfgId = v.key, num = v.value})
|
||||||
|
end
|
||||||
|
ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIPOPGot, {rewards = rewards})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIChatView:FillContent(data, uiBase)
|
function UIChatView:FillContent(data, uiBase)
|
||||||
@ -721,7 +728,7 @@ function UIChatView:RefreshMessageTab()
|
|||||||
|
|
||||||
local worldTitle = "世界"
|
local worldTitle = "世界"
|
||||||
local worldSubTitle = "给世界发一条消息吧!"
|
local worldSubTitle = "给世界发一条消息吧!"
|
||||||
if #worldHeadIcons > 0 then
|
if #worldHeadIcons > 0 and worldChats[#worldChats].fromData then
|
||||||
worldSubTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message
|
worldSubTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message
|
||||||
else
|
else
|
||||||
worldHeadIcons = {"Heads/head_100102"}
|
worldHeadIcons = {"Heads/head_100102"}
|
||||||
@ -768,6 +775,7 @@ function UIChatView:RefreshMessageTab()
|
|||||||
for i = 1, #storyChatDatas do
|
for i = 1, #storyChatDatas do
|
||||||
local storyCfg = storyChatDatas[i]
|
local storyCfg = storyChatDatas[i]
|
||||||
local firstStoryPerformCfg = ManagerContainer.CfgMgr:GetFirstStoryPerformCfg(storyCfg.StoryId)
|
local firstStoryPerformCfg = ManagerContainer.CfgMgr:GetFirstStoryPerformCfg(storyCfg.StoryId)
|
||||||
|
LogError("firstStoryPerformCfg: "..Inspect(firstStoryPerformCfg))
|
||||||
local headImg, name
|
local headImg, name
|
||||||
if firstStoryPerformCfg.SpeakSite == 1 then
|
if firstStoryPerformCfg.SpeakSite == 1 then
|
||||||
headImg = firstStoryPerformCfg.LeftImg
|
headImg = firstStoryPerformCfg.LeftImg
|
||||||
@ -1011,6 +1019,7 @@ function UIChatView:EnterChatLayer2(channelId, storyData)
|
|||||||
self.chatLayer2.titleBarReturnBtn.button.interactable = true
|
self.chatLayer2.titleBarReturnBtn.button.interactable = true
|
||||||
end
|
end
|
||||||
local storyRecordDatas = ManagerContainer.DataMgr.StoryData:GetStoryDatas()
|
local storyRecordDatas = ManagerContainer.DataMgr.StoryData:GetStoryDatas()
|
||||||
|
LogError("storyRecordDatas: "..Inspect(storyRecordDatas))
|
||||||
if true or not storyRecordDatas[storyData.StoryId] then
|
if true or not storyRecordDatas[storyData.StoryId] then
|
||||||
self:SetUIStoryMode(true)
|
self:SetUIStoryMode(true)
|
||||||
self.controller:StartStoryChat(storyData.Id, newMessageNtfFunc, chatInputNtfFunc, storyPlayFinishNtfFunc, true)
|
self.controller:StartStoryChat(storyData.Id, newMessageNtfFunc, chatInputNtfFunc, storyPlayFinishNtfFunc, true)
|
||||||
@ -1019,6 +1028,8 @@ function UIChatView:EnterChatLayer2(channelId, storyData)
|
|||||||
self:SetUIStoryMode(false)
|
self:SetUIStoryMode(false)
|
||||||
end
|
end
|
||||||
self:RefreshChatLayer2(channelId, storyData)
|
self:RefreshChatLayer2(channelId, storyData)
|
||||||
|
|
||||||
|
self.controller:GetStoryChatReward(storyData.StoryId)
|
||||||
else
|
else
|
||||||
self:SetUIStoryMode(false)
|
self:SetUIStoryMode(false)
|
||||||
self:RefreshChatLayer2(channelId, storyData)
|
self:RefreshChatLayer2(channelId, storyData)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user