Merge branch 'china/dev' into 0功能/角色战斗力计算2

# Conflicts:
#	Assets/Editor/AutoPack.cs
#	Assets/Scripts/Editor/ExcelTool/DataConfig/DataConfigWindow.cs
dev_chengFeng
gaoxin 2021-09-22 10:54:15 +08:00
commit bc659b68f8
25 changed files with 253 additions and 110 deletions

View File

@ -4,34 +4,30 @@ using System.IO;
using System;
using GameEditor.FrameTool;
using GameEditor.Util;
using System.Collections;
using System.Collections.Generic;
public class PackConfig
{
public string name;
public string scene;
public string project;
public string version;
public string bench;
public PackConfig(string _name, string _scene, string _project, string _version, string _bench)
{
name = _name;
scene = _scene;
project = _project;
version= _version;
bench = _bench;
}
}
public class AutoPack : EditorWindow
{
static string[][] PackConfig = new string[][]
{
// 内网包
new string[]{ "内网包", "Logo_gm_nosdk", "TCX_LOCAL", "china/local"},
// 专服
new string[]{ "C轮v2", "Logo_gm_nosdk", "TCX_TEST_C_V2", "china/zf_test"},
new string[]{ "灵动专服-测试", "Logo_gn_zf_test", "MHT_GN_ZF_TEST" , "china/zf_test"},
new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE3" , "china/zf_test"},
new string[]{ "喜扑", "Logo_cn_xipu", "MHT_CN_XIPU", "china/zf_test"},
new string[]{ "草花", "Logo_cn_caohua", "MHT_CN_MIDDLE_WARE" , "china/zf_test"},
new string[]{ "游心", "Logo_cn_youxin", "MHT_CN_YOUXIN", "china/zf_test"},
new string[]{ "动游", "Logo_cn_dongyou", "MHT_CN_DONGYOU", "china/zf_test"},
new string[]{ "渠道-MHT", "Logo_gn_zf_quick", "MHT_GN_ZF_QUICK", "china/zf_test"},
new string[]{ "渠道-Quick", "Logo_cn_quick", "MHT_CN_QUICK" , "china/zf_test"},
// 灵动商务
new string[]{ "灵动商务", "Logo_mht_sw", "MHT_GN_SW" , "china/mht_sw"},
//先遣
new string[]{ "跨服", "LogoChinaXQCS", "MHT_GN_KUAFU", "china/xq"},
new string[]{ "先遣-测试", "LogoChinaXQCS", "MHT_GN_XQ_TEST", "china/xq"},
new string[]{ "先遣", "LogoChinaXQ", "MHT_GN_XQ", "china/xq"},
};
static List<PackConfig> PackConfig = new List<PackConfig>();
#if UNITY_ANDROID
static string Platform = "Android";
@ -75,7 +71,26 @@ public class AutoPack : EditorWindow
ScenePath = Application.dataPath + "/LuaFramework/Scenes/";
ABPath = Application.dataPath + "/../BuildABs/" + Platform + "/";
ExportType = 2;
Chooser = new bool[PackConfig.Length];
// 加载配置
LoadConfig();
}
static void LoadConfig()
{
PackConfig.Clear();
Hashtable config = ClientConfigManager.Instance.GetAutoPackConfig();
foreach (string k in config.Keys)
{
Hashtable ht = config[k] as Hashtable;
string name = k;
string scene = ht["scene"] as string;
string project = ht["project"] as string;
string version = ht["version"] as string;
string bench = ht["bench"] as string;
PackConfig.Add(new PackConfig(name, scene, project, version, bench));
}
Chooser = new bool[PackConfig.Count];
}
/// <summary>
@ -105,7 +120,7 @@ public class AutoPack : EditorWindow
benchName = GitUtil.GetCurBenchName();
UnityEngine.Debug.Log("当前分支:" + benchName);
//创建窗口
Rect wr = new Rect(0, 0, 500, 700);
Rect wr = new Rect(0, 0, 500, 1000);
var buildWin = GetWindowWithRect<AutoPack>(wr, true);
buildWin.titleContent = new GUIContent("打包工具");
buildWin.Show();
@ -137,31 +152,31 @@ public class AutoPack : EditorWindow
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.LabelField("请选择要打的包:");
for(int i = 0; i < PackConfig.Length; i++)
for(int i = 0; i < PackConfig.Count; i++)
{
if (PackConfig[i][3].Equals(benchName))
if (PackConfig[i].bench.Equals(benchName))
{
EditorGUILayout.BeginVertical();
Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i][0], Chooser[i]);
Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i].name, Chooser[i]);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("编辑Config", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + ConfigFileName;
string tpath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[i].version + "/" + ConfigFileName;
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("编辑Version", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + VersionFileName;
string tpath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[i].version + "/" + VersionFileName;
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("编辑Gradle", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/build.gradle";
string tpath = _MomPackPath + PackConfig[i].project + "/build.gradle";
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("更新蓝鲸SDK", GUILayout.Height(20f)))
{
File.Copy(_MomPackPath + "BlueWhaleJar/app/build/outputs/aar/app-release.aar", _MomPackPath + PackConfig[i][2] + "/libs/BlueWhale.aar", true);
File.Copy(_MomPackPath + "BlueWhaleJar/app/build/outputs/aar/app-release.aar", _MomPackPath + PackConfig[i].project + "/libs/BlueWhale.aar", true);
Debug.Log("更新完成");
}
EditorGUILayout.EndHorizontal();
@ -195,16 +210,16 @@ public class AutoPack : EditorWindow
for (int i = 0; i < Chooser.Length; i++)
{
if (!Chooser[i]) continue;
string sceneFilePath = ScenePath + PackConfig[i][1];
string sceneFilePath = ScenePath + PackConfig[i].scene;
if (!File.Exists(sceneFilePath + ".unity"))
{
Debug.LogError(PackConfig[i][0] + " 未找到场景:" + sceneFilePath);
Debug.LogError(PackConfig[i].name + " 未找到场景:" + sceneFilePath);
check_result = true;
}
string momPath = _MomPackPath + PackConfig[i][2];
string momPath = _MomPackPath + PackConfig[i].project;
if (!Directory.Exists(momPath))
{
Debug.LogError(PackConfig[i][0] + " 未找到母包:" + momPath);
Debug.LogError(PackConfig[i].name + " 未找到母包:" + momPath);
check_result = true;
}
}
@ -250,7 +265,7 @@ public class AutoPack : EditorWindow
public static void CreateLogFile(int index)
{
APKPath = _MomPackPath + PackConfig[index][2] + "/APK/";
APKPath = _MomPackPath + PackConfig[index].project + "/APK/";
if (!Directory.Exists(APKPath))
{
Directory.CreateDirectory(APKPath);
@ -266,7 +281,7 @@ public class AutoPack : EditorWindow
// 导出android 工程
public static void ExportAS(int index)
{
string pName = PackConfig[index][1] + "__" + PackConfig[index][2];
string pName = PackConfig[index].scene + "__" + PackConfig[index].project;
PlayerSettings.productName = pName;
PlayerSettings.Android.useAPKExpansionFiles = isObb;
if (isObb)
@ -285,8 +300,8 @@ public class AutoPack : EditorWindow
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
// 设置需要打包的场景
string launchScene = "Assets/LuaFramework/Scenes/" + PackConfig[index][1] + ".unity";
Debug.Log(PackConfig[index][0] + ":打包场景:" + launchScene);
string launchScene = "Assets/LuaFramework/Scenes/" + PackConfig[index].scene + ".unity";
Debug.Log(PackConfig[index].name + ":打包场景:" + launchScene);
BuildPlayerOptions bpo = new BuildPlayerOptions();
bpo.locationPathName = ExportPackPath;
bpo.options = BuildOptions.None;
@ -295,8 +310,8 @@ public class AutoPack : EditorWindow
bpo.target = BuildTarget.Android;
// 调用开始打包
BuildPipeline.BuildPlayer(bpo);
Debug.Log(PackConfig[index][0] + "android工程导出路径" + ExportPackPath + "/" + pName);
Debug.Log(PackConfig[index][0] + "android工程导出完成");
Debug.Log(PackConfig[index].name + "android工程导出路径" + ExportPackPath + "/" + pName);
Debug.Log(PackConfig[index].name + "android工程导出完成");
}
static string[] ReplaceDir = new string[]
@ -312,8 +327,8 @@ public class AutoPack : EditorWindow
// 从工程中替换
private static void ReplaceFromProject(int index)
{
string fromPath = ExportPackPath + "/" + PackConfig[index][1] + "__" + PackConfig[index][2];
string toPath = _MomPackPath + PackConfig[index][2];
string fromPath = ExportPackPath + "/" + PackConfig[index].scene + "__" + PackConfig[index].project;
string toPath = _MomPackPath + PackConfig[index].project;
for (int i = 0; i < ReplaceDir.Length; i++)
{
string dir = ReplaceDir[i];
@ -334,13 +349,13 @@ public class AutoPack : EditorWindow
});
EditorUtility.ClearProgressBar();
}
Debug.Log(PackConfig[index][0] + ":母包工程资源替换完成");
Debug.Log(PackConfig[index].name + ":母包工程资源替换完成");
// 替换build-id
EditorUtility.DisplayProgressBar("重写AndroidManifest", "", 0.5f);
RewriteManifest(fromPath + "/src/main/AndroidManifest.xml", toPath + "/src/main/AndroidManifest.xml");
Debug.Log(PackConfig[index][0] + "母包Manifest修改完成");
Debug.Log(PackConfig[index].name + "母包Manifest修改完成");
EditorUtility.ClearProgressBar();
}
private static void RewriteManifest(string f, string t)
@ -387,7 +402,7 @@ public class AutoPack : EditorWindow
// 从AB包替换
private static void ReplaceFromAB(int index)
{
string toPath = _MomPackPath + PackConfig[index][2] + "/src/main/assets/Android";
string toPath = _MomPackPath + PackConfig[index].project + "/src/main/assets/Android";
if (Directory.Exists(toPath)) Directory.Delete(toPath, true);
Directory.CreateDirectory(toPath);
GameCore.FileUtils.ReplaceDir(ABPath, toPath, (string dirName, string fileName, float progress) =>
@ -395,18 +410,23 @@ public class AutoPack : EditorWindow
EditorUtility.DisplayProgressBar("正在复制:" + dirName, fileName, progress);
});
EditorUtility.ClearProgressBar();
Debug.Log(PackConfig[index][0] + "替换AB包完成");
Debug.Log(PackConfig[index].name + "替换AB包完成");
}
// 替换配置文件
private static void ReplaceConfigAndVersion(int index)
{
EditorUtility.DisplayProgressBar("替换配置文件", "", 0.5f);
string toPath = _MomPackPath + PackConfig[index][2] + "/src/main/assets/Android/";
string fromPath = _MomPackPath + PackConfig[index][2] + "/Config/";
EditorUtility.DisplayProgressBar("替换配置文件1", "", 0.5f);
string fromPath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[index].version + "/";
string toPath = _MomPackPath + PackConfig[index].project + "/Config/";
File.Copy(fromPath + ConfigFileName, toPath + ConfigFileName, true);
File.Copy(fromPath + VersionFileName, toPath + VersionFileName, true);
Debug.Log(PackConfig[index][0]+":配置文件替换完成");
EditorUtility.DisplayProgressBar("替换配置文件2", "", 0.5f);
fromPath = toPath;
toPath = _MomPackPath + PackConfig[index].project + "/src/main/assets/Android/";
File.Copy(fromPath + ConfigFileName, toPath + ConfigFileName, true);
File.Copy(fromPath + VersionFileName, toPath + VersionFileName, true);
Debug.Log(PackConfig[index].name+":配置文件替换完成");
EditorUtility.ClearProgressBar();
}
@ -414,17 +434,17 @@ public class AutoPack : EditorWindow
private static void StartGradleBuild(int index)
{
EditorUtility.DisplayProgressBar("正在生成APK", "", 0f);
GameEditor.Util.ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index][2], "gradlew assembleRelease>>" + APKPath + "/_log.txt");
GameEditor.Util.ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, "gradlew assembleRelease>>" + APKPath + "/_log.txt");
EditorUtility.DisplayProgressBar("正在导出APK", "", 1f);
string versionStr = GetAPKVersionStr(PackConfig[index][2]);
string apkFilePath = _MomPackPath + PackConfig[index][2] + "/build/outputs/apk/release/" + PackConfig[index][2] + "-release.apk";
string versionStr = GetAPKVersionStr(PackConfig[index].project);
string apkFilePath = _MomPackPath + PackConfig[index].project + "/build/outputs/apk/release/" + PackConfig[index].project + "-release.apk";
if (File.Exists(apkFilePath))
{
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk");
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk");
}
Debug.Log(PackConfig[index][0] + ":打包完成");
Debug.Log(PackConfig[index].name + ":打包完成");
EditorUtility.ClearProgressBar();
}
@ -458,17 +478,17 @@ public class AutoPack : EditorWindow
{
if (CommitToGit)
{
string versionStr = GetAPKVersionStr(PackConfig[index][2]);
string versionStr = GetAPKVersionStr(PackConfig[index].project);
EditorUtility.DisplayProgressBar("正在提交修改", "", 0f);
string printlog = ">>" + APKPath + "/_log.txt";
string[] commands = new string[]{
"echo git add ." + printlog,
"git add ." + printlog,
"echo git commit -m 'AutoPack" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git commit -m 'AutoPack" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"echo git commit -m 'AutoPack" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git commit -m 'AutoPack" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git push",
};
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index][2], commands);
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, commands);
EditorUtility.ClearProgressBar();
}

View File

@ -41,6 +41,7 @@ public class ClientConfigManager
// 获取所有的version文件列表
public string[] GetVersionList()
{
SVN_Update();
string versionPath = localPath + "/Version";
string[] list = Directory.GetDirectories(versionPath);
Debug.LogError(list.Length);
@ -50,6 +51,7 @@ public class ClientConfigManager
// 获取热更新用的配置文件
public Hashtable GetHotFixConfig()
{
SVN_Update();
string hotfixConfig = localPath + "/HotFixWindow.txt";
Hashtable config = null;
if (File.Exists(hotfixConfig))
@ -61,6 +63,33 @@ public class ClientConfigManager
return config;
}
// 获取打包工具配置文件
public Hashtable GetAutoPackConfig()
{
SVN_Update();
string hotfixConfig = localPath + "/AutoPack.txt";
Hashtable config = null;
if (File.Exists(hotfixConfig))
{
string s = File.ReadAllText(hotfixConfig);
config = MiniJSON.jsonDecode(s) as Hashtable;
}
return config;
}
// 获取校验服同步工程配置文件
public Hashtable GetFightServerConfig()
{
SVN_Update();
string hotfixConfig = localPath + "/FightServer.txt";
Hashtable config = null;
if (File.Exists(hotfixConfig))
{
string s = File.ReadAllText(hotfixConfig);
config = MiniJSON.jsonDecode(s) as Hashtable;
}
return config;
}
// 获取svn工程根目录路径
public string GetClientConfigPath()
{

View File

@ -60,6 +60,7 @@ GameEvent = {
OnResetFormationHp = "Formation.OnResetFormationHp",
-- 掉血消息
OnMapTeamHpReduce = "Formation.OnMapTeamHpReduce",
OnFormationChange1 = "OnFormationChange1",
},
Mission = {
--新增任务

View File

@ -213,15 +213,15 @@ function this.GetBaoKuData()
end
end
end
local BasicPoolId = string.split(BlessingConfigNew.BasicPoolId, "#")
--大奖和当前层数数据
for i = 1, 1100 do
if ActInfo.mission[i] then
local v = ActInfo.mission[i]
if v.missionId == 100 then
-- LogYellow("层数:"..v.progress)
actData.curLevel = v.progress
curBasicPool = BlessingConfigNew.BasicPoolId[v.progress]
curBasicPool = tonumber(BasicPoolId[v.progress])
actData.poolId = curBasicPool
curFinalPool = BlessingConfigNew.FinalPoolId
elseif v.missionId > 1000 then
local data = {}
@ -272,7 +272,7 @@ end
function this.GetLeftRewardData()
local actData = this.GetBaoKuData()
local finalCardDatas = actData.finalCardDatas
local RewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",actData.curLevel)--初始所有奖励数据
local RewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",actData.poolId)--初始所有奖励数据
local data={}
for i = 1, #RewardConfig do
data[RewardConfig[i].Id] = {}

View File

@ -64,21 +64,27 @@ end
--刷新编队数据
function this.UpdateFormation(msg)
Log("编队数量:" .. #msg.TeamPosInfo)
this.formationList = {}
-- this.curFormationIndex = this.SetCurFormationIndex()
this.curFormationIndex = 1
for i, team in ipairs(msg.TeamPosInfo) do
LogGreen("team.teamId:"..team.teamId)
local isRefresh = false
local oTeam = this.MakeAEmptyTeam(team.teamId)
for j = 1, #team.teamHeroInfos do
local teamHeroInfo = team.teamHeroInfos[j]
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
if HeroManager.GetSingleHeroData(teamHeroInfo.heroId) then
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
else
isRefresh = true
end
end
oTeam.teamPokemonInfos = {}
this.formationList[team.teamId] = oTeam
if isRefresh then
FormationManager.RefreshFormation(team.teamId, this.formationList[team.teamId].teamHeroInfos, {})
end
end
if #msg.TeamPosInfo == 0 then
@ -233,7 +239,9 @@ function this.GetFormationByID(teamId)
local _v=tonumber(v)
if teamId==_v and #this.formationList[teamId].teamHeroInfos<=0 then
for n = 1, #this.formationList[1].teamHeroInfos do
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
if HeroManager.GetSingleHeroData(this.formationList[1].teamHeroInfos.heroId) then
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
end
end
--
FormationManager.RefreshFormation(teamId, this.formationList[teamId].teamHeroInfos, {})

View File

@ -196,10 +196,12 @@ end
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange, this.RefreshPower)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange1, this.OnShow)
end
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange, this.RefreshPower)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange1, this.OnShow)
end
function this:OnSortingOrderChange()

View File

@ -93,10 +93,20 @@ function this.On_Btn2_Click()
if LengthOfTable(this.root.choosedList) < 1 then
PopupTipPanel.ShowTip("挑战编队为空")
return
end
local newteam = {}
for i = 1,#this.root.choosedList do
if HeroManager.GetSingleHeroData(this.root.choosedList[i].heroId) then
table.insert(newteam, this.root.choosedList[i])
end
end
if #newteam < 1 then
PopupTipPanel.ShowTip("挑战编队为空")
return
end
FormationManager.RefreshFormation(
this.root.curFormationIndex,
this.root.choosedList,
newteam,
FormationManager.formationList[this.root.curFormationIndex].teamPokemonInfos
)
this.StartFight()

View File

@ -93,7 +93,7 @@ function GeneralBigPopup:OnOpen(popupKey,...)
this.Mask:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
this.BG:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
this.popupKey = popupKey
this.args = ...
this.args = {...}
end
function GeneralBigPopup:OnShow()

View File

@ -35,10 +35,10 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,data)
parent=_parent
sortingOrder = _parent.sortingOrder
local args = {...}
local args = data
activityId = args[1]
activityType = args[2]
local rewardTabs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRankingReward,"ActivityId",activityId)

View File

@ -50,13 +50,16 @@ function this:BindEvent()
end
function this:BtnClick(i)
if curIndex == i then
return
end
curIndex = i
LogGreen("curIndex:"..curIndex)
this.selectBtn.transform:SetParent(tabs[i].transform)
this.selectBtn:GetComponent("RectTransform").localPosition = Vector3.zero
this.selectBtn.transform:SetAsFirstSibling()
curIndex = i
for k,v in pairs(itemList) do
v.gameObject:SetActive(false)
end
@ -69,14 +72,15 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
parent=_parent
sortingOrder = _parent.sortingOrder
local args = {...}
local args = _Data
waveId = args[1]
curType = args[2]
friendHelpHeros = args[3]
myHeros = args[4]
LogGreen("myHeros:"..#myHeros)
this:SetMyHeightPower()
this.titleText.text = FourElementName[curType]
rate = tonumber(string.format("%.2f",ConfigManager.GetConfigData(ConfigName.CampTowerSetting,1).HelpFightMax / 10000))
@ -152,6 +156,10 @@ end
function this:SetMyHeightPower()
heightPower = 0
if not myHeros or #myHeros < 1 then
heightPower = 0
return
end
for k,v in ipairs(myHeros) do
if v.warPower > heightPower then
heightPower = v.warPower

View File

@ -27,11 +27,11 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
parent=_parent
sortingOrder = _parent.sortingOrder
parent.BG:SetActive(false)
local args = {...}
local args = _Data
local curHeroData = args[1]
if not curHeroData or not HeroConfig[curHeroData.heroConfig.Id] or #HeroConfig[curHeroData.heroConfig.Id].RankupConsumeMaterial < 1 then
parent:ClosePanel()

View File

@ -48,10 +48,10 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
parent=_parent
sortingOrder = _parent.sortingOrder
local args = {...}
local args = _Data
local helpType = args[1]
local str = ConfigManager.TryGetConfigData(ConfigName.QAConfig,helpType).content
str = string.gsub(str,"{","<color=#D48A07>")

View File

@ -70,10 +70,10 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
self.parent=_parent
self.sortingOrder = _parent.sortingOrder
local args = {...}
local args = _Data
NetManager.ChoiceWishHeroRequest(nil,function ()
if args[1] then
self.curSelect = args[1]

View File

@ -26,11 +26,11 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
parent=_parent
sortingOrder = _parent.sortingOrder
parent.BG:SetActive(false)
local args = {...}
local args = _Data
local data = args[1]
for i = 1, #data do
if not attriList[i] then

View File

@ -58,11 +58,11 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local _args = {...}
local _args = _Data
data = _args[1]
func = _args[2]
self.heroList = HeroManager.GetHeroDataByPropertyAndProfession(data.FitList[1],data.FitList[2],1)

View File

@ -30,10 +30,10 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,_Data)
self.parent=_parent
self.sortingOrder = _parent.sortingOrder
local args = {...}
local args = _Data
self.actData = args[1]
self.timeText.text = string.format("概率有效期:%s ~ %s",os.date("%Y-%m-%d", self.actData.startTime),os.date("%Y-%m-%d", self.actData.endTime))
this:Refresh(true,true)

View File

@ -51,18 +51,24 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,data)
itemList={}
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
_args = {...}
_args = data
ActData = _args[1]
func = _args[2]
this.titleText.text = Language[10760]
curId = ActData.selectId or nil
local RewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",ActData.curFinalPool)
table.sort(RewardConfig, function(a, b)
if a.FloorLimit == b.FloorLimit then
return a.Id < b.Id
end
return a.FloorLimit < b.FloorLimit
end)
this.ScrollView:SetData(RewardConfig, function(index, go)
this:SetSingleData(index,go, RewardConfig[index])
end)
@ -130,15 +136,18 @@ function this:SetSingleData(index,item,data)
limit2.text = Language[10262]..data.FloorLimit..Language[10762]
t2 = false
end
-- LogRed(ActData.allData[index].rewardId..""..tostring(ActData.allData[index].progress))
if ActData.allData[index].progress > data.InitializeNum then
local aData = this.GetDataByRewardId(data.Id)
-- LogRed(aData.rewardId..""..tostring(aData.progress))
if aData.progress >= data.InitializeNum then
t3 = false
elseif ActData.allData[index].progress == data.InitializeNum and ActData.curLevel > data.InitializeNum then
t3 = false
num.text = "<color=red>"..(data.InitializeNum-ActData.allData[index].progress).."/"..data.InitializeNum.."</color>"
-- 如果是当前层选中的特殊奖励
if aData.progress == data.InitializeNum and ActData.selectId == data.Id then--and ActData.curLevel > data.InitializeNum
t3 = true
end
num.text = "<color=red>"..(data.InitializeNum-aData.progress).."/"..data.InitializeNum.."</color>"
else
t3 = true
num.text = (data.InitializeNum-ActData.allData[index].progress).."/"..data.InitializeNum
num.text = (data.InitializeNum - aData.progress).."/"..data.InitializeNum
end
num.gameObject:SetActive(t1 and t2)
@ -146,6 +155,16 @@ function this:SetSingleData(index,item,data)
end
-- 获取数量
function this.GetDataByRewardId(rId)
for k, v in ipairs(ActData.allData) do
if v.rewardId == rId then
return v
end
end
end
function this:OnClose()
end
@ -153,6 +172,7 @@ end
function this:OnDestroy()
this.spLoader:Destroy()
itemIconList={}
goList = {}
end
return this

View File

@ -44,13 +44,13 @@ end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
function this:OnShow(_parent,data)
itemList={}
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
_args = {...}
_args = data
ActData = _args[1]
func = _args[2]
this.titleText.text = Language[10763]
@ -81,7 +81,7 @@ function this:OnShow(_parent,...)
table.insert(tempData,value)
end
this.ScrollView:SetData(tempData, function(index, go)
this:SetSingleData(index,go,leftRewardData[index + (ActData.curLevel-1)*10])
this:SetSingleData(index,go,leftRewardData[index + (ActData.poolId-1)*10])
end)
end

View File

@ -482,6 +482,24 @@ end
--设置好友帮助我的英雄 以试炼类型为键
function this.SetFriendHelpHero(helpFightList,trailType)
if not trailType then
for i = 1,4 do
local team = FormationManager.GetFormationByID(i + 3000)
if this.friendHelpHero and this.friendHelpHero[i] and this.friendHelpHero[i].hero then
local newteam = {}
for k,v in ipairs(team.teamHeroInfos) do
if v.heroId == this.friendHelpHero[i].hero.dynamicId then
else
table.insert(newteam,v)
end
end
if LengthOfTable(newteam) ~= LengthOfTable(team.teamHeroInfos) then
FormationManager.RefreshFormation(
i + 3000,
newteam,
FormationManager.formationList[i + 3000].teamPokemonInfos)
end
end
end
this.friendHelpHero = {}
for k,v in ipairs(helpFightList) do
if not this.friendHelpHero[v.trailType] then
@ -493,6 +511,7 @@ function this.SetFriendHelpHero(helpFightList,trailType)
local power = HeroPowerManager.GetHeroPower(v.hero.dynamicId)
this.friendHelpHero[v.trailType].hero.warPower = power -- allAddProVal[HeroProType.WarPower]
end
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnFormationChange1)
else
if not this.friendHelpHero then
this.friendHelpHero = {}

View File

@ -138,6 +138,7 @@ local TypeUpdateFunc = {
for j = 1, #configData do
if curData.rewards[i].missionId == configData[j].Id then
curData.rewards[i].otherData.PackId = configData[j].PackId
curData.rewards[i].otherData.Sort = configData[j].Sort
curData.rewards[i].otherData.BuyDay = configData[j].BuyDay
curData.rewards[i].otherData.Name = rechargeConfig[configData[j].PackId].Name
curData.rewards[i].otherData.Reward = rechargeConfig[configData[j].PackId].RewardShow
@ -153,7 +154,7 @@ local TypeUpdateFunc = {
end
end
table.sort(curData.rewards,function (a,b)
return a.otherData.PackId < b.otherData.PackId
return a.otherData.Sort < b.otherData.Sort
end)
end,

View File

@ -143,6 +143,12 @@ function SurpriseBox:ShowSingleData(item,data,index)
end
Util.AddOnceClick(getBtn,function ()
local actData = CommonActPageManager.GetData(ActivityTypeDef.SurpriseBox)
if not actData then
PopupTipPanel.ShowTip("活动已关闭")
self:ClosePanel()
return
end
if data.progress == 1 then--完成所有条件,可购买
PayManager.Pay(data.otherData.PackId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(data.otherData.PackId)

View File

@ -69,10 +69,16 @@ end
--添加事件监听(用于子类重写)
function XunBaoMiZong:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.UpdateGoldVal, self)
end
--移除事件监听(用于子类重写)
function XunBaoMiZong:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, self.UpdateGoldVal, self)
end
function XunBaoMiZong:UpdateGoldVal()
self:Refresh()
end
function XunBaoMiZong:OnSortingOrderChange(_sortingOrder)

View File

@ -354,8 +354,8 @@ function UpView:RechargeType(_type)
JumpManager.GoJump(40014)
elseif _type == UpViewRechargeType.HuaLingFu then--跳灵兽特惠
JumpManager.GoJump(40010)
elseif _type == UpViewRechargeType.XunBaoMiZong then--寻宝迷踪->主题活动日任务
JumpManager.GoJump(40011)
elseif _type == UpViewRechargeType.XunBaoMiZong then--寻宝迷踪->惊喜礼盒
JumpManager.GoJump(36041)
elseif _type == UpViewRechargeType.GrowthAmulet or
_type == UpViewRechargeType.Yaoh or
_type == UpViewRechargeType.Panacea or

View File

@ -1,6 +1,7 @@
using GameCore;
using GameEditor.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -33,10 +34,8 @@ namespace GameEditor.Core.DataConfig
[MenuItem("Data Config/Export")]
private static void ShowConfigWin()
{
ServerBattleConfig.Clear();
ServerBattleConfig.Add("china/dev", "test");
ServerBattleConfig.Add("china/xq", "master_zh_test");
ServerBattleConfig.Add("china/zf_test", "master_zh_online_special");
// 加载配置文件
LoadConfig();
m_CurGitBench = GitUtil.GetCurBenchName();
ServerBattleConfig.TryGetValue(m_CurGitBench, out m_CurServerBattlePath);
@ -52,6 +51,21 @@ namespace GameEditor.Core.DataConfig
win.titleContent = new GUIContent("Export");
win.Show();
}
// 加载配置文件
static void LoadConfig()
{
ServerBattleConfig.Clear();
Hashtable config = ClientConfigManager.Instance.GetFightServerConfig();
foreach (string k in config.Keys)
{
Hashtable ht = config[k] as Hashtable;
string folder = ht["folder"] as string;
string bench = ht["bench"] as string;
XDebug.Log.l(folder, bench);
ServerBattleConfig.Add(bench, folder);
}
}
//提供给打包工具调用的一键导表接口
public static void PyCallBuildData()
{

View File

@ -326,7 +326,6 @@ namespace GameEditor.FrameTool {
{
//if (!string.IsNullOrEmpty(versionPath) && Directory.Exists(versionPath))
//{
ClientConfigManager.Instance.SVN_Update();
m_Files = ClientConfigManager.Instance.GetVersionList();//Directory.GetFiles(versionPath, "*.txt", SearchOption.AllDirectories);
m_Choose = new bool[m_Files.Length];
//}