【家园】装备强化升级
parent
a1301a4a22
commit
630d56c810
File diff suppressed because it is too large
Load Diff
|
@ -2317,6 +2317,7 @@ GENERAL_POPUP_TYPE={
|
|||
HomeLandBuildingDetail = 63,--家园建筑详情
|
||||
GemOneKey = 60, --命石一键合成
|
||||
GemMoreCom = 61, --命石批量合成
|
||||
HomeLandEquip = 65,--家园装备升级
|
||||
|
||||
--大号通用弹窗
|
||||
YiJingBaoKu = 30,--易经宝库
|
||||
|
|
|
@ -249,6 +249,8 @@ ConfigName = {
|
|||
HomeLand = "HomeLand",
|
||||
HomeLandLevel = "HomeLandLevel",
|
||||
HomeLandTask = "HomeLandTask",
|
||||
EquipStrengthen = "EquipStrengthen",
|
||||
EquipRankUp = "EquipRankUp",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -420,6 +420,7 @@ VIEWHEROINFORESPONSE_SPECIALEFFECTS_FIELD = protobuf.FieldDescriptor();
|
|||
VIEWHEROINFORESPONSE_FORCE_FIELD = protobuf.FieldDescriptor();
|
||||
VIEWHEROINFORESPONSE_GUILDSKILL_FIELD = protobuf.FieldDescriptor();
|
||||
VIEWHEROINFORESPONSE_TREELEVEL_FIELD = protobuf.FieldDescriptor();
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD = protobuf.FieldDescriptor();
|
||||
RANKREQUEST = protobuf.Descriptor();
|
||||
RANKREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
|
||||
RANKREQUEST_ACTIVITEID_FIELD = protobuf.FieldDescriptor();
|
||||
|
@ -656,10 +657,10 @@ WANDERDISPATCHRESPONSE_LAND_FIELD = protobuf.FieldDescriptor();
|
|||
WANDERDISPATCHRESPONSE_HEROTIDS_FIELD = protobuf.FieldDescriptor();
|
||||
WANDERDISPATCHRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
EQUIPINTENSIFYREQUSET = protobuf.Descriptor();
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD = protobuf.FieldDescriptor();
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD = protobuf.FieldDescriptor();
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD = protobuf.FieldDescriptor();
|
||||
EQUIPINTENSIFYRESPONSE = protobuf.Descriptor();
|
||||
EQUIPINTENSIFYRESPONSE_INFOS_FIELD = protobuf.FieldDescriptor();
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD = protobuf.FieldDescriptor();
|
||||
ARCHITECTUREUNLOCKINDICATION = protobuf.Descriptor();
|
||||
ARCHITECTUREUNLOCKINDICATION_INFOS_FIELD = protobuf.FieldDescriptor();
|
||||
|
||||
|
@ -4533,11 +4534,21 @@ VIEWHEROINFORESPONSE_TREELEVEL_FIELD.default_value = 0
|
|||
VIEWHEROINFORESPONSE_TREELEVEL_FIELD.type = 5
|
||||
VIEWHEROINFORESPONSE_TREELEVEL_FIELD.cpp_type = 1
|
||||
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.name = "homeEquipLv"
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.full_name = ".rpc.protocols.ViewHeroInfoResponse.homeEquipLv"
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.number = 7
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.index = 6
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.label = 3
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.has_default_value = false
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.default_value = {}
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.type = 5
|
||||
VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD.cpp_type = 1
|
||||
|
||||
VIEWHEROINFORESPONSE.name = "ViewHeroInfoResponse"
|
||||
VIEWHEROINFORESPONSE.full_name = ".rpc.protocols.ViewHeroInfoResponse"
|
||||
VIEWHEROINFORESPONSE.nested_types = {}
|
||||
VIEWHEROINFORESPONSE.enum_types = {}
|
||||
VIEWHEROINFORESPONSE.fields = {VIEWHEROINFORESPONSE_HERO_FIELD, VIEWHEROINFORESPONSE_EQUIP_FIELD, VIEWHEROINFORESPONSE_SPECIALEFFECTS_FIELD, VIEWHEROINFORESPONSE_FORCE_FIELD, VIEWHEROINFORESPONSE_GUILDSKILL_FIELD, VIEWHEROINFORESPONSE_TREELEVEL_FIELD}
|
||||
VIEWHEROINFORESPONSE.fields = {VIEWHEROINFORESPONSE_HERO_FIELD, VIEWHEROINFORESPONSE_EQUIP_FIELD, VIEWHEROINFORESPONSE_SPECIALEFFECTS_FIELD, VIEWHEROINFORESPONSE_FORCE_FIELD, VIEWHEROINFORESPONSE_GUILDSKILL_FIELD, VIEWHEROINFORESPONSE_TREELEVEL_FIELD, VIEWHEROINFORESPONSE_HOMEEQUIPLV_FIELD}
|
||||
VIEWHEROINFORESPONSE.is_extendable = false
|
||||
VIEWHEROINFORESPONSE.extensions = {}
|
||||
RANKREQUEST_TYPE_FIELD.name = "type"
|
||||
|
@ -6639,31 +6650,21 @@ WANDERDISPATCHRESPONSE.enum_types = {}
|
|||
WANDERDISPATCHRESPONSE.fields = {WANDERDISPATCHRESPONSE_LAND_FIELD, WANDERDISPATCHRESPONSE_HEROTIDS_FIELD, WANDERDISPATCHRESPONSE_DROP_FIELD}
|
||||
WANDERDISPATCHRESPONSE.is_extendable = false
|
||||
WANDERDISPATCHRESPONSE.extensions = {}
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.name = "location"
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.full_name = ".rpc.protocols.EquipIntensifyRequset.location"
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.number = 1
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.index = 0
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.label = 1
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.has_default_value = false
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.default_value = 0
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.type = 5
|
||||
EQUIPINTENSIFYREQUSET_LOCATION_FIELD.cpp_type = 1
|
||||
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.name = "upLevel"
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.full_name = ".rpc.protocols.EquipIntensifyRequset.upLevel"
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.number = 2
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.index = 1
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.label = 1
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.has_default_value = false
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.default_value = 0
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.type = 5
|
||||
EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD.cpp_type = 1
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.name = "type"
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.full_name = ".rpc.protocols.EquipIntensifyRequset.type"
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.number = 1
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.index = 0
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.label = 1
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.has_default_value = false
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.default_value = 0
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.type = 5
|
||||
EQUIPINTENSIFYREQUSET_TYPE_FIELD.cpp_type = 1
|
||||
|
||||
EQUIPINTENSIFYREQUSET.name = "EquipIntensifyRequset"
|
||||
EQUIPINTENSIFYREQUSET.full_name = ".rpc.protocols.EquipIntensifyRequset"
|
||||
EQUIPINTENSIFYREQUSET.nested_types = {}
|
||||
EQUIPINTENSIFYREQUSET.enum_types = {}
|
||||
EQUIPINTENSIFYREQUSET.fields = {EQUIPINTENSIFYREQUSET_LOCATION_FIELD, EQUIPINTENSIFYREQUSET_UPLEVEL_FIELD}
|
||||
EQUIPINTENSIFYREQUSET.fields = {EQUIPINTENSIFYREQUSET_TYPE_FIELD}
|
||||
EQUIPINTENSIFYREQUSET.is_extendable = false
|
||||
EQUIPINTENSIFYREQUSET.extensions = {}
|
||||
EQUIPINTENSIFYRESPONSE_INFOS_FIELD.name = "infos"
|
||||
|
@ -6677,11 +6678,21 @@ EQUIPINTENSIFYRESPONSE_INFOS_FIELD.message_type = CommonProto_pb.EQUIPINTENSIFYI
|
|||
EQUIPINTENSIFYRESPONSE_INFOS_FIELD.type = 11
|
||||
EQUIPINTENSIFYRESPONSE_INFOS_FIELD.cpp_type = 10
|
||||
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.name = "equipRankUp"
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.full_name = ".rpc.protocols.EquipIntensifyResponse.equipRankUp"
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.number = 2
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.index = 1
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.label = 1
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.has_default_value = false
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.default_value = 0
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.type = 5
|
||||
EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD.cpp_type = 1
|
||||
|
||||
EQUIPINTENSIFYRESPONSE.name = "EquipIntensifyResponse"
|
||||
EQUIPINTENSIFYRESPONSE.full_name = ".rpc.protocols.EquipIntensifyResponse"
|
||||
EQUIPINTENSIFYRESPONSE.nested_types = {}
|
||||
EQUIPINTENSIFYRESPONSE.enum_types = {}
|
||||
EQUIPINTENSIFYRESPONSE.fields = {EQUIPINTENSIFYRESPONSE_INFOS_FIELD}
|
||||
EQUIPINTENSIFYRESPONSE.fields = {EQUIPINTENSIFYRESPONSE_INFOS_FIELD, EQUIPINTENSIFYRESPONSE_EQUIPRANKUP_FIELD}
|
||||
EQUIPINTENSIFYRESPONSE.is_extendable = false
|
||||
EQUIPINTENSIFYRESPONSE.extensions = {}
|
||||
ARCHITECTUREUNLOCKINDICATION_INFOS_FIELD.name = "infos"
|
||||
|
|
|
@ -4,6 +4,8 @@ local HomeLand = ConfigManager.GetConfig(ConfigName.HomeLand)
|
|||
local HomeLandLevel = ConfigManager.GetConfig(ConfigName.HomeLandLevel)
|
||||
local HomeLandTask = ConfigManager.GetConfig(ConfigName.HomeLandTask)
|
||||
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local EquipStrengthen = ConfigManager.GetConfig(ConfigName.EquipStrengthen)
|
||||
local EquipRankUp = ConfigManager.GetConfig(ConfigName.EquipRankUp)
|
||||
function this.Initialize()
|
||||
this.BuildData = {}
|
||||
for _, configData in ConfigPairs(HomeLand) do
|
||||
|
@ -17,6 +19,23 @@ function this.Initialize()
|
|||
this.BuildData[configData.Id].endTime = 0 --建筑升级的结束时间
|
||||
end
|
||||
end
|
||||
this.EquipData = {}
|
||||
this.levelProId = 0
|
||||
for i = 1, 4 do
|
||||
this.EquipData[i] = {}
|
||||
this.EquipData[i].Id = 1001
|
||||
end
|
||||
|
||||
this.curEquip = 1--当前停留的装备
|
||||
end
|
||||
|
||||
--获取家园和装备强化信息
|
||||
function this.GetData(func)
|
||||
NetManager.HomeInfoRequest()
|
||||
NetManager.EquipIntensifyRequset(-1)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
--接收服务器信息
|
||||
|
@ -41,6 +60,27 @@ function this.GetServerData(msg,func)
|
|||
end
|
||||
end
|
||||
|
||||
--获取服务器装备信息
|
||||
function this.GetServerEquipData(msg,func)
|
||||
this.levelProId = msg.equipRankUp
|
||||
this.levelProId = msg.equipRankUp + 1
|
||||
-- this.levelProId = 1
|
||||
if msg.infos and #msg.infos > 0 then
|
||||
for index, value in ipairs(msg.infos) do
|
||||
-- value.lvId = 1022
|
||||
LogYellow("Location:"..tostring(value.location).." lvId:"..tostring(value.lvId).." 突破等级Id:"..tostring(this.levelProId))
|
||||
if value.location and value.location > 0 and value.location < 5 then
|
||||
this.EquipData[value.location].Id = value.lvId
|
||||
this.EquipData[value.location].configData = EquipStrengthen[value.lvId]
|
||||
this.EquipData[value.location].configPro = EquipRankUp[this.levelProId]
|
||||
end
|
||||
end
|
||||
end
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
--升级材料和前置浮生殿等级检测
|
||||
function this.ResumeCost(_data,_str,func)
|
||||
if _data.Rule and this.BuildData[_data.Rule[1]].level < _data.Rule[2] then
|
||||
|
@ -101,4 +141,55 @@ end
|
|||
-- return num
|
||||
-- end
|
||||
|
||||
--检测当前停留
|
||||
function this.GetCurIndex()
|
||||
for i = 1, 4 do
|
||||
if this.EquipData[i].configData.Limit2 == EquipRankUp[this.levelProId].Level then
|
||||
this.curEquip = i
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--检测按钮显示
|
||||
function this.GetCurIndexBtnsShow()
|
||||
-- LogBlue("this.curEquip:"..tostring(this.curEquip))
|
||||
-- LogBlue("Limit2:"..tostring(this.EquipData[this.curEquip].configData.Limit2))
|
||||
-- LogBlue("this.levelProLevel:"..tostring(EquipRankUp[this.levelProId].Level))
|
||||
return this.EquipData[this.curEquip].configData.Limit2 == EquipRankUp[this.levelProId].Level
|
||||
end
|
||||
|
||||
--检测是否全部可以突破
|
||||
function this.GetAllCanUpgrade()
|
||||
local num = 0
|
||||
for i = 1, 4 do
|
||||
if this.EquipData[i].configData.Limit2 > EquipRankUp[this.levelProId].Level then
|
||||
num = num + 1
|
||||
end
|
||||
end
|
||||
if num == 4 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--检测是否全部可以突破并提示
|
||||
function this.GetAllCanUpgradeWithPopup()
|
||||
local TEXT = {
|
||||
[1] = {"武器","r_Equip_GuardianWeapon_0004"},
|
||||
[2] = {"战甲","r_Equip_Coat_0005"},
|
||||
[3] = {"头饰","r_Equip_HeadAccessory_0005"},
|
||||
[4] = {"战靴","r_equip_Shoes_0005"},
|
||||
}
|
||||
local num = 0
|
||||
for i = 1, 4 do
|
||||
if this.EquipData[i].configData.Limit2 == EquipRankUp[this.levelProId].Level then
|
||||
PopupTipPanel.ShowTip(string.format("%s未达到最大等级,不可突破!",TEXT[i][1]))
|
||||
this.curEquip = i
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return HomeLandManager
|
|
@ -139,7 +139,7 @@ function HomeLand:BindEvent()
|
|||
end)
|
||||
--摘星阁
|
||||
Util.AddOnceClick(self.mapData[6].Obj,function ()
|
||||
PopupTipPanel.ShowTip("摘星阁")
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HomeLandEquip)
|
||||
end)
|
||||
|
||||
--产出详情框
|
||||
|
|
|
@ -696,7 +696,7 @@ function this.ExecuteLoading()
|
|||
--[[[52] =]]function() NetManager.GetLingMaiInfoRequest(0,LoadingPanel.OnStep) end, --灵脉秘境
|
||||
--[[[53] =]]function() NetManager.SendGetTailsmanSoulData(LoadingPanel.OnStep) end, --法宝之灵
|
||||
--[[[54] =]]function() NetManager.RequestArenaRankData(1,LoadingPanel.OnStep) end, --获取竞技场数据
|
||||
--[[[55] =]]function() NetManager.HomeInfoRequest(LoadingPanel.OnStep) end, --家园获取数据
|
||||
--[[[55] =]]function() HomeLandManager.GetData(LoadingPanel.OnStep) end, --家园获取数据
|
||||
function() -- 登录请求最终接口,所有请求放在此接口之前
|
||||
-- 登录成功确认
|
||||
NetManager.LoginConfimRequest()
|
||||
|
|
|
@ -6378,8 +6378,10 @@ function NetManager.HomeAllGainRequset(_id,func)
|
|||
local msg = PlayerInfoProto_pb.HomeAllGainResponse()
|
||||
msg:ParseFromString(data)
|
||||
-- UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
|
||||
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[1].itemId)
|
||||
PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[1].itemId)), msg.drop.itemlist[1].itemNum)
|
||||
if msg.drop and msg.drop.itemlist and msg.drop.itemlist[1] and msg.drop.itemlist[1].itemId then
|
||||
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[1].itemId)
|
||||
PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[1].itemId)), msg.drop.itemlist[1].itemNum)
|
||||
end
|
||||
this.HomeInfoRequest(function ()
|
||||
if func then
|
||||
func(msg)
|
||||
|
@ -6388,19 +6390,20 @@ function NetManager.HomeAllGainRequset(_id,func)
|
|||
end)
|
||||
end
|
||||
|
||||
--摘星阁装备强化
|
||||
function NetManager.EquipIntensifyRequset(_location,_upLevel,func)
|
||||
local data = PlayerInfoProto_pb.HomeAllGainRequset()
|
||||
data.location = _location
|
||||
data.upLevel = _upLevel
|
||||
--摘星阁装备强化信息请求
|
||||
function NetManager.EquipIntensifyRequset(_type,func)
|
||||
local data = PlayerInfoProto_pb.EquipIntensifyRequset()
|
||||
data.type = _type
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.EquipIntensifyRequset, MessageTypeProto_pb.EquipIntensifyResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.HomeAllGainResponse()
|
||||
local msg = PlayerInfoProto_pb.EquipIntensifyResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
HomeLandManager.GetServerEquipData(msg,function ()
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ local contentScripts = {
|
|||
[GENERAL_POPUP_TYPE.ResolveReStar] = {view = require("Modules/Popup/View/GeneralPopup_ResolveReStar"), panelName = "GeneralPopup_ResolveReStar"},
|
||||
--家园建筑详情
|
||||
[GENERAL_POPUP_TYPE.HomeLandBuildingDetail] = {view = require("Modules/Popup/View/GeneralPopup_HomeLandBuildingDetail"), panelName = "GeneralPopup_HomeLandBuildingDetail"},
|
||||
--家园装备升级
|
||||
[GENERAL_POPUP_TYPE.HomeLandEquip] = {view = require("Modules/Popup/View/GeneralPopup_HomeLandEquip"), panelName = "GeneralPopup_HomeLandEquip"},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
----- --家园装备升级 -----
|
||||
local this = {}
|
||||
local HomeLand = ConfigManager.GetConfig(ConfigName.HomeLand)
|
||||
local HomeLandLevel = ConfigManager.GetConfig(ConfigName.HomeLandLevel)
|
||||
local HomeLandTask = ConfigManager.GetConfig(ConfigName.HomeLandTask)
|
||||
local EquipStrengthen = ConfigManager.GetConfig(ConfigName.EquipStrengthen)
|
||||
local EquipRankUp = ConfigManager.GetConfig(ConfigName.EquipRankUp)
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--传入特效层级
|
||||
local sortingOrder=0
|
||||
local data=nil
|
||||
local TEXT = {
|
||||
[1] = {"武器","r_Equip_GuardianWeapon_0004"},
|
||||
[2] = {"战甲","r_Equip_Coat_0005"},
|
||||
[3] = {"头饰","r_Equip_HeadAccessory_0005"},
|
||||
[4] = {"战靴","r_equip_Shoes_0005"},
|
||||
}
|
||||
function this:InitComponent(gameObject)
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||||
this.titleText.text="摘星阁"
|
||||
this.Btn1 = Util.GetGameObject(gameObject,"Btn1")
|
||||
this.Btn2 = Util.GetGameObject(gameObject,"Btn2")
|
||||
|
||||
this.objList = {}
|
||||
for i = 1, 4 do
|
||||
this.objList[i] = {}
|
||||
this.objList[i].Obj = Util.GetGameObject(gameObject,"Content/Grid/Pre ("..i..")")
|
||||
this.objList[i].name = Util.GetGameObject(this.objList[i].Obj,"Name"):GetComponent("Text")
|
||||
this.objList[i].level = Util.GetGameObject(this.objList[i].Obj,"Num"):GetComponent("Text")
|
||||
this.objList[i].image = Util.GetGameObject(this.objList[i].Obj,"Icon"):GetComponent("Image")
|
||||
this.objList[i].mask = Util.GetGameObject(this.objList[i].Obj,"Mask")
|
||||
this.objList[i].select = Util.GetGameObject(this.objList[i].Obj,"Select")
|
||||
end
|
||||
|
||||
this.Desc = Util.GetGameObject(gameObject,"Content/Desc"):GetComponent("Text")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.Btn1,function()
|
||||
local data = HomeLandManager.EquipData[HomeLandManager.curEquip].configData
|
||||
if HomeLandManager.BuildData[data.Limit[1]].level < data.Limit[2] then
|
||||
PopupTipPanel.ShowTip(string.format("%s到达%s级可升级!",HomeLandManager.BuildData[data.Limit[1]].dataMain.Name,data.Limit[2]))
|
||||
return
|
||||
end
|
||||
NetManager.EquipIntensifyRequset(HomeLandManager.curEquip,function ()
|
||||
this:Refresh()
|
||||
end)
|
||||
end)
|
||||
Util.AddClick(this.Btn2,function()
|
||||
if HomeLandManager.GetAllCanUpgradeWithPopup() then
|
||||
this:Refresh()
|
||||
return
|
||||
end
|
||||
NetManager.EquipIntensifyRequset(0,function ()
|
||||
this:Refresh()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,_args)
|
||||
data = _args
|
||||
parent=_parent
|
||||
sortingOrder =_parent.sortingOrder
|
||||
HomeLandManager.GetCurIndex()
|
||||
this:Refresh()
|
||||
end
|
||||
|
||||
function this:Refresh()
|
||||
for i = 1, 4 do
|
||||
local go = this.objList[i]
|
||||
go.select:SetActive(i == HomeLandManager.curEquip)
|
||||
go.name.text = TEXT[i][1].."加持"
|
||||
go.level.text = HomeLandManager.EquipData[i].configData.Level
|
||||
go.image.sprite = this.spLoader:LoadSprite(TEXT[i][2])
|
||||
|
||||
|
||||
Util.AddOnceClick(go.mask,function ()
|
||||
HomeLandManager.curEquip = i
|
||||
this:Refresh()
|
||||
end)
|
||||
end
|
||||
|
||||
local bool = HomeLandManager.GetCurIndexBtnsShow()
|
||||
-- LogBlue("bool:"..tostring(bool))
|
||||
this.Btn1:SetActive(bool)
|
||||
this.Btn2:SetActive(not bool)
|
||||
|
||||
this:SetData()
|
||||
end
|
||||
|
||||
function this:SetData()
|
||||
-- LogPink(HomeLandManager.EquipData[HomeLandManager.curEquip].Id)
|
||||
local curIndex = HomeLandManager.curEquip
|
||||
local data = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id].Rate--当前装备加成
|
||||
local proData = EquipRankUp[HomeLandManager.levelProId].Rate--当前装备突破加成
|
||||
|
||||
local nextData = EquipStrengthen[HomeLandManager.EquipData[curIndex].Id + 1].Rate--下一装备加成
|
||||
local nextProData = EquipRankUp[HomeLandManager.levelProId + 1].Rate--下一装备突破加成
|
||||
|
||||
local num1 = data + proData[curIndex]
|
||||
-- LogYellow(tostring(data).." @ "..tostring(proData[curIndex]))
|
||||
local num2 = 0
|
||||
if HomeLandManager.GetAllCanUpgrade() then--如果都到达了等级上限
|
||||
num2 = data + nextProData[curIndex]
|
||||
-- LogYellow(tostring(data).." $ "..tostring(nextProData[curIndex]))
|
||||
else
|
||||
num2 = nextData + proData[curIndex]
|
||||
-- LogYellow(tostring(nextData).." # "..tostring(proData[curIndex]))
|
||||
end
|
||||
this.Desc.text = string.format("神将佩戴的%s基础属性增加%s",TEXT[curIndex][1],num1).."%"..string.format("<color=#00FF00>(%s",num2).."%)</color>"
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
HomeLandManager.curEquip = 1
|
||||
data=nil
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
this.SelectList = {}
|
||||
this.spLoader:Destroy()
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e1dbee4100b7a7b48a48f68fc680720b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -33,7 +33,7 @@ function this.InitTypeTaskList(_userMissionList)
|
|||
userMissionList.takeTimes = _userMissionList[i].takeTimes
|
||||
userMissionList.heroId = _userMissionList[i].heroId
|
||||
userMissionList.lock = _userMissionList[i].lock
|
||||
LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
|
||||
--LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
|
||||
if not TypeTaskData[_userMissionList[i].type] then
|
||||
TypeTaskData[_userMissionList[i].type] = {}
|
||||
end
|
||||
|
@ -206,7 +206,7 @@ end
|
|||
function this.RefreshTypeTaskInfo(taskInfoList)
|
||||
for i = 1, #taskInfoList do
|
||||
local taskInfo = taskInfoList[i]
|
||||
LogRed("服务器推送任务刷新type:"..taskInfo.type.."missionId:"..taskInfo.missionId.."state:"..taskInfo.state.."progress:"..taskInfo.progress.."takeTimes:"..taskInfo.takeTimes)
|
||||
--LogRed("服务器推送任务刷新type:"..taskInfo.type.."missionId:"..taskInfo.missionId.."state:"..taskInfo.state.."progress:"..taskInfo.progress.."takeTimes:"..taskInfo.takeTimes)
|
||||
this.SetTypeTaskInfo(taskInfo.type, taskInfo.missionId, taskInfo.state, taskInfo.progress, taskInfo.takeTimes,taskInfo.heroId,taskInfo.lock)
|
||||
end
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.MissionDaily.OnMissionDailyChanged)
|
||||
|
|
Loading…
Reference in New Issue