心愿抽卡修改提交

dev_chengFeng
wangzhenxing 2023-05-27 19:04:30 +08:00
parent a0fa68be2a
commit ac172339ae
7 changed files with 141 additions and 45 deletions

View File

@ -2350,7 +2350,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1006421095
RectTransform:
m_ObjectHideFlags: 0
@ -10289,10 +10289,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 650, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8682382969320885722
CanvasRenderer:
@ -20932,10 +20932,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 510, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2548272237263765984
CanvasRenderer:
@ -21281,7 +21281,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2919348480456994023}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
@ -24125,10 +24125,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 370, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &725074640987852237
CanvasRenderer:
@ -36923,10 +36923,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 90, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1752293183709431928
CanvasRenderer:
@ -46675,10 +46675,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 230, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5187175447103501528
CanvasRenderer:
@ -47500,10 +47500,10 @@ RectTransform:
m_Father: {fileID: 6669000462376630719}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 790, y: -50}
m_SizeDelta: {x: 60, y: 88}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5340892954920088993
CanvasRenderer:

View File

@ -1512,6 +1512,7 @@ ActivityTypeDef = {
xianjingleichong = 114,--仙晶累充
godsWayTowerTreasure_two=115, --多队塔二队秘宝
godsWayTowerTreasure_three=116,--多队塔三队秘宝
wishHero=117, --英雄心愿抽卡
}
--活动结束需要处理面板关闭类型
ActivityTypePanel = {

View File

@ -286,6 +286,8 @@ ConfigName = {
ShenBingSetting="ShenBingSetting",
ShenBingLevel="ShenBingLevel",
ShenBing="ShenBing",
TabulationConfig="TabulationConfig",
WishConfig="WishConfig",
}

View File

@ -135,6 +135,8 @@ function this.GetActivityRewardRequest(type, index)
end
end)
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.GetRewardRefresh, this.chapterGiftData)
elseif type==11701 then
Game.GlobalEvent:DispatchEvent(GameEvent.Recruit.OnRecruitRefreshData)
end
--CheckRedPointStatus(RedPointType.SecretTer)
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshRedShow)

View File

@ -6,12 +6,14 @@ local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
function this:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
self.okBtn = Util.GetGameObject(gameObject,"okBtn")
self.helpBtn = Util.GetGameObject(gameObject, "helpBtn")
self.scroll = Util.GetGameObject(gameObject,"selectList")
self.itemPre = Util.GetGameObject(gameObject,"itemPre")
-- 设置循环滚动,万一内容不停地加
local rootHight = self.scroll.transform.rect.height
local width = self.scroll.transform.rect.width
self.infoTxt=Util.GetGameObject(gameObject,"Bg/tiao1/Text (1)"):GetComponent("Text")
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scroll.transform,
self.itemPre, nil, Vector2.New(width, rootHight), 1, 5, Vector2.New(20, 45))
self.scrollView.moveTween.MomentumAmount = 1
@ -26,6 +28,14 @@ function this:InitComponent(gameObject)
self.wishListObj[i] = Util.GetGameObject(gameObject,"wishList/hero ("..i..")")
self.bgObjlist[i] = Util.GetGameObject(gameObject,"Bg/bglist/obj"..i)
Util.GetGameObject(self.bgObjlist[i], "frame"):GetComponent("Image").sprite = self.spLoader:LoadSprite("r_characterbg_goden")
--心愿神将现在只显示一个
if i>1 then
self.wishListObj[i]:SetActive(false)
self.bgObjlist[i]:SetActive(false)
else
self.wishListObj[i]:SetActive(true)
self.bgObjlist[i]:SetActive(true)
end
end
--tabList
self.tabListObj = {}
@ -36,8 +46,7 @@ function this:InitComponent(gameObject)
self.tabListObj[j] = Util.GetGameObject(gameObject,"Tabs/grid/Btn"..j)
end
self.okBtn = Util.GetGameObject(gameObject,"okBtn")
self.helpBtn = Util.GetGameObject(gameObject, "helpBtn")
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
end
@ -49,18 +58,25 @@ function this:BindEvent()
end)
end
for i = 1, 3 do
Util.AddOnceClick(self.bgObjlist[i],function ()
--心愿只能选一个神将
if i>1 then
return
end
self.curSelect = RecruitManager.CheckIndex()
this:Refresh(true,false)
end)
end
Util.AddOnceClick(self.okBtn,function ()
LogError("点击确定按钮")
self.parent:ClosePanel()
end)
--帮助按钮
Util.AddClick(self.helpBtn, function()
LogError("点击帮助按钮")
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.WishCard,self.helpPosition.x,self.helpPosition.y)
end)
end
@ -90,14 +106,17 @@ function this:Refresh(isTop,isAni)
if not RecruitManager.drawTimes[1] or RecruitManager.drawTimes[1] < data then
self.parent:ClosePanel()
end
local aaa=string.format("抽到<size=35><color=#31FF00>5星</color></size>神将时,有<size=35><color=#31FF00>%s%s</color></size>几率转化为<size=35><color=#31FF00>心愿神将!</color></size>",RecruitManager.GetWishPro(),"%")
self.infoTxt.text=aaa
self.selectBtn:GetComponent("RectTransform").localPosition = self.tabListObj[self.curSelect]:GetComponent("RectTransform").localPosition
this:SetHeroList(isTop,isAni)
this:SetUpHero()
end
function this:SetUpHero()
for i = 1, 3 do
for i = 1, 1 do
local go = self.wishListObj[i]
local frame = Util.GetGameObject(go, "frame"):GetComponent("Image")
local icon = Util.GetGameObject(go, "icon"):GetComponent("Image")
local proIcon = Util.GetGameObject(go, "proIcon"):GetComponent("Image")
@ -125,6 +144,11 @@ function this:SetUpHero()
else
go:SetActive(false)
end
LogError("i==================="..i)
if i>1 then
self.wishListObj[i]:SetActive(false)
LogError("false false")
end
Util.AddLongPressClick(go,function ()
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroId, 5)
end,0.5)

View File

@ -53,7 +53,15 @@ function this.GetWishTailsManSoulChips()
end
return datas
end
local wishPro=20
function this.SetWishPro(pro)
LogError("pro==========="..pro)
wishPro=pro
end
function this.GetWishPro()
return wishPro
end
function this.CheckIsUpTailsManSoulChip(id)
if this.upTailsManSoulChip[id] then
return true
@ -582,7 +590,7 @@ function this.CheckCurHeroState(_heroTid)
num = num + 1
end
end
if num == 3 then
if num == 1 then
--如果上方神将满则其他全部置灰
return 2
end

View File

@ -14,7 +14,8 @@ local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig)
local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
local wishConfig=ConfigManager.GetConfig(ConfigName.WishConfig)
local getId=0
function RecruitPanelNew:InitComponent()
self.spLoader = SpriteLoader.New()
self.panel = Util.GetGameObject(self.gameObject,"Panel")
@ -29,7 +30,7 @@ function RecruitPanelNew:InitComponent()
self.slider = Util.GetGameObject(self.rewardBox,"Bg/Slider"):GetComponent("Image")
self.sliderText = Util.GetGameObject(self.rewardBox, "progress/Text"):GetComponent("Text")
self.boxNameText = Util.GetGameObject(self.rewardBox, "di/Text"):GetComponent("Text")
self.boxNameText.text="传说自选"
self.boxNameText.text="等级宝"
self.boxBtn=Util.GetGameObject(self.rewardBox,"Btn")
self.UI_effect_RecruitPanel_box_normal = Util.GetGameObject(self.rewardBox,"UI_effect_RecruitPanel_box_normal")
effectAdapte(Util.GetGameObject(self.UI_effect_RecruitPanel_box_normal, "quan01"))
@ -43,7 +44,6 @@ function RecruitPanelNew:InitComponent()
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
self.wish = Util.GetGameObject(self.panel,"wishBtn")
self.wish:SetActive(false)
self.wishNoOpen = Util.GetGameObject(self.wish,"noOpen")
self.wishBtn = Util.GetGameObject(self.wishNoOpen,"Img")
self.wishTextImg = Util.GetGameObject(self.wishNoOpen,"ImgText")
@ -69,7 +69,14 @@ function RecruitPanelNew:InitComponent()
self.upHeroPreList[i].item = SubUIManager.Open(SubUIConfig.ItemView,self.upHeroPreList[i].itempos.transform)
self.upHeroPreList[i].item.gameObject:SetActive(false)
self.upHeroPreList[i].item.transform:SetSiblingIndex(0)
self.upHeroPreList[i].choosed = Util.GetGameObject(self.upHeroPreList[i].go,"state")
self.upHeroPreList[i].choosed = Util.GetGameObject(self.upHeroPreList[i].go,"state")
--心愿神将现在只显示一个
if i>1 then
self.upHeroPreList[i].go:SetActive(false)
else
self.upHeroPreList[i].go:SetActive(true)
end
end
self.btns = {}
for i = 1,2 do
@ -91,8 +98,13 @@ function RecruitPanelNew:BindEvent()
end)
--宝箱按钮
Util.AddClick(self.boxBtn,function()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
--UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.RecruitBox)
--self.UI_effect_RecruitPanel_box_normal:SetActive(true)
if RecruitManager.isCanOpenBox then
LogError("getid=========="..getId)
ActivityGiftManager.GetActivityRewardRequest(11701,getId)
end
end)
--奖池预览按钮
Util.AddClick(self.previewBtn, function()
@ -158,11 +170,27 @@ function RecruitPanelNew:OnShow(sortingOrder)
end
end
local progresss=0
local wishLv=0
function RecruitPanelNew:UpdataPanel()
self.bg1.sprite = self.spLoader:LoadSprite(self.config.Icon[3])
self.bg2.sprite = self.spLoader:LoadSprite(self.config.Icon[4])
self.bg3.sprite = self.spLoader:LoadSprite(self.config.Icon[8])
self.title.sprite = self.spLoader:LoadSprite(self.config.Icon[5])
--宝箱活动数据
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
for i = 1,#actconfigs.mission do
progresss=actconfigs.mission[i].progress
end
LogError("progress==============="..progresss)
for i, v in ConfigPairs(wishConfig) do
if RecruitManager.drawTimes[1] and RecruitManager.drawTimes[1]>= v.DrawCardNumber then
wishLv=v.Id
RecruitManager.SetWishPro(v.Weight/10000*100)
end
end
self.boxNameText.text="宝箱等级:"..wishLv
self.title:SetNativeSize()
for i = 1,2 do
self.btns[i].layoutDi.sprite = self.spLoader:LoadSprite(self.config.Icon[6])
@ -170,6 +198,7 @@ function RecruitPanelNew:UpdataPanel()
self.parent.mask2.sprite = self.spLoader:LoadSprite(self.config.Icon[7])
self.parent.mask1.sprite = self.spLoader:LoadSprite(self.config.Icon[7])
-- self.tip.text = self.config.TitleText
self:UpdataWishPanel()
self:UpdataBoxReward()
local num=PrivilegeManager.GetPrivilegeRemainValue(self.singleConfig.MoneyTimes)
@ -184,18 +213,17 @@ function RecruitPanelNew:UpdataWishPanel()
self.tenTip.gameObject:SetActive(false)
return
end
--屏蔽心愿
self.wish.gameObject:SetActive(false)
--如果没有达到150抽按钮置灰
local data = tonumber(specialConfig[119].Value)
NetManager.ChoiceWishHeroRequest(nil,function ()
--LogError(" RecruitManager.drawTimes[1]===".. RecruitManager.drawTimes[1])
if RecruitManager.drawTimes[1] then
if RecruitManager.drawTimes[1] < data then
if wishLv < data then
self.wishNoOpen.gameObject:SetActive(true)
self.wishOpen.gameObject:SetActive(false)
Util.SetGray(self.wishBtn,true)
self.wishText.text = string.format("%s/%s",RecruitManager.drawTimes[1],data)
self.wishTipIma.text = "开启心愿功能,将有更高概率获得心愿神将~"
self.wishText.text = string.format("%s/%s",wishLv,data)
self.wishTipIma.text = "宝箱等级"..data.."级后开启心愿功能,\n将有更高概率获得心愿神将~"
else
self.wishNoOpen.gameObject:SetActive(false)
self.wishOpen.gameObject:SetActive(true)
@ -248,11 +276,42 @@ function RecruitPanelNew:UpdataWishPanel()
end
function RecruitPanelNew:UpdataBoxReward()
local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1])
RecruitManager.isCanOpenBox = num >= self.XianZhaoConfig.CostItem[1][2]
self.slider.fillAmount = num/self.XianZhaoConfig.CostItem[1][2]
self.sliderText.text = string.format("%s/%s", num, self.XianZhaoConfig.CostItem[1][2])
--local num = BagManager.GetItemCountById(self.XianZhaoConfig.CostItem[1][1])
LogError("更新宝箱显示s")
local actconfigs=ActivityGiftManager.GetActivityInfoByType(11701)
RecruitManager.isCanOpenBox=false
for i = 1,#actconfigs.mission do
local config=ConfigManager.TryGetConfigData(ConfigName.WishConfig,actconfigs.mission[i].missionId)
-- if config then
-- LogError("actconfigs.mission[i].state=="..actconfigs.mission[i].state.." RecruitManager.drawTimes[1]=="..RecruitManager.drawTimes[1].." config.DrawCardNumber== "..config.DrawCardNumber)
-- end
if config and actconfigs.mission[i].state==0 and RecruitManager.drawTimes[1] and RecruitManager.drawTimes[1]>=config.DrawCardNumber then
RecruitManager.isCanOpenBox=true
getId=actconfigs.mission[i].missionId
break
end
end
self.boxIcon:GetComponent("Animator").enabled = RecruitManager.isCanOpenBox
local wishData=ConfigManager.TryGetConfigData(ConfigName.WishConfig,wishLv+1)
if wishData then
--self.XianZhaoConfig.CostItem[1][2]
-- = RecruitManager.drawTimes[1]>= wishData.DrawCardNumber
self.sliderText.text = string.format("%s/%s", RecruitManager.drawTimes[1] or 0,wishData.DrawCardNumber )
if RecruitManager.drawTimes[1] then
self.slider.fillAmount = RecruitManager.drawTimes[1]/wishData.DrawCardNumber
else
self.slider.fillAmount = 0 /wishData.DrawCardNumber
end
else
--self.boxIcon:GetComponent("Animator").enabled = false
self.slider.fillAmount = 1
self.sliderText.text ="宝箱已达最大等级"
end
--self.sliderText.text = string.format("%s/%s", num, self.XianZhaoConfig.CostItem[1][2])
-- self.UI_effect_RecruitPanel_box_normal:SetActive(not RecruitManager.isCanOpenBox)
-- self.UI_effect_RecruitPanel_box_open:SetActive(RecruitManager.isCanOpenBox)
end