xuyuan commit

dev_chengFeng
jiaoyangna 2020-08-12 19:17:05 +08:00
parent 783583404e
commit 39fb3d113c
13 changed files with 1169 additions and 39 deletions

View File

@ -642,9 +642,9 @@ RectTransform:
m_Father: {fileID: 7783633391680431993}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 161.5, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 161.5, y: -50}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1351034079552654768
@ -2067,7 +2067,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 510, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2009070379428583229

File diff suppressed because it is too large Load Diff

View File

@ -1777,6 +1777,7 @@ GENERAL_POPUP_TYPE={
TrialBomb=18,--次元炸弹
RecruitConfirm=19,----神将召唤、限时召唤、乾坤宝盒 二次确认界面
TalismanResolve=20,--法宝回归
XuanYuanBuyTimes=21,--轩辕宝镜购买次数确认
}
--抽卡类型
@ -2006,7 +2007,7 @@ BATTLE_TYPE = {
GUILD_CAR_DELAY = 10, -- 车迟斗法
DEATH_POS = 11, -- 十绝阵
Senro = 12, --森罗幻境
Xuanyuan = 13, --轩辕宝镜
}
rankKingList={ [1] = { bgImage = "r_zjm_paihangbang_banner04", name = Language[12164] ,Id = 26 ,rankType = RANK_TYPE.FIGHT_LEVEL_RANK,activiteId = 0,isRankingMainPanelShow = true},
[2] = { bgImage = "r_zjm_paihangbang_banner02", name = Language[12165] ,Id = 55,rankType = RANK_TYPE.FORCE_CURR_RANK,activiteId = 0,isRankingMainPanelShow = true},

View File

@ -256,6 +256,7 @@ GameEvent = {
FunctionCtrl = {
OnFunctionOpen = "FunctionCtrl.OnFunctionOpen",
OnFunctionClose = "FunctionCtrl.OnFunctionClose",
OnXuanYuanFunctionChange = "FunctionCtrl.OnXuanYuanFunctionChange",
},
Guild = {
JoinGuildSuccess = "Guild.JoinGuildSuccess",

View File

@ -66,7 +66,7 @@ function this.InitMirrorData()
end
function this.UpdateMirrorState(msg)
if not msg.infos then
if not msg.infos or #msg.infos < 1 then
LogBlue("")
return
end
@ -216,24 +216,25 @@ function this.GetRewardView()
end
--开始战斗
function this.ExecuteFightBattle(id,type,func)
NetManager.StartSituationChallengeRequest(id,type,function (msg)
NetManager.StartSituationChallengeRequest(id,type,function(msg)
if type == 1 then
local fightData = BattleManager.GetBattleServerData(msg,0)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.DAILY_CHALLENGE,function(result)
if func then
func()
end
if result.result ==0 then
elseif result.result==1 then
if this.levelData[this.curType].state == 1 then
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType)
else
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
end
if result.result == 0 then
elseif result.result == 1 then
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
this.levelData[this.curType].passId = id
this.UpdateLevelState(this.curType)
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.freeTimeId, 1)
if this.levelData[this.curType].state == 1 then
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,this.curType)
else
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
end
end)
end
end)

View File

@ -70,12 +70,12 @@ end
--添加事件监听(用于子类重写)
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.UpdateCarbonContent)
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange, this.UpdateCarbonContent)
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.UpdateCarbonContent)
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange, this.UpdateCarbonContent)
end
function this:OnOpen()
@ -95,16 +95,12 @@ end
function this:GetOpenTime(id)
local str = nil
LogBlue("id:"..id)
local isFunction = false
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig,70)
if config then
LogBlue(config.Value)
for k,v in ipairs(string.split(config.Value,"|")) do
isFunction = false
LogBlue(v)
for n,m in ipairs(string.split(v,"#")) do
LogBlue("n:"..n.." m:"..m)
if tonumber(n) == 1 and tonumber(m) == id then
isFunction = true
else
@ -128,6 +124,7 @@ this.UpdateCarbonContent = function()
if not type then
return
end
LogYellow("收到消息,刷新界面")
local openFunctions = {}
for k,v in pairs(type) do
local go = Util.GetGameObject(this.gameObject, v.gameObject)

View File

@ -68,7 +68,6 @@ local difficult = {
--初始化组件(用于子类重写)
function this:InitComponent()
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
this.remainTimesTip = Util.GetGameObject(self.gameObject, "Panel/tip/remainTimesTip"):GetComponent("Text")
this.vipTips = Util.GetGameObject(self.gameObject, "Panel/tip/vipTips"):GetComponent("Text")
this.btnBack = Util.GetGameObject(self.gameObject, "Panel/BackBtn")
@ -104,15 +103,16 @@ end
--添加事件监听(用于子类重写)
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.RefreshPanel)
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange, this.RefreshPanel)
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.RefreshPanel)
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange, this.RefreshPanel)
end
this.RefreshPanel = function()
LogRed("收到消息,刷新界面")
local data = XuanYuanMirrorManager.GetMirroData(curType)
if data.passId == 0 or XuanYuanMirrorManager.GetMirrorState(curType) ~= 1 then
if data.passId == 0 then
@ -122,6 +122,8 @@ this.RefreshPanel = function()
end
this:OnClose()
UIManager.OpenPanel(UIName.XuanYuanMirrorPanel)
else
this:OnShow()
end
end
@ -207,7 +209,7 @@ function this:SetLevelData(go, data)
if XuanYuanMirrorManager.freeTime < 1 then
costNumText.gameObject:SetActive(true)
costIcon.gameObject:SetActive(true)
costNumText.text = costNum
costNumText.text =string.format("<color=#%s>%s</color>", colorText.color[data.state], costNum)
end
end
@ -224,20 +226,29 @@ function this:SetLevelData(go, data)
if BagManager.GetItemCountById(itemId) < costNum and XuanYuanMirrorManager.freeTime <= 0 then
PopupTipPanel.ShowTip(string.format(Language[10343], itemConfig[itemId].Name))
return
end
if XuanYuanMirrorManager.freeTime <= 0 then
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeData.Id,1,function()
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.buyTimeId, 1)
end)
end
if data.state == 2 then
end
if data.state == 2 then
if XuanYuanMirrorManager.freeTime <= 0 then
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeData.Id,1,function()
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.buyTimeId, 1)
end)
end
XuanYuanMirrorManager.ExecuteFightBattle(data.id,2,function()
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.freeTimeId, 1)
this:OnShow()
end)
elseif data.state == 1 then
LogGreen("curType" .. curType)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.XUANYUAN_MIRROR, curType, data)
if XuanYuanMirrorManager.freeTime <= 0 then
local func = function()
ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,storeData.Id,1,function()
PrivilegeManager.RefreshPrivilegeUsedTimes(XuanYuanMirrorManager.buyTimeId, 1)
end)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.XUANYUAN_MIRROR, curType, data)
end
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.XuanYuanBuyTimes,costNum,func)
else
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.XUANYUAN_MIRROR, curType, data)
end
end
end
end)

View File

@ -80,8 +80,7 @@ end
--- 关闭界面事件
function this.OnCloseBtnClick()
this.root.gameObject:SetActive(false)
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,XuanYuanMirrorManager.curType)
this.root:ClosePanel()
end
return this

View File

@ -657,11 +657,12 @@ function this:BindEvent()
this.ScenceBtnClick(FUNCTION_OPEN_TYPE.ARENA)
end)
Util.AddClick(this.btnColorfulWorld, function()
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.TRIAL) then
if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.TRIAL) then
PlayerManager.carbonType = 2
UIManager.OpenPanel(UIName.CarbonTypePanelV2)
else
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.TRIAL))
local config = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,FUNCTION_OPEN_TYPE.TRIAL)
PopupTipPanel.ShowTip(string.format("玩家等级达到%s级开启",config.OpenRules[2]))
end
end)
Util.AddClick(this.btnFenjie, function()

View File

@ -112,11 +112,13 @@ function this.RegisterMessage(network)
socket:RegistNetMessage(MessageTypeProto_pb.SITUATION_INFO_INDICATION, this.SiTuaTionInfoIndication)
end
function this.SiTuaTionInfoIndication()
function this.SiTuaTionInfoIndication(buffer)
local data = buffer:DataByte()
local msg =MapInfoProto_pb.SituationChallengeResponse()
local msg = MapInfoProto_pb.SituationChallengeResponse()
msg:ParseFromString(data)
LogGreen("5点到了开始刷新了,发了消息GameEvent.FunctionCtrl.OnXuanYuanFunctionClose")
XuanYuanMirrorManager.UpdateMirrorState(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange)
end
function this.RefreshActivityList(buffer)

View File

@ -45,6 +45,7 @@ local contentScripts = {
[19] = {view = require("Modules/Popup/View/GeneralPopup_RecruitConfirm"), panelName = "GeneralPopup_RecruitConfirm",type=GENERAL_POPUP_TYPE.RecruitConfirm},
--法宝回归
[20] = {view = require("Modules/Popup/View/GeneralPopup_TalismanResolve"), panelName = "GeneralPopup_TalismanResolve",type=GENERAL_POPUP_TYPE.TalismanResolve},
[21] = {view = require("Modules/Popup/View/GeneralPopup_BuyXuanYuanMirrorTims"), panelName = "GeneralPopup_BuyXuanYuanMirrorTims",type=GENERAL_POPUP_TYPE.XuanYuanBuyTimes},
}
--子模块预设
local contentPrefabs={}

View File

@ -0,0 +1,59 @@
----- 归元弹窗 -----
local this = {}
--传入父脚本模块
local parent
--层级
local sortingOrder = 0
--传入不定参
local _args = {}
local func
function this:InitComponent(gameObject)
this.titleText = Util.GetGameObject(gameObject, "TitleText"):GetComponent("Text")
this.bodyText = Util.GetGameObject(gameObject, "BodyText"):GetComponent("Text")
this.cancelBtn = Util.GetGameObject(gameObject, "CancelBtn")
this.confirmBtn = Util.GetGameObject(gameObject, "ConfirmBtn")
this.goButton = Util.GetGameObject(gameObject, "GameObject/Button")
this.root = Util.GetGameObject(gameObject, "GameObject")
end
function this:BindEvent()
Util.AddClick(this.goButton,function()
UIManager.OpenPanel(UIName.MainRechargePanel, 3)
end)
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
if func then
func()
end
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
local args = {...}
this.bodyText.text =string.format("是否消耗%s妖晶购买一次挑战次数",args[1])
func = args[2]
if XuanYuanMirrorManager.GetBuyTimesTip() then
this.root:SetActive(false)
else
this.root:SetActive(true)
end
end
function this:OnClose()
end
function this:OnDestroy()
end
return this

View File

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