天地洪炉提交
parent
879cf506f5
commit
fd22b5a87f
Binary file not shown.
After Width: | Height: | Size: 310 KiB |
|
@ -0,0 +1,110 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dbcb91733d14217438992675f51d65c8
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 2
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 65
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 56
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: cb713eb8f3e76af4eb851bdcc9bd25f1
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag: TailsmanSoulAtlas
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 29f8a9053bacee54cb9bb865fb6b854d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2293,6 +2293,8 @@ GENERAL_POPUP_TYPE={
|
|||
ShenHunShuXing = 54,
|
||||
LingMaiRecord = 55,--灵脉秘境纪录
|
||||
IncarnationDes = 56,
|
||||
|
||||
chooseTailsManSoul = 57,
|
||||
}
|
||||
|
||||
--通用信息弹窗类型
|
||||
|
|
|
@ -505,4 +505,5 @@ SubUIConfig = {
|
|||
[32] = {name = "ElementDrawCardPanelNew",assetName = "ElementDrawCardPanelNew",script = "Modules/Recruit/ElementDrawCardPanelNew"},--升星有礼
|
||||
[33] = {name = "XunBaoMiZongPanel",assetName = "XunBaoMiZongPanel",script = "Modules/XunBaoMiZong/XunBaoMiZongPanel"},--寻宝迷踪
|
||||
[34] = {name = "WeekCardPage",assetName = "WeekCardPage",script = "Modules/Operating/WeekCardPage"},
|
||||
[35] = {name = "page16",assetName = "page16",script = "Modules/Operating/TailsmanSoulChipLottery"},
|
||||
}
|
|
@ -215,6 +215,8 @@ GameEvent = {
|
|||
TimeLimitUpHeroChange = "Activity.TimeLimitUpHeroChange",
|
||||
--灵兽宝阁灵兽改变
|
||||
UpMonsterChange = "Activity.UpMonsterChange",
|
||||
--天地洪炉法宝碎片改变
|
||||
TailsmanSoulChipChange = "Activity.TailsmanSoulChipChange",
|
||||
},
|
||||
Carbon = {
|
||||
CarbonCountChange = "Carbon.CarbonCountChange",
|
||||
|
|
|
@ -38,6 +38,7 @@ local contentScripts = {
|
|||
--灵脉秘境纪录
|
||||
[GENERAL_POPUP_TYPE.LingMaiRecord] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_LingMaiRecord"), panelName = "GeneralBigPopup_LingMaiRecord"},
|
||||
[GENERAL_POPUP_TYPE.IncarnationDes] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_IncarnationDes"), panelName = "GeneralBigPopup_IncarnationDes"},
|
||||
[GENERAL_POPUP_TYPE.chooseTailsManSoul] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_WishTailsmanSoulChip"), panelName = "GeneralBigPopup_WishTailsmanSoulChip"},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
----- 神应属性弹窗 -----
|
||||
local this = {}
|
||||
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
local sortingOrder=0
|
||||
local itemList = {}
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
self.grid = Util.GetGameObject(gameObject, "grid")
|
||||
self.itemPre = Util.GetGameObject(gameObject, "itemPre")
|
||||
self.sureBtn = Util.GetGameObject(gameObject, "sureBtn")
|
||||
self.cancelBtn = Util.GetGameObject(gameObject, "cancelBtn")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddOnceClick(self.sureBtn,function()
|
||||
if LengthOfTable(self.selectData) < 4 then
|
||||
PopupTipPanel.ShowTip("请选择4个法宝之灵碎片作为心愿!")
|
||||
return
|
||||
end
|
||||
NetManager.SendRefreshTailsmanSoulData(self.selectData,function()
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
Util.AddOnceClick(self.cancelBtn,function()
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
self.selectData = RecruitManager.GetWishTailsManSoulChips()
|
||||
self.curData = TailsManSoulManager.GetTailsmanSoulDatas(6)
|
||||
|
||||
for i = 1, math.max(#itemList,#self.curData) do
|
||||
if not self.curData[i] then
|
||||
itemList[i].go.gameObject:SetActive(false)
|
||||
else
|
||||
if not itemList[i] then
|
||||
itemList[i] = {}
|
||||
itemList[i].go = newObjToParent(self.itemPre,self.grid)
|
||||
itemList[i].title = Util.GetGameObject(itemList[i].go, "titleDi/Text"):GetComponent("Text")
|
||||
itemList[i].lookBtn = Util.GetGameObject(itemList[i].go, "lookBtn")
|
||||
itemList[i].selectBtn = Util.GetGameObject(itemList[i].go, "selectBtn")
|
||||
itemList[i].itemGrid = Util.GetGameObject(itemList[i].go, "itemGrid")
|
||||
itemList[i].items = {}
|
||||
for i = 1,4 do
|
||||
itemList[i].items[i] = {}
|
||||
itemList[i].items[i].go = Util.GetGameObject(itemList[i].go, "ItemPos"..i):GetComponent("Text")
|
||||
itemList[i].items[i].pos = Util.GetGameObject(itemList[i].items[i].go, "pos")
|
||||
itemList[i].items[i].item = SubUIManager.Open(SubUIConfig.ItemView,itemList[i].items[i].pos.transform)
|
||||
itemList[i].items[i].item.transform.localPosition = Vector3.zero
|
||||
itemList[i].items[i].lv = Util.GetGameObject(itemList[i].items[i].go, "lvDi/Text"):GetComponent("Text")
|
||||
itemList[i].items[i].select = Util.GetGameObject(itemList[i].items[i].go, "select")
|
||||
itemList[i].items[i].go.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
itemList[i].go.gameObject:SetActive(true)
|
||||
itemList[i].title = self.curData[i].name
|
||||
Util.AddOnceClick(itemList[i].lookBtn,function()
|
||||
JumpManager.GoJump()
|
||||
end)
|
||||
Util.AddOnceClick(itemList[i].selectBtn,function()
|
||||
MsgPanel.ShowTwo(string.format("确认选择%s作为心愿?",self.curData[i].name), function()end, function()
|
||||
NetManager.SendRefreshTailsmanSoulData(self.curData.trumpChipList,function()
|
||||
self:OnShow(_parent)
|
||||
end)
|
||||
end, "取消", "确认", "提示",false,"")
|
||||
end)
|
||||
|
||||
for j = 1,math.max(#itemList[i].items, #self.curData.trumpChipList) do
|
||||
if not self.curData.trumpChipList[j] then
|
||||
itemList[i].items[j].go.gameObject:SetActive(false)
|
||||
else
|
||||
if not itemList[i].items[j] then
|
||||
itemList[i].items[j] = {}
|
||||
itemList[i].items[j].go = newObjToParent(itemList[i].items[1].go,itemList[i].itemGrid)
|
||||
itemList[i].items[j].pos = Util.GetGameObject(itemList[i].items[j].go, "pos")
|
||||
itemList[i].items[j].item = SubUIManager.Open(SubUIConfig.ItemView,itemList[i].items[j].pos.transform)
|
||||
itemList[i].items[j].item.transform.localPosition = Vector3.zero
|
||||
itemList[i].items[j].lv = Util.GetGameObject(itemList[i].items[j].go, "lvDi/Text"):GetComponent("Text")
|
||||
itemList[i].items[j].select = Util.GetGameObject(itemList[i].items[j].go, "select")
|
||||
end
|
||||
itemList[i].items[j].go.gameObject:SetActive(true)
|
||||
itemList[i].items[j].item:OnOpen(false,{self.curData.trumpChipList[j],0}, 1.1, true, false, false, sortingOrder + 1)
|
||||
itemList[i].items[j].lv.text = TailsManSoulManager.GetTailsmanLvById(self.curData.trumpChipList[j])
|
||||
itemList[i].items[j].select.gameObject:SetActive(this:CheckIsSelect(self.curData.trumpChipList[j]))
|
||||
Util.AddOnceClick(itemList[i].items[j].go,function()
|
||||
if LengthOfTable(self.selectData >= 4) then
|
||||
PopupTipPanel.ShowTip("心愿碎片最多为4个!")
|
||||
else
|
||||
this:SetIsSelect(self.curData.trumpChipList[j])
|
||||
itemList[i].items[j].select.gameObject:SetActive(this:CheckIsSelect(self.curData.trumpChipList[j]))
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this:SetIsSelect(id)
|
||||
local isAdd = true
|
||||
for k,v in pairs(self.selectData) do
|
||||
if v == id then
|
||||
v = nil
|
||||
isAdd = false
|
||||
end
|
||||
end
|
||||
if isAdd then
|
||||
table.insert(self.selectData,id)
|
||||
end
|
||||
end
|
||||
|
||||
function this:CheckIsSelect(id)
|
||||
for k,v in pairs(self.selectData) do
|
||||
if v == id then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
itemList = {}
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 267e8766a6be9bd46ac7c9428cf361d6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -121,7 +121,7 @@ function this:InitComponent()
|
|||
|
||||
-- 无尽
|
||||
this.btnEndLess = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnEndLess")
|
||||
this.btnEndLess:SetActive(false)
|
||||
this.btnEndLess:SetActive(true)
|
||||
|
||||
--鸿蒙
|
||||
this.btnHongMeng=Util.GetGameObject(self.gameObject,"RightDown/btnHongMeng")
|
||||
|
|
|
@ -6148,4 +6148,18 @@ function NetManager.LingMaiRecordRequest(func)
|
|||
end)
|
||||
end
|
||||
|
||||
function NetManager.SendRefreshTailsmanSoulData(idlist,fun)
|
||||
local data = HeroInfoProto_pb.HeroGodSoulBindRequest()
|
||||
for k,v in pairs(idlist) do
|
||||
data.idlist:append(v)
|
||||
end
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.CrossLingmaiSecretAreaRecordRequest, MessageTypeProto_pb.CrossLingmaiSecretAreaRecordResponse, nil, function(buffer)
|
||||
RecruitManager.SetWishTailsManSoulChips(idlist)
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.TailsmanSoulChipChange)
|
||||
if fun then
|
||||
fun()
|
||||
end
|
||||
end)
|
||||
end
|
||||
return this
|
|
@ -36,7 +36,24 @@ function this.Initialize()
|
|||
this.InitPreData()
|
||||
this.newWishList = {}--心愿抽新增的神将
|
||||
this.openTime = 0--开服时间戳或是0(用于判断心愿神将是否加入卡池)
|
||||
this.wishTailsManSoulChips = {}
|
||||
end
|
||||
|
||||
function this.SetWishTailsManSoulChips(_datas)
|
||||
this.wishTailsManSoulChips = {}
|
||||
for k,v in pairs(_datas) do
|
||||
table.insert(this.wishTailsManSoulChips,v)
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetWishTailsManSoulChips()
|
||||
local datas = {}
|
||||
for k,v in pairs(this.wishTailsManSoulChips) do
|
||||
table.insert(datas,v)
|
||||
end
|
||||
return datas
|
||||
end
|
||||
|
||||
--请求抽卡 1抽卡类型 2回调 3特权id
|
||||
function this.RecruitRequest(recruitType, func, privilegeId,_itemId,_itemNum)
|
||||
local itemId = 0
|
||||
|
|
|
@ -20,6 +20,7 @@ function this.GetTailsmanSoulDatas(qua)
|
|||
singBookData.icon = v.Icon
|
||||
singBookData.quality = v.Quality
|
||||
singBookData.trumpList,singBookData.maxLv,singBookData.lv,singBookData.skillList = this.GetTailsmanSoulDataById(singBookData.id)
|
||||
singBookData.trumpChipList = v.ItemList
|
||||
singBookData.skillConfig = v.SkillList
|
||||
table.insert(datas,singBookData)
|
||||
end
|
||||
|
|
|
@ -0,0 +1,317 @@
|
|||
|
||||
local TailsmanSoulChipLottery = {}
|
||||
local sortingOrder = 0
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local artConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
||||
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
|
||||
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
|
||||
local lotterySpecialConfig = ConfigManager.GetConfig(ConfigName.LotterySpecialConfig)
|
||||
local wishSoulData
|
||||
function TailsmanSoulChipLottery:New(gameObject)
|
||||
local b = {}
|
||||
b.gameObject = gameObject
|
||||
b.transform = gameObject.transform
|
||||
setmetatable(b, { __index = TailsmanSoulChipLottery })
|
||||
return b
|
||||
end
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function TailsmanSoulChipLottery:InitComponent()
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.btnHelp= Util.GetGameObject(self.gameObject,"help")
|
||||
self.helpPosition=self.btnHelp:GetComponent("RectTransform").localPosition
|
||||
|
||||
self.limit = Util.GetGameObject(self.gameObject,"limitdi/limit"):GetComponent("Text")
|
||||
|
||||
--rightUp
|
||||
self.rightUp = Util.GetGameObject(self.gameObject,"rightUp")
|
||||
self.btnReward = Util.GetGameObject(self.rightUp,"reward")
|
||||
self.btnStore = Util.GetGameObject(self.rightUp,"store")
|
||||
self.zhenqibaogeBtn = Util.GetGameObject(self.rightUp,"zqbg")
|
||||
self.zqbgEffect = Util.GetGameObject(self.zhenqibaogeBtn,"Fx_Circle 1")
|
||||
self.btn_soul = Util.GetGameObject(self.rightUp, "btn_hero")
|
||||
self.upSoulImg= Util.GetGameObject(self.btn_soul, "Icon"):GetComponent("Image")
|
||||
Util.GetGameObject(self.btn_soul,"InfoImg"):GetComponent("Image").sprite = self.spLoader:LoadSprite("q_qiankun__icondi_ghwj_zh")
|
||||
Util.GetGameObject(self.btn_soul,"InfoImg2"):GetComponent("Image").sprite = self.spLoader:LoadSprite("x_xinjiangzhaohuan_gailv_zh")
|
||||
|
||||
self.btns = {}
|
||||
for i = 1 , 2 do
|
||||
self.btns[i] = {}
|
||||
self.btns[i].btn = Util.GetGameObject(self.rightUp,"btn"..i)
|
||||
self.btns[i].red = Util.GetGameObject(self.btns[i].btn.gameObject,"redPoint")
|
||||
self.btns[i].info = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/Text"):GetComponent("Text")
|
||||
self.btns[i].icon = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/icon"):GetComponent("Image")
|
||||
self.btns[i].num = Util.GetGameObject(self.btns[i].btn.gameObject,"layout/num"):GetComponent("Text")
|
||||
end
|
||||
self.btnTime = Util.GetGameObject(self.btns[1].btn,"di1/time"):GetComponent("Text")
|
||||
--center
|
||||
self.center = Util.GetGameObject(self.gameObject,"center")
|
||||
self.icons = {}
|
||||
for i = 1 , 4 do
|
||||
self.icons[i] = {}
|
||||
self.icons[i].go = Util.GetGameObject(self.center,"icons/icon"..i)
|
||||
self.icons[i].icon = Util.GetGameObject(self.icons[i].go,"frame/icon"):GetComponent("Image")
|
||||
self.icons[i].kuang = Util.GetGameObject(self.icons[i].go,"kuang"):GetComponent("Image")
|
||||
if i < 4 then
|
||||
self.icons[i].effect=Util.GetGameObject(self.icons[i].go,"UI_effect_RecruitPanel_box_open")
|
||||
end
|
||||
end
|
||||
|
||||
self.updateTimes = Util.GetGameObject(self.btns[1].btn,"di1")
|
||||
self.updateTimesTip = Util.GetGameObject(self.updateTimes,"Text"):GetComponent("Text")
|
||||
self.updateTimesTip1 = Util.GetGameObject(self.updateTimes,"Text1"):GetComponent("Text")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function TailsmanSoulChipLottery:BindEvent()
|
||||
Util.AddOnceClick(self.zhenqibaogeBtn, function()
|
||||
JumpManager.GoJump(40011)
|
||||
end)
|
||||
Util.AddOnceClick(self.btnHelp, function()
|
||||
UIManager.OpenPanel(UIName.HelpPopup,self.actConfig.HelpId,self.helpPosition.x,self.helpPosition.y)
|
||||
end)
|
||||
|
||||
Util.AddOnceClick(self.btnReward, function()
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.RecrutDetail,self.actConfig.HelpId,self.actType,PRE_REWARD_POOL_TYPE.LOTTERY_SOUL_UP,PRE_REWARD_POOL_TYPE.LOTTERY_SOUL)
|
||||
end)
|
||||
|
||||
Util.AddOnceClick(self.btnStore, function()
|
||||
--JumpManager.GoJump()
|
||||
end)
|
||||
|
||||
Util.AddOnceClick(self.btn_soul, function()
|
||||
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.chooseTailsManSoul)
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function TailsmanSoulChipLottery:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.TailsmanSoulChipChange,self.OnUPEquipChange,self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function TailsmanSoulChipLottery:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.TailsmanSoulChipChange,self.OnUPEquipChange,self)
|
||||
end
|
||||
|
||||
|
||||
--up的魂印改变
|
||||
function TailsmanSoulChipLottery:OnUPEquipChange(id)
|
||||
self:contentShow()
|
||||
end
|
||||
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function TailsmanSoulChipLottery:OnOpen(_activityConfig,_index,parent)
|
||||
self.actConfig = _activityConfig
|
||||
self.pageIndex = _index
|
||||
self.parent = parent
|
||||
end
|
||||
|
||||
function TailsmanSoulChipLottery:OnSortingOrderChange(_sortingOrder)
|
||||
sortingOrder = _sortingOrder or 0
|
||||
Util.SetParticleSortLayer(self.zqbgEffect, sortingOrder+1)
|
||||
for i = 1, 5 do
|
||||
if self.icons[i] and self.icons[i].effect then
|
||||
Util.SetParticleSortLayer(self.icons[i].effect.gameObject, sortingOrder+1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function TailsmanSoulChipLottery:OnShow(_sortingOrder)
|
||||
self.gameObject:SetActive(true)
|
||||
sortingOrder = _sortingOrder
|
||||
Util.SetParticleSortLayer(self.zqbgEffect, sortingOrder+1)
|
||||
self.actId = self.actConfig.ActId
|
||||
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
|
||||
if self.actConfig.IfBack == 1 then
|
||||
if self.actConfig.ActiveType > 0 then
|
||||
local id = ActivityGiftManager.IsActivityTypeOpen(self.actConfig.ActiveType)
|
||||
if id and id > 0 then
|
||||
self.actId = id
|
||||
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"PageType",self.actConfig.PageType,"ActiveType",self.actConfig.ActiveType,"ActId",id)
|
||||
if config then
|
||||
self.actConfig = config
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local array = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySetting,"ActivityId",self.actId)
|
||||
self.singleRecruit = array[1]
|
||||
self.tenRecruit = array[2]
|
||||
self.freeTimesId=self.singleRecruit.FreeTimes
|
||||
self.maxtimesId=self.singleRecruit.MaxTimes
|
||||
self:refreshMagicNum()
|
||||
self:refreshBtnShow()--刷新按钮显示
|
||||
self:contentShow()
|
||||
end
|
||||
|
||||
function TailsmanSoulChipLottery:refreshMagicNum()
|
||||
local actData = ActivityGiftManager.GetActivityTypeInfo(self.actType)
|
||||
local d = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotterySpecialConfig,"Type",self.singleRecruit.MergePool)
|
||||
self.updateTimesTip.text = string.format("召唤<color=#%s>%s次必得红色碎片</color>","A55A13",d[1].Count-math.floor(actData.value/1000))
|
||||
local endTime = ActivityGiftManager.GetTaskEndTime(self.actType) - PlayerManager.serverTime
|
||||
self.updateTimesTip1.text = string.format("活动剩余时间:"..self:TimeToDHMS(endTime))
|
||||
local timeDown=CalculateSecondsNowTo_N_OClock(0)
|
||||
self.timer = Timer.New(function()
|
||||
if timeDown < 1 then
|
||||
self:RefreshGetHeroTimes()
|
||||
return
|
||||
else
|
||||
self.btnTime.text = TimeToHMS(timeDown).."后刷新"
|
||||
end
|
||||
if endTime < 1 then
|
||||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
self:OnShow(sortingOrder)
|
||||
return
|
||||
else
|
||||
self.updateTimesTip1.text = string.format("活动剩余时间:"..self:TimeToDHMS(endTime))
|
||||
end
|
||||
endTime = endTime - 1
|
||||
timeDown = timeDown - 1
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
end
|
||||
|
||||
function TailsmanSoulChipLottery:refreshBtnShow()
|
||||
local curTimes = PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)
|
||||
self.limit.text ="今日召唤上限:"..curTimes.."/"..privilegeConfig[self.maxtimesId].Condition[1][2]
|
||||
self.btnTime.gameObject:SetActive(true)
|
||||
local freeTime = 0
|
||||
if self.freeTimesId and self.freeTimesId > 0 then
|
||||
freeTime = PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
|
||||
RecruitManager.freeUseTimeList[self.freeTimesId]=freeTime
|
||||
end
|
||||
|
||||
--按钮赋值
|
||||
for n, m in ipairs(self.btns) do
|
||||
--存在免费次数 并且 免费>=1 并且是1按钮
|
||||
local isFree = freeTime >= 1 and n == 1
|
||||
m.red.gameObject:SetActive(isFree)
|
||||
m.icon.gameObject:SetActive(not isFree)
|
||||
m.num.gameObject:SetActive(not isFree)
|
||||
local itemId=0
|
||||
local itemNum=0
|
||||
local type = 0
|
||||
if n == 1 then
|
||||
type = self.singleRecruit.Id
|
||||
m.info.text = "1次"
|
||||
else
|
||||
type = self.tenRecruit.Id
|
||||
m.info.text = "10次"
|
||||
end
|
||||
local d = {}
|
||||
if (isFree) then
|
||||
self.btnTime.gameObject:SetActive(false)
|
||||
m.info.text="免费抽取"
|
||||
else
|
||||
local d = RecruitManager.GetExpendData(type)
|
||||
itemId=d[1]
|
||||
itemNum=d[2]
|
||||
m.icon.sprite = self.spLoader:LoadSprite(artConfig[itemConfig[itemId].ResourceID].Name)
|
||||
m.num.text= tostring(itemNum)
|
||||
end
|
||||
|
||||
Util.AddOnceClick(m.btn,function()
|
||||
if not isFree then
|
||||
if BagManager.GetItemCountById(itemId) < itemNum then
|
||||
PopupTipPanel.ShowTip(itemConfig[itemId].Name.."数量不足!")
|
||||
return
|
||||
end
|
||||
end
|
||||
local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..RecruitType.QianKunBoxTen)
|
||||
local recrutId = n == 1 and self.singleRecruit.Id or self.tenRecruit.Id
|
||||
local recrutNum = n == 1 and 1 or 10
|
||||
local uiName = n == 1 and UIName.QianKunBoxBuyOnePanel or UIName.QianKunBoxBuyTenPanel
|
||||
if state==0 and itemId == 16 and not isFree then
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitConfirm,recrutId,function()
|
||||
self:Recruit(recrutNum,recrutId,uiName)
|
||||
end)
|
||||
else
|
||||
self:Recruit(recrutNum,recrutId,uiName)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function TailsmanSoulChipLottery:Recruit(recrutType,recrutId,uiName)
|
||||
if PrivilegeManager.GetPrivilegeUsedTimes(self.maxtimesId)+recrutType>privilegeConfig[self.maxtimesId].Condition[1][2] then
|
||||
PopupTipPanel.ShowTip("无法超出每日召唤次数上限!")
|
||||
return
|
||||
end
|
||||
RecruitManager.RecruitRequest(recrutId, function(msg)
|
||||
PrivilegeManager.RefreshPrivilegeUsedTimes(self.maxtimesId,recrutType)--记录抽卡次数
|
||||
UIManager.OpenPanel(uiName, msg.drop,recrutId,{RecruitType.QianKunBoxTen,RecruitType.QianKunBoxTen})
|
||||
CheckRedPointStatus(RedPointType.TailsmanSoulChipLottery)
|
||||
end,self.freeTimesId)
|
||||
end
|
||||
|
||||
--五个魂印头像
|
||||
function TailsmanSoulChipLottery:contentShow()
|
||||
wishSoulData = RecruitManager.GetWishTailsManSoulChips()
|
||||
local iconsData = ConfigManager.GetAllConfigsDataByKey(ConfigName.LotteryRewardConfig,"Pool",self.singleRecruit.DiamondBoxContain[1][1])
|
||||
if wishSoulData and #wishSoulData > 0 then
|
||||
else
|
||||
local li = {}
|
||||
for i = 1,#iconsData do
|
||||
table.insert(li,iconsData[i].Reward[1])
|
||||
end
|
||||
RecruitManager.SetWishTailsManSoulChips(li)
|
||||
end
|
||||
--如果没有默认数值,默认的就是表里面的请三个魂印
|
||||
if wishSoulData and #wishSoulData~=0 then
|
||||
for i = 1, #self.icons do
|
||||
if i<=#wishSoulData then
|
||||
self.icons[i].icon.gameObject:SetActive(true)
|
||||
self.icons[i].kuang.gameObject:SetActive(true)
|
||||
local id=wishSoulData[i]
|
||||
self.icons[i].icon.sprite = self.spLoader:LoadSprite(artConfig[itemConfig[id].ResourceID].Name)
|
||||
self.icons[i].kuang.sprite = self.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[id].Quantity].circle)
|
||||
--点击能查看魂印信息
|
||||
Util.AddOnceClick(self.icons[i].kuang.gameObject,function ()
|
||||
UIManager.OpenPanel(UIName.SoulPrintPopUp,nil,nil,id,nil,nil)
|
||||
end)
|
||||
end
|
||||
Util.SetParticleSortLayer(self.icons[i].effect, sortingOrder+1)
|
||||
end
|
||||
end
|
||||
self.upSoulImg.sprite=self.spLoader:LoadSprite(artConfig[itemConfig[wishSoulData[1]].ResourceID].Name)
|
||||
end
|
||||
|
||||
--- 将一段时间转换为天时分秒
|
||||
function TailsmanSoulChipLottery:TimeToDHMS(second)
|
||||
local day = math.floor(second / (24 * 3600))
|
||||
local minute = math.floor(second / 60) % 60
|
||||
local sec = math.floor(second % 60)
|
||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||
if day <= 0 and hour <= 0 then
|
||||
return string.format("%s分%s秒",minute, sec)
|
||||
else
|
||||
return string.format("%s天%s小时",day, hour)
|
||||
end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function TailsmanSoulChipLottery:OnClose()
|
||||
self.gameObject:SetActive(false)
|
||||
if self.timer then
|
||||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
if self.shopView then
|
||||
SubUIManager.Close(self.shopView)
|
||||
end
|
||||
self.shopView = nil
|
||||
end
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function TailsmanSoulChipLottery:OnDestroy()
|
||||
self.btns = {}
|
||||
if self.shopView then
|
||||
SubUIManager.Close(self.shopView)
|
||||
end
|
||||
self.shopView = nil
|
||||
end
|
||||
|
||||
return TailsmanSoulChipLottery
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a3471573a44562240b6411195631a4be
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue