副本修改提交

dev_chengFeng
jiaoyangna 2020-08-05 15:00:56 +08:00
parent dd4800f657
commit c5bced9968
2 changed files with 96 additions and 33 deletions

View File

@ -79,6 +79,18 @@ local type = {
tip = string.format("<color=#BA9AC2>%s</color>",specialConfig[67].Value),
redPointType = -1
},
[2] = {
id = FUNCTION_OPEN_TYPE.PEOPLE_MIRROR, --轩辕
bg = "r_Dungeon_rendi_04",
name = "r_Dungeon_xuanyuanbaojing",
live = "m_chsm_0035_png",
livePos = Vector2(274.5, -408.1),
liveSize = Vector2(1612, 1802),
tipBg = "r_Dungeon_juqingdian",
resetTime = string.format("<color=#BA9AC2>%s</color>",specialConfig[66].Value),
tip = string.format("<color=#BA9AC2>%s</color>",specialConfig[67].Value),
redPointType = -1
},
default = {id = -1,bg = "r_Dungeon_rendi_01"}
}
}
@ -274,7 +286,7 @@ function this.UpdateCarbonContent()
end
if data.id == -1 then
Util.SetGray(v,true)
elseif data.id == FUNCTION_OPEN_TYPE.CARDELAY then
elseif data.id == FUNCTION_OPEN_TYPE.CARDELAY or data.id == FUNCTION_OPEN_TYPE.PEOPLE_MIRROR then
Util.SetGray(v,not ActTimeCtrlManager.IsQualifiled(data.id))
else
Util.SetGray(v,not ActTimeCtrlManager.SingleFuncState(data.id))
@ -352,6 +364,13 @@ function this.BtnClick(id)
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.TRIAL))
end
elseif id == FUNCTION_OPEN_TYPE.PEOPLE_MIRROR then
if ActTimeCtrlManager.IsQualifiled(id) then
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
else
local config = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,FUNCTION_OPEN_TYPE.PEOPLE_MIRROR)
PopupTipPanel.ShowTip(string.format("玩家等级达到%s级开启",config.OpenRules[2]))
end
end
end

View File

