global.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. global = global or {}
  2. local M = global
  3. M.frameworkCore = "mmoclient"
  4. -- ************************** init cpp ctl **************************
  5. -- init cocos2d ctl
  6. M.Director = cc.Director:getInstance()
  7. M.FileUtilCtl = cc.FileUtils:getInstance()
  8. M.Platform = cc.Application:getInstance():getTargetPlatform()
  9. M.Scheduler = M.Director:getScheduler()
  10. M.GLProgramCache = cc.GLProgramCache:getInstance()
  11. M.TextureCache = M.Director:getTextureCache()
  12. M.SpriteFrameCache = cc.SpriteFrameCache:getInstance()
  13. M.ScriptHandlerMgr = ScriptHandlerMgr:getInstance()
  14. -- init mmoclient ctl
  15. M.networkCtl = nil
  16. M.sceneGraphCtl = nil
  17. M.gamePlayerController = nil
  18. M.netPlayerController = nil
  19. M.sceneManager = nil
  20. M.actorManager = nil
  21. M.monsterManager = nil
  22. M.playerManager = nil
  23. M.npcManager = nil
  24. M.dropItemManager = nil
  25. M.sceneEffectManager = nil
  26. M.FrameAnimManager = nil
  27. M.LuaBridgeCtl = nil
  28. M.BuffManager = nil
  29. M.gameWorldController = nil
  30. M.userInputController = nil
  31. M.BehaviorController = nil
  32. M.ActorEffectManager = nil
  33. M.modBridgeController = nil
  34. M.HttpDownloader = nil -- 下载(URL)
  35. M.gameEnvironment = nil
  36. M.gameStateCtl = nil
  37. M.NativeBridgeCtl = nil
  38. M.skillManager = nil
  39. M.HUDManager = nil
  40. M.ResDownloader = nil
  41. M.JsonProtoHelper = nil
  42. M.ssrBridge = nil
  43. M.darkNodeManager = nil
  44. -- init lua global member
  45. M.Facade = nil -- pureMVC facade
  46. M.GameStateController = nil
  47. M.DesignPolicy = cc.ResolutionPolicy.FIXED_WIDTH
  48. M.ActorAttr = {}
  49. -- ************************** init cpp ctl end **************************
  50. -- ************************** world ui zOrder **************************
  51. M.UIZ =
  52. {
  53. UI_BOTTOM = -3, -- 战争迷雾最底层
  54. UI_RTOUCH = -2, -- 按键触摸层
  55. UI_MAIN = -1, -- 主界面
  56. UI_NORMAL = 1, -- 正常界面(全屏)
  57. UI_FUNC = 2, -- 功能按钮
  58. UI_LOADING = 3, -- loading层
  59. UI_TOBOX = 4, -- 弹出框
  60. UI_LOADINGBAR = 5, -- 菊花转
  61. UI_NOTICE = 6, -- 滚动层提示
  62. UI_MOUSE = 7, -- 鼠标操作层
  63. UI_MASK = 8, -- 遮盖一切
  64. }
  65. -- ************************** world ui zOrder end **************************
  66. -- macro
  67. M.isWindows = M.Platform == cc.PLATFORM_OS_WINDOWS or M.Platform == cc.PLATFORM_OS_HARMONY_PC
  68. M.isAndroid = M.Platform == cc.PLATFORM_OS_ANDROID
  69. M.isIOS = M.Platform == cc.PLATFORM_OS_IPAD or M.Platform == cc.PLATFORM_OS_IPHONE
  70. M.isOHOS = M.Platform == cc.PLATFORM_OS_HARMONY
  71. M.isMobile = M.isAndroid or M.isIOS or M.isOHOS
  72. -- play mode
  73. M.isWinPlayMode = global.CURRENT_OPERMODE == global.OPERMODE_WINDOWS
  74. -- init notice table
  75. M.NoticeTable = require( "config/NotificationTable" )
  76. -- init Proxy table
  77. M.ProxyTable = require( "config/ProxyTable" )
  78. -- init Game Constants
  79. M.MMO = require( "config/mmoConstants" )
  80. -- init MsgType
  81. require("network/netMessageDef")
  82. M.MsgType = MsgType
  83. M.JsonMsgType = require("network/jsonproto/JsonMessageTable")
  84. M.ActMessageTable = requireConfig("ActMessageTable")
  85. M.LayerTable = requireConfig("LayerTable")
  86. M.SUIComponentTable = requireConfig("SUIComponentTable")
  87. M.BehaviorConfig = requireConfig("BehaviorConfig")
  88. M.ConstantConfig = requireConfig("ConstantConfig")