Magically import images and more into Gamecraft as blocks
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

61 lines
1.8KB

  1. using System;
  2. using System.Reflection;
  3. using System.IO;
  4. using System.Runtime.CompilerServices;
  5. using UnityEngine;
  6. using Unity.Mathematics; // float3
  7. using IllusionPlugin;
  8. using GamecraftModdingAPI.Utility;
  9. using Pixi.Audio;
  10. using Pixi.Common;
  11. using Pixi.Images;
  12. using Pixi.Robots;
  13. namespace Pixi
  14. {
  15. public class PixiPlugin : IEnhancedPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin'
  16. {
  17. public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; // Pixi
  18. // To change the name, change the project's name
  19. public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString();
  20. // To change the version, change <Version>#.#.#</Version> in Pixi.csproj
  21. // called when Gamecraft shuts down
  22. public override void OnApplicationQuit()
  23. {
  24. // Shutdown this mod
  25. Logging.LogDebug($"{Name} has shutdown");
  26. // Shutdown the Gamecraft modding API last
  27. GamecraftModdingAPI.Main.Shutdown();
  28. }
  29. // called when Gamecraft starts up
  30. public override void OnApplicationStart()
  31. {
  32. // Initialize the Gamecraft modding API first
  33. GamecraftModdingAPI.Main.Init();
  34. // check out the modding API docs here: https://mod.exmods.org/
  35. // Initialize Pixi mod
  36. CommandRoot root = new CommandRoot();
  37. // 2D Image Functionality
  38. root.Inject(new ImageCanvasImporter());
  39. root.Inject(new ImageTextBlockImporter());
  40. root.Inject(new ImageCommandImporter());
  41. // Robot functionality
  42. root.Inject(new RobotInternetImporter());
  43. //RobotCommands.CreateRobotCRFCommand();
  44. //RobotCommands.CreateRobotFileCommand();
  45. #if DEBUG
  46. // Development functionality
  47. RobotCommands.CreatePartDumpCommand();
  48. #endif
  49. // Audio functionality
  50. root.Inject(new MidiImporter());
  51. }
  52. }
  53. }