ProjectLogic.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. -----------------------------------------------------
  2. -- 项目相关
  3. -- 项目名称(PROJECT_NAME):
  4. -- 闪烁战火:sszh
  5. -- 闪烁二次元:ssecy
  6. -----------------------------------------------------
  7. local Config = require("Config")
  8. local Util = require("common.Util")
  9. local Lang = require("common.Lang")
  10. local LangSszh = require("common.LangSszh")
  11. local LangSsecy = require("common.LangSsecy")
  12. -- 是否闪烁战火
  13. function isSszh()
  14. if Config.PROJECT_NAME == nil or
  15. Config.PROJECT_NAME == "sszh" then
  16. return true
  17. end
  18. end
  19. -- 是否小精灵
  20. function isSsecy()
  21. if Config.PROJECT_NAME == "ssecy" then
  22. return true
  23. end
  24. end
  25. -- 是否符合
  26. function inProjectName(projectNames)
  27. if type(projectNames) ~= "table" then
  28. assert(nil)
  29. end
  30. if Util.getTableCount(projectNames) == 0 then
  31. return true
  32. end
  33. for _, projectName in ipairs(projectNames) do
  34. if Config.PROJECT_NAME == projectName then
  35. return true
  36. end
  37. end
  38. end
  39. function initAfterHot()
  40. local tempLang = nil
  41. if isSszh() == true then
  42. tempLang = LangSszh
  43. elseif isSsecy() == true then
  44. tempLang = LangSsecy
  45. else
  46. assert(nil)
  47. end
  48. for k, v in pairs(tempLang) do
  49. if type(k) == "string" and type(v) == "string" then
  50. --print("---------", k, v, type(k), type(v))
  51. Lang[k] = v
  52. end
  53. end
  54. end