miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_ExpeditionRepl...

77 lines
3.0 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
----- 大闹天宫 回复 和 复活节点弹窗 -----
2020-06-18 20:39:29 +08:00
local this = {}
--传入父脚本模块
local parent
local sortingOrder
local nodeType
local nodeState
local fun
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.content=Util.GetGameObject(gameObject,"content"):GetComponent("Text")
2020-06-19 16:18:05 +08:00
this.iconImage=Util.GetGameObject(gameObject,"iconImage"):GetComponent("Image")
2020-06-18 20:39:29 +08:00
this.goBtn=Util.GetGameObject(gameObject,"GoBtn")
this.goBtnText=Util.GetGameObject(gameObject,"GoBtn/Text"):GetComponent("Text")
end
function this:BindEvent()
Util.AddOnceClick(this.goBtn,function()
if fun then
fun()
fun = nil
end
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 = {...}
nodeType = _args[1]
nodeState = _args[2]
fun = _args[3]
this.RefreshPanel(nodeType,nodeState)
end
function this:OnClose()
end
function this:OnDestroy()
end
--刷新面板
function this.RefreshPanel()
2020-06-19 16:18:05 +08:00
this.iconImage.sprite = Util.LoadSprite(ConfigManager.GetConfigData(ConfigName.ExpeditionNodeConfig,nodeType).Icon)
2020-06-18 20:39:29 +08:00
if nodeType == ExpeditionNodeType.Reply then--回复节点
2021-03-02 15:49:02 +08:00
this.titleText.text="蟠桃树"
2020-06-19 16:18:05 +08:00
local num = ConfigManager.GetConfigData(ConfigName.ExpeditionSetting,1).RegeneratePercent/100
2020-06-18 20:39:29 +08:00
if nodeState == ExpeditionNodeState.No then
2021-03-02 15:49:02 +08:00
this.content.text = "挂满了千年蟠桃的蟠桃树,采摘食用可以让所有存活的神将恢复生命上限"..num.."%的生命值!"
this.goBtnText.text = "确定"
2020-06-18 20:39:29 +08:00
elseif nodeState == ExpeditionNodeState.NoPass then
2021-03-02 15:49:02 +08:00
this.content.text = "挂满了千年蟠桃的蟠桃树,采摘食用可以让所有存活的神将恢复生命上限"..num.."%的生命值,是否采摘?"
this.goBtnText.text = "前往"
2020-06-18 20:39:29 +08:00
end
elseif nodeType == ExpeditionNodeType.Resurgence then--复活节点
2021-03-02 15:49:02 +08:00
this.titleText.text="八卦炼丹炉"
2020-06-18 20:39:29 +08:00
if nodeState == ExpeditionNodeState.No then
2021-03-02 15:49:02 +08:00
this.content.text = "太上老君的炼丹炉,其中炼制着一颗能生死人肉白骨的神丹百转大还丹,可以随机复活一名阵亡的神将。如果没有阵亡的神将,则使一名随机神将恢复至满生命值。"
this.goBtnText.text = "确定"
2020-06-18 20:39:29 +08:00
elseif nodeState == ExpeditionNodeState.NoPass then
2021-03-02 15:49:02 +08:00
this.content.text = "太上老君的炼丹炉,其中炼制着一颗能生死人肉白骨的神丹百转大还丹,可以随机复活一名阵亡的神将。如果没有阵亡的神将,则使一名随机神将恢复至满生命值。"
this.goBtnText.text = "前往"
2020-06-18 20:39:29 +08:00
end
end
end
2020-06-23 18:36:24 +08:00
return this