【本地化工具】添加不导出文件配置,gm界面不再导出翻译

dev_chengFeng
gaoxin 2021-04-09 18:02:32 +08:00
parent 26fda17758
commit 0cc7de1597
3 changed files with 61 additions and 40 deletions

View File

@ -61,44 +61,44 @@ function GMPanel:InitComponent()
--- subType 类型 Server 直接向服务器请求的GM Func 回调某个方法的GM
---
_GMConfig = {
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "12#0#%s", btnTip = Language[11170], inputTip = {Language[11171]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "20#0#%s", btnTip = Language[11172], inputTip = {Language[11173]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "16#%s#0", btnTip = Language[11174], inputTip = {Language[11175]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "15#%s#0", btnTip = Language[11176], inputTip = {Language[11177]}, callBack = this.SetSunLongScroe},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "12#0#%s", btnTip = "改名", inputTip = {"输入名称"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "20#0#%s", btnTip = "完成", inputTip = {"输入任务ID"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "16#%s#0", btnTip = "跳转", inputTip = {"输入兽潮层数"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "15#%s#0", btnTip = "获取", inputTip = {"孙龙秘宝积分"}, callBack = this.SetSunLongScroe},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "13#%s#0", btnTip = "解锁", inputTip = {"外敌ID"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "11#%s#0", btnTip = Language[10732], inputTip = {Language[11178]}, callBack = this.SetVip},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "7#%s#0", btnTip = Language[11179],inputTip = {Language[11180]}, callBack = this.LVPlayer},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "11#%s#0", btnTip = "确定", inputTip = {"输入Vip等级"}, callBack = this.SetVip},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "7#%s#0", btnTip = "角色升级",inputTip = {"输入等级"}, callBack = this.LVPlayer},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#4#%s", btnTip = "设置服务器时间", inputTip = {"例20170801190000"}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#%s#0", btnTip = "搜索地图", inputTip = {"输入地图Id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "1#%s", btnTip = Language[11181], inputTip = {Language[11182]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[12138], inputTip = {Language[12139]}, callBack = this.GetManyItems},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "4#%s", btnTip = Language[11183], inputTip = {Language[11184]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[12140], inputTip = {Language[12141]}, callBack = this.GetManyHeros},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "9#%s#0", btnTip = Language[11185], inputTip = {Language[11186]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "3#1#%s", btnTip = Language[11187], inputTip = {"id,num|id,num..."}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "14#%s#0", btnTip = Language[11174], inputTip = {Language[11188]}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[12142], inputTip = {Language[12143]}, callBack = this.AddHoly},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "8#1#1", btnTip = Language[11189], inputTip = {}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "1#%s", btnTip = "生成道具", inputTip = {"道具ID#道具数量"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成道具", inputTip = {"道具ID#道具数量|..."}, callBack = this.GetManyItems},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "4#%s", btnTip = "生成英雄", inputTip = {"英雄ID#星级"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成英雄", inputTip = {"英雄ID#星级|..."}, callBack = this.GetManyHeros},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "9#%s#0", btnTip = "通关关卡", inputTip = {"关卡id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "3#1#%s", btnTip = "发送邮件", inputTip = {"id,num|id,num..."}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "14#%s#0", btnTip = "跳转", inputTip = {"试炼副本层数"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "添加圣物", inputTip = {"输入圣物ID"}, callBack = this.AddHoly},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "8#1#1", btnTip = "通关所有关卡", inputTip = {}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "6#0#0", btnTip = "一键物品", inputTip = {""}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "22#0#0", btnTip = "一键异妖", inputTip = {""}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[11190], inputTip = {""}, callBack = this.FiveHero},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[11191], inputTip = {""}, callBack = this.GetMoney},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[11192], inputTip = {""}, callBack = this.Baowu},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[11193], inputTip = {""}, callBack = this.GetEquipe},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[12151], inputTip = {""}, callBack = this.GetAllItems},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成五个12星英雄", inputTip = {""}, callBack = this.FiveHero},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "一键很多钱", inputTip = {""}, callBack = this.GetMoney},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成顶级魂灵宝", inputTip = {""}, callBack = this.Baowu},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成顶级装备", inputTip = {""}, callBack = this.GetEquipe},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成很多物品", inputTip = {""}, callBack = this.GetAllItems},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[11194], inputTip = {Language[11195]}, callBack = this.TestJump},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "23#0#%s", btnTip = Language[11176], inputTip = {Language[11196]}, callBack = nil},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "24#%s", btnTip = Language[11197], inputTip = {Language[11198]}, callBack = nil},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[12175], inputTip = {Language[12176]}, callBack = this.TestFuncGuide},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[12285], inputTip = {""}, callBack = this.OpenRedDebug},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "跳转测试", inputTip = {"输入跳转ID"}, callBack = this.TestJump},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "23#0#%s", btnTip = "获取", inputTip = {"天宫秘宝积分"}, callBack = nil},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "24#%s", btnTip = "逍遥游", inputTip = {"类型#mapId#bossId"}, callBack = nil},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "功能引导测试", inputTip = {"请输入引导ID"}, callBack = this.TestFuncGuide},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "红点Debug", inputTip = {""}, callBack = this.OpenRedDebug},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = Language[11199], inputTip = {""}, callBack = this.GoTestBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[11200], inputTip = {Language[11201]}, callBack = this.ChallengeMonster},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[11202], inputTip = {Language[11203]}, callBack = this.RunFakeBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = Language[11204], inputTip = {Language[11205], Language[11206]}, callBack = this.RunBattleData},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = Language[11207], inputTip = {Language[11208]}, callBack = this.RunServerBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "战斗测试场景", inputTip = {""}, callBack = this.GoTestBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "挑战怪物", inputTip = {"输入怪物组id"}, callBack = this.ChallengeMonster},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "测试假战斗", inputTip = {"输入假战斗id"}, callBack = this.RunFakeBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = "演算战斗数据", inputTip = {"战斗数据", "时间戳"}, callBack = this.RunBattleData},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "演算后端战斗", inputTip = {"输入战斗id"}, callBack = this.RunServerBattle},
}
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
@ -156,7 +156,7 @@ function GMPanel:BindEvent()
end
function this.GetManyItems(text)
if text == Language[12247] then
if text == "一键装备" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
local cor = coroutine.start(function()
for k,v in (config) do
@ -169,7 +169,7 @@ function this.GetManyItems(text)
end)
return
end
if text == Language[12248] then
if text == "一键宝器" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.JewelConfig))
local cor = coroutine.start(function()
for k,v in (config) do
@ -180,7 +180,7 @@ function this.GetManyItems(text)
end)
return
end
if text == Language[12249] then
if text == "一键魂印" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
local cor = coroutine.start(function()
for k,v in (config) do
@ -193,7 +193,7 @@ function this.GetManyItems(text)
end)
return
end
if text == Language[12250] then
if text == "一键灵兽" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.SpiritAnimal))
local cor = coroutine.start(function()
for k,v in (config) do
@ -343,11 +343,11 @@ end
function this.ChallengeMonster(text)
local monsterId = tonumber(text)
if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
PopupTipPanel.ShowTip(Language[10700])
PopupTipPanel.ShowTip("编队没人,请先上人!")
else
local MonsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
if not MonsterGroup[monsterId] then
PopupTipPanel.ShowTip(Language[10704] .. monsterId .. Language[10705])
PopupTipPanel.ShowTip("怪物表id " .. monsterId .. "不存在!")
else
UIManager.OpenPanel(UIName.BattlePanel, BattleManager.GetBattleData(1, monsterId), nil, nil, nil, monsterId, nil)
end
@ -443,7 +443,7 @@ function GMPanel:OnOpen(...)
local args = {}
for i = 1, config.inputNum do
if input[i].text == "" then
PopupTipPanel.ShowTip(Language[11209])
PopupTipPanel.ShowTip("参数错误")
return
end
table.insert(args, input[i].text)
@ -455,13 +455,13 @@ function GMPanel:OnOpen(...)
if config.callBack then
config.callBack(unpack(args))
end
PopupTipPanel.ShowTip(Language[11210])
PopupTipPanel.ShowTip("GM应用成功")
end)
elseif config.subType == GMSubType.Func then
if config.callBack then
config.callBack(unpack(args))
end
PopupTipPanel.ShowTip(Language[11210])
PopupTipPanel.ShowTip("GM应用成功")
end
end)
end

View File

@ -134,7 +134,7 @@ end
function RewardBoxPanel:RefreshData()
this.selectBar:SetActive(#this.rewardGroup ~= 1)--设置顶部属性条
this.tip.text = BagManager.isBagPanel and GetLanguageStrById(Language[12287]) or GetLanguageStrById(Language[12287])--GetLanguageStrById(Language[12288])
this.tip.text = BagManager.isBagPanel and GetLanguageStrById(Language[12287]) or GetLanguageStrById(Language[12287])
RewardBoxPanel:SetGiftData()
RewardBoxPanel:SetBottom()
end

View File

@ -39,6 +39,10 @@ namespace Assets.Scripts.Editor.LanguageTool
"Assets/ManagedResources/~Lua/Logic/Network.lua",
//"Assets/ManagedResources/~Lua/Modules/DynamicActivity/ShengXingYouLi.lua"
};
private static string[] ExceptLuaPath = new string[] {
"Assets/ManagedResources/~Lua/Modules/Main/GMPanel.lua"
};
// lua数据文件路径
private static string LuaDataPath = "Assets/ManagedResources/~Lua/Common/Language.lua";
@ -608,9 +612,26 @@ namespace Assets.Scripts.Editor.LanguageTool
/// </summary>
///
private static bool IsExceptLuaPath(string path)
{
foreach(string eptName in ExceptLuaPath)
{
if (path.Replace("\\", "/").Equals(eptName))
{
return true;
}
}
return false;
}
// 遍历lua文件的每一行找到 中文数据并替换
private static void CheckLuaPath(string path)
{
if (IsExceptLuaPath(path))
{
Debug.Log("Except lua file: " + path);
return;
}
string[] lines = File.ReadAllLines(path, System.Text.Encoding.UTF8);
if (lines.Length <= 0)
{