Update - 1.4.0.73
EN: 1.4.0.73 CN: 1.4.0.74 JP: 1.4.0.77 KR: 1.4.0.80
This commit is contained in:
@@ -436,6 +436,7 @@ end
|
||||
function BaseCtrl:GetPanelParam()
|
||||
return self._panel:GetPanelParam()
|
||||
end
|
||||
local bActive_AutoFit = true
|
||||
function BaseCtrl:GetAtlasSprite(sAtlasPath, sSpriteName)
|
||||
if string.find(sAtlasPath, "/CommonEx/") ~= nil or string.find(sAtlasPath, "/Common/") ~= nil then
|
||||
printError("新版UI在换过图集做法后,从图集中取Sprite时不应出现/CommonEx/目录 或 /Common/ 目录。" .. sAtlasPath .. "," .. sSpriteName)
|
||||
@@ -445,11 +446,18 @@ function BaseCtrl:GetAtlasSprite(sAtlasPath, sSpriteName)
|
||||
local sFullPath = string.format("%sUI/CommonEx/atlas_png/%s/%s.png", sRootPath, sAtlasPath, sSpriteName)
|
||||
return GameResourceLoader.LoadAsset(ResType.Any, sFullPath, typeof(Sprite))
|
||||
end
|
||||
function BaseCtrl:GetPngSprite(sPath)
|
||||
function BaseCtrl:GetPngSprite(sPath, sSurfix, imgObj)
|
||||
if type(sPath) == "number" then
|
||||
printError("调用接口处需更新,panel id:" .. self._panel._nPanelId .. ",ctrl name:" .. self.__cname)
|
||||
return nil
|
||||
end
|
||||
if type(sPath) == "string" and sPath ~= "" and type(sSurfix) == "string" and sSurfix ~= "" then
|
||||
if bActive_AutoFit == true then
|
||||
sPath = self:_AutoFitIcon(imgObj, sPath, sSurfix)
|
||||
else
|
||||
sPath = sPath .. sSurfix
|
||||
end
|
||||
end
|
||||
if string.find(sPath, "Icon/") == nil and string.find(sPath, "Image/") == nil and string.find(sPath, "ImageAvg/") == nil and string.find(sPath, "big_sprites/") == nil then
|
||||
printError("配置表中 Icon 资源字段内容填写错误,应填路径,如:Icon/Item/item_1,panel id:" .. self._panel._nPanelId .. ",ctrl name:" .. self.__cname)
|
||||
return nil
|
||||
@@ -518,12 +526,63 @@ function BaseCtrl:SetActivityAtlasSprite(imgObj, sActivityPath, sSpriteName)
|
||||
end
|
||||
return bSuc
|
||||
end
|
||||
function BaseCtrl:SetPngSprite(imgObj, sPath)
|
||||
function BaseCtrl:SetActivityAtlasSprite_New(imgObj, sActivityPath, sSpriteName)
|
||||
local sFullPath = string.format("%sUI_Activity/%s/%s.png", sRootPath, sActivityPath, sSpriteName)
|
||||
local bSuc = NovaAPI.SetImageSprite(imgObj, sFullPath)
|
||||
if not bSuc then
|
||||
traceback(string.format("icon设置失败:%s,panel id:%s,ctrl name:%s", sFullPath, tostring(self._panel._nPanelId), tostring(self.__cname)))
|
||||
end
|
||||
return bSuc
|
||||
end
|
||||
function BaseCtrl:_AutoFitIcon(imgObj, sPath, sSurfix)
|
||||
local mapAutoFix = AllEnum.CharHeadIconSurfixAutoFit[sSurfix]
|
||||
if mapAutoFix == nil then
|
||||
return sPath .. sSurfix
|
||||
end
|
||||
local rectTransform = imgObj.gameObject:GetComponent("RectTransform")
|
||||
local nTargetWidth = rectTransform.rect.width
|
||||
local nTargetHeight = rectTransform.rect.height
|
||||
local sAutoFit, nRange
|
||||
for k, v in pairs(mapAutoFix) do
|
||||
local nMultiple_W = math.abs(nTargetWidth - v.w) / v.w
|
||||
local nMultiple_H = math.abs(nTargetHeight - v.h) / v.h
|
||||
local nMultiple = nMultiple_W >= nMultiple_H and nMultiple_W or nMultiple_H
|
||||
if nRange == nil then
|
||||
nRange = nMultiple
|
||||
sAutoFit = k
|
||||
elseif nMultiple < nRange then
|
||||
nRange = nMultiple
|
||||
sAutoFit = k
|
||||
end
|
||||
end
|
||||
if sAutoFit == nil then
|
||||
return sPath .. sSurfix
|
||||
else
|
||||
local _sPath = sPath .. sAutoFit
|
||||
local bExist = GameResourceLoader.ExistsAsset(sRootPath .. _sPath .. ".png")
|
||||
if bExist == false then
|
||||
if NovaAPI.IsEditorPlatform() == true then
|
||||
printError(string.format("抽卡角色头像 icon 自适应失败,资源缺失。%s 将 %s 自适应调整为 %s", sPath, sSurfix, sAutoFit))
|
||||
end
|
||||
_sPath = sPath .. sSurfix
|
||||
NovaAPI.SetImageColor(imgObj, Color.cyan)
|
||||
end
|
||||
return _sPath
|
||||
end
|
||||
end
|
||||
function BaseCtrl:SetPngSprite(imgObj, sPath, sSurfix)
|
||||
if type(sPath) == "number" then
|
||||
traceback("调用接口处需更新,panel id:" .. self._panel._nPanelId .. ",ctrl name:" .. self.__cname)
|
||||
NovaAPI.SetImageSpriteAsset(imgObj, nil)
|
||||
return false
|
||||
end
|
||||
if type(sPath) == "string" and sPath ~= "" and type(sSurfix) == "string" and sSurfix ~= "" then
|
||||
if bActive_AutoFit == true then
|
||||
sPath = self:_AutoFitIcon(imgObj, sPath, sSurfix)
|
||||
else
|
||||
sPath = sPath .. sSurfix
|
||||
end
|
||||
end
|
||||
if string.find(sPath, "Icon/") == nil and string.find(sPath, "Image/") == nil and string.find(sPath, "ImageAvg/") == nil and string.find(sPath, "big_sprites/") == nil and string.find(sPath, "Disc/") == nil and string.find(sPath, "Play_") == nil and string.find(sPath, "UI_Activity") == nil then
|
||||
traceback("配置表中 Icon 资源字段内容填写错误,应填路径,如:Icon/Item/item_1,panel id:" .. self._panel._nPanelId .. ",ctrl name:" .. self.__cname)
|
||||
NovaAPI.SetImageSpriteAsset(imgObj, nil)
|
||||
|
||||
@@ -63,6 +63,7 @@ local PanelDefine = {
|
||||
[PanelId.RogueBossBuildBrief] = "Game.UI.RegionBossFormationEx.RegionBossBuildPanel",
|
||||
[PanelId.Mail] = "Game.UI.Mail.MailPanel",
|
||||
[PanelId.ReceivePropsTips] = "Game.UI.ReceivePropsEx.ReceivePropsPanel",
|
||||
[PanelId.ReceivePropsNPC] = "Game.UI.ReceivePropsEx.ReceivePropsNPCPanel",
|
||||
[PanelId.Friend] = "Game.UI.FriendEx.FriendPanel",
|
||||
[PanelId.FriendCarte] = "Game.UI.FriendEx.FriendCartePanel",
|
||||
[PanelId.RoguelikeLevel] = "Game.UI.FixedRoguelikeLevelSelectEx.FixedRoguelikeLevelSelectPanel",
|
||||
@@ -75,7 +76,6 @@ local PanelDefine = {
|
||||
[PanelId.MallPopup] = "Game.UI.Mall.MallPopupPanel",
|
||||
[PanelId.MallSkinPreview] = "Game.UI.Mall.MallSkinPreviewPanel",
|
||||
[PanelId.CharShardsConvert] = "Game.UI.Mall.CharShardsConvertPanel",
|
||||
[PanelId.TravelerDuelLevelSelect] = "Game.UI.TravelerDuelLevelSelect.TravelerDuelLevelPanel",
|
||||
[PanelId.DailyInstanceLevelSelect] = "Game.UI.DailyInstanceLevelSelect.DailyInstanceLevelSelectPanel",
|
||||
[PanelId.EquipmentInstanceLevelSelect] = "Game.UI.EquipmentInstanceLevelSelect.EquipmentInstanceLevelSelectPanel",
|
||||
[PanelId.ItemTips] = "Game.UI.CommonTipsEx.ItemTipsPanel",
|
||||
@@ -104,7 +104,7 @@ local PanelDefine = {
|
||||
[PanelId.FRQuestComplete] = "Game.UI.FixedRoguelikeEx.FixedRoguelikeQuestCompletePanel",
|
||||
[PanelId.PopupSkillPanel] = "Game.UI.CommonTipsEx.PopupSkillPanel",
|
||||
[PanelId.TravelerDuelLevelQuestPanel] = "Game.UI.TravelerDuelLevelSelect.TravelerDuelQuest.TravelerDuelQuestPanel",
|
||||
[PanelId.TDBattleResultPanel] = "Game.UI.BattleResult.TDBattleResultPanel",
|
||||
[PanelId.TDBattleResultPanel] = "Game.UI.TrekkerVersus.TDBattleResultPanel",
|
||||
[PanelId.TDLevelUpgrade] = "Game.UI.TravelerDuelLevelSelect.TDClassUpgradePanel",
|
||||
[PanelId.CharacterRelation] = "Game.UI.CharacterInfoEx.CharacterPlotPanel",
|
||||
[PanelId.ExChangePanel] = "Game.UI.ExChange.ExChangePanel",
|
||||
@@ -155,6 +155,7 @@ local PanelDefine = {
|
||||
[PanelId.StarTowerShop] = "Game.UI.StarTower.StarTowerShop.StarTowerShopPanel",
|
||||
[PanelId.StarTowerBuildBriefList] = "Game.UI.StarTower.Build.StarTowerBuildBriefPanel",
|
||||
[PanelId.StarTowerBuildDetail] = "Game.UI.StarTower.Build.StarTowerBuildDetailPanel",
|
||||
[PanelId.StarTowerBuildDetailPreview] = "Game.UI.StarTower.Build.StarTowerBuildDetailPreviewPanel",
|
||||
[PanelId.BuildAttrPreview] = "Game.UI.StarTower.Build.BuildAttrPreviewPanel",
|
||||
[PanelId.FilterPopupPanel] = "Game.UI.Filter.FilterPopupPanel",
|
||||
[PanelId.DispatchPanel] = "Game.UI.Dispatch.DispatchPanel",
|
||||
@@ -188,6 +189,8 @@ local PanelDefine = {
|
||||
[PanelId.CookieBoardPanel] = "Game.UI.Play_Cookie.CookieBoardPanel",
|
||||
[PanelId.CookieGamePanel] = "Game.UI.Play_Cookie.CookieGamePanel",
|
||||
[PanelId.CookieQuestPanel] = "Game.UI.Play_Cookie.CookieQuestPanel",
|
||||
[PanelId.CookieBoardPanel_400004] = "Game.UI.Play_Cookie_400004.CookieBoardPanel",
|
||||
[PanelId.CookieGamePanel_400004] = "Game.UI.Play_Cookie_400004.CookieGamePanel",
|
||||
[PanelId.LampNoticePanel] = "Game.UI.LampNotice.LampNoticePanel",
|
||||
[PanelId.TrialLevelSelect] = "Game.UI.TrialLevelSelect.TrialLevelSelectPanel",
|
||||
[PanelId.TrialFormation] = "Game.UI.TrialLevelSelect.TrialFormationPanel",
|
||||
@@ -246,13 +249,48 @@ local PanelDefine = {
|
||||
[PanelId.DreamThemePanel] = "Game.UI.ActivityTheme.10102.DreamThemePanel",
|
||||
[PanelId.BdConvertQuestPanel] = "Game.UI.Activity.BdConvert._500001.BdConvertQuestPanel",
|
||||
[PanelId.BdConvertPanel] = "Game.UI.Activity.BdConvert._500001.BdConvertPanel",
|
||||
[PanelId.BdConvertBuildPanel] = "Game.UI.Activity.BdConvert._500001.BdConvertBuildPanel",
|
||||
[PanelId.BdConvertResultPanel] = "Game.UI.Activity.BdConvert._500001.BdConvertResultPanel",
|
||||
[PanelId.BdConvertBuildDetail] = "Game.UI.Activity.BdConvert._500001.BdConvertBuildDetailPanel",
|
||||
[PanelId.Task_10101] = "Game.UI.ActivityTheme.10101.Task.OurRegimentTaskPanel",
|
||||
[PanelId.MiningGame_400002] = "Game.UI.Play_Mining_400002.MiningGamePanel",
|
||||
[PanelId.MiningGameGuidePanel_400002] = "Game.UI.Play_Mining_400002.MiningGameGuidePanel",
|
||||
[PanelId.TowerDefenseGiveupPanel] = "Game.UI.TowerDefense.TowerDefenseGiveUpPanel"
|
||||
[PanelId.TowerDefenseGiveupPanel] = "Game.UI.TowerDefense.TowerDefenseGiveUpPanel",
|
||||
[PanelId.BreakOutThemePanel] = "Game.UI.ActivityTheme.30101.BreakOutThemePanel",
|
||||
[PanelId.Shop_30101] = "Game.UI.ActivityTheme.30101.Shop.ActivityShopPanel",
|
||||
[PanelId.ShopPopup_30101] = "Game.UI.ActivityTheme.30101.Shop.ActivityShopPopupPanel",
|
||||
[PanelId.Task_30101] = "Game.UI.ActivityTheme.30101.Task.BreakOutTaskPanel",
|
||||
[PanelId.QuestNewbie] = "Game.UI.QuestNewbie.QuestNewbiePanel",
|
||||
[PanelId.TowerDefenseTestPanel] = "Game.Editor.TowerDefense.TowerDefenseTestPanel",
|
||||
[PanelId.TowerDefenseTestResultPanel] = "Game.Editor.TowerDefense.TowerDefenseTestResultPanel",
|
||||
[PanelId.MiningGame_400003] = "Game.UI.Play_Mining.400003.MiningGamePanel",
|
||||
[PanelId.MiningGameGuidePanel_400003] = "Game.UI.Play_Mining.400003.MiningGameGuidePanel",
|
||||
[PanelId.TrekkerVersus] = "Game.UI.TrekkerVersus.TrekkerVersusPanel",
|
||||
[PanelId.ActivityLevelsSelectPanel_20101] = "Game.UI.ActivityTheme.20101.ActivityLevels.ActivityLevelsSelectPanel",
|
||||
[PanelId.ChristmasThemePanel] = "Game.UI.ActivityTheme.20101.ChristmasThemePanel",
|
||||
[PanelId.BreakOutLevelDetailPanel] = "Game.UI.Play_BreakOut_30101.BreakOutLevelDetailPanel",
|
||||
[PanelId.Shop_10103] = "Game.UI.ActivityTheme.10103.Shop.ActivityShopPanel",
|
||||
[PanelId.ShopPopup_10103] = "Game.UI.ActivityTheme.10103.Shop.ActivityShopPopupPanel",
|
||||
[PanelId.Task_10103] = "Game.UI.ActivityTheme.10103.Task.MiracleTaskPanel",
|
||||
[PanelId.Main_10103] = "Game.UI.ActivityTheme.10103.MiracleThemePanel",
|
||||
[PanelId.ActivityLevelsSelectPanel_10103] = "Game.UI.ActivityTheme.10103.ActivityLevels.ActivityLevelsSelectPanel",
|
||||
[PanelId.BreakOutResultPanel] = "Game.UI.Play_BreakOut_30101.BreakOutResultPanel",
|
||||
[PanelId.BreakOutPlayPanel] = "Game.UI.Play_BreakOut_30101.BreakOutPlayPanel",
|
||||
[PanelId.Shop_20101] = "Game.UI.ActivityTheme.20101.Shop.ActivityShopPanel",
|
||||
[PanelId.ShopPopup_20101] = "Game.UI.ActivityTheme.20101.Shop.ActivityShopPopupPanel",
|
||||
[PanelId.Task_20101] = "Game.UI.ActivityTheme.20101.Task.ChristmasTaskPanel",
|
||||
[PanelId.ActivityStory_20101] = "Game.UI.ActivityTheme.20101.Story.ChristmasStoryPanel"
|
||||
}
|
||||
if NovaAPI.GetClientChannel() == AllEnum.ChannelName.BanShu then
|
||||
end
|
||||
local sChannel = NovaAPI.GetClientChannel()
|
||||
local tbNeedTestLogin = {
|
||||
"CN_TEST_2",
|
||||
"EN_TEST_2",
|
||||
"TW_TEST_2",
|
||||
"JP_TEST_2",
|
||||
"KR_TEST_2"
|
||||
}
|
||||
if table.indexof(tbNeedTestLogin, sChannel) > 0 then
|
||||
PanelDefine[PanelId.Login] = "Game.UI.GMTool.LoginPanel_Test"
|
||||
end
|
||||
return PanelDefine
|
||||
|
||||
@@ -40,6 +40,7 @@ local PanelId = {
|
||||
Quest = 49,
|
||||
ExChangePanel = 50,
|
||||
FillMaterial = 51,
|
||||
ReceivePropsNPC = 52,
|
||||
LevelMenu = 54,
|
||||
Mainline = 55,
|
||||
RoguelikeLevel = 56,
|
||||
@@ -50,7 +51,7 @@ local PanelId = {
|
||||
StrengthPerkTipsPanel = 62,
|
||||
MonsterTips = 64,
|
||||
BtnTips = 66,
|
||||
TravelerDuelLevelSelect = 68,
|
||||
TrekkerVersus = 68,
|
||||
DailyInstanceLevelSelect = 69,
|
||||
Achievement = 71,
|
||||
MonthlyCard = 72,
|
||||
@@ -257,13 +258,41 @@ local PanelId = {
|
||||
DreamThemePanel = 194,
|
||||
BdConvertQuestPanel = 195,
|
||||
BdConvertPanel = 196,
|
||||
BdConvertBuildPanel = 197,
|
||||
BdConvertResultPanel = 197,
|
||||
Task_10101 = 351,
|
||||
MiningGame_400002 = 352,
|
||||
MiningGameGuidePanel_400002 = 353,
|
||||
BdConvertActPanel = 354,
|
||||
TowerDefenseGiveupPanel = 355,
|
||||
DatingTest = 356,
|
||||
BdConvertBuildDetail = 357
|
||||
BdConvertBuildDetail = 357,
|
||||
Shop_30101 = 358,
|
||||
ShopPopup_30101 = 359,
|
||||
BreakOutThemePanel = 360,
|
||||
Task_30101 = 361,
|
||||
QuestNewbie = 362,
|
||||
TowerDefenseTestPanel = 363,
|
||||
TowerDefenseTestResultPanel = 364,
|
||||
LoginSpReward_301011 = 365,
|
||||
LoginSpRewardPop_301011 = 366,
|
||||
MiningGame_400003 = 367,
|
||||
MiningGameGuidePanel_400003 = 368,
|
||||
ActivityLevelsSelectPanel_20101 = 369,
|
||||
StarTowerBuildDetailPreview = 370,
|
||||
ChristmasThemePanel = 371,
|
||||
BreakOutLevelDetailPanel = 372,
|
||||
Shop_10103 = 373,
|
||||
ShopPopup_10103 = 374,
|
||||
Task_10103 = 375,
|
||||
ActivityLevelsSelectPanel_10103 = 376,
|
||||
BreakOutResultPanel = 377,
|
||||
BreakOutPlayPanel = 378,
|
||||
Shop_20101 = 379,
|
||||
ShopPopup_20101 = 380,
|
||||
Task_20101 = 381,
|
||||
ActivityStory_20101 = 382,
|
||||
CookieBoardPanel_400004 = 383,
|
||||
CookieGamePanel_400004 = 384,
|
||||
Main_10103 = 385
|
||||
}
|
||||
return PanelId
|
||||
|
||||
@@ -413,6 +413,24 @@ local CreatePlayerInfoTips = function()
|
||||
objPlayerInfoPanel:_PreEnter()
|
||||
objPlayerInfoPanel:_Enter()
|
||||
end
|
||||
local ResetTouchEffect = function()
|
||||
local GameResourceLoader = require("Game.Common.Resource.GameResourceLoader")
|
||||
local ResType = GameResourceLoader.ResType
|
||||
local objMain, objSlide
|
||||
local sPathFormat = Settings.AB_ROOT_PATH .. "UI/CommonEx/TouchEffect/%s.prefab"
|
||||
local sValue_Main = ConfigTable.GetConfigValue("TouchEffect_Main")
|
||||
if type(sValue_Main) == "string" and sValue_Main ~= "" then
|
||||
objMain = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Main), typeof(GameObject), "UI")
|
||||
end
|
||||
local sValue_Slide = ConfigTable.GetConfigValue("TouchEffect_Slide")
|
||||
if type(sValue_Slide) == "string" and sValue_Main ~= "" then
|
||||
objSlide = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Slide), typeof(GameObject), "UI")
|
||||
end
|
||||
if objMain ~= nil or objSlide ~= nil then
|
||||
local trNode = mapUIRootTransform[AllEnum.SortingLayerName.Overlay]
|
||||
NovaAPI.ResetTouchEffect(trNode:Find("TouchEffectUI/fxContainer"), objMain, objSlide)
|
||||
end
|
||||
end
|
||||
function PanelManager.Init()
|
||||
local goUIRoot = GameObject.Find("==== UI ROOT ====")
|
||||
if goUIRoot ~= nil then
|
||||
@@ -448,6 +466,7 @@ function PanelManager.Init()
|
||||
local goLaunchUI = GameObject.Find("==== Builtin UI ====/LaunchUI")
|
||||
NovaAPI.CloseLaunchLoading(goLaunchUI)
|
||||
CreatePlayerInfoTips()
|
||||
ResetTouchEffect()
|
||||
end
|
||||
function PanelManager.GetUIRoot(sSortingLayerName)
|
||||
if sSortingLayerName == nil then
|
||||
|
||||
Reference in New Issue
Block a user