@ -1,16 +1,43 @@
require("Base/BasePanel")
XuanYuanMirrorPanel = Inherit(BasePanel)
local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig)
local this = XuanYuanMirrorPanel
local hasFresh = false
local orginLayer = 0
local type = {
[1] = {
id = FUNCTION_OPEN_TYPE.PEOPLE_MIRROR, --人杰
bg = "ui_fb_btn_jy",
name = "人杰宝镜",
gameObject = "btnRoot/circle/root/renjiebaojing" ,
redPointType = RedPointType.People_Mirror
},
[2] = {
id = FUNCTION_OPEN_TYPE.BUDDHIST_MIRROR, --佛禅
bg = "ui_fb_btn_gh",
name = "佛禅宝镜",
gameObject = "btnRoot/circle/root/fuochanbaojing" ,
redPointType = RedPointType.Buddhist_Mirror
},
[3] = {
id = FUNCTION_OPEN_TYPE.MAGIC_MIRROR, --妖灵
bg = "ui_fb_btn_sl",
name = "妖灵宝镜",
gameObject = "btnRoot/circle/root/yaolingbaojing" ,
redPointType = RedPointType.Magic_Mirror
},
[4] = {
id = FUNCTION_OPEN_TYPE.TAOIST_MIRROR, --道玄
bg = "ui_fb_btn_jq",
name = "道玄宝镜",
gameObject = "btnRoot/circle/root/daoxuanbaojing" ,
redPointType = RedPointType.Buddhist_Mirror
},
}
--初始化组件(用于子类重写)
function this:InitComponent()
--this.btnBack:SetActive(false)
this.btnYaoling = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/yaolingbaojing") -- 妖灵
this.btnRenjie = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/renjiebaojing") -- 人杰
this.btnFochan = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/fuochanbaojing") -- 佛禅
this.btnDaoxuan = Util.GetGameObject(self.gameObject, "btnRoot/circle/root/daoxuanbaojing") -- 道玄
this.btnHelp = Util.GetGameObject(self.gameObject, "btnRoot/btnhelp")
this.helpPosition = this.btnHelp:GetComponent("RectTransform").localPosition
this.btnRank = Util.GetGameObject(self.gameObject, "btnRoot/btnRank")
@ -27,30 +54,11 @@ function this:InitComponent()
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
this.AnimRoot = Util.GetGameObject(self.gameObject, "btnRoot/circle/root")
BindRedPointObject(RedPointType.Magic_Mirror, Util.GetGameObject(this.btnYaoling, "redPoint"))
BindRedPointObject(RedPointType.People_Mirror, Util.GetGameObject(this.btnRenjie, "redPoint"))
BindRedPointObject(RedPointType.Buddhist_Mirror, Util.GetGameObject(this.btnFochan, "redPoint"))
BindRedPointObject(RedPointType.Taoist_Mirror, Util.GetGameObject(this.btnDaoxuan, "redPoint"))
end
local index = 1
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.btnYaoling, function()
this:BtnAction(FUNCTION_OPEN_TYPE.MAGIC_MIRROR)
end)
Util.AddClick(this.btnRenjie, function()
this:BtnAction(FUNCTION_OPEN_TYPE.PEOPLE_MIRROR)
end)
Util.AddClick(this.btnFochan, function()
this:BtnAction(FUNCTION_OPEN_TYPE.BUDDHIST_MIRROR)
end)
Util.AddClick(this.btnDaoxuan, function()
this:BtnAction(FUNCTION_OPEN_TYPE.TAOIST_MIRROR)
end)
Util.AddClick(this.btnHelp, function()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.XuanYuanMirror,this.helpPosition.x,this.helpPosition.y)
end)
@ -64,13 +72,6 @@ function this:BindEvent()
this:OnClose()
end)
end
function this:BtnAction(_type)
if ActTimeCtrlManager.SingleFuncState(_type) then
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,_type,XuanYuanMirrorManager.GetMirrorData(_type))
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(_type))
end
end
--添加事件监听(用于子类重写)
function this:AddListener()
@ -90,6 +91,8 @@ end
--界面打开时调用(用于子类重写)
function this:OnShow(...)
this:UpdateCarbonContent()
Util.SetGray(this.btnYaoling, not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.MAGIC_MIRROR))
Util.SetGray(this.btnRenjie, not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.PEOPLE_MIRROR))
Util.SetGray(this.btnFochan, not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.BUDDHIST_MIRROR))
@ -104,6 +107,47 @@ function this:OnShow(...)
this.PlayScaleAnim()
end
function this:BtnAction(_type)
if ActTimeCtrlManager.SingleFuncState(_type) then
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,_type,XuanYuanMirrorManager.GetMirrorData(_type))
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(_type))
end
end
function this:GetOpenTime(id)
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig,68)
if config then
for k,v in ipairs(string.split(config.Value,"|")) do
for n,m in ipairs(string.split(v,"#")) do
if v[1] == id then
end
end
end
end
end
function this:UpdateCarbonContent()
if not type then
return
end
for k,v in pairs(type) do
local go = Util.GetGameObject(self.gameObject, v.gameObject)
BindRedPointObject(v.redPointType, Util.GetGameObject(go, "redPoint"))
go:GetComponent("Image").sprite = Util.LoadSprite(v.bg)
Util.GetGameObject(go, "titileBg/Text"):GetComponent("Text").text =v.name
Util.GetGameObject(go, "timeBg/Text"):GetComponent("Text").text = this:GetOpenTime(v.id)
Util.SetGray(go,not ActTimeCtrlManager.SingleFuncState(v.id))
v:GetComponent("Button").enabled = ActTimeCtrlManager.SingleFuncState(v.id)
Util.AddOnceClick(go ,function()
this.BtnClick(v.id)
end)
end
end
function this:OnSortingOrderChange()
Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.wind, self.sortingOrder - orginLayer)