【鸿蒙阵】 初版提交
parent
2627341766
commit
15eebe4584
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e68a4946b4f957e42bf712fefb472e96
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 36509fd3b353f0f4d97dad9f649c79fb
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
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: a99b505dc81e52d4aa4ebb2f918178a4
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -177,6 +177,8 @@ local ManagerNames = {
|
|||
--主题活动管理器
|
||||
"DynamicActivity/DynamicActivityManager",
|
||||
"Hero/HeroSkinManager",
|
||||
--鸿蒙阵
|
||||
"Harmony/Manager/HarmonyManager",
|
||||
--!!!!红点管理(尽量放在最后)!!!!--
|
||||
"Player/RedpotManager",
|
||||
}
|
||||
|
|
|
@ -177,7 +177,8 @@ ConfigName = {
|
|||
HeroSkin = "HeroSkin",
|
||||
BlessingConfigNew = "BlessingConfigNew",
|
||||
BlessingRewardPoolNew = "BlessingRewardPoolNew",
|
||||
SpiritAnimalSummon = "SpiritAnimalSummon"
|
||||
SpiritAnimalSummon = "SpiritAnimalSummon",
|
||||
Hongmeng="Hongmeng"
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -418,5 +418,10 @@ GameEvent = {
|
|||
},
|
||||
Role={
|
||||
UpdateSkin="Role.UpdateSkin",-- 刷新皮肤
|
||||
},
|
||||
|
||||
HongMeng={
|
||||
RereshNumText="RereshNumText",
|
||||
|
||||
}
|
||||
}
|
|
@ -53,12 +53,12 @@ end
|
|||
|
||||
--添加事件监听(用于子类重写)
|
||||
function AchievementPanel:AddListener()
|
||||
--Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
||||
-- Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function AchievementPanel:RemoveListener()
|
||||
--Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
||||
-- Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, self.RefreshActivityBtn, self)
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
|
|
|
@ -153,7 +153,8 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
|
|||
local starGrid = Util.GetGameObject(go.transform, "star")
|
||||
SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
|
||||
local cardBtn = Util.GetGameObject(go.transform, "icon")
|
||||
Util.AddOnceClick(cardBtn, function()
|
||||
|
||||
Util.AddOnceClick(cardBtn, function()
|
||||
if curSelectHeroList[heroData.dynamicId] then
|
||||
choosed:SetActive(false)
|
||||
curSelectHeroList[heroData.dynamicId]=nil
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9bda2d7e8ddc4254b968d4000136a8b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,74 @@
|
|||
require("Base/BasePanel")
|
||||
HarmonyPanel = Inherit(BasePanel)
|
||||
|
||||
|
||||
|
||||
HarmonyPanel.contents = {
|
||||
[1] = {view = require("Modules/Harmony/View/HarmonyScrllow"), panelName = "HarmonyPanel"},
|
||||
|
||||
}
|
||||
HarmonyPanel.prefab={}
|
||||
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function HarmonyPanel:InitComponent()
|
||||
|
||||
self.btnBack = Util.GetGameObject(self.gameObject, "Back/BackBtn")
|
||||
|
||||
self.panel=Util.GetGameObject(self.gameObject,"Panel")
|
||||
|
||||
for i = 1, #self.contents do
|
||||
self.prefab[i]=Util.GetGameObject(self.panel,self.contents[i].panelName);
|
||||
|
||||
self.contents[i].view:InitComponent(self.panel)
|
||||
end
|
||||
|
||||
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft })
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function HarmonyPanel:BindEvent()
|
||||
Util.AddClick(self.btnBack, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function HarmonyPanel:AddListener()
|
||||
for i = 1, #self.contents do
|
||||
|
||||
self.contents[i].view:AddListener()
|
||||
end
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function HarmonyPanel:RemoveListener()
|
||||
for i = 1, #self.contents do
|
||||
|
||||
self.contents[i].view:RemoveListener()
|
||||
end
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function HarmonyPanel:OnOpen(equipSId)
|
||||
|
||||
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function HarmonyPanel:OnShow()
|
||||
self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Talisman})
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function HarmonyPanel:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function HarmonyPanel:OnDestroy()
|
||||
SubUIManager.Close(self.UpView)
|
||||
end
|
||||
|
||||
return HarmonyPanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aacc4766406a29346beabc50d56ff497
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d0323b96f4a55ab45b1276019cd8c6e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,38 @@
|
|||
HarmonyManager = {}
|
||||
local this = HarmonyManager
|
||||
|
||||
--鸿蒙阵数据
|
||||
this.hongmengGuards = {}
|
||||
this.hongmengHeroInfos = {}
|
||||
this.hongmengTablet = 0
|
||||
this.hongmengAdditions = {}
|
||||
|
||||
function this:InitHongMengData(hongmengGuards, hongmengHeroInfos, hongmengTablet, hongmengAdditions)
|
||||
-- body
|
||||
this.hongmengGuards = hongmengGuards
|
||||
this.hongmengHeroInfos = hongmengHeroInfos
|
||||
this.hongmengTablet = hongmengTablet
|
||||
this.hongmengAdditions = hongmengAdditions
|
||||
|
||||
-- print(GameDataBase.SheetBase.GetKeys(this.hongmengGuards)," ~~~~44444444")
|
||||
-- -- print(this.hongmengHeroInfos)
|
||||
-- for key, value in ConfigPairs(this.hongmengHeroInfos) do
|
||||
-- LogGreen(key," ",value)
|
||||
-- end
|
||||
-- print(this.hongmengTablet)
|
||||
-- for key, value in ConfigPairs(this.hongmengAdditions) do
|
||||
-- -- body
|
||||
-- LogGreen(key," ",value)
|
||||
-- end
|
||||
--print(this.hongmengAdditions)
|
||||
end
|
||||
|
||||
|
||||
function this:SendHarmonyManagerMsg()
|
||||
NetManager.HongMengRequset(0,function(msg)
|
||||
--
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
return HarmonyManager
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0a1604d2a6c3754abd41c1bb29288e4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f1164ab514aca7b498ae3c56e901b319
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,158 @@
|
|||
local this={}
|
||||
|
||||
this.tab=ConfigManager.GetConfig(ConfigName.Hongmeng)
|
||||
local Box=0;
|
||||
local OpenBox=2
|
||||
function this:InitComponent(gameObject)
|
||||
|
||||
-- item预制件
|
||||
|
||||
this.item = Util.GetGameObject(gameObject , "HarmonyPanel/item")
|
||||
|
||||
--btn组件
|
||||
this.addBtn = Util.GetGameObject(gameObject,"HarmonyPanel/AddBtn")
|
||||
this.GongMingMsgBtn = Util.GetGameObject(gameObject,"HarmonyPanel/KnowGongMing")
|
||||
this.NumText = Util.GetGameObject(gameObject,"HarmonyPanel/itemNumText"):GetComponent("Text")
|
||||
this.scrollbar = Util.GetGameObject(gameObject,"HarmonyPanel/Scrollbar"):GetComponent("Scrollbar")
|
||||
local scrollParent = Util.GetGameObject(gameObject, "HarmonyPanel/scroll"):GetComponent("RectTransform").rect
|
||||
|
||||
|
||||
|
||||
this.ScrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,Util.GetGameObject(gameObject,"HarmonyPanel/scroll").transform,
|
||||
this.item,this.scrollbar,Vector2.New(-scrollParent.x*2,-scrollParent.y*2),1,5,Vector2.New(35,15))
|
||||
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 1
|
||||
-- for key, value in ConfigPairs(this.tab) do
|
||||
-- print("key:",key,"value",value.Id)
|
||||
-- end
|
||||
|
||||
|
||||
this.BoxList=0;
|
||||
this:InitBox()
|
||||
end
|
||||
|
||||
function this:InitBox()
|
||||
this.NumText.text = string.format("%d/%d",0,this.BoxList)
|
||||
local keys = GameDataBase.SheetBase.GetKeys(this.tab) --获取数据长度
|
||||
this.ScrollView:SetData(keys,function (index, go)
|
||||
local key = keys[index]
|
||||
this.SingleBoxDataShow(go, this.tab[key])
|
||||
|
||||
end)
|
||||
end
|
||||
function this.SingleBoxDataShow(go,boxData)
|
||||
-- body
|
||||
print("1111111111s")
|
||||
local mask = Util.GetGameObject(go.transform,"Box/Empty/lock/mask");
|
||||
local lock=Util.GetGameObject(go.transform,"Box/Empty/lock");
|
||||
|
||||
if mask.activeSelf then
|
||||
if boxData.Id<OpenBox then--拥有格子数
|
||||
mask:SetActive(false)
|
||||
if boxData.Id<=Box then
|
||||
-- body
|
||||
lock:SetActive(false)
|
||||
end
|
||||
Util.AddOnceClick(go,function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.HongMeng.RereshNumText);
|
||||
-- lock:SetActive(false)
|
||||
end)
|
||||
else
|
||||
mask:SetActive(true)
|
||||
lock:SetActive(true)
|
||||
end
|
||||
-- body
|
||||
else
|
||||
if boxData.Id<OpenBox then--拥有格子数
|
||||
mask:SetActive(false)
|
||||
lock:SetActive(false)
|
||||
else
|
||||
mask:SetActive(true)
|
||||
lock:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if boxData.Id<OpenBox then--拥有格子数
|
||||
mask:SetActive(false)
|
||||
Util.AddOnceClick(go,function()
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.HongMeng.RereshNumText);
|
||||
lock:SetActive(false)
|
||||
end)
|
||||
else
|
||||
mask:SetActive(true)
|
||||
--Box:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
-- body
|
||||
|
||||
|
||||
end
|
||||
--刷新显示的方法 已拥有的鸿蒙守卫数 已拥有的格子数 格子总数
|
||||
function this:UpdataShow(itemList,BoxList,BoxLength)
|
||||
|
||||
for i = 1, BoxLength do
|
||||
if i<=#itemList then
|
||||
|
||||
-- this.SingleItemDataShow(this.item , )
|
||||
elseif i>#itemList and i<=#BoxList then
|
||||
-- body
|
||||
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function this.SingleItemDataShow(clone,Itemdata)
|
||||
-- Util.GetGameObject(clone.transform,"GameObject/icon"):GetComponent("icon").sprite=Util.LoadSprite(GetHeroQuantityImageByquality(heroData.config.Quality,heroData.star))
|
||||
-- Util.GetGameObject(clone.transform, "lv"):SetActive(false)-- :GetComponent("Text").text = heroData.lv
|
||||
-- Util.GetGameObject(clone.transform, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(heroData.config.Icon))
|
||||
-- Util.GetGameObject(clone.transform, "posIcon"):SetActive(false)--:GetComponent("Image").sprite = Util.LoadSprite(heroData.professionIcon)
|
||||
-- Util.GetGameObject(clone.transform, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.config.PropertyName))
|
||||
end
|
||||
|
||||
|
||||
function this:Refesh()
|
||||
-- body
|
||||
|
||||
Box=Box+1
|
||||
OpenBox = OpenBox+1
|
||||
this.NumText.text = string.format("%d/%d",0,Box)
|
||||
|
||||
local keys = GameDataBase.SheetBase.GetKeys(this.tab) --获取数据长度
|
||||
this.ScrollView:SetData(keys,function (index, go)
|
||||
local key = keys[index]
|
||||
this.SingleBoxDataShow(go, this.tab[key])
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
-- body
|
||||
print(" 注册消息成功")
|
||||
Game.GlobalEvent:AddEvent(GameEvent.HongMeng.RereshNumText,self.Refesh,self)
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
-- body
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.HongMeng.RereshNumText,self.Refesh,self)
|
||||
end
|
||||
function this:OnShow(...)
|
||||
-- body
|
||||
|
||||
end
|
||||
|
||||
|
||||
function this:SingleHeroDataShow(_go,_HongMengData)
|
||||
local clone = _go
|
||||
local HongMeng = _HongMengData
|
||||
|
||||
-- body
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f2ad8b58b6184134980bc37b9dbd5a79
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -232,7 +232,8 @@ function this:InitComponent()
|
|||
-- 无尽
|
||||
this.btnEndLess = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnEndLess")
|
||||
this.btnEndLess:SetActive(false)
|
||||
|
||||
--鸿蒙
|
||||
this.btnHongMeng=Util.GetGameObject(self.gameObject,"RightDown/btnHongMeng")
|
||||
-- 设置
|
||||
--this.btnSet = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnSetting")
|
||||
--this.setRed = Util.GetGameObject(this.btnSet, "redPoint")
|
||||
|
@ -879,6 +880,10 @@ function this:BindEvent()
|
|||
Util.AddClick(this.btnDemonSlayer, function()
|
||||
UIManager.OpenPanel(UIName.DemonSlayerPanel)
|
||||
end)
|
||||
|
||||
Util.AddClick(this.btnHongMeng,function()
|
||||
UIManager.OpenPanel(UIName.HongMengPanel)
|
||||
end)
|
||||
this.BindRedPoint()
|
||||
end
|
||||
|
||||
|
|
|
@ -4781,4 +4781,25 @@ function this.ChengeMonsterChooseRequest(activityId,selectId,func)
|
|||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--鸿蒙阵
|
||||
function this.HongMengRequset(_gridId,func)
|
||||
|
||||
|
||||
--鸿蒙阵数据传递
|
||||
-- HarmonyManager:InitHongMengData(msg.hongmengGuards,msg.hongmengHeroInfos,msg.hongmengTablet,msg.hongmengAdditions)
|
||||
|
||||
local data = HeroInfoProto_pb.OpenResonanceRequest()
|
||||
data.gridId = _gridId
|
||||
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.HERO_SKIN_CHANGE_REQUEST, MessageTypeProto_pb.HERO_SKIN_CHANGE_RESPONSE, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.OpenResonanceResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
return this
|
|
@ -0,0 +1,9 @@
|
|||
local HarmonyView={}
|
||||
|
||||
function HarmonyView:New()
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
return HarmonyView
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1c245d37f39936d46bbf88a0ef8b4036
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue