【修行】提交

dev_chengFeng
ZhangBiao 2021-05-13 21:03:27 +08:00
parent 8df2338780
commit 4b20254ddd
10 changed files with 1291 additions and 15 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1981,6 +1981,7 @@ GENERAL_POPUP_TYPE={
YiJingBaoKuConfirm = 31,--易经宝库奖励确认
LingShouBaoGe = 33,--灵兽宝阁选择神兽
YunYouMan = 34,--云游商人选择装备
XiuXingSelectHero = 36,--修行选择英雄弹窗
--大号通用弹窗
YiJingBaoKu = 30,--易经宝库

View File

@ -2202,6 +2202,19 @@ function this.GetHeroDataByProperty(_property, _lvLimit)
return heros
end
--通过职业,阵营筛选英雄
function this.GetHeroDataByProperty(_property, _profession)
local heros = {}
local index = 1
for i, v in pairs(heroDatas) do
if (v.profession == _profession or _profession == 0) then --0 全职业
heros[index] = v
index = index + 1
end
end
return heros
end
--通过品阶筛选英雄
function this.GetHeroDataByNatural(_natural)
local heros = {}

View File

@ -65,6 +65,8 @@ local contentScripts = {
[31] = {view = require("Modules/Popup/View/GeneralPopup_LingShouBaoGe"), panelName = "GeneralPopup_LingShouBaoGe",type=GENERAL_POPUP_TYPE.LingShouBaoGe},
--云游商人选择装备
[32] = {view = require("Modules/Popup/View/GeneralPopup_YunYouMan"), panelName = "GeneralPopup_YunYouMan",type=GENERAL_POPUP_TYPE.YunYouMan},
--修行选择附身英雄
[33] = {view = require("Modules/Popup/View/GeneralPopup_XiuXingSelectHero"), panelName = "GeneralPopup_XiuXingSelectHero",type=GENERAL_POPUP_TYPE.XiuXingSelectHero},
}
--子模块预设
local contentPrefabs={}

View File

@ -0,0 +1,130 @@
----- 修行选择英雄弹窗 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local func
local data
function this:InitComponent(gameObject)
self.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
self.tip=Util.GetGameObject(gameObject,"tip"):GetComponent("Text")
self.scroll = Util.GetGameObject(gameObject, "Scroll")
self.confirm = Util.GetGameObject(gameObject, "ConfirmBtn")
self.cancel = Util.GetGameObject(gameObject, "CancelBtn")
self.itemPre = Util.GetGameObject(gameObject, "itemPre")
self.mask = Util.GetGameObject(gameObject, "itemPre/item")
-- 设置循环滚动,万一内容不停地加
local rootHight = self.scroll.transform.rect.height
local width = self.scroll.transform.rect.width
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scroll.transform,
self.itemPre, nil, Vector2.New(width, rootHight), 1, 5, Vector2.New(0, 35))
self.scrollView.moveTween.MomentumAmount = 1
self.scrollView.moveTween.Strength = 2
self.heroList={}
self.itemList = {}
self.maskList = {}
self.maskImageList = {}
end
function this:BindEvent()
Util.AddClick(this.confirm,function()
data.otherData.selectId = self.selectId
parent:ClosePanel()
if func then
func()
end
end)
Util.AddClick(this.cancel,function()
parent:ClosePanel()
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local _args = {...}
data = _args[1]
func = _args[2]
-- self.heroList
this:Refresh(true,true)
end
function this:Refresh(isTop,isAni)
this.titleText.text = "神印附身"
if not self.itemList then
self.itemList = {}
end
for i = 1, #self.itemList do
self.itemList[i].gameObject:SetActive(false)
end
self.scrollView:SetData(self.heroList, function (index, item)
this:ShowSingleData(item, self.heroList[index],index)
end,not isTop,not isAni)
if #self.heroList ~= 0 then
this.tip.text = "请选择您要附身的神将"
self.tip.gameObject:GetComponent("RectTransform").localPosition = Vector3.New(0,232,0)
else
self.tip.text = "暂无可附身的神将"
self.tip.gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
end
end
function this:ShowSingleData(item,sdata,index)
local itemtrans = Util.GetGameObject(item,"item")
local itemmask = Util.GetGameObject(item,"mask")
local maskImage = Util.GetGameObject(item,"mask/Image")
local equiped = Util.GetGameObject(item,"equiped")
maskImage:SetActive(false)
equiped:SetActive(sdata.Equiped)
if not self.itemList[index] then
self.itemList[index] = SubUIManager.Open(SubUIConfig.ItemView,itemtrans.transform)
self.itemList[index].gameObject:SetActive(false)
end
LogGreen("index:"..tostring(index))
self.itemList[index]:OnOpen(false, {sdata.Id,sdata.Num}, 1,true,false,false,sortingOrder)
self.itemList[index].gameObject:SetActive(true)
self.maskList[index] = itemmask
self.maskImageList[index] = maskImage
self.maskImageList[index]:SetActive(self.selectId == sdata.Id)
Util.AddOnceClick(self.maskList[index],function ()
for i = 1, #self.maskImageList do
self.maskImageList[i]:SetActive(false)
end
if self.selectId == sdata.Id then
self.maskImageList[index]:SetActive(false)
self.selectId = 0
else
self.maskImageList[index]:SetActive(true)
self.selectId = sdata.Id
end
end)
Util.AddOnceClick(equiped,function ()
PopupTipPanel.ShowTip("神印已附身此神将!")
end)
end
function this:OnClose()
self.selectId = nil
self.heroList={}
self.maskList = {}
self.maskImageList = {}
end
function this:OnDestroy()
self.itemList = {}
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1b3251df7138e924e916826fffb7feae
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15,6 +15,11 @@ function PracticeImprint:InitComponent()
self.rightInfo = Util.GetGameObject(self.ImprintInfo, "Content/Layout/Right")
self.tightTitle = Util.GetGameObject(self.rightInfo, "Title/Text"):GetComponent("Text")
self.Add = Util.GetGameObject(self.rightInfo, "AddBtn")
self.Hero = Util.GetGameObject(self.rightInfo, "Hero")
self.itemView = Util.GetGameObject(self.Hero, "itemview")
self.MaskBtn = Util.GetGameObject(self.rightInfo, "mask")
self.doBtn = Util.GetGameObject(self.ImprintInfo, "Content/Btn")
self.doBtnText = Util.GetGameObject(self.doBtn, "Text"):GetComponent("Text")
@ -33,9 +38,6 @@ function PracticeImprint:BindEvent()
Util.AddClick(self.ImprintInfoBack, function()
self.ImprintInfo:SetActive(false)
end)
Util.AddClick(self.doBtn, function()
LogGreen("按钮")
end)
end
function PracticeImprint:AddListener()
@ -82,6 +84,7 @@ function PracticeImprint:SetSingleImprint(_go,_imprintId)
stateImg.sprite = Util.LoadSprite("r_Dungeon_lockon")
heroImg.gameObject:SetActive(false)
else--已解锁
LogGreen(" _imprintId:"..tostring(_imprintId).." serverData.state:"..tostring(serverData.state))
if serverData.state == 0 then--未使用
stateImg.gameObject:SetActive(false)
heroImg.gameObject:SetActive(false)
@ -103,22 +106,33 @@ end
--设置下方神印信息界面
function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
local curHero = ""
--title显示
if _configData.Type == 0 then
self.leftTitle.text = string.format("通用神印·%s",_configData.Name)
elseif _configData.Type == 1 then
self.leftTitle.text = string.format("附身神印·%s",_configData.Name)
end
--右侧部分状态和按钮显示
if not _serverData then
self.rightInfo:SetActive(false)
self.doBtnText.text = string.format("%s期解锁",_configData.Name)
self.doBtnText.text = string.format("%s解锁",_configData.Unlock)
else
if _configData.Type == 0 then
self.rightInfo:SetActive(false)
self.doBtnText.text = "选择神印"
elseif _configData.Type == 1 then
self.rightInfo:SetActive(true)
end
if _serverData.state == 0 then
self.doBtnText.text = "选择神印"
elseif _serverData.state == 1 then
self.doBtnText.text = "取消神印"
end
end
self.leftTitle.text = string.format("通用神印·%s",_configData.Name)
--详情
self.leftDetail.text = _configData.Desc
if _serverData then
Util.AddOnceClick(self.doBtn,function ()
--神印确认/取消按钮
Util.AddOnceClick(self.doBtn,function ()
if _serverData ~= nil then
local old,new,sub = 0,0,""
old = PracticeManager.BigLevelImprintList[_configData.UnlockId]
new = _configData.Id
@ -126,8 +140,26 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
NetManager.PracticeImprintRequest(old,new,sub,function ()
self:OnShow()
end)
end
end)
--如果神印已开启且是附身神印
if _serverData and _configData.Type == 1 then
self.Add:SetActive(true)
self.Hero:SetActive(false)
if _serverData.subId ~= "" then
self.Add:SetActive(false)
self.Hero:SetActive(true)
local view = SubUIManager.Open(SubUIConfig.ItemView, self.itemView.transform)
view:OnOpen(false, {tonumber(_serverData.subId),0}, 1.3,false,false,false,self.sortingOrder)
end
Util.AddOnceClick(self.MaskBtn,function()
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.XiuXingSelectHero,_configData,function ()
self:Refresh()
end)
-- LogRed("OpenPanel")
end)
end
--神将选择
end

View File

@ -3,6 +3,7 @@ local this = PracticeManager
local XiuXianConfig = ConfigManager.GetConfig(ConfigName.XiuXianConfig)
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local XiuXianSkillConfig = ConfigManager.GetConfig(ConfigName.XiuXianSkillConfig)
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
function this.Initialize()
this.PracticeLevel = 1--小境界id
@ -58,7 +59,11 @@ function this.GetCurAllGetAdd()
-- LogGreen("#Pros:"..tostring(#Pros))
for i = 1, #Pros do
-- LogBlue("ProsId:"..tostring(Pros[i][1]).." ProsNum:"..tostring(Pros[i][2]))
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
if PropertyConfig[Pros[i][1]].Style == 1 then
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
elseif PropertyConfig[Pros[i][1]].Style == 2 then
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]/100
end
end
end
end
@ -73,7 +78,11 @@ function this.GetAddsListWithTemplate()
if v.TotalPros then
local Pros = v.TotalPros
for i = 1, #Pros do
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
if PropertyConfig[Pros[i][1]].Style == 1 then
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
elseif PropertyConfig[Pros[i][1]].Style == 2 then
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]/100
end
end
end
end
@ -93,7 +102,11 @@ function this.GetAddsListWithOutTemplate()
if not addsList[v.RealmId][Pros[i][1]] then
addsList[v.RealmId][Pros[i][1]] = 0
end
addsList[v.RealmId][Pros[i][1]] = addsList[v.RealmId][Pros[i][1]] + Pros[i][2]
if PropertyConfig[Pros[i][1]].Style == 1 then
addsList[v.RealmId][Pros[i][1]] = addsList[v.RealmId][Pros[i][1]] + Pros[i][2]
elseif PropertyConfig[Pros[i][1]].Style == 2 then
addsList[v.RealmId][Pros[i][1]] = addsList[v.RealmId][Pros[i][1]] + Pros[i][2]/100
end
end
end
end
@ -118,7 +131,11 @@ end
--返回预览界面文字
function this.GetPreviewSingleText(id,value)
return string.format("全体神将%s+%s",PropertyConfig[id].Info,value)
if PropertyConfig[id].Style == 1 then
return string.format("全体神将%s+%s",PropertyConfig[id].Info,value)
elseif PropertyConfig[id].Style == 2 then
return string.format("全体神将%s+%s",PropertyConfig[id].Info,value).."%"
end
end
--获取所有神印信息
@ -143,7 +160,6 @@ function this.UpdataImprintDataFromServer(_imprintList)
this.ImprintServerData[value.id].type = value.type
this.ImprintServerData[value.id].subId = value.subId
this.ImprintServerData[value.id].state = value.state
LogPurple("id:"..tostring(value.id).." state:"..tostring(value.state))
if value.state == 1 then
this.BigLevelImprintList[XiuXianSkillConfig[value.id].UnlockId] = value.id
end

View File

@ -1,6 +1,7 @@
local Practice = quick_class("Practice", BasePanel)
local orginLayer
local XinXianConfig = ConfigManager.GetConfig(ConfigName.XiuXianConfig)
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
function Practice:InitComponent()
orginLayer = 0
@ -60,13 +61,31 @@ function Practice:BindEvent()
LogGreen("打开山河社稷图")
end)
Util.AddClick(self.button, function()
-- self:UpgradeCheck()
if self:UpgradeCheck() then return end
NetManager.UpPracticeLevelRequest(function ()
self:OnShow()
end)
end)
end
--Check
function Practice:UpgradeCheck()
if PracticeManager.StarNum < self.curLevelConfig.NeedStarNum then
PopupTipPanel.ShowTip("无法破境,请前往山河社稷图获取更多星星!")
return true
end
if self.curLevelConfig.LevelUpCost then
for i = 1, #self.curLevelConfig.LevelUpCost do
local data = self.curLevelConfig.LevelUpCost[i]
if BagManager.GetTotalItemNum(data[1]) < data[2] then
PopupTipPanel.ShowTip(string.format("%s不足!",ItemConfig[data[1]].Name))
return true
end
end
end
return false
end
function Practice:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.OnShow,self)
end

View File

@ -108,7 +108,6 @@ function PlayerInfoView:OnShow()
end
function PlayerInfoView:RefreshPower(force)
LogGreen("force:"..tostring(force))
self.heroTeamPower.text = force
-- self.heroTeamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end