2f4426de71b8d1a4e8b2b9bb70b61d43167480dd.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, oops, GameConfig, _crd;
  4. function _reportPossibleCrUseOfoops(extras) {
  5. _reporterNs.report("oops", "../../core/Oops", _context.meta, extras);
  6. }
  7. _export("GameConfig", void 0);
  8. return {
  9. setters: [function (_unresolved_) {
  10. _reporterNs = _unresolved_;
  11. }, function (_cc) {
  12. _cclegacy = _cc.cclegacy;
  13. }, function (_unresolved_2) {
  14. oops = _unresolved_2.oops;
  15. }],
  16. execute: function () {
  17. _crd = true;
  18. _cclegacy._RF.push({}, "54585zBsmtGfZEDczLG3SH5", "GameConfig", undefined);
  19. /*
  20. * @Author: dgflash
  21. * @Date: 2021-07-03 16:13:17
  22. * @LastEditors: dgflash
  23. * @LastEditTime: 2023-02-14 14:27:22
  24. */
  25. /* 游戏配置解析,对应 resources/config/config.json 配置 */
  26. _export("GameConfig", GameConfig = class GameConfig {
  27. /** 客户端版本号配置 */
  28. get version() {
  29. return this._data["config"]["version"];
  30. }
  31. /** 包名 */
  32. get package() {
  33. return this._data["config"]["package"];
  34. }
  35. /** 游戏每秒传输帧数 */
  36. get frameRate() {
  37. return this._data.config.frameRate;
  38. }
  39. /** 本地存储内容加密 key */
  40. get localDataKey() {
  41. return this._data.config.localDataKey;
  42. }
  43. /** 本地存储内容加密 iv */
  44. get localDataIv() {
  45. return this._data.config.localDataIv;
  46. }
  47. /** Http 服务器地址 */
  48. get httpServer() {
  49. return this._data.config.httpServer;
  50. }
  51. /** Http 请求超时时间 */
  52. get httpTimeout() {
  53. return this._data.config.httpTimeout;
  54. }
  55. /** 获取当前客户端支持的语言类型 */
  56. get language() {
  57. return this._data.language.type || ["zh"];
  58. }
  59. /** 获取当前客户端支持的语言 Json 配置路径 */
  60. get languagePathJson() {
  61. return this._data.language.path.json || "language/json";
  62. }
  63. /** 获取当前客户端支持的语言纹理配置路径 */
  64. get languagePathTexture() {
  65. return this._data.language.path.texture || "language/texture";
  66. }
  67. /** 默认语言 */
  68. get languageDefault() {
  69. return this._data.language.default || "zh";
  70. }
  71. /** 是否启用远程资源 */
  72. get bundleEnable() {
  73. return this._data.bundle.enable;
  74. }
  75. /** 远程资源服务器地址 */
  76. get bundleServer() {
  77. return this._data.bundle.server;
  78. }
  79. /** 远程资源名 */
  80. get bundleDefault() {
  81. return this._data.bundle.default;
  82. }
  83. /** 远程所有资源包配置 */
  84. get bundlePackages() {
  85. return this._data.bundle.packages;
  86. }
  87. /** 加载界面资源超时提示 */
  88. get loadingTimeoutGui() {
  89. return this._data.config.loadingTimeoutGui || 1000;
  90. }
  91. /** 是否开启移动设备安全区域适配 */
  92. get mobileSafeArea() {
  93. return this._data.config.mobileSafeArea || false;
  94. }
  95. /** 游戏配置数据 */
  96. get data() {
  97. return this._data;
  98. }
  99. constructor(config) {
  100. this._data = null;
  101. this._data = Object.freeze(config.json);
  102. (_crd && oops === void 0 ? (_reportPossibleCrUseOfoops({
  103. error: Error()
  104. }), oops) : oops).log.logConfig(this._data, "游戏配置");
  105. }
  106. });
  107. _cclegacy._RF.pop();
  108. _crd = false;
  109. }
  110. };
  111. });
  112. //# sourceMappingURL=2f4426de71b8d1a4e8b2b9bb70b61d43167480dd.js.map