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.

52 lines
2.3KB

  1. using System.Collections.Generic;
  2. using HarmonyLib;
  3. using RobocraftX.Blocks;
  4. using RobocraftX.PilotSeat;
  5. using Techblox.EngineBlock;
  6. using Techblox.ServoBlocksServer;
  7. using Techblox.WheelRigBlock;
  8. namespace CodeGenerator
  9. {
  10. internal class Program
  11. {
  12. public static void Main(string[] args)
  13. {
  14. GenerateBlockClasses();
  15. var mepig = new MakeEverythingPublicInGame();
  16. mepig.Start();
  17. }
  18. private static void GenerateBlockClasses()
  19. {
  20. var bcg = new BlockClassGenerator();
  21. bcg.Generate("Engine", null, new Dictionary<string, string>
  22. {
  23. { "engineOn", "On" }
  24. }, AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), // Simulation time properties
  25. typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent));
  26. bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary<string, string>
  27. {
  28. {"maxExtent", "MaxExtension"}
  29. },
  30. typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct));
  31. bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP");
  32. bcg.Generate("Servo", types: typeof(ServoReadOnlyTweakableComponent), renames: new Dictionary<string, string>
  33. {
  34. {"minDeviation", "MinimumAngle"},
  35. {"maxDeviation", "MaximumAngle"},
  36. {"servoVelocity", "MaximumForce"}
  37. });
  38. bcg.Generate("WheelRig", "WHEELRIG_BLOCK_BUILD_GROUP", null,
  39. typeof(WheelRigTweakableStruct), typeof(WheelRigReadOnlyStruct),
  40. typeof(WheelRigSteerableTweakableStruct), typeof(WheelRigSteerableReadOnlyStruct));
  41. bcg.Generate("Seat", "RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP", null, typeof(SeatFollowCamComponent), typeof(SeatReadOnlySettingsComponent));
  42. bcg.Generate("Piston", null, new Dictionary<string, string>
  43. {
  44. {"pistonVelocity", "MaximumForce"}
  45. }, typeof(PistonReadOnlyStruct));
  46. bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct));
  47. //bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent));
  48. }
  49. }
  50. }