【命格】命石替换

dev_chengFeng
ZhangBiao 2021-12-08 14:17:18 +08:00
parent 1efc9fc56b
commit 016780c7bc
11 changed files with 7601 additions and 3410 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 735055bf31ae4184a9f6e0685b33ee4a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15560,6 +15560,14 @@ MonoBehaviour:
extension: .png
resPathIndex: 18
resAbNameIndex: 9
- resName: kangbaojia
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: kangbaojian
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_Attack_Down
extension: .png
resPathIndex: 19
@ -15652,10 +15660,22 @@ MonoBehaviour:
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_jinjia
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_mofu
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_Up
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_MD_xianyin
extension: .png
resPathIndex: 19
resAbNameIndex: 9
- resName: r_buff_Nohealing_0001
extension: .png
resPathIndex: 19
@ -28676,6 +28696,14 @@ MonoBehaviour:
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_niu_attack_01
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_niu_hit_01
extension: .mp3
resPathIndex: 193
resAbNameIndex: 489
- resName: Audio_normal_effect_01
extension: .mp3
resPathIndex: 193
@ -29236,6 +29264,14 @@ MonoBehaviour:
extension: .mp3
resPathIndex: 198
resAbNameIndex: 611
- resName: Audio_fangcunzhuanpan_0
extension: .mp3
resPathIndex: 199
resAbNameIndex: 611
- resName: Audio_fangcunzhuanpan_1
extension: .mp3
resPathIndex: 199
resAbNameIndex: 611
- resName: Audio_guide_001
extension: .mp3
resPathIndex: 199
@ -59184,6 +59220,10 @@ MonoBehaviour:
extension: .prefab
resPathIndex: 754
resAbNameIndex: 3195
- resName: RewardGemSingleShowPopup
extension: .prefab
resPathIndex: 754
resAbNameIndex: 3195
- resName: RewardItemPopup
extension: .prefab
resPathIndex: 754
@ -78160,6 +78200,7 @@ MonoBehaviour:
- lz4/dynamicatlas/s_slbz_kuang1.unity3d
- lz4/dynamicatlas/s_slbz_kuang2.unity3d
- lz4/dynamicatlas/s_slbz_xian.unity3d
- lz4/dynamicatlas/t_tequan_kuang.unity3d
- lz4/fonts/fzjinls.unity3d
- lz4/fonts/kaiu.unity3d
- lz4/icon/hero.unity3d

View File

@ -435,6 +435,7 @@ UIName = {
ContinueGiftPanel = 441, -- 连续礼包
ContinuePackagePanel = 442, -- 连购礼包new
GemPanel = 443, --命格界面
RewardGemSingleShowPopup = 444,--命石信息界面
}
SubUIConfig = {

View File

@ -522,12 +522,12 @@ function this.SingleItemDataShow(_go, _itemData)
this.OnClickTabBtn(sortIndex, sortIndexBtnGo,false,true)
UIManager.ClosePanel(UIName.RewardItemSingleShowPopup)
end)
-- elseif _itemData.itemConfig.ItemType == ItemType.HeadFrame then
-- --
-- UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, _itemData.id,function()
-- this.OnClickTabBtn(sortIndex, sortIndexBtnGo)
-- UIManager.ClosePanel(UIName.RewardItemSingleShowPopup)
-- end)
elseif _itemData.itemConfig.ItemType == ItemType.Gem then
--命石
UIManager.OpenPanel(UIName.RewardGemSingleShowPopup, _itemData.id,1,function()
this.OnClickTabBtn(sortIndex, sortIndexBtnGo,false,true)
UIManager.ClosePanel(UIName.RewardGemSingleShowPopup)
end)
else
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, _itemData.id, function()
this.OnClickTabBtn(sortIndex, sortIndexBtnGo,false,true)

View File

@ -1,6 +1,11 @@
local Gem = quick_class("Gem", BasePanel)
local itemData = ConfigManager.GetConfig(ConfigName.ItemConfig)
local gemConfig = ConfigManager.GetConfig(ConfigName.GemConfig)
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local typeName = {
[1] = "攻击",[2] = "生命",[3] = "增伤",[4] = "减伤",[5] = "人杰",[6] = "佛禅",[7] = "妖灵",[8] = "道玄",
}
function Gem:InitComponent()
self.spLoader = SpriteLoader.New()
@ -18,12 +23,14 @@ function Gem:InitComponent()
self.gems = Util.GetGameObject(self.gameObject, "Gems")
self.stones = Util.GetGameObject(self.gameObject, "Stones")
self.itemList = {}
self.propertyList = {}
--页签
self.btnPractice = Util.GetGameObject(self.gameObject, "Tab/tab1")
self.onekey = Util.GetGameObject(self.gameObject, "onekey")
self.fast = Util.GetGameObject(self.gameObject, "fast")
self.more = Util.GetGameObject(self.gameObject, "more")
self.curType = 1
end
function Gem:BindEvent()
@ -63,6 +70,7 @@ function Gem:OnOpen()
end
function Gem:OnSortingOrderChange()
self.BtView:OnOpen(self,{ sortOrder = self.sortingOrder, panelType = PanelTypeView.Practice })
self.ManCanvas.sortingOrder = self.sortingOrder + 2
Util.SetParticleSortLayer(self.fx_ui_xiuxingshengxin_cangzhu, self.sortingOrder + 1)
-- 头像层级
@ -80,7 +88,7 @@ function Gem:Refresh()
local oldWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
self:RefreshMid()
self:SetGems()
self:SetStones(nil,1)
self:SetStones(GemManager.myGemList[self.curType],self.curType)
end
--刷新中部人物
@ -95,6 +103,8 @@ function Gem:SetGems()
local gemData = GemManager.myGemList
for i = 1, 8 do
local itemGo = Util.GetGameObject(self.gems,"item ("..i..")")
local name = Util.GetGameObject(itemGo,"Name"):GetComponent("Text")
name.text = typeName[i]
for j = 1, 3 do
local stoneGo = Util.GetGameObject(itemGo,"stone ("..j..")")
local level = Util.GetGameObject(stoneGo,"Text"):GetComponent("Text")
@ -107,11 +117,13 @@ function Gem:SetGems()
stoneGo:GetComponent("Image").sprite = self.spLoader:LoadSprite(name)
end
Util.AddOnceClick(itemGo,function ()
self.curType = i
self:SetStones(gemData[i],i)
end)
end
end
--设置下部宝石数据
function Gem:SetStones(_data,index)
if _data then--最终删除
LogWarn("[1]"..tostring(_data[1]).." [2]"..tostring(_data[2]).." [3]"..tostring(_data[3]))
@ -125,9 +137,13 @@ function Gem:SetStones(_data,index)
local mask = Util.GetGameObject(stoneGo,"Mask")
local property = Util.GetGameObject(stoneGo,"Property")
local textPre = Util.GetGameObject(property,"Text")
textPre:GetComponent("Text").text = "############"
local name = Util.GetGameObject(stoneGo,"Name"):GetComponent("Text")
textPre:GetComponent("Text").text = ""
textPre:SetActive(false)
property:SetActive(false)
item:SetActive(false)
name.text = ""
if data and data[i] and data[i] > 0 then
if not self.itemList[i] then
local view = SubUIManager.Open(SubUIConfig.ItemView,item.transform)
@ -136,13 +152,42 @@ function Gem:SetStones(_data,index)
self.itemList[i]:OnOpen(false, {data[i],0}, 1.1, false,false,false,self.sortingOrder + 1)
self.itemList[i].gameObject:SetActive(true)
item:SetActive(true)
name.text = GetStringByEquipQua(itemConfig[data[i]].Quantity1,gemConfig[data[i]].Name)--gemConfig[data[i]].Name
self:SetProperty(gemConfig[data[i]],data,property,textPre)
end
Util.AddOnceClick(mask,function ()
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.SelectGem,index,i)
if data and data[i] and data[i] > 0 then
UIManager.OpenPanel(UIName.RewardGemSingleShowPopup,data[i],2,nil,index,i)
else
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.SelectGem,index,i)
end
end)
end
end
function Gem:SetProperty(configData,data,parent,text)
if not configData then
return
end
if not self.propertyList[parent] then
self.propertyList[parent] = {}
end
for k = 1, #self.propertyList[parent] do
self.propertyList[parent][k]:SetActive(false)
end
for j = 1, #configData.Property do
local data = configData.Property[j]
local item = self.propertyList[parent][j]
parent:SetActive(true)
if not item then
item = newObjToParent(text,parent.transform)
self.propertyList[parent][j] = item
end
item:SetActive(true)
item:GetComponent("Text").text = string.format( "%s+%s",PropertyConfig[data[1]].Info,data[2]/100).."%"
end
end
function Gem:OnClose()
end
@ -157,6 +202,7 @@ function Gem:OnDestroy()
self.playerInfoView = nil
end
self.itemList = {}
self.propertyList = {}
end
return Gem

View File

@ -0,0 +1,243 @@
require("Base/BasePanel")
RewardGemSingleShowPopup = Inherit(BasePanel)
local this = RewardGemSingleShowPopup
local JumpConfig = ConfigManager.GetConfig(ConfigName.JumpConfig)
local RechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local gemConfig = ConfigManager.GetConfig(ConfigName.GemConfig)
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local itemSid
local itemConfigData
local func
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
--初始化组件(用于子类重写)
function RewardGemSingleShowPopup:InitComponent()
this.spLoader = SpriteLoader.New()
this.BtnBack = Util.GetGameObject(self.transform, "bg/btnBack")
this.mask = Util.GetGameObject(self.transform, "mask")
this.topBar = Util.GetGameObject(self.transform, "bg/topBar")
this.itemPos = Util.GetGameObject(self.transform, "bg/topBar/armor/itemPos")
this.itemView = SubUIManager.Open(SubUIConfig.ItemView,this.itemPos.transform)
this.armorType = Util.GetGameObject(self.transform, "bg/topBar/armor/info/armorType"):GetComponent("Text")
this.armorLanTuNum = Util.GetGameObject(self.transform, "bg/topBar/armor/info/armorLanTuNum"):GetComponent("Text")
this.info = Util.GetGameObject(self.transform, "bg/topBar/armor/info")
this.itemName = Util.GetGameObject(this.info, "name"):GetComponent("Text")
this.armorTitle = Util.GetGameObject(this.info, "armorTitle"):GetComponent("Text")
this.armorDesc = Util.GetGameObject(this.info, "armorDesc"):GetComponent("Text")
this.equipQuaText = Util.GetGameObject(self.transform, "bg/topBar/armor/equipQuaText"):GetComponent("Text")
this.armorInfo = Util.GetGameObject(self.transform, "bg/topBar/armorInfo")
this.armorInfoText = Util.GetGameObject(self.transform, "bg/topBar/armorInfo"):GetComponent("Text")
this.howGet = Util.GetGameObject(self.transform, "bg/midBar/layout1")
this.scroll = Util.GetGameObject(self.transform, "bg/midBar/scroll")
this.equipProGrid = Util.GetGameObject(self.transform, "bg/midBar/scroll/grid")
this.equipProGridCom = Util.GetGameObject(self.transform, "bg/midBar/scroll/grid"):GetComponent("VerticalLayoutGroup")
this.bottomBar = Util.GetGameObject(self.transform, "bg/bottomBar")
this.btnSure = Util.GetGameObject(self.transform, "bg/bottomBar/btnSure")
this.btnJump = Util.GetGameObject(self.transform, "bg/bottomBar/btnJump")
this.btnClose = Util.GetGameObject(self.transform, "bg/bottomBar/btnClose")
this.proGrid = Util.GetGameObject(self.transform, "bg/midBar/GemPro/grid")
this.proPre = Util.GetGameObject(this.proGrid, "proName")
this.proPre:SetActive(false)
this.proList = {}
end
--绑定事件(用于子类重写)
function RewardGemSingleShowPopup:BindEvent()
Util.AddClick(this.BtnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
PlayerManager.RewardItemSingleShowPopupIsRoleUpStarLayout2 = false
self:ClosePanel()
end)
Util.AddClick(this.mask, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
PlayerManager.RewardItemSingleShowPopupIsRoleUpStarLayout2 = false
self:ClosePanel()
end)
Util.AddClick(this.btnClose, function()--替换,穿戴
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.SelectGem,this.gemType,this.position,function ()
self:ClosePanel()
end)
end)
Util.AddClick(this.btnSure, function()--卸下命石
NetManager.LifeGridChangeRequest(2,this.gemType,this.position,itemSid,function ()
Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
self:ClosePanel()
end)
end)
Util.AddClick(this.btnJump, function()--合成
end)
end
--添加事件监听(用于子类重写)
function RewardGemSingleShowPopup:AddListener()
end
--移除事件监听(用于子类重写)
function RewardGemSingleShowPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function RewardGemSingleShowPopup:OnOpen(...)
local data = { ... }
itemSid = data[1]
itemConfigData = ConfigManager.GetConfigData(ConfigName.ItemConfig, itemSid)
this.openType = data[2]
if data[3] then
func = data[3]
end
if data[4] then
this.gemType = data[4]
end
if data[5] then
this.position = data[5]
end
end
function RewardGemSingleShowPopup:OnShow()
this.itemName.text = GetStringByEquipQua(itemConfigData.Quantity, GetLanguageStrById(itemConfigData.Name))
this.topBar:GetComponent("Image").sprite = self.spLoader:LoadSprite("t_tongyong_di_"..itemConfigData.Quantity)
this.howGet:SetActive(false)
this.scroll:SetActive(false)
this.btnClose:SetActive(false)
this.btnSure:SetActive(false)
this.btnJump:SetActive(false)
this.bottomBar:SetActive(false)
if this.openType == 1 then--背包中打开
this.howGet:SetActive(true)
this.scroll:SetActive(true)
this.btnJump:SetActive(true)
this.bottomBar:SetActive(true)
elseif this.openType == 2 then--装备命石时打开
this.btnClose:SetActive(true)
this.btnSure:SetActive(true)
this.btnJump:SetActive(true)
this.bottomBar:SetActive(true)
end
local creatJumpData = function(jumpDataList)
local jumpSortData = {}
if jumpDataList and #jumpDataList > 0 then
for i = 1, #jumpDataList do--为关卡跳转做的排序数据
local jumpData = {}
jumpData.id = jumpDataList[i]
jumpData.data = JumpConfig[jumpDataList[i]]
table.insert(jumpSortData,jumpData)
end
end
return jumpSortData
end
if this.jumpViewList and #this.jumpViewList > 0 then
for i = 1,#this.jumpViewList do
SubUIManager.Close(this.jumpViewList[i])
end
end
this.jumpViewList = {}
this.equipQuaText.gameObject:SetActive(true)
this.equipQuaText.text = GetStringByEquipQua(itemConfigData.Quantity, GetQuaStringByEquipQua(itemConfigData.Quantity))
this.armorInfo.gameObject:SetActive(true)
this.armorTitle.gameObject:SetActive(false)
this.armorDesc.gameObject:SetActive(false)
this.armorType.gameObject:SetActive(true)
this.armorLanTuNum.text = Language[11516] .. BagManager.GetItemCountById(itemSid)
this.armorType.text = this.getType()--道具类型显示
this.armorInfoText.text = string.gsub(GetLanguageStrById(itemConfigData.ItemDescribe), "\\n", "")
local jumpDataList = itemConfigData.Jump
local jumpSortData = creatJumpData(jumpDataList)
for i = 1, #jumpSortData do
-- type 大于 10000为活动 直接显示按钮如果小于1000 为功能 开启才显示
if jumpSortData[i].id > 0 and (JumpConfig[jumpSortData[i].id].Type >= 10000 or ActTimeCtrlManager.SingleFuncState(JumpConfig[jumpSortData[i].id].Type)) then
local tempView = SubUIManager.Open(SubUIConfig.JumpView, this.equipProGrid.transform, jumpSortData[i].id,true,self)
if tempView then
table.insert(this.jumpViewList,tempView)
end
end
end
this.scroll:GetComponent("RectTransform").sizeDelta = Vector2.New(912.8,600)
this.equipProGridCom.spacing = 130
if jumpDataList and #jumpDataList then
this.equipProGrid:GetComponent("RectTransform").sizeDelta = Vector2.New(807.7,this.equipProGridCom.spacing*(#jumpDataList))
end
this.itemView:OnOpen(false, {itemConfigData.Id,0}, 1.1, false, false, false, self.sortingOrder)
--设置命石属性
this.SetGemProperty()
end
function this.SetGemProperty()
local data = gemConfig[itemSid].Property
for key, value in pairs(this.proList) do
value:SetActive(false)
end
for i = 1, #data do
local go = this.proList[i]
if not go then
go = newObjToParent(this.proPre,this.proGrid)
this.proList[i] = go
end
go:SetActive(true)
go:GetComponent("Text").text = string.format( "全体神将%s+%s",PropertyConfig[data[i][1]].Info,data[i][2]/100).."%"
end
end
--获取道具种类
function this.getType()
local type = itemConfig[itemSid].ItemBaseType
if type == 1 then
return Language[11089]..Language[11517]
elseif type == 2 then
return Language[11089]..Language[10201]
elseif type == 4 then
return Language[11089]..Language[11518]
elseif type == 5 then
return Language[11089]..Language[11519]
elseif type == 6 then
return Language[11089]..Language[11520]
elseif type == 7 then
return Language[11089]..Language[11521]
end
end
--界面关闭时调用(用于子类重写)
function RewardGemSingleShowPopup:OnClose()
if this.jumpViewList and #this.jumpViewList > 0 then
for i = 1,#this.jumpViewList do
SubUIManager.Close(this.jumpViewList[i])
end
end
this.jumpViewList = {}
end
--界面销毁时调用(用于子类重写)
function RewardGemSingleShowPopup:OnDestroy()
SubUIManager.Close(this.itemView)
if this.jumpViewList and #this.jumpViewList > 0 then
for i = 1,#this.jumpViewList do
SubUIManager.Close(this.jumpViewList[i])
end
end
this.jumpViewList = {}
this.proList = {}
this.gemType = nil
this.position = nil
this.spLoader:Destroy()
end
function this.WarPowerChange(oldPowerNum,type)
-- 设置脏数据
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.PlayerExtra)
--
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.OnBagShowWarPowerChange,oldPowerNum,type)
local newPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
if oldPowerNum ~= newPowerNum then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPowerNum,newValue = newPowerNum})
end
end
return RewardGemSingleShowPopup

View File

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

View File

@ -55,6 +55,10 @@ function SelectGem:SingleDataShow(go,data,index)
local btn = Util.GetGameObject(go,"Btn")
local btnText = Util.GetGameObject(go,"Btn/Text"):GetComponent("Text")
btnText.text = "穿 戴"
if GemManager.myGemList[args[1]] and GemManager.myGemList[args[1]][args[2]] and GemManager.myGemList[args[1]][args[2]] > 0 then
btnText.text = "替 换"
end
if not self.itemList[go] then
local view = SubUIManager.Open(SubUIConfig.ItemView,icon.transform)
self.itemList[go] = view
@ -63,11 +67,10 @@ function SelectGem:SingleDataShow(go,data,index)
self.itemList[go].gameObject:SetActive(true)
name.text = GetStringByEquipQua(itemConfig[data.id].Quantity1,data.name)
Util.AddOnceClick(btn,function ()
local type = 1
if GemManager.myGemList[args[1]] and GemManager.myGemList[args[1]][args[2]] and GemManager.myGemList[args[1]][args[2]] > 0 then
type = 2
end
NetManager.LifeGridChangeRequest(type,args[1],args[2],data.id,function ()
NetManager.LifeGridChangeRequest(1,args[1],args[2],data.id,function ()
if args[3] then
args[3]()
end
Game.GlobalEvent:DispatchEvent(GameEvent.Gem.RefreshPanel)
parent:ClosePanel()
end)

View File

@ -278,6 +278,7 @@ end
function Practice:OnSortingOrderChange()
orginLayer = self.sortingOrder
self.BtView:OnOpen(self,{ sortOrder = self.sortingOrder, panelType = PanelTypeView.Practice })
Util.SetParticleSortLayer(self.effect, self.sortingOrder+1)
Util.SetParticleSortLayer(self.fx_ui_xiuxingshengxin_01, self.sortingOrder+1)
Util.SetParticleSortLayer(self.fx_ui_xiuxingshengxin_02, self.sortingOrder+1)