注释和删除中文

This commit is contained in:
chenxi 2023-06-20 20:18:11 +08:00
parent 594a6cced5
commit 1e8aebf944
5 changed files with 9 additions and 224 deletions

View File

@ -1684,15 +1684,13 @@ function GFunc.recycleTempMap()
end end
end end
--[[
tabLe只速 Lua error
locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg
read_onLy的机制
Lua5.3 1) table库支持调用元方法table.remove table.insert也会抛出错误,
2)_ipairs 5.3 ipairs迭代器支持访问元方法__indexpairs迭代器next不支持故需要元方法_pairs
Lua此网数不能完全按照预期工作
]]
-- 设置tabLe只速 出现改写会抛出Lua error
-- 用法locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg
-- 增加了防重置设置read_onLy的机制
-- Lua5.3支持 1) table库支持调用元方法所以table.remove table.insert也会抛出错误,
-- 2)不用定义_ipairs 5.3 ipairs迭代器支持访问元方法__indexpairs迭代器next不支持故需要元方法_pairs
-- 低版本Lua此网数不能完全按照预期工作
function GFunc.readOnlyTab(inputTable) function GFunc.readOnlyTab(inputTable)
local travelled_tables = {} local travelled_tables = {}
local function _read_only(tbl) local function _read_only(tbl)

View File

@ -1,7 +1,6 @@
--[[ -- whitelist里面的才会被热更
whitelist里面的才会被热更 -- 一个c#类对应一个lua
c#lua
]]
local WhiteList = local WhiteList =
{ {
} }

View File

@ -37,7 +37,6 @@ function TestLoginUI:onLoadRootComplete()
uiMap["test_login_ui.login_node.login_btn"]:setTouchEnable(true) uiMap["test_login_ui.login_node.login_btn"]:setTouchEnable(true)
uiMap["test_login_ui.login_node.login_btn"]:addClickListener(function() uiMap["test_login_ui.login_node.login_btn"]:addClickListener(function()
if not self.inputField.text or self.inputField.text == "" then if not self.inputField.text or self.inputField.text == "" then
GFunc.showToast("请输入账号")
return return
end end
LocalData:setDistinctId(self.inputField.text) LocalData:setDistinctId(self.inputField.text)

View File

@ -1,204 +0,0 @@
local HeroInfoCell = class("HeroInfoCell", BaseCell)
local FIELD_CELL = "app/ui/gm/cell/field_cell"
local HERO_INFO = {
-- as = 1,
heroid = 2,
level = 3,
ishero = 4,
collision_radius = 5,
group = 6,
atk = 7,
hp = 8,
def = 9,
spd = 10,
crit = 11,
crit_dmg = 12,
acc = 13,
resist = 14,
move = 15,
ultimate_skill_1 = 16,
ultimate_skill_2 = 17,
ultimate_skill_3 = 18,
passive_skill_1 = 19,
passive_skill_2 = 20,
move_factor = 21,
model_id = 22,
x = 23,
y = 24,
z = 25
}
local STRING_FIELD = {
[HERO_INFO.model_id] = true
}
local HERO_DEFAULT_INFO_DESC = {
-- [HERO_INFO.as] = "觉醒等级",
[HERO_INFO.heroid] = "英雄id",
[HERO_INFO.ishero] = "是英雄",
[HERO_INFO.collision_radius] = "碰撞半径",
[HERO_INFO.group] = "属性阵营",
[HERO_INFO.atk] = "攻击",
[HERO_INFO.hp] = "血量",
[HERO_INFO.def] = "防御",
[HERO_INFO.spd] = "行动值",
[HERO_INFO.crit] = "暴击率",
[HERO_INFO.crit_dmg] = "暴击伤害",
[HERO_INFO.acc] = "减益命中",
[HERO_INFO.resist] = "减益抵抗",
[HERO_INFO.move] = "移动速度",
[HERO_INFO.ultimate_skill_1] = "主动技能1",
[HERO_INFO.ultimate_skill_2] = "主动技能2",
[HERO_INFO.ultimate_skill_3] = "主动技能3",
[HERO_INFO.passive_skill_1] = "被动技能1",
[HERO_INFO.passive_skill_2] = "被动技能2",
[HERO_INFO.move_factor] = "减速系数",
[HERO_INFO.level] = "等级",
[HERO_INFO.model_id] = "模型ID",
[HERO_INFO.x] = "初始坐标X",
[HERO_INFO.y] = "初始坐标Y",
[HERO_INFO.z] = "初始坐标Z"
}
local HERO_FIELD_TRANS = {
["ultimate_skill_1"] = "active_skill_1",
["ultimate_skill_2"] = "active_skill_2",
["ultimate_skill_3"] = "active_skill_3",
}
function HeroInfoCell:refresh(heroInfo)
self.heroInfo = heroInfo or {}
self.filedList = {}
if not self.heroInfo.collision_radius and not self.heroInfo.hid then
local info = {}
for field, index in pairs(HERO_INFO) do
if heroInfo and heroInfo[field] then
info[field] = heroInfo[field]
else
if not STRING_FIELD[index] then
info[field] = 0
else
info[field] = ""
end
end
end
self.heroInfo = info
end
local uiMap = self:getUIMap()
uiMap["hero_info_cell.sync_btn.Text"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT).text = "配置表同步"
uiMap["hero_info_cell.clear_btn.Text"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT).text = "清除选定"
uiMap["hero_info_cell.clear_btn"]:addClickListener(function()
self:refresh()
end)
uiMap["hero_info_cell.sync_btn"]:addClickListener(function()
self:syncCfg()
end)
if not self.heroCell then
self.heroCell = CellManager:addCellComp(uiMap["hero_info_cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
end
if self.heroInfo.ishero == 1 then
self.heroCell:refreshWithHeroId(self.heroInfo.heroid, self.heroInfo.level, self.heroInfo.as or 0)
else
self.heroCell:refreshWithMonsterId(self.heroInfo.heroid)
end
if self.heroInfo.heroid <= 0 then
self.heroCell:refreshEmpty()
end
uiMap["hero_info_cell.scrollrect"]:setActive(self.heroInfo.hid == nil)
uiMap["hero_info_cell.sync_btn"]:setActive(self.heroInfo.hid == nil)
if self.heroInfo.hid ~= nil then
return
end
for k, v in pairs(self.heroInfo) do
table.insert(self.filedList, k)
end
table.sort(self.filedList, function(a, b)
return HERO_INFO[a] < HERO_INFO[b]
end)
local y = math.min(50 * #self.filedList / 5)
uiMap["hero_info_cell.scrollrect"]:setSizeDeltaY(y)
if self.fieldScrollRect then
self.fieldScrollRect:updateAllCell()
return
end
self.fieldScrollRect = uiMap["hero_info_cell.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.fieldScrollRect:clearCells()
self.fieldScrollRect:setFadeArgs(0, 0.3)
self.fieldScrollRect:addInitCallback(function()
return FIELD_CELL
end)
self.fieldScrollRect:addRefreshCallback(function(index, cell)
local field = self.filedList[index]
cell:refresh(HERO_DEFAULT_INFO_DESC[HERO_INFO[field]], self.heroInfo, field, STRING_FIELD[HERO_INFO[field]])
end)
self.fieldScrollRect:refillCells(#self.filedList)
end
function HeroInfoCell:syncCfg()
self:getHeroInfo()
if self.heroInfo then
local cfg
if self.heroInfo.ishero == 1 then
cfg = ConfigManager:getConfig("hero")[self.heroInfo.heroid]
if cfg then
for k, value in pairs(self.heroInfo) do
local field = k
if HERO_FIELD_TRANS[field] then
field = HERO_FIELD_TRANS[field]
end
if cfg[field] then
self.heroInfo[k] = cfg[field]
end
end
end
else
cfg = ConfigManager:getConfig("monster")[self.heroInfo.heroid]
if cfg then
for k, value in pairs(self.heroInfo) do
local field = k
if field == "ultimate_skill_1" then
if cfg["act_skillid"] and cfg["act_skillid"][1] then
self.heroInfo[k] = cfg["act_skillid"][1]
end
elseif field == "ultimate_skill_2" then
if cfg["act_skillid"] and cfg["act_skillid"][2] then
self.heroInfo[k] = cfg["act_skillid"][3]
end
elseif field == "ultimate_skill_3" then
if cfg["act_skillid"] and cfg["act_skillid"][3] then
self.heroInfo[k] = cfg["act_skillid"][3]
end
else
if cfg[field] then
self.heroInfo[k] = cfg[field]
end
end
end
end
end
self:refresh(self.heroInfo)
end
end
function HeroInfoCell:getHeroInfo()
if self.fieldScrollRect and not self.heroInfo.hid then
self.fieldScrollRect:getAllCellAndIndex(function(index, cell)
local k, v = cell:getKV()
self.heroInfo[k] = v
end)
end
return self.heroInfo
end
return HeroInfoCell

View File

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