Merge branch 'china/dev-c' of http://60.1.1.230/gaoxin/JL_Client into china/dev-c
commit
1ab094facb
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2d69b6d42fb1e3c438857d0f2a6c3751
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1334,7 +1334,8 @@ PRIVILEGE_TYPE = {
|
|||
GUILDTRANSCRIPT_BUY_BATTLENUM = 3012, -- 公会副本挑战购买次数
|
||||
FINDTREASURE_EXPERT = 34, -- 活动寻宝达人寻宝消耗降低%s
|
||||
HANG_ON_TIME = 2002, -- 挂机时长特权
|
||||
|
||||
MONSTERCAMP_BATTLENUM = 2025, -- 心魔试炼挑战次数
|
||||
MONSTERCAMP_BUY_BATTLENUM = 2026, -- 心魔试炼挑战购买次数
|
||||
}
|
||||
|
||||
-- 功能开启类型
|
||||
|
@ -2261,6 +2262,7 @@ EXPEDITON_POPUP_TYPE={
|
|||
Monster=3,--普通 精英 boss
|
||||
Trail=4,--试炼
|
||||
Greed = 5,--贪婪
|
||||
FourElementMonster = 6,--心魔试炼 四灵试炼
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -386,6 +386,7 @@ UIName = {
|
|||
PracticeImprintPanel = 394,--修行神印界面
|
||||
GeneralInfoPopup = 395,--通用信息弹窗(类似技能信息界面)
|
||||
CongratulationPopup = 396,--通用恭喜界面(类似恭喜升级)
|
||||
MonsterCampNewPanel = 398,--心魔试炼新界面
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -464,5 +464,9 @@ GameEvent = {
|
|||
--山河社稷图
|
||||
FightLevel={
|
||||
MainLevelInfoRefresh = "FightLevel.MainLevelInfoRefresh",--主关卡详情界面属性
|
||||
},
|
||||
--心魔试炼
|
||||
MonsterCamp={
|
||||
UpdatePri = "MonsterCamp.UpdatePri",
|
||||
}
|
||||
}
|
|
@ -131,6 +131,10 @@ RECHARGEINFOINDICATION = protobuf.Descriptor();
|
|||
RECHARGEINFOINDICATION_RECHARGEID_FIELD = protobuf.FieldDescriptor();
|
||||
RECHARGEINFOINDICATION_BUYCOUNT_FIELD = protobuf.FieldDescriptor();
|
||||
RECHARGEINFOINDICATION_LEFTTIME_FIELD = protobuf.FieldDescriptor();
|
||||
SWEEPDEMONREQUEST = protobuf.Descriptor();
|
||||
SWEEPDEMONREQUEST_ID_FIELD = protobuf.FieldDescriptor();
|
||||
SWEEPDEMONRESPONSE = protobuf.Descriptor();
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
|
||||
FIGHTSTARTREQUEST_FIGHTTYPE_FIELD.name = "fightType"
|
||||
FIGHTSTARTREQUEST_FIGHTTYPE_FIELD.full_name = ".rpc.protocols.FightStartRequest.fightType"
|
||||
|
@ -1335,6 +1339,41 @@ RECHARGEINFOINDICATION.enum_types = {}
|
|||
RECHARGEINFOINDICATION.fields = {RECHARGEINFOINDICATION_RECHARGEID_FIELD, RECHARGEINFOINDICATION_BUYCOUNT_FIELD, RECHARGEINFOINDICATION_LEFTTIME_FIELD}
|
||||
RECHARGEINFOINDICATION.is_extendable = false
|
||||
RECHARGEINFOINDICATION.extensions = {}
|
||||
SWEEPDEMONREQUEST_ID_FIELD.name = "id"
|
||||
SWEEPDEMONREQUEST_ID_FIELD.full_name = ".rpc.protocols.SweepDemonRequest.id"
|
||||
SWEEPDEMONREQUEST_ID_FIELD.number = 1
|
||||
SWEEPDEMONREQUEST_ID_FIELD.index = 0
|
||||
SWEEPDEMONREQUEST_ID_FIELD.label = 1
|
||||
SWEEPDEMONREQUEST_ID_FIELD.has_default_value = false
|
||||
SWEEPDEMONREQUEST_ID_FIELD.default_value = 0
|
||||
SWEEPDEMONREQUEST_ID_FIELD.type = 5
|
||||
SWEEPDEMONREQUEST_ID_FIELD.cpp_type = 1
|
||||
|
||||
SWEEPDEMONREQUEST.name = "SweepDemonRequest"
|
||||
SWEEPDEMONREQUEST.full_name = ".rpc.protocols.SweepDemonRequest"
|
||||
SWEEPDEMONREQUEST.nested_types = {}
|
||||
SWEEPDEMONREQUEST.enum_types = {}
|
||||
SWEEPDEMONREQUEST.fields = {SWEEPDEMONREQUEST_ID_FIELD}
|
||||
SWEEPDEMONREQUEST.is_extendable = false
|
||||
SWEEPDEMONREQUEST.extensions = {}
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.name = "Drop"
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.full_name = ".rpc.protocols.SweepDemonResponse.Drop"
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.number = 1
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.index = 0
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.label = 1
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.has_default_value = false
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.default_value = nil
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.message_type = CommonProto_pb.DROP
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.type = 11
|
||||
SWEEPDEMONRESPONSE_DROP_FIELD.cpp_type = 10
|
||||
|
||||
SWEEPDEMONRESPONSE.name = "SweepDemonResponse"
|
||||
SWEEPDEMONRESPONSE.full_name = ".rpc.protocols.SweepDemonResponse"
|
||||
SWEEPDEMONRESPONSE.nested_types = {}
|
||||
SWEEPDEMONRESPONSE.enum_types = {}
|
||||
SWEEPDEMONRESPONSE.fields = {SWEEPDEMONRESPONSE_DROP_FIELD}
|
||||
SWEEPDEMONRESPONSE.is_extendable = false
|
||||
SWEEPDEMONRESPONSE.extensions = {}
|
||||
|
||||
AdventureBossFindIndication = protobuf.Message(ADVENTUREBOSSFINDINDICATION)
|
||||
AdventureBossInfoResponse = protobuf.Message(ADVENTUREBOSSINFORESPONSE)
|
||||
|
@ -1363,6 +1402,8 @@ MainLevelRankInfoResponse = protobuf.Message(MAINLEVELRANKINFORESPONSE)
|
|||
QuickStartMonsterFightRequest = protobuf.Message(QUICKSTARTMONSTERFIGHTREQUEST)
|
||||
QuickStartMonsterFightResponse = protobuf.Message(QUICKSTARTMONSTERFIGHTRESPONSE)
|
||||
RechargeInfoIndication = protobuf.Message(RECHARGEINFOINDICATION)
|
||||
SweepDemonRequest = protobuf.Message(SWEEPDEMONREQUEST)
|
||||
SweepDemonResponse = protobuf.Message(SWEEPDEMONRESPONSE)
|
||||
SweepRightRequest = protobuf.Message(SWEEPRIGHTREQUEST)
|
||||
SweepRightResponse = protobuf.Message(SWEEPRIGHTRESPONSE)
|
||||
TakeAventureRewardRequest = protobuf.Message(TAKEAVENTUREREWARDREQUEST)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -262,6 +262,7 @@ function this.ChatDataAdapter(channel, data)
|
|||
-- newChat.multiple = 1
|
||||
|
||||
GuildRedPacketManager.isCheck = true
|
||||
MyGuildManager.PackageNum=MyGuildManager.PackageNum+1
|
||||
CheckRedPointStatus(RedPointType.Guild_RedPacket)
|
||||
CheckRedPointStatus(RedPointType.Guid_GetPackage)
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@ local contentScripts = {
|
|||
[4]= {view=require("Modules/Expedition/View/ExpeditionMonsterInfo_Trail"),panelName="ExpeditionMonsterInfo_Trail",type=EXPEDITON_POPUP_TYPE.Trail},
|
||||
--贪婪
|
||||
[5]= {view=require("Modules/Expedition/View/ExpeditionMonsterInfo_Greed"),panelName="ExpeditionMonsterInfo_Greed",type=EXPEDITON_POPUP_TYPE.Greed},
|
||||
-- 四灵试炼 boss
|
||||
[6]= {view=require("Modules/Expedition/View/MonsterFormationInfo"),panelName="MonsterFormationInfo",type = EXPEDITON_POPUP_TYPE.FourElementMonster},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
@ -0,0 +1,266 @@
|
|||
----- 远征怪节点弹窗 -----
|
||||
local this = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--传入特效层级
|
||||
local sortingOrder=0
|
||||
|
||||
--item容器
|
||||
local itemList = {}
|
||||
local heroListGo = {}
|
||||
|
||||
local waveId = 0 --当前层
|
||||
local curType = 1 --当前试炼类型
|
||||
local configData = {} --当前层的数据表
|
||||
local data = {} --当前试炼的数据
|
||||
local rewardData = {} --当前层的奖励
|
||||
|
||||
local freeTime = 0
|
||||
local buyTime = 0
|
||||
|
||||
local itemId = 0
|
||||
local costNum = 0
|
||||
local storeDataId = 0
|
||||
|
||||
local roleConfig=ConfigManager.GetConfig(ConfigName.RoleConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
function this:InitComponent(gameObject)
|
||||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||||
this.power = Util.GetGameObject(gameObject, "Power/Value"):GetComponent("Text")
|
||||
|
||||
--滚动条根节点
|
||||
this.root = Util.GetGameObject(gameObject, "Root")
|
||||
for i = 1, 6 do
|
||||
heroListGo[i] = Util.GetGameObject(gameObject, "RoleGrid/Bg"..i.."/Hero"..i)
|
||||
Util.GetGameObject(gameObject, "RoleGrid/Bg"..i):GetComponent("Image").sprite = Util.LoadSprite(CardPosImageName[i])
|
||||
end
|
||||
this.backBtn=Util.GetGameObject(gameObject,"BackBtn")
|
||||
this.sureBtn=Util.GetGameObject(gameObject,"sureBtn")
|
||||
this.fightBtn=Util.GetGameObject(gameObject,"sureBtn/fightBtn")
|
||||
this.fightBtnText=Util.GetGameObject(this.fightBtn,"Text"):GetComponent("Text")
|
||||
this.fightBtnIcon=Util.GetGameObject(this.fightBtn,"Icon"):GetComponent("Image")
|
||||
this.fightBtnNum=Util.GetGameObject(this.fightBtn,"IconNum"):GetComponent("Text")
|
||||
this.fightBtn.gameObject:SetActive(true)
|
||||
this.returnLook=Util.GetGameObject(gameObject,"returnLook")
|
||||
this.returnLook.gameObject:SetActive(true)
|
||||
this.tip = Util.GetGameObject(gameObject,"tip"):GetComponent("Text")
|
||||
Util.GetGameObject(gameObject, "RoleGrid/FrontImage"):GetComponent("Image").sprite = Util.LoadSprite("bd_xinqianpai_zh")
|
||||
Util.GetGameObject(gameObject, "RoleGrid/BehindImage"):GetComponent("Image").sprite = Util.LoadSprite("bd_xinhoupai_zh")
|
||||
this.returnLook:GetComponent("Image").sprite = Util.LoadSprite("s_silingshilian_huifanganniu_zh")
|
||||
Util.GetGameObject(gameObject, "Power"):GetComponent("Image").sprite = Util.LoadSprite("t_tongyong-zhanli_zh")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.sureBtn, function()
|
||||
this:BtnClickEvent()
|
||||
end)
|
||||
Util.AddClick(this.returnLook, function()
|
||||
--faxieyi
|
||||
local tempData = {}
|
||||
NetManager.GetRePlayData(curType,waveId,function(msg)
|
||||
tempData = msg.userRank
|
||||
if not tempData or #tempData < 1 then
|
||||
PopupTipPanel.ShowTip("无通关记录!")
|
||||
else
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.FourElementReturnLook,waveId,curType,tempData)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Util.AddClick(this.backBtn, function()
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end
|
||||
function this:BtnClickEvent()
|
||||
local x = function()
|
||||
MonsterCampManager.ExecuteFightBattle(waveId,1,function()
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(data.freeTimeId, 1)
|
||||
this:SetIcon()
|
||||
end,curType)
|
||||
end
|
||||
if waveId == data.monsterWave then
|
||||
LogGreen(freeTime..buyTime)
|
||||
if freeTime <=0 and buyTime <= 0 then
|
||||
PopupTipPanel.ShowTip("今日已无扫荡次数!")
|
||||
return
|
||||
end
|
||||
if freeTime <= 0 then
|
||||
if BagManager.GetItemCountById(itemId) < costNum then
|
||||
PopupTipPanel.ShowTip(string.format(Language[10343], itemConfig[itemId].Name))
|
||||
return
|
||||
end
|
||||
MsgPanel.ShowTwo(string.format("是否花费%s%s购买一次扫荡次数?",costNum,itemConfig[itemId].Name),function() end,function()
|
||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeDataId,1,function()
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(data.buyTimeId, 1)
|
||||
x()
|
||||
end)
|
||||
end,"取消","确定")
|
||||
else
|
||||
x()
|
||||
end
|
||||
elseif (waveId == data.monsterWave + 1) then
|
||||
if data.canFightTime > 0 then
|
||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.FOUR_ELEMENT, curType,waveId)
|
||||
parent:ClosePanel()
|
||||
else
|
||||
PopupTipPanel.ShowTip("今日已无可挑战层数!")
|
||||
end
|
||||
else
|
||||
parent:ClosePanel()
|
||||
end
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
|
||||
end
|
||||
|
||||
function this:SetIcon()
|
||||
freeTime,buyTime = MonsterCampManager.GetTimeTip(curType)
|
||||
storeDataId,itemId,costNum = MonsterCampManager.GetCost(curType)
|
||||
Util.SetGray(this.fightBtn,false)
|
||||
this.fightBtnIcon.gameObject:SetActive(false)
|
||||
this.fightBtnNum.gameObject:SetActive(false)
|
||||
this.sureBtn:GetComponent("Image").sprite = Util.LoadSprite("r_hero_button_002")
|
||||
if waveId == data.monsterWave then
|
||||
this.tip.text = "扫荡奖励"
|
||||
if freeTime > 0 then
|
||||
this.fightBtnText.text = string.format("<color=#%s>%s</color>","17232A","免费扫荡")
|
||||
else
|
||||
this.fightBtnIcon.gameObject:SetActive(true)
|
||||
this.fightBtnNum.gameObject:SetActive(true)
|
||||
this.fightBtnIcon.sprite = Util.LoadSprite(GetResourcePath(itemConfig[itemId].ResourceID))
|
||||
local color = 0
|
||||
if BagManager.GetItemCountById(itemId) < costNum then
|
||||
color = "E71515"
|
||||
else
|
||||
color = "17232A"
|
||||
end
|
||||
this.fightBtnNum.text =string.format("<color=#%s>%s</color>",color,costNum)
|
||||
this.fightBtnText.text = string.format("<color=#%s>%s</color>",color,"扫荡")
|
||||
if buyTime < 1 then
|
||||
Util.SetGray(this.fightBtn,true)
|
||||
end
|
||||
end
|
||||
elseif (waveId == data.monsterWave + 1) then
|
||||
this.tip.text = "战斗奖励"
|
||||
this.sureBtn:GetComponent("Image").sprite = Util.LoadSprite("r_hero_button_001")
|
||||
this.fightBtnText.text = string.format("<color=#%s>%s</color>","17232A","挑 战")
|
||||
else
|
||||
this.tip.text = "战斗奖励"
|
||||
this.fightBtnText.text =string.format("<color=#%s>%s</color>","17232A","确定")
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
local args = {...}
|
||||
curType = args[1]
|
||||
waveId = args[2]
|
||||
|
||||
configData = MonsterCampManager.GetFourElementMonsterInfoByWave(curType,waveId)
|
||||
data = MonsterCampManager.GetCurFourElementMonsterInfo(curType)
|
||||
this:SetIcon()
|
||||
local rewardIds = {}
|
||||
if waveId == data.monsterWave then
|
||||
--扫荡
|
||||
rewardIds = configData.commonReward
|
||||
else
|
||||
rewardIds = configData.firstReward
|
||||
end
|
||||
|
||||
if rewardIds and #rewardIds > 0 then
|
||||
for i, v in pairs(rewardIds) do
|
||||
table.insert(rewardData,{v.id,v.num})
|
||||
end
|
||||
end
|
||||
this:FormationAdapter()
|
||||
end
|
||||
-- 编队数据匹配
|
||||
function this:FormationAdapter()
|
||||
this.titleText.text = string.format("%s层",configData.wave)
|
||||
this.power.text = configData.power
|
||||
local bossTeaminfo = configData.monster
|
||||
for i = 1, #heroListGo do
|
||||
if (bossTeaminfo[i]) and bossTeaminfo[i] > 0 then
|
||||
heroListGo[i].transform.parent:GetComponent("Image").sprite=Util.LoadSprite("t_chengyuankuang_kuang")
|
||||
this.SetCardSingleData(heroListGo[i],bossTeaminfo[i],i)
|
||||
heroListGo[i]:SetActive(true)
|
||||
else
|
||||
heroListGo[i]:SetActive(false)
|
||||
end
|
||||
end
|
||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
|
||||
end
|
||||
|
||||
function this.OnSortingOrderChange()
|
||||
for i = 1, #heroListGo do
|
||||
Util.AddParticleSortLayer(heroListGo[i], self.sortingOrder - sortingOrder)
|
||||
end
|
||||
sortingOrder = self.sortingOrder
|
||||
end
|
||||
|
||||
--设置单个上阵英雄信息
|
||||
function this.SetCardSingleData(o,monsterId, _pos)
|
||||
local yuanImage=Util.GetGameObject(o,"yuanImage")
|
||||
yuanImage:SetActive(false)
|
||||
local hp = Util.GetGameObject(o,"hpProgress")
|
||||
hp:SetActive(false)
|
||||
local rage = Util.GetGameObject(o,"rageProgress")
|
||||
rage:SetActive(false)
|
||||
|
||||
local monsterconfig = ConfigManager.GetConfigData(ConfigName.MonsterConfig, monsterId)
|
||||
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, monsterconfig.MonsterId)
|
||||
|
||||
local bg=Util.GetGameObject(o,"Bg1"):GetComponent("Image")
|
||||
bg.sprite = Util.LoadSprite(GetHeroCardStarBg[heroConfig.Star])
|
||||
local fg=Util.GetGameObject(o,"Bg2"):GetComponent("Image")
|
||||
fg.sprite = Util.LoadSprite(GetHeroCardStarFg[heroConfig.Star])
|
||||
|
||||
-- local live=Util.GetGameObject(o,"Mask/Live")
|
||||
local lv=Util.GetGameObject(o,"lv/Text"):GetComponent("Text")
|
||||
lv.text=monsterconfig.Level
|
||||
|
||||
local pro=Util.GetGameObject(o,"Pro/Image"):GetComponent("Image")
|
||||
pro.sprite=Util.LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
|
||||
local starGrid=Util.GetGameObject(o,"StarGrid")
|
||||
SetCardStars(starGrid,heroConfig.Star)
|
||||
local name=Util.GetGameObject(o,"Name/Text"):GetComponent("Text")
|
||||
name.text=heroConfig.ReadingName
|
||||
|
||||
local live = Util.GetGameObject(o, "Mask/icon"):GetComponent("RawImage")
|
||||
local liveName = GetResourcePath(heroConfig.Live)
|
||||
local roleConfig = ConfigManager.GetConfigData(ConfigName.RoleConfig, heroConfig.Id)
|
||||
local scale = roleConfig.play_liveScale
|
||||
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
|
||||
live.texture = CardRendererManager.GetSpineTexture(_pos, liveName, Vector3.one * scale, livePos, true)
|
||||
live.transform.localScale = Vector3.one
|
||||
live.transform.localPosition = Vector3.zero
|
||||
|
||||
local zs = Util.GetGameObject(o, "zs")
|
||||
local zsName = GetHeroCardStarZs[heroConfig.Star]
|
||||
if zsName == "" then
|
||||
zs:SetActive(false)
|
||||
else
|
||||
zs:SetActive(true)
|
||||
zs:GetComponent("Image").sprite = Util.LoadSprite(zsName)
|
||||
end
|
||||
|
||||
if heroConfig.Star > 9 then
|
||||
Util.GetGameObject(o,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(true)
|
||||
else
|
||||
Util.GetGameObject(o,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
rewardData = {}
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7b9c7d5cf678256498a8f008243e458e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -349,16 +349,9 @@ function this.GetCurLevelIsOpen(levelDatas)
|
|||
end
|
||||
if levelDatas.nodeId > FightLevelManager.GetCurChapterLevelId() then
|
||||
--特殊判断 分主关卡和副关卡
|
||||
if levelDatas.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then
|
||||
local upMainLevelConfig = FightLevelManager.GetChapterLevelData(levelDatas.config.Chapter,levelDatas.nodeId - 2)
|
||||
if not upMainLevelConfig.isPass then
|
||||
return 1
|
||||
end
|
||||
elseif levelDatas.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevel or levelDatas.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevelReward then
|
||||
local upMainLevelConfig = FightLevelManager.GetChapterLevelData(levelDatas.config.Chapter,levelDatas.nodeId - 1)
|
||||
if not upMainLevelConfig.isPass then
|
||||
return 1
|
||||
end
|
||||
local upMainLevelConfig = FightLevelManager.GetChapterLevelData(levelDatas.config.Chapter,levelDatas.config.NextLevel)
|
||||
if not upMainLevelConfig.isPass then
|
||||
return 1
|
||||
end
|
||||
end
|
||||
if levelDatas.config.LevelLimit > PlayerManager.level then
|
||||
|
|
|
@ -107,9 +107,9 @@ function this.StraightBattle()
|
|||
else
|
||||
MonsterCampManager.monsterWave = MonsterCampManager.monsterWave + 1
|
||||
end
|
||||
|
||||
this.root:ClosePanel()
|
||||
-- 返回那个界面
|
||||
UIManager.OpenPanel(UIName.MonsterCampPanel)
|
||||
-- UIManager.OpenPanel(UIName.MonsterCampPanel)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -189,6 +189,8 @@ function GuildInfoPopup:BindEvent()
|
|||
MyGuildManager.RequestQuitGuild(function()
|
||||
this:ClosePanel()
|
||||
GuildManager.RefreshGuildAllRedState()
|
||||
MyGuildManager.PackageNum=0
|
||||
CheckRedPointStatus(RedPointType.Guid_GetPackage)
|
||||
UIManager.OpenPanel(UIName.MainPanel)
|
||||
end)
|
||||
end)
|
||||
|
|
|
@ -215,11 +215,11 @@ function MyGuildManager.SetMyGuidRedPackage(data)
|
|||
local list={}
|
||||
if data then
|
||||
for key, value in pairs(data) do
|
||||
if value.id then
|
||||
if value.id and value.num then
|
||||
LogError(" package id =="..value.id.." num=="..value.num)
|
||||
local data={}
|
||||
data.num=value.num
|
||||
list[value.id]=data
|
||||
local aaa={}
|
||||
aaa.num=value.num
|
||||
list[value.id]=aaa
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -424,6 +424,8 @@ function MyGuildManager.RequestQuitGuild(func)
|
|||
this.MyGuildMemList = {}
|
||||
this.MyGuildApplyList = {}
|
||||
this.MyGuildLogList = {}
|
||||
this.MyGuidRedPackage={}
|
||||
this.PackageNum=0
|
||||
if func then func() end
|
||||
-- 退出公会成功事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.OnQuitGuild)
|
||||
|
|
|
@ -16,11 +16,11 @@ function this.CheckGuildRedPacketRedPoint()
|
|||
-- else
|
||||
-- return false
|
||||
-- end
|
||||
LogError("检测发红包红点")
|
||||
local list=MyGuildManager.GetMyGuidRedPackage()
|
||||
if list then
|
||||
LogRed("检测发红包红点")
|
||||
for key, value in pairs(list) do
|
||||
if value.num>0 then
|
||||
if value and value.num and value.num>0 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -78,13 +78,13 @@ function this.InitView(redId,id)
|
|||
index=4
|
||||
end
|
||||
this.title.sprite=Util.LoadSprite(RedPacketName[index])
|
||||
LogError("BaseType=="..config.BaseType)
|
||||
if config.BaseType==1 then
|
||||
this.titleTip.text=GetLanguageStrById(config.SendWord)
|
||||
elseif config.BaseType==2 then
|
||||
this.titleTip.text=GetLanguageStrById(config.RuleDes)
|
||||
end
|
||||
this.title.sprite=this.spLoader:LoadSprite(RedPacketName[index])
|
||||
this.titleTip.text=GetLanguageStrById(config.SendWord)
|
||||
NetManager.GetRedPackageDetailRequest(redId,function(msg)
|
||||
-- logWarnTrance(TimeToDHMS(msg.remainTime))
|
||||
-- for k,v in ipairs(msg.info) do
|
||||
|
|
|
@ -5,7 +5,7 @@ local sortingOrder=0
|
|||
local RedPacketName={"g_ghhb_ming_01_zh","g_ghhb_ming_02_zh","g_ghhb_ming_03_zh","g_ghhb_ming_04_zh"}
|
||||
--红包按钮状态图片
|
||||
local BtnStateImage={"g_ghhb_qiang_zh","g_ghhb_lingqu_zh","g_ghhb_lingwan_zh"}--抢 已领取 已领完
|
||||
|
||||
local SpecialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,115)
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
this.spLoader = SpriteLoader.New()
|
||||
|
@ -72,7 +72,6 @@ function this:InitGetView()
|
|||
for i,v in ipairs(msg.info) do
|
||||
table.insert(data,v)
|
||||
end
|
||||
LogError("len=========="..LengthOfTable(data))
|
||||
this:DataSort(data)
|
||||
dataLength=#msg.info
|
||||
|
||||
|
@ -88,7 +87,7 @@ function this:InitGetView()
|
|||
if value.isGet==0 and (config.Num-value.getCount)>0 and isAuto then
|
||||
if config.BaseType~=2 or PlayerManager.dailyRedPack< tonumber(SpecialConfig.Value) then
|
||||
isAuto=false
|
||||
LogError("redid============"..value.redId)
|
||||
--LogError("redid============"..value.redId)
|
||||
NetManager.GetRobRedPackageRequest(value.redId,function(msg)
|
||||
local success=msg.isSuccess
|
||||
local itemId=msg.itemId
|
||||
|
@ -121,7 +120,6 @@ end
|
|||
|
||||
|
||||
function this:SetView(root,data)
|
||||
LogError("-------------------")
|
||||
local nameImage=Util.GetGameObject(root,"NameImage"):GetComponent("Image")--红包名
|
||||
local fromPlayer=Util.GetGameObject(root,"FromPlayer"):GetComponent("Text")--红包来自玩家名
|
||||
local getBtn=Util.GetGameObject(root,"GetBtn")--抢红包按钮
|
||||
|
@ -166,6 +164,10 @@ function this:SetView(root,data)
|
|||
getBtnImage:SetNativeSize()
|
||||
|
||||
Util.AddOnceClick(getBtn,function()
|
||||
if data.redType>3 and PlayerManager.dailyRedPack>=tonumber(SpecialConfig.Value) then
|
||||
PopupTipPanel.ShowTip("今日福利红包抢夺次数到达上限!")
|
||||
return
|
||||
end
|
||||
NetManager.GetRobRedPackageRequest(redId,function(msg)
|
||||
local success=msg.isSuccess
|
||||
local itemId=msg.itemId
|
||||
|
@ -173,7 +175,6 @@ function this:SetView(root,data)
|
|||
if success==1 then--红包抢成功
|
||||
local itemName=GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name)
|
||||
UIManager.OpenPanel(UIName.RedPacketPopup,redId,data.redType)
|
||||
--红包类型大于3的是福利红包
|
||||
if data.redType>3 then
|
||||
PlayerManager.SettDailyRedPackageTime(PlayerManager.dailyRedPack+1)
|
||||
end
|
||||
|
|
|
@ -262,6 +262,7 @@ function this.RechargeSuccessFunc(id)
|
|||
this.SetInfo(curIndex)
|
||||
--PopupTipPanel.ShowTip(string.format( Language[11051],GetLanguageStrById(redpack.Name)))
|
||||
ChatManager.RequestSendRedPacket(curIndex)
|
||||
--MyGuildManager.ReuqsetRedPackage()
|
||||
CheckRedPointStatus(RedPointType.Guid_GetPackage)
|
||||
end
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ end)
|
|||
this.scrollView:SetData(showList,function(index,root)
|
||||
this:ShowItemInfo(root,showList[index])
|
||||
end)
|
||||
CheckRedPointStatus(RedPointType.Guid_SendPackage)
|
||||
end
|
||||
--显示红包数据
|
||||
function this:ShowItemInfo(go,data)
|
||||
|
@ -115,7 +116,7 @@ function this:ShowItemInfo(go,data)
|
|||
PopupTipPanel.ShowTip("成功发送福利红包!")
|
||||
this:InitView()
|
||||
--刷新发送福利红包按钮红点
|
||||
CheckRedPointStatus(RedPointType.Guid_SendPackage)
|
||||
CheckRedPointStatus(RedPointType.Guid_GetPackage)
|
||||
MyGuildManager.ReuqsetRedPackage(function()
|
||||
CheckRedPointStatus(RedPointType.Guid_GetPackage)
|
||||
end)
|
||||
|
|
|
@ -187,4 +187,55 @@ function this.SetRewardData()
|
|||
return dataList
|
||||
end
|
||||
|
||||
--新心魔试炼
|
||||
-- 获取剩余挑战次数 特权
|
||||
function this.GetCanBattleCount()
|
||||
return PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.MONSTERCAMP_BATTLENUM)
|
||||
end
|
||||
-- 获取剩余挑战购买次数 特权
|
||||
function this.GetCanBuyBattleCount()
|
||||
return PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.MONSTERCAMP_BUY_BATTLENUM)
|
||||
end
|
||||
--心魔试炼特权购买信息
|
||||
function this.MonsterCampGetCost()
|
||||
local buyTimeId = PRIVILEGE_TYPE.MONSTERCAMP_BUY_BATTLENUM
|
||||
local storeData = ConfigManager.GetConfigDataByDoubleKey(ConfigName.StoreConfig, "StoreId", 7, "Limit", buyTimeId)
|
||||
--商店表数据
|
||||
local buyTimes = (PrivilegeManager.GetPrivilegeUsedTimes(buyTimeId) + 1) > PrivilegeManager.GetPrivilegeNumber(buyTimeId)
|
||||
and PrivilegeManager.GetPrivilegeNumber(buyTimeId) or (PrivilegeManager.GetPrivilegeUsedTimes(buyTimeId) + 1)
|
||||
return storeData.Id, storeData.Cost[1][1],storeData.Cost[2][buyTimes]
|
||||
end
|
||||
--获取心魔试炼表数据
|
||||
function this.GetMonstersInfo()
|
||||
local datas = {}
|
||||
for _, configInfo in ConfigPairs(monsterCampConfig) do
|
||||
table.insert(datas,configInfo)
|
||||
end
|
||||
return datas
|
||||
end
|
||||
--扫荡
|
||||
function this.MonsterCampBattle(id,type,func)
|
||||
NetManager.FourChallengeDoRequest(id,type,function(msg)
|
||||
if type == 0 then
|
||||
local fightData = BattleManager.GetBattleServerData(msg,0)
|
||||
this.drop = msg.drop
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FOURELEMENT,function(result)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
if result.result == 0 then
|
||||
elseif result.result == 1 then
|
||||
this.fourMonsterData[curType].monsterWave = id
|
||||
end
|
||||
end)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,183 @@
|
|||
require("Base/BasePanel")
|
||||
require("View/MonsterCampSingleWave")
|
||||
MonsterCampNewPanel = Inherit(BasePanel)
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local this = MonsterCampNewPanel
|
||||
|
||||
this.grid = {}
|
||||
this.singledataList = {}
|
||||
|
||||
local itemId = 0
|
||||
local costNum = 0
|
||||
local freeTimes = 0
|
||||
local buyTimes = 0
|
||||
local storeDataId = 0
|
||||
local callBack
|
||||
|
||||
-- local redTrailType = {
|
||||
-- [1] = RedPointType.PersonTrailHelp,
|
||||
-- [2] = RedPointType.BuddishTrailHelp,
|
||||
-- [3] = RedPointType.DemonTrailHelp,
|
||||
-- [4] = RedPointType.TaoistTrailHelp,
|
||||
-- }
|
||||
--初始化组件(用于子类重写)
|
||||
function MonsterCampNewPanel:InitComponent()
|
||||
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
||||
|
||||
this.btnBack = Util.GetGameObject(self.gameObject, "InfoRoot/btnBack")
|
||||
this.helpBtn = Util.GetGameObject(self.gameObject, "InfoRoot/help")
|
||||
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
|
||||
this.pre = Util.GetGameObject(self.gameObject, "InfoRoot/pre")
|
||||
this.grid = Util.GetGameObject(self.gameObject, "InfoRoot/grid")
|
||||
local rootHight = this.grid.transform.rect.height
|
||||
local width = this.grid.transform.rect.width
|
||||
this.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.grid.transform,
|
||||
this.pre, nil, Vector2.New(1080, 1544.8), 1, 1, Vector2.New(0, 0))
|
||||
this.scrollView.moveTween.MomentumAmount = 1
|
||||
this.scrollView.moveTween.Strength = 2
|
||||
|
||||
this.titleText = Util.GetGameObject(self.gameObject, "InfoRoot/tiitleRoot/title"):GetComponent("Text")
|
||||
this.canFightWaves = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/canFightWaves"):GetComponent("Text")
|
||||
this.freeMoppingTimes = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/freeMoppingTimes"):GetComponent("Text")
|
||||
this.buyMoppingTimes = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/buyMoppingTimes"):GetComponent("Text")
|
||||
this.addBtn = Util.GetGameObject(self.gameObject, "InfoRoot/bottomLayout/addBtn")
|
||||
this.btnRank = Util.GetGameObject(self.gameObject, "InfoRoot/btnRank")
|
||||
this.btnHelpFight = Util.GetGameObject(self.gameObject, "InfoRoot/btnHelpFight")
|
||||
this.btnHelpFight:GetComponent("Image").sprite = Util.LoadSprite("g_guanka_tongguanjiangli_zh")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function MonsterCampNewPanel:BindEvent()
|
||||
Util.AddClick(this.btnBack, function ()
|
||||
self:ClosePanel()
|
||||
if callBack then callBack() end
|
||||
end)
|
||||
Util.AddClick(this.helpBtn, function ()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.FoueElementPeo,this.helpPosition.x,this.helpPosition.y)
|
||||
end)
|
||||
Util.AddClick(this.addBtn, function ()
|
||||
if buyTimes < 0 then
|
||||
PopupTipPanel.ShowTip("今日已无购买次数")
|
||||
else
|
||||
if BagManager.GetItemCountById(itemId) < costNum then
|
||||
PopupTipPanel.ShowTip(string.format(Language[10343], itemConfig[itemId].Name))
|
||||
return
|
||||
end
|
||||
MsgPanel.ShowTwo(string.format("是否花费%s%s购买一次扫荡次数?",costNum,itemConfig[itemId].Name),function() end,function()
|
||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeDataId,1,function()
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.MONSTERCAMP_BUY_BATTLENUM, 1)
|
||||
this.UpdatePrivilage()
|
||||
end)
|
||||
end,"取消","确定")
|
||||
end
|
||||
end)
|
||||
Util.AddClick(this.btnRank, function ()
|
||||
-- UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[4])]\
|
||||
UIManager.OpenPanel(UIName.CarbonScoreSortPanel, 2)
|
||||
end)
|
||||
Util.AddClick(this.btnHelpFight, function ()
|
||||
MonsterCampManager.preType = 2
|
||||
UIManager.OpenPanel(UIName.TrialRewardPopup,MonsterCampManager.SetRewardData(),function(id,rewardFunc)
|
||||
NetManager.DemonsTrialRewardRequest(id, function(msg)
|
||||
MonsterCampManager.SetRewardWave({id}) --本地记录已领奖励信息
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
|
||||
if rewardFunc then
|
||||
rewardFunc()
|
||||
end
|
||||
CheckRedPointStatus(RedPointType.EpicExplore)
|
||||
end)
|
||||
end)
|
||||
end,2)
|
||||
end)
|
||||
BindRedPointObject(RedPointType.EpicExplore,Util.GetGameObject(this.btnHelpFight, "redPoint"))
|
||||
end
|
||||
|
||||
this.UpdatePrivilage = function()
|
||||
-- if this.singledataList[trailData.monsterWave] then
|
||||
-- this.singledataList[trailData.monsterWave]:UpdatePrivilage()
|
||||
-- end
|
||||
storeDataId,itemId,costNum = MonsterCampManager.MonsterCampGetCost()
|
||||
freeTimes = MonsterCampManager.GetCanBattleCount()
|
||||
buyTimes = MonsterCampManager.GetCanBuyBattleCount()
|
||||
this.freeMoppingTimes.text = "免费扫荡:" ..freeTimes
|
||||
this.buyMoppingTimes.text = "购买次数:" ..buyTimes
|
||||
end
|
||||
--添加事件监听(用于子类重写)
|
||||
function MonsterCampNewPanel:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.MonsterCamp.UpdatePri, self.UpdatePrivilage,self)
|
||||
-- Game.GlobalEvent:AddEvent(GameEvent.FourEle.RefreshView, self.OnShow,self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function MonsterCampNewPanel:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.MonsterCamp.UpdatePri, self.UpdatePrivilage,self)
|
||||
-- Game.GlobalEvent:RemoveEvent(GameEvent.FourEle.RefreshView, self.OnShow,self)
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function MonsterCampNewPanel:OnOpen()
|
||||
this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.MonsterCamp })
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function MonsterCampNewPanel:OnShow()
|
||||
storeDataId,itemId,costNum = MonsterCampManager.MonsterCampGetCost()
|
||||
this.titleText.text = Language[12099]
|
||||
this.canFightWaves.text = "可挑战层数:"..MonsterCampManager.monsterWave
|
||||
freeTimes = MonsterCampManager.GetCanBattleCount()
|
||||
buyTimes = MonsterCampManager.GetCanBuyBattleCount()
|
||||
this.freeMoppingTimes.text = "免费扫荡:" ..freeTimes
|
||||
this.buyMoppingTimes.text= "购买次数:" ..buyTimes
|
||||
this.InitMonsterShow()
|
||||
|
||||
-- local waves = MonsterCampManager.GetFourElementTotalWave()
|
||||
-- if not PlayerPrefs.HasKey("FourElement"..PlayerManager.uid) then
|
||||
-- PlayerPrefs.SetInt("FourElement"..PlayerManager.uid,-1)
|
||||
-- end
|
||||
-- if waves ~= PlayerPrefs.GetInt("FourElement"..PlayerManager.uid) then
|
||||
-- PlayerPrefs.SetInt("FourElement"..PlayerManager.uid,waves)
|
||||
-- local propertyId = SacredTreeManager.GetUnLockNewProperty(waves)
|
||||
-- if propertyId > 0 then
|
||||
-- UIManager.OpenPanel(UIName.RewardItemPopup,nil,nil,nil,CompShowType.fourElement,nil,nil,nil,propertyId)
|
||||
-- local power = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||
-- if power - MonsterCampManager.oldpower > 0 then
|
||||
-- UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = MonsterCampManager.oldpower,newValue = power})
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
|
||||
function this.SingleDataShow(go, data)
|
||||
local singledata = MonsterCampSingleWave:New(go)
|
||||
singledata:InitComponent(go,data)
|
||||
singledata:OnOpen()
|
||||
return singledata
|
||||
end
|
||||
|
||||
function this.InitMonsterShow()
|
||||
local monsterInfo = MonsterCampManager.GetMonstersInfo()
|
||||
table.sort(monsterInfo,function(a,b) return a.Id > b.Id end)
|
||||
this.scrollView:SetData(monsterInfo, function (index, go)
|
||||
local tempData = this.SingleDataShow(go, monsterInfo[index])
|
||||
this.singledataList[monsterInfo[index].Id] = tempData
|
||||
end)
|
||||
LogYellow("MonsterCampManager.monsterWave "..MonsterCampManager.monsterWave)
|
||||
this.scrollView:SetIndex(#monsterInfo - MonsterCampManager.monsterWave)
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function MonsterCampNewPanel:OnClose()
|
||||
MonsterCampManager.CurOffsetIndex = -1
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function MonsterCampNewPanel:OnDestroy()
|
||||
ClearRedPointObject(RedPointType.EpicExplore,Util.GetGameObject(this.btnHelpFight, "redPoint"))
|
||||
for k,v in pairs(this.singledataList) do
|
||||
v:OnDestroy()
|
||||
end
|
||||
this.singledataList = {}
|
||||
SubUIManager.Close(this.scrollView)
|
||||
end
|
||||
|
||||
return MonsterCampNewPanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8bd3ee3330bb5c346bd0076a304dd317
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -5140,4 +5140,18 @@ function NetManager.VipLevelStateRewardRequset(vipLevelId,func)
|
|||
end
|
||||
end)
|
||||
end
|
||||
--心魔试炼扫荡
|
||||
function NetManager.SweepDemonRequest(id,func)
|
||||
local data = FightInfoProto_pb.SweepDemonRequest()
|
||||
data.id = id
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.SWEEP_DEMON_REQUEST, MessageTypeProto_pb.SWEEP_DEMON_RESPONSE, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = FightInfoProto_pb.SweepDemonResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
return this
|
|
@ -373,7 +373,8 @@ local jumpDic = {
|
|||
end
|
||||
end,
|
||||
[JumpType.BeastIncomingTide]=function()
|
||||
UIManager.OpenPanel(UIName.MonsterCampPanel)
|
||||
-- UIManager.OpenPanel(UIName.MonsterCampPanel)
|
||||
UIManager.OpenPanel(UIName.MonsterCampNewPanel)
|
||||
end,
|
||||
[JumpType.AllForMation]=function(data)
|
||||
if ActTimeCtrlManager.SingleFuncState(FormationManager.AllFormationFunIds[data[1]]) then
|
||||
|
|
|
@ -0,0 +1,296 @@
|
|||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
MonsterCampSingleWave = {}
|
||||
|
||||
function MonsterCampSingleWave:New(gameObject)
|
||||
local b = {}
|
||||
b.gameObject = gameObject
|
||||
b.transform = gameObject.transform
|
||||
setmetatable(b, { __index = MonsterCampSingleWave })
|
||||
return b
|
||||
end
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function MonsterCampSingleWave:InitComponent(go,_data)
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.Id = Util.GetGameObject(go,"bg/leftLayout/num"):GetComponent("Text")
|
||||
self.power = Util.GetGameObject(go,"bg/power/Text"):GetComponent("Text")
|
||||
|
||||
self.hero = Util.GetGameObject(go,"bg/Hero")
|
||||
self.frame=Util.GetGameObject(self.hero,"Bg1"):GetComponent("Image")
|
||||
self.icon=Util.GetGameObject(self.hero, "Mask/icon"):GetComponent("RawImage")
|
||||
-- self.icon=Util.GetGameObject(self.hero, "Mask/icon"):GetComponent("Image")
|
||||
self.lv = Util.GetGameObject(self.hero, "lv/Text"):GetComponent("Text")
|
||||
self.pro = Util.GetGameObject(self.hero, "Pro/Image"):GetComponent("Image")
|
||||
self.fg = Util.GetGameObject(self.hero,"Bg2"):GetComponent("Image")
|
||||
--self.starGrid = Util.GetGameObject(self.hero,"starGrid")
|
||||
self.starGrid = Util.GetGameObject(self.hero,"StarGrid")
|
||||
self.name=Util.GetGameObject(self.hero,"Name/Text"):GetComponent("Text")
|
||||
|
||||
|
||||
self.reward = Util.GetGameObject(go,"bg/rewardRect")
|
||||
self.fight = Util.GetGameObject(go,"bg/fight")
|
||||
self.fightText = Util.GetGameObject(go,"bg/fight/Text"):GetComponent("Text")
|
||||
-- self.pass = Util.GetGameObject(go,"bg/pass"):GetComponent("Image")
|
||||
-- self.title = Util.GetGameObject(go,"bg/leftLayout/title"):GetComponent("Image")
|
||||
self.rewardText = Util.GetGameObject(self.reward,"Text"):GetComponent("Text")
|
||||
-- self.fightBtnIcon = Util.GetGameObject(self.fight,"layout/icon"):GetComponent("Image")
|
||||
-- self.fightBtnNum = Util.GetGameObject(self.fight,"layout/num"):GetComponent("Text")
|
||||
-- self.fightBtnText = Util.GetGameObject(self.fight,"layout/Text"):GetComponent("Text")
|
||||
self.fightBtnMask = Util.GetGameObject(self.fight,"mask"):GetComponent("Image")
|
||||
self.bg = Util.GetGameObject(go,"bg"):GetComponent("Image")
|
||||
self.rewardGrid = Util.GetGameObject(self.reward,"grid")
|
||||
|
||||
self.btn=Util.GetGameObject(go,"bg/btn")
|
||||
self.data = _data
|
||||
|
||||
self.rewardList = {}
|
||||
for i = 1, self.rewardGrid.transform.childCount do
|
||||
local temp = self:NewItemView(SubUIConfig.ItemView, self.rewardGrid.transform:GetChild(i-1).gameObject)
|
||||
table.insert(self.rewardList,temp)
|
||||
end
|
||||
end
|
||||
|
||||
function MonsterCampSingleWave:OnOpen()
|
||||
self:UpdatePrivilage()
|
||||
-- self.fightBtnIcon.gameObject:SetActive(false)
|
||||
-- self.fightBtnNum.gameObject:SetActive(false)
|
||||
self.Id.text = "第"..self.data.Id.."层"
|
||||
self.power.text = self.data.Force
|
||||
self.bg.sprite = self.spLoader:LoadSprite("s_silingshilian_renjieshiliandi")
|
||||
local MonsterGroup = ConfigManager.GetConfigData(ConfigName.MonsterGroup,self.data.Monster)
|
||||
local monsterConfig = ConfigManager.GetConfigData(ConfigName.MonsterConfig,MonsterGroup.Contents[1][1])
|
||||
local herodata = ConfigManager.GetConfigData(ConfigName.HeroConfig,monsterConfig.MonsterId)
|
||||
self:SingleHeroDataShow(monsterConfig,herodata)
|
||||
self.rewardText.text = "奖励"
|
||||
self.fight.gameObject:SetActive(false)
|
||||
if self.data.Id < MonsterCampManager.monsterWave - 1 then
|
||||
|
||||
elseif self.data.Id == MonsterCampManager.monsterWave - 1 then--扫荡
|
||||
self.fight.gameObject:SetActive(true)
|
||||
self.fightText.text = Language[10997]
|
||||
elseif self.data.Id == MonsterCampManager.monsterWave then--挑战
|
||||
self.fight.gameObject:SetActive(true)
|
||||
self.fightText.text = Language[10559]
|
||||
elseif self.data.Id > MonsterCampManager.monsterWave then
|
||||
|
||||
end
|
||||
self.rewardData = self.data.RewardShow
|
||||
if self.rewardData and #self.rewardData then
|
||||
self:InitShowReward()
|
||||
self.reward.gameObject:SetActive(true)
|
||||
else
|
||||
self.reward.gameObject:SetActive(false)
|
||||
end
|
||||
|
||||
-- if self.data.Id < MonsterCampManager.monsterWave then
|
||||
-- self.fight.gameObject:SetActive(false)
|
||||
-- self.reward.gameObject:SetActive(false)
|
||||
-- else
|
||||
-- self.fight.gameObject:SetActive(true)
|
||||
-- self.rewardText.text = "挑战奖励"
|
||||
|
||||
-- self:SetIcon()
|
||||
-- self.rewardData = self.data.RewardShow
|
||||
-- if self.rewardData and #self.rewardData then
|
||||
-- self:InitShowReward()
|
||||
-- self.reward.gameObject:SetActive(true)
|
||||
-- else
|
||||
-- self.reward.gameObject:SetActive(false)
|
||||
-- end
|
||||
-- end
|
||||
-- Util.AddOnceClick(self.pass.gameObject, function()
|
||||
-- UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.Id)
|
||||
-- end)
|
||||
-- Util.AddOnceClick(self.hero, function()
|
||||
-- UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.Id)
|
||||
-- end)
|
||||
Util.AddOnceClick(self.btn, function()
|
||||
UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.Id)
|
||||
end)
|
||||
Util.AddOnceClick(self.fight, function()
|
||||
LogGreen(self.data.Id)
|
||||
local x = function()
|
||||
NetManager.SweepDemonRequest(self.data.Id,function(msg)
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.MONSTERCAMP_BATTLENUM, 1)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.MonsterCamp.UpdatePri)
|
||||
self:UpdatePrivilage()
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.Drop,1,function()
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.MONSTERCAMP_BATTLENUM, 1)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
if self.data.Id == MonsterCampManager.monsterWave - 1 then--扫荡
|
||||
LogGreen(self.freeTimes..self.buyTimes)
|
||||
if self.freeTimes <=0 and self.buyTimes <= 0 then
|
||||
PopupTipPanel.ShowTip("今日已无扫荡次数!")
|
||||
return
|
||||
end
|
||||
LogGreen(self.itemId.." "..self.costNum)
|
||||
if self.freeTimes <= 0 then
|
||||
if BagManager.GetItemCountById(self.itemId) < self.costNum then
|
||||
PopupTipPanel.ShowTip(string.format(Language[10298], itemConfig[self.itemId].Name))
|
||||
return
|
||||
end
|
||||
MsgPanel.ShowTwo(string.format("是否花费%s%s购买一次扫荡次数?",self.costNum,itemConfig[self.itemId].Name),function() end,function()
|
||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,self.storeDataId,1,function()
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.MONSTERCAMP_BUY_BATTLENUM, 1)
|
||||
x()
|
||||
end)
|
||||
end,"取消","确定")
|
||||
else
|
||||
x()
|
||||
end
|
||||
elseif self.data.Id == MonsterCampManager.monsterWave then--挑战
|
||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.MONSTER_CAMP)
|
||||
end
|
||||
|
||||
|
||||
-- if self.data.Id == MonsterCampManager.monsterWave - 1 then
|
||||
-- LogGreen(self.freeTimes..self.buyTimes)
|
||||
-- if self.freeTimes <=0 and self.buyTimes <= 0 then
|
||||
-- PopupTipPanel.ShowTip("今日已无扫荡次数!")
|
||||
-- return
|
||||
-- end
|
||||
-- LogGreen(self.itemId.." "..self.costNum)
|
||||
-- if self.freeTimes <= 0 then
|
||||
-- if BagManager.GetItemCountById(self.itemId) < self.costNum then
|
||||
-- PopupTipPanel.ShowTip(string.format(Language[10298], itemConfig[self.itemId].Name))
|
||||
-- return
|
||||
-- end
|
||||
-- MsgPanel.ShowTwo(string.format("是否花费%s%s购买一次扫荡次数?",self.costNum,itemConfig[self.itemId].Name),function() end,function()
|
||||
-- ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,self.storeDataId,1,function()
|
||||
-- PrivilegeManager.RefreshPrivilegeUsedTimes(self.trailData.buyTimeId, 1)
|
||||
-- x()
|
||||
-- end)
|
||||
-- end,"取消","确定")
|
||||
-- else
|
||||
-- x()
|
||||
-- end
|
||||
-- elseif self.data.Id == self.trailData.monsterWave + 1 then
|
||||
-- if self.trailData.canFightTime > 0 then
|
||||
-- if LengthOfTable(FormationManager.GetWuJinFormationHeroIds(self.trailData.fourElementType + 1700)) > 0 then
|
||||
-- MonsterCampManager.ExecuteFightBattle(self.data.Id,0,nil,self.trailData.fourElementType)
|
||||
-- else
|
||||
-- -- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.FOUR_ELEMENT, self.trailData.fourElementType,self.data.Id)
|
||||
-- UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.MONSTER_CAMP)
|
||||
-- end
|
||||
-- else
|
||||
-- PopupTipPanel.ShowTip("今日已无可挑战层数!")
|
||||
-- end
|
||||
-- --UIManager.OpenPanel(UIName.ExpeditionMonsterInfoPopup,EXPEDITON_POPUP_TYPE.FourElementMonster,self.trailData.fourElementType,self.data.Id)
|
||||
-- end
|
||||
end)
|
||||
end
|
||||
-- 初始化奖励显示
|
||||
function MonsterCampSingleWave:InitShowReward()
|
||||
for i = 1 ,#self.rewardList do
|
||||
self.rewardList[i].gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1,#self.rewardData do
|
||||
if not self.rewardList[i] then
|
||||
self.rewardList[i] = SubUIManager.Open(SubUIConfig.ItemView, self.rewardGrid.transform)
|
||||
self.rewardList[i].gameObject:SetActive(false)
|
||||
end
|
||||
self.rewardList[i]:OnOpen(false, {self.rewardData[i][1],self.rewardData[i][2]}, 0.65,false,false,false)
|
||||
self.rewardList[i].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
--设置每条英雄数据
|
||||
function MonsterCampSingleWave:SingleHeroDataShow(monConfig,heroData)
|
||||
self.frame.sprite=Util.LoadSprite(GetHeroCardStarBg[monConfig.Star])
|
||||
local liveName = GetResourcePath(heroData.Live)
|
||||
local roleConfig = ConfigManager.GetConfigData(ConfigName.RoleConfig, heroData.Id)
|
||||
local scale = roleConfig.play_liveScale
|
||||
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
|
||||
LogYellow("(self.data.Id%6 == 0 and 12 or (self.data.Id%6 + 6)) "..(self.data.Id%6 == 0 and 12 or (self.data.Id%6 + 6)))
|
||||
self.icon.texture = CardRendererManager.GetSpineTexture((self.data.Id%6 == 0 and 6 or (self.data.Id%6)), liveName, Vector3.one * scale, livePos, true)
|
||||
self.icon.transform.localScale = Vector3.one
|
||||
self.icon.transform.localPosition = Vector3.zero
|
||||
self.lv.text = monConfig.Level
|
||||
self.pro.sprite= self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName))
|
||||
--self.icon.sprite = Util.LoadSprite(heroData.painting)
|
||||
SetCardStars(self.starGrid,monConfig.Star)
|
||||
self.fg.sprite = self.spLoader:LoadSprite(GetHeroCardStarFg[monConfig.Star])
|
||||
self.name.text = heroData.ReadingName
|
||||
end
|
||||
|
||||
function MonsterCampSingleWave:UpdatePrivilage()
|
||||
self.storeDataId,self.itemId,self.costNum = MonsterCampManager.MonsterCampGetCost()
|
||||
-- self.freeTimes,self.buyTimes = MonsterCampManager.GetTimeTip(self.trailData.fourElementType)
|
||||
self.freeTimes = MonsterCampManager.GetCanBattleCount()
|
||||
self.buyTimes = MonsterCampManager.GetCanBuyBattleCount()
|
||||
-- self:SetIcon()
|
||||
end
|
||||
|
||||
-- function MonsterCampSingleWave:SetIcon()
|
||||
-- Util.SetGray(self.fight,false)
|
||||
-- if self.data.Id == MonsterCampManager.monsterWave then
|
||||
-- --设置扫荡按钮
|
||||
-- self.rewardText.text = "扫荡奖励"
|
||||
-- self.fightBtnMask.sprite = self.spLoader:LoadSprite("r_hero_button_002")
|
||||
-- if self.freeTimes > 0 then
|
||||
-- -- self.fightBtnIcon.gameObject:SetActive(false)
|
||||
-- -- self.fightBtnNum.gameObject:SetActive(false)
|
||||
-- self.fightBtnText.text = string.format("<color=#%s>%s</color>","17232A","免费扫荡")
|
||||
-- Util.SetGray(self.fight,false)
|
||||
-- else
|
||||
-- -- self.fightBtnIcon.gameObject:SetActive(true)
|
||||
-- -- self.fightBtnNum.gameObject:SetActive(true)
|
||||
-- -- self.fightBtnIcon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemConfig[self.itemId].ResourceID))
|
||||
-- local color = 0
|
||||
-- if BagManager.GetItemCountById(self.itemId) < self.costNum then
|
||||
-- color = "E71515"
|
||||
-- else
|
||||
-- color = "17232A"
|
||||
-- end
|
||||
-- self.fightBtnNum.text =string.format("<color=#%s>%s</color>",color,self.costNum)
|
||||
-- self.fightBtnText.text = string.format("<color=#%s>%s</color>",color,"扫荡")
|
||||
-- if self.buyTimes < 1 then
|
||||
-- Util.SetGray(self.fight,true)
|
||||
-- end
|
||||
-- end
|
||||
-- else
|
||||
-- if self.data.Id == self.trailData.monsterWave + 1 then
|
||||
-- --设置挑战fight
|
||||
-- -- self.fightBtnIcon.gameObject:SetActive(false)
|
||||
-- -- self.fightBtnNum.gameObject:SetActive(false)
|
||||
-- -- self.fightBtnMask:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_hero_button_001")
|
||||
-- -- self.fightBtnText.text = string.format("<color=#%s>%s</color>","17232A","挑战")
|
||||
-- else
|
||||
-- self.fight.gameObject:SetActive(false)
|
||||
-- end
|
||||
-- Util.SetGray(self.fight,false)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function MonsterCampSingleWave:OnDestroy()
|
||||
self.rewardList = {}
|
||||
self.spLoader:Destroy()
|
||||
end
|
||||
function MonsterCampSingleWave:NewItemView(config, gameObject, ...)
|
||||
local view = reimport(config.script)
|
||||
local sub = view:New(gameObject)
|
||||
sub.assetName = config.assetName
|
||||
if sub.Awake then
|
||||
sub:Awake()
|
||||
end
|
||||
if sub.InitComponent then
|
||||
sub:InitComponent()
|
||||
end
|
||||
if sub.BindEvent then
|
||||
sub:BindEvent()
|
||||
end
|
||||
if sub.AddListener then
|
||||
sub:AddListener()
|
||||
end
|
||||
if sub.Update then
|
||||
UpdateBeat:Add(sub.Update, sub)
|
||||
end
|
||||
if sub.OnOpen then
|
||||
sub:OnOpen(...)
|
||||
end
|
||||
return sub
|
||||
end
|
||||
return MonsterCampSingleWave
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 22b07c6ddee97514e914448efb2fbf33
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue