A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
3.2KB

  1. using DataLoader;
  2. using HarmonyLib;
  3. using RobocraftX;
  4. using RobocraftX.CR.MainGame;
  5. using RobocraftX.GUI;
  6. using RobocraftX.Multiplayer;
  7. using Svelto.Context;
  8. using Svelto.DataStructures;
  9. using Svelto.ECS;
  10. using Svelto.ECS.GUI;
  11. using Techblox.GameSelection;
  12. using UnityEngine;
  13. using Unity.Entities;
  14. using Unity.Physics.Systems;
  15. namespace TechbloxModdingAPI.Utility
  16. {
  17. /// <summary>
  18. /// Public access to the private variables in RobocraftX.FullGameCompositionRoot
  19. /// </summary>
  20. public static class FullGameFields
  21. {
  22. public static FullGameCompositionRoot Instance
  23. {
  24. private set;
  25. get;
  26. } = null;
  27. public static MultiplayerInitParameters _multiplayerParams
  28. {
  29. get
  30. {
  31. return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue();
  32. }
  33. }
  34. public static EnginesRoot _frontEndEnginesRoot
  35. {
  36. get
  37. {
  38. return (EnginesRoot)fgcr?.Field("_frontEndEnginesRoot").GetValue();
  39. }
  40. }
  41. public static EnginesRoot _mainGameEnginesRoot
  42. {
  43. get
  44. {
  45. return (EnginesRoot)fgcr?.Field("_mainGameEnginesRoot").GetValue();
  46. }
  47. }
  48. public static World _physicsWorld
  49. {
  50. get
  51. {
  52. return (World)fgcr?.Field("_physicsWorld").GetValue();
  53. }
  54. }
  55. public static World _renderingWorld
  56. {
  57. get
  58. {
  59. return (World)fgcr?.Field("_renderingWorld").GetValue();
  60. }
  61. }
  62. public static BuildPhysicsWorld _physicsWorldSystem
  63. {
  64. get
  65. {
  66. return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
  67. }
  68. }
  69. public static UnityContext<FullGameCompositionRoot> _contextHolder
  70. {
  71. get
  72. {
  73. return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
  74. }
  75. }
  76. public static GameObject _frontEndGo
  77. {
  78. get
  79. {
  80. return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
  81. }
  82. }
  83. public static GameObject _mainGameGo
  84. {
  85. get
  86. {
  87. return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
  88. }
  89. }
  90. /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
  91. {
  92. get
  93. {
  94. return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
  95. }
  96. }*/
  97. public static LoadingScreenImplementer _loadingScreen
  98. {
  99. get
  100. {
  101. return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
  102. }
  103. }
  104. public static IDataDB _dataDb
  105. {
  106. get
  107. {
  108. return (IDataDB)fgcr?.Field("_dataDb").GetValue();
  109. }
  110. }
  111. public static ECSResourceManagers _managers
  112. {
  113. get
  114. {
  115. return (ECSResourceManagers)fgcr?.Field("_managers").GetValue();
  116. }
  117. }
  118. public static bool _isQuitting
  119. {
  120. get
  121. {
  122. return (bool)fgcr?.Field("_isQuitting").GetValue();
  123. }
  124. }
  125. public static FasterList<EGID> _deserialisedBlockMap
  126. {
  127. get
  128. {
  129. return (FasterList<EGID>) fgcr?.Field("_deserialisedBlockMap").GetValue();
  130. }
  131. }
  132. public static SveltoGUI _frontEndGUI
  133. {
  134. get
  135. {
  136. return (SveltoGUI)fgcr?.Field("_frontEndGUI").GetValue();
  137. }
  138. }
  139. public static GameSelectionData _gameSelectionData
  140. {
  141. get
  142. {
  143. return (GameSelectionData)fgcr?.Field("_gameSelectionData").GetValue();
  144. }
  145. }
  146. private static Traverse fgcr;
  147. public static void Init(FullGameCompositionRoot instance)
  148. {
  149. fgcr = new Traverse(instance);
  150. FullGameFields.Instance = instance;
  151. }
  152. }
  153. }