Browse Source

Renamed all references of Gamecraft to Techblox

Except those that actually refer to the game's code
tags/v2.0.0
NorbiPeti 3 years ago
parent
commit
c914b5b393
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
51 changed files with 94 additions and 95 deletions
  1. +0
    -0
      TechbloxModdingAPI.sln
  2. +1
    -1
      TechbloxModdingAPI/App/AppEngine.cs
  3. +1
    -1
      TechbloxModdingAPI/App/AppExceptions.cs
  4. +4
    -4
      TechbloxModdingAPI/App/Client.cs
  5. +1
    -1
      TechbloxModdingAPI/App/Game.cs
  6. +1
    -1
      TechbloxModdingAPI/App/GameBuildSimEventEngine.cs
  7. +1
    -1
      TechbloxModdingAPI/App/GameGameEngine.cs
  8. +1
    -1
      TechbloxModdingAPI/App/GameMenuEngine.cs
  9. +1
    -1
      TechbloxModdingAPI/Blocks/BlockCloneEngine.cs
  10. +1
    -1
      TechbloxModdingAPI/Blocks/BlockEngine.cs
  11. +1
    -1
      TechbloxModdingAPI/Blocks/BlockEventsEngine.cs
  12. +1
    -1
      TechbloxModdingAPI/Blocks/BlockExceptions.cs
  13. +1
    -1
      TechbloxModdingAPI/Blocks/BlockIDs.cs
  14. +1
    -1
      TechbloxModdingAPI/Blocks/BlueprintEngine.cs
  15. +2
    -2
      TechbloxModdingAPI/Blocks/CustomBlockEngine.cs
  16. +1
    -1
      TechbloxModdingAPI/Blocks/MovementEngine.cs
  17. +1
    -1
      TechbloxModdingAPI/Blocks/PlacementEngine.cs
  18. +1
    -1
      TechbloxModdingAPI/Blocks/RemovalEngine.cs
  19. +1
    -1
      TechbloxModdingAPI/Blocks/RotationEngine.cs
  20. +1
    -1
      TechbloxModdingAPI/Blocks/ScalingEngine.cs
  21. +1
    -1
      TechbloxModdingAPI/Blocks/SignalEngine.cs
  22. +1
    -1
      TechbloxModdingAPI/Commands/CommandExceptions.cs
  23. +1
    -1
      TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs
  24. +1
    -1
      TechbloxModdingAPI/Events/EventExceptions.cs
  25. +3
    -3
      TechbloxModdingAPI/Events/GameActivatedComposePatch.cs
  26. +1
    -1
      TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs
  27. +1
    -1
      TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs
  28. +2
    -2
      TechbloxModdingAPI/Events/MenuActivatedPatch.cs
  29. +1
    -1
      TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs
  30. +5
    -5
      TechbloxModdingAPI/GamecraftModdingAPIException.cs
  31. +1
    -1
      TechbloxModdingAPI/Input/FakeInputEngine.cs
  32. +3
    -3
      TechbloxModdingAPI/Interface/IMGUI/Constants.cs
  33. +1
    -1
      TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs
  34. +1
    -1
      TechbloxModdingAPI/Inventory/HotbarEngine.cs
  35. +10
    -10
      TechbloxModdingAPI/Main.cs
  36. +1
    -1
      TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs
  37. +1
    -1
      TechbloxModdingAPI/Persistence/IEntitySerializer.cs
  38. +1
    -1
      TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs
  39. +1
    -1
      TechbloxModdingAPI/Persistence/SerializerManager.cs
  40. +1
    -1
      TechbloxModdingAPI/Players/PlayerEngine.cs
  41. +1
    -1
      TechbloxModdingAPI/Players/PlayerExceptions.cs
  42. +3
    -3
      TechbloxModdingAPI/Tasks/Scheduler.cs
  43. +0
    -1
      TechbloxModdingAPI/TechbloxModdingAPI.csproj
  44. +6
    -6
      TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs
  45. +2
    -2
      TechbloxModdingAPI/Tests/TestRoot.cs
  46. +1
    -1
      TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs
  47. +1
    -1
      TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs
  48. +2
    -2
      TechbloxModdingAPI/Utility/GameState.cs
  49. +1
    -1
      TechbloxModdingAPI/Utility/GameStateEngine.cs
  50. +14
    -14
      TechbloxModdingAPI/Utility/Logging.cs
  51. +2
    -2
      TechbloxModdingAPI/Utility/VersionTracking.cs

GamecraftModdingAPI.sln → TechbloxModdingAPI.sln View File


+ 1
- 1
TechbloxModdingAPI/App/AppEngine.cs View File

@@ -16,7 +16,7 @@ namespace TechbloxModdingAPI.App

public IEntityFactory Factory { set; private get; }

public string Name => "GamecraftModdingAPIAppEngine";
public string Name => "TechbloxModdingAPIAppEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/App/AppExceptions.cs View File

@@ -3,7 +3,7 @@ using System.Runtime.Serialization;

namespace TechbloxModdingAPI.App
{
public class AppException : GamecraftModdingAPIException
public class AppException : TechbloxModdingAPIException
{
public AppException()
{


+ 4
- 4
TechbloxModdingAPI/App/Client.cs View File

@@ -10,7 +10,7 @@ using TechbloxModdingAPI.Utility;
namespace TechbloxModdingAPI.App
{
/// <summary>
/// The Gamecraft application that is running this code right now.
/// The Techblox application that is running this code right now.
/// </summary>
public class Client
{
@@ -42,7 +42,7 @@ namespace TechbloxModdingAPI.App
}
/// <summary>
/// Gamecraft build version string.
/// Techblox build version string.
/// Usually this is in the form YYYY.mm.DD.HH.MM.SS
/// </summary>
/// <value>The version.</value>
@@ -75,7 +75,7 @@ namespace TechbloxModdingAPI.App
}

/// <summary>
/// Whether Gamecraft is in the Main Menu
/// Whether Techblox is in the Main Menu
/// </summary>
/// <value><c>true</c> if in menu; <c>false</c> when loading or in a game.</value>
public bool InMenu
@@ -85,7 +85,7 @@ namespace TechbloxModdingAPI.App

/// <summary>
/// Open a popup which prompts the user to click a button.
/// This reuses Gamecraft's error dialog popup
/// This reuses Techblox's error dialog popup
/// </summary>
/// <param name="popup">The popup to display. Use an instance of SingleChoicePrompt or DualChoicePrompt.</param>
public void PromptUser(Error popup)


+ 1
- 1
TechbloxModdingAPI/App/Game.cs View File

@@ -118,7 +118,7 @@ namespace TechbloxModdingAPI.App

/// <summary>
/// An event that fires right before a game returns to the main menu.
/// At this point, Gamecraft is transitioning state so many things are invalid/unstable here.
/// At this point, Techblox is transitioning state so many things are invalid/unstable here.
/// </summary>
public static event EventHandler<GameEventArgs> Exit
{


+ 1
- 1
TechbloxModdingAPI/App/GameBuildSimEventEngine.cs View File

@@ -15,7 +15,7 @@ namespace TechbloxModdingAPI.App

public event EventHandler<GameEventArgs> BuildMode;

public string Name => "GamecraftModdingAPIBuildSimEventGameEngine";
public string Name => "TechbloxModdingAPIBuildSimEventGameEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/App/GameGameEngine.cs View File

@@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.App

public event EventHandler<GameEventArgs> ExitGame;

public string Name => "GamecraftModdingAPIGameInfoMenuEngine";
public string Name => "TechbloxModdingAPIGameInfoMenuEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/App/GameMenuEngine.cs View File

@@ -17,7 +17,7 @@ namespace TechbloxModdingAPI.App
{
public IEntityFactory Factory { set; private get; }

public string Name => "GamecraftModdingAPIGameInfoGameEngine";
public string Name => "TechbloxModdingAPIGameInfoGameEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/Blocks/BlockCloneEngine.cs View File

@@ -100,7 +100,7 @@ namespace TechbloxModdingAPI.Blocks
}
}

public string Name { get; } = "GamecraftModdingAPIBlockCloneGameEngine";
public string Name { get; } = "TechbloxModdingAPIBlockCloneGameEngine";
public bool isRemovable { get; } = false;
}
}

+ 1
- 1
TechbloxModdingAPI/Blocks/BlockEngine.cs View File

@@ -24,7 +24,7 @@ namespace TechbloxModdingAPI.Blocks
/// </summary>
public partial class BlockEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIBlockGameEngine";
public string Name { get; } = "TechbloxModdingAPIBlockGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 1
- 1
TechbloxModdingAPI/Blocks/BlockEventsEngine.cs View File

@@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.Blocks
{
}

public string Name { get; } = "GamecraftModdingAPIBlockEventsEngine";
public string Name { get; } = "TechbloxModdingAPIBlockEventsEngine";
public bool isRemovable { get; } = false;

private bool shouldAddRemove;


+ 1
- 1
TechbloxModdingAPI/Blocks/BlockExceptions.cs View File

@@ -4,7 +4,7 @@ using TechbloxModdingAPI;

namespace TechbloxModdingAPI.Blocks
{
public class BlockException : GamecraftModdingAPIException
public class BlockException : TechbloxModdingAPIException
{
public BlockException()
{


+ 1
- 1
TechbloxModdingAPI/Blocks/BlockIDs.cs View File

@@ -6,7 +6,7 @@ namespace TechbloxModdingAPI.Blocks
public enum BlockIDs : ushort
{
/// <summary>
/// Called "nothing" in Gamecraft. (DBID.NOTHING)
/// Called "nothing" in Techblox. (DBID.NOTHING)
/// </summary>
Invalid = ushort.MaxValue,
Cube = 0,


+ 1
- 1
TechbloxModdingAPI/Blocks/BlueprintEngine.cs View File

@@ -248,7 +248,7 @@ namespace TechbloxModdingAPI.Blocks
clipboardManager.DecrementRefCount(blueprintID);
}

public string Name { get; } = "GamecraftModdingAPIBlueprintGameEngine";
public string Name { get; } = "TechbloxModdingAPIBlueprintGameEngine";
public bool isRemovable { get; } = false;

[HarmonyPatch]


+ 2
- 2
TechbloxModdingAPI/Blocks/CustomBlockEngine.cs View File

@@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks
{
public class CustomBlockEntityDescriptor : SerializableEntityDescriptor<CustomBlockEntityDescriptor._CustomBlockDescriptor>
{
[HashName("GamecraftModdingAPICustomBlockV0")]
[HashName("TechbloxModdingAPICustomBlockV0")]
public class _CustomBlockDescriptor : IEntityDescriptor
{
public IComponentBuilder[] componentsToBuild { get; } =
@@ -57,7 +57,7 @@ namespace TechbloxModdingAPI.Blocks
_registeredBlocks.Add((id, name));
}

public string Name { get; } = "GamecraftModdingAPICustomBlockEngine";
public string Name { get; } = "TechbloxModdingAPICustomBlockEngine";
public bool isRemovable { get; } = false;
public IEntityFactory Factory { get; set; }
}*/

+ 1
- 1
TechbloxModdingAPI/Blocks/MovementEngine.cs View File

@@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks
/// </summary>
public class MovementEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIMovementGameEngine";
public string Name { get; } = "TechbloxModdingAPIMovementGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 1
- 1
TechbloxModdingAPI/Blocks/PlacementEngine.cs View File

@@ -80,7 +80,7 @@ namespace TechbloxModdingAPI.Blocks
return structInitializer;
}

public string Name => "GamecraftModdingAPIPlacementGameEngine";
public string Name => "TechbloxModdingAPIPlacementGameEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/Blocks/RemovalEngine.cs View File

@@ -38,7 +38,7 @@ namespace TechbloxModdingAPI.Blocks
{
}

public string Name { get; } = "GamecraftModdingAPIRemovalGameEngine";
public string Name { get; } = "TechbloxModdingAPIRemovalGameEngine";

public bool isRemovable => false;



+ 1
- 1
TechbloxModdingAPI/Blocks/RotationEngine.cs View File

@@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Blocks
/// </summary>
public class RotationEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIRotationGameEngine";
public string Name { get; } = "TechbloxModdingAPIRotationGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 1
- 1
TechbloxModdingAPI/Blocks/ScalingEngine.cs View File

@@ -23,7 +23,7 @@ namespace TechbloxModdingAPI.Blocks
{
}

public string Name { get; } = "GamecraftModdingAPIScalingEngine";
public string Name { get; } = "TechbloxModdingAPIScalingEngine";
public bool isRemovable { get; } = false;
private EntityManager _entityManager; //Unity entity manager


+ 1
- 1
TechbloxModdingAPI/Blocks/SignalEngine.cs View File

@@ -16,7 +16,7 @@ namespace TechbloxModdingAPI.Blocks
public const float HIGH = 1.0f;
public const float ZERO = 0.0f;

public string Name { get; } = "GamecraftModdingAPISignalGameEngine";
public string Name { get; } = "TechbloxModdingAPISignalGameEngine";

public EntitiesDB entitiesDB { set; private get; }


+ 1
- 1
TechbloxModdingAPI/Commands/CommandExceptions.cs View File

@@ -1,7 +1,7 @@
using System;
namespace TechbloxModdingAPI.Commands
{
public class CommandException : GamecraftModdingAPIException
public class CommandException : TechbloxModdingAPIException
{
public CommandException() : base() {}



+ 1
- 1
TechbloxModdingAPI/Commands/CommandRegistrationHelper.cs View File

@@ -10,7 +10,7 @@ using RobocraftX.CommandLine.Custom;
namespace TechbloxModdingAPI.Commands
{
/// <summary>
/// Convenient methods for registering commands to Gamecraft.
/// Convenient methods for registering commands to Techblox.
/// All methods register to the command line and console block by default.
/// </summary>
public static class CommandRegistrationHelper


+ 1
- 1
TechbloxModdingAPI/Events/EventExceptions.cs View File

@@ -1,7 +1,7 @@
using System;
namespace TechbloxModdingAPI.Events
{
public class EventException : GamecraftModdingAPIException
public class EventException : TechbloxModdingAPIException
{
public EventException()
{


+ 3
- 3
TechbloxModdingAPI/Events/GameActivatedComposePatch.cs View File

@@ -34,18 +34,18 @@ namespace TechbloxModdingAPI.Events
// so all event emitters and handlers must be re-registered.
EventManager.RegisterEngines(enginesRoot);
Logging.Log("Dispatching Game Activated event");
EventManager.GetEventEmitter("GamecraftModdingAPIGameActivatedEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIGameActivatedEventEmitter").Emit();
if (IsGameSwitching)
{
IsGameSwitching = false;
Logging.Log("Dispatching Game Switched To event");
EventManager.GetEventEmitter("GamecraftModdingAPIGameSwitchedToEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIGameSwitchedToEventEmitter").Emit();
}
if (IsGameReloading)
{
IsGameReloading = false;
Logging.Log("Dispatching Game Reloaded event");
EventManager.GetEventEmitter("GamecraftModdingAPIGameReloadedEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIGameReloadedEventEmitter").Emit();
}
}



+ 1
- 1
TechbloxModdingAPI/Events/GameStateBuildEmitterEngine.cs View File

@@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Events
[Obsolete]
public class GameStateBuildEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeStoppedModeEntered
{
public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ;
public string Name { get; } = "TechbloxModdingAPIGameStateBuildEventEmitter" ;

public EntitiesDB entitiesDB { set; private get; }



+ 1
- 1
TechbloxModdingAPI/Events/GameStateSimulationEmitterEngine.cs View File

@@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Events
[Obsolete]
public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeRunningModeEntered
{
public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ;
public string Name { get; } = "TechbloxModdingAPIGameStateSimulationEventEmitter" ;

public EntitiesDB entitiesDB { set; private get; }



+ 2
- 2
TechbloxModdingAPI/Events/MenuActivatedPatch.cs View File

@@ -33,10 +33,10 @@ namespace TechbloxModdingAPI.Events
FullGameFields.Init(__instance);
//Application.Application.SetFullGameCompositionRoot(__instance);
Logging.Log("Dispatching App Init event");
EventManager.GetEventEmitter("GamecraftModdingAPIApplicationInitializedEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIApplicationInitializedEventEmitter").Emit();
}
Logging.Log("Dispatching Menu Activated event");
EventManager.GetEventEmitter("GamecraftModdingAPIMenuActivatedEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIMenuActivatedEventEmitter").Emit();
}
}
}

+ 1
- 1
TechbloxModdingAPI/Events/MenuSwitchedToPatch.cs View File

@@ -22,7 +22,7 @@ namespace TechbloxModdingAPI.Events
{
// Event emitters and handlers should already be registered by MenuActivated event
Logging.Log("Dispatching Menu Switched To event");
EventManager.GetEventEmitter("GamecraftModdingAPIMenuSwitchedToEventEmitter").Emit();
EventManager.GetEventEmitter("TechbloxModdingAPIMenuSwitchedToEventEmitter").Emit();
}
}
}

+ 5
- 5
TechbloxModdingAPI/GamecraftModdingAPIException.cs View File

@@ -3,21 +3,21 @@ using System.Runtime.Serialization;

namespace TechbloxModdingAPI
{
public class GamecraftModdingAPIException : Exception
public class TechbloxModdingAPIException : Exception
{
public GamecraftModdingAPIException()
public TechbloxModdingAPIException()
{
}

public GamecraftModdingAPIException(string message) : base(message)
public TechbloxModdingAPIException(string message) : base(message)
{
}

public GamecraftModdingAPIException(string message, Exception innerException) : base(message, innerException)
public TechbloxModdingAPIException(string message, Exception innerException) : base(message, innerException)
{
}

protected GamecraftModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context)
protected TechbloxModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}


+ 1
- 1
TechbloxModdingAPI/Input/FakeInputEngine.cs View File

@@ -12,7 +12,7 @@ namespace TechbloxModdingAPI.Input
{
public class FakeInputEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIFakeInputEngine";
public string Name { get; } = "TechbloxModdingAPIFakeInputEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 3
- 3
TechbloxModdingAPI/Interface/IMGUI/Constants.cs View File

@@ -22,9 +22,9 @@ namespace TechbloxModdingAPI.Interface.IMGUI
private static GUISkin _default = null;
/// <summary>
/// Best-effort imitation of Gamecraft's UI style.
/// Best-effort imitation of Techblox's UI style.
/// </summary>
public static GUISkin Default
public static GUISkin Default //TODO: Update to Techblox style
{
get
{
@@ -122,7 +122,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI
_defaultCompletion++;
};
_blueBackground = new Texture2D(1, 1);
_blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Gamecraft Blue */);
_blueBackground.SetPixel(0, 0, new Color(0.004f, 0.522f, 0.847f) /* Techblox Blue */);
_blueBackground.Apply();
_grayBackground = new Texture2D(1, 1);
_grayBackground.SetPixel(0, 0, new Color(0.745f, 0.745f, 0.745f) /* Gray */);


+ 1
- 1
TechbloxModdingAPI/Interface/IMGUI/IMGUIManager.cs View File

@@ -20,7 +20,7 @@ namespace TechbloxModdingAPI.Interface.IMGUI
/// </summary>
public static class IMGUIManager
{
internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("GamecraftModdingAPI_IMGUIScheduler");
internal static OnGuiRunner ImguiScheduler = new OnGuiRunner("TechbloxModdingAPI_IMGUIScheduler");
private static Dictionary<string, UIElement> _activeElements = new Dictionary<string,UIElement>();



+ 1
- 1
TechbloxModdingAPI/Inventory/HotbarEngine.cs View File

@@ -18,7 +18,7 @@ namespace TechbloxModdingAPI.Inventory
{
public class HotbarEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIHotbarGameEngine";
public string Name { get; } = "TechbloxModdingAPIHotbarGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 10
- 10
TechbloxModdingAPI/Main.cs View File

@@ -31,7 +31,7 @@ namespace TechbloxModdingAPI

/// <summary>
/// Initializes the TechbloxModdingAPI.
/// Call this as soon as possible after Gamecraft starts up.
/// Call this as soon as possible after Techblox starts up.
/// Ideally, this should be called from your main Plugin class's OnApplicationStart() method.
/// </summary>
public static void Init()
@@ -43,7 +43,7 @@ namespace TechbloxModdingAPI
Logging.LogWarning("TechbloxModdingAPI.Main.Init() called but API is already initialized!");
return;
}
Logging.MetaDebugLog($"Patching Gamecraft");
Logging.MetaDebugLog($"Patching Techblox");
var currentAssembly = Assembly.GetExecutingAssembly();
harmony = new Harmony(currentAssembly.GetName().Name);
try
@@ -53,7 +53,7 @@ namespace TechbloxModdingAPI
catch (Exception e)
{ //Can't use ErrorBuilder or Logging.LogException (which eventually uses ErrorBuilder) yet
Logging.Log(e.ToString());
Logging.LogWarning("Failed to patch Gamecraft. Attempting to patch to display error...");
Logging.LogWarning("Failed to patch Techblox. Attempting to patch to display error...");
harmony.Patch(AccessTools.Method(typeof(FullGameCompositionRoot), "OnContextInitialized")
.MakeGenericMethod(typeof(UnityContext<FullGameCompositionRoot>)),
new HarmonyMethod(((Action) OnPatchError).Method)); //Can't use lambdas here :(
@@ -67,12 +67,12 @@ namespace TechbloxModdingAPI
Utility.VersionTracking.Init();
// create default event emitters
Logging.MetaDebugLog($"Initializing Events");
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.ApplicationInitialized, "GamecraftModdingAPIApplicationInitializedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Menu, "GamecraftModdingAPIMenuActivatedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.MenuSwitchedTo, "GamecraftModdingAPIMenuSwitchedToEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Game, "GamecraftModdingAPIGameActivatedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameReloaded, "GamecraftModdingAPIGameReloadedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameSwitchedTo, "GamecraftModdingAPIGameSwitchedToEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.ApplicationInitialized, "TechbloxModdingAPIApplicationInitializedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Menu, "TechbloxModdingAPIMenuActivatedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.MenuSwitchedTo, "TechbloxModdingAPIMenuSwitchedToEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.Game, "TechbloxModdingAPIGameActivatedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameReloaded, "TechbloxModdingAPIGameReloadedEventEmitter", false));
EventManager.AddEventEmitter(new SimpleEventEmitterEngine(EventType.GameSwitchedTo, "TechbloxModdingAPIGameSwitchedToEventEmitter", false));
EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.buildEngine);
EventManager.AddEventEmitter(GameHostTransitionDeterministicGroupEnginePatch.simEngine);
#pragma warning restore 0612,0618
@@ -100,7 +100,7 @@ namespace TechbloxModdingAPI

/// <summary>
/// Shuts down & cleans up the TechbloxModdingAPI.
/// Call this as late as possible before Gamecraft quits.
/// Call this as late as possible before Techblox quits.
/// Ideally, this should be called from your main Plugin class's OnApplicationQuit() method.
/// </summary>
public static void Shutdown()


+ 1
- 1
TechbloxModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs View File

@@ -17,7 +17,7 @@ namespace TechbloxModdingAPI.Persistence
{
internal static EntitiesDB entitiesDB = null;

private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0");
private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0TechbloxModdingAPI\0\0\0");

public static void Prefix(ref ISerializationData ____serializationData, ref FasterList<byte> ____bytesStream, ref IEntitySerialization ____entitySerializer, bool ____spawnBlocksOnly)
{


+ 1
- 1
TechbloxModdingAPI/Persistence/IEntitySerializer.cs View File

@@ -8,7 +8,7 @@ using TechbloxModdingAPI.Utility;
namespace TechbloxModdingAPI.Persistence
{
/// <summary>
/// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC).
/// Entity serializer and deserializer interface for storing and retrieving data in a Techblox save file (GameSave.GC).
/// </summary>
public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine
{


+ 1
- 1
TechbloxModdingAPI/Persistence/SaveGameEnginePatch.cs View File

@@ -15,7 +15,7 @@ namespace TechbloxModdingAPI.Persistence
//[HarmonyPatch] - TODO
class SaveGameEnginePatch
{
private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0GamecraftModdingAPI\0\0\0");
private static readonly byte[] frameStart = Encoding.UTF8.GetBytes("\0\0\0TechbloxModdingAPI\0\0\0");

public static void Postfix(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer)
{


+ 1
- 1
TechbloxModdingAPI/Persistence/SerializerManager.cs View File

@@ -11,7 +11,7 @@ namespace TechbloxModdingAPI.Persistence
/// <summary>
/// Keeps track of serializers.
/// This is used to add and retrieve serializers.
/// Added IEntitySerializations are used in serializing and deserializing Gamecraft save files (GameSave.GC).
/// Added IEntitySerializations are used in serializing and deserializing Techblox save files (GameSave.GC).
/// </summary>
public static class SerializerManager
{


+ 1
- 1
TechbloxModdingAPI/Players/PlayerEngine.cs View File

@@ -26,7 +26,7 @@ namespace TechbloxModdingAPI.Players
{
internal class PlayerEngine : IApiEngine, IFactoryEngine
{
public string Name { get; } = "GamecraftModdingAPIPlayerGameEngine";
public string Name { get; } = "TechbloxModdingAPIPlayerGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 1
- 1
TechbloxModdingAPI/Players/PlayerExceptions.cs View File

@@ -1,7 +1,7 @@
using System;
namespace TechbloxModdingAPI.Players
{
public class PlayerException : GamecraftModdingAPIException
public class PlayerException : TechbloxModdingAPIException
{
public PlayerException()
{


+ 3
- 3
TechbloxModdingAPI/Tasks/Scheduler.cs View File

@@ -32,9 +32,9 @@ namespace TechbloxModdingAPI.Tasks
}
}

public static readonly Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner extraLeanRunner = new Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner("GamecraftModdingAPIExtraLean");
public static readonly Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner extraLeanRunner = new Svelto.Tasks.ExtraLean.Unity.UpdateMonoRunner("TechbloxModdingAPIExtraLean");

public static readonly Svelto.Tasks.Lean.Unity.UpdateMonoRunner leanRunner = new Svelto.Tasks.Lean.Unity.UpdateMonoRunner("GamecraftModdingAPILean");
public static readonly Svelto.Tasks.Lean.Unity.UpdateMonoRunner leanRunner = new Svelto.Tasks.Lean.Unity.UpdateMonoRunner("TechbloxModdingAPILean");

/// <summary>
/// Schedule a task to run asynchronously.
@@ -42,7 +42,7 @@ namespace TechbloxModdingAPI.Tasks
/// </summary>
/// <param name="toRun">The task to run</param>
/// <param name="extraLean">Schedule toRun on an extra lean runner?</param>
/// <param name="ui">Schedule toRun on Gamecraft's built-in UI task runner?</param>
/// <param name="ui">Schedule toRun on Techblox's built-in UI task runner?</param>
public static void Schedule(ISchedulable toRun, bool extraLean = false, bool ui = false)
{
if (extraLean)


+ 0
- 1
TechbloxModdingAPI/TechbloxModdingAPI.csproj View File

@@ -8,7 +8,6 @@
<PackageProjectUrl>https://git.exmods.org/modtainers/GamecraftModdingAPI</PackageProjectUrl>
<NeutralLanguage>en-CA</NeutralLanguage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>GamecraftModdingAPI</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>


+ 6
- 6
TechbloxModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs View File

@@ -55,7 +55,7 @@ namespace TechbloxModdingAPI.Tests
/// Modding API implemented as a standalone IPA Plugin.
/// Ideally, TechbloxModdingAPI should be loaded by another mod; not itself
/// </summary>
public class GamecraftModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin
public class TechbloxModdingAPIPluginTest : IllusionPlugin.IEnhancedPlugin
{

private static Harmony harmony { get; set; }
@@ -64,7 +64,7 @@ namespace TechbloxModdingAPI.Tests

public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString();

public string HarmonyID { get; } = "org.git.exmods.modtainers.gamecraftmoddingapi";
public string HarmonyID { get; } = "org.git.exmods.modtainers.techbloxmoddingapi";

public override void OnApplicationQuit()
{
@@ -367,16 +367,16 @@ namespace TechbloxModdingAPI.Tests
}

// dependency test
if (Dependency.Hell("GamecraftScripting", new Version("0.0.1.0")))
if (Dependency.Hell("TechbloxScripting", new Version("0.0.1.0")))
{
Logging.LogWarning("You're in GamecraftScripting dependency hell");
Logging.LogWarning("You're in TechbloxScripting dependency hell");
}
else
{
Logging.Log("Compatible GamecraftScripting detected");
Logging.Log("Compatible TechbloxScripting detected");
}
// Interface test
/*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "GamecraftModdingAPI_UITestGroup", true);
/*Interface.IMGUI.Group uiGroup = new Group(new Rect(20, 20, 200, 500), "TechbloxModdingAPI_UITestGroup", true);
Interface.IMGUI.Button button = new Button("TEST");
button.OnClick += (b, __) => { Logging.MetaDebugLog($"Click on {((Interface.IMGUI.Button)b).Name}");};
Interface.IMGUI.Button button2 = new Button("TEST2");


+ 2
- 2
TechbloxModdingAPI/Tests/TestRoot.cs View File

@@ -21,7 +21,7 @@ namespace TechbloxModdingAPI.Tests
{
public static bool AutoShutdown = true;

public const string ReportFile = "GamecraftModdingAPI_tests.log";
public const string ReportFile = "TechbloxModdingAPI_tests.log";

private static bool _testsPassed = false;

@@ -283,7 +283,7 @@ namespace TechbloxModdingAPI.Tests
Logging.MetaLog("Starting test run");
// log metadata
Assert.Log($"Unity {Application.unityVersion}");
Assert.Log($"Gamecraft {Application.version}");
Assert.Log($"Techblox {Application.version}");
Assert.Log($"TechbloxModdingAPI {Assembly.GetExecutingAssembly().GetName().Version}");
Assert.Log($"Testing {asm.GetName().Name} {asm.GetName().Version}");
Assert.Log($"START: --- {DateTime.Now.ToString()} --- ({testTypes.Count} tests classes detected)");


+ 1
- 1
TechbloxModdingAPI/Utility/AsyncUtilsEngine.cs View File

@@ -57,7 +57,7 @@ namespace TechbloxModdingAPI.Utility
{
}

public string Name { get; } = "GamecraftModdingAPIAsyncUtilsGameEngine";
public string Name { get; } = "TechbloxModdingAPIAsyncUtilsGameEngine";
public bool isRemovable { get; } = false;
}
}

+ 1
- 1
TechbloxModdingAPI/Utility/DebugInterfaceEngine.cs View File

@@ -31,7 +31,7 @@ namespace TechbloxModdingAPI.Utility
public void SetInfo(string id, Func<string> contentGetter) => _extraInfo[id] = contentGetter;
public bool RemoveInfo(string id) => _extraInfo.Remove(id);

public string Name => "GamecraftModdingAPIDebugInterfaceGameEngine";
public string Name => "TechbloxModdingAPIDebugInterfaceGameEngine";
public bool isRemovable => true;

[HarmonyPatch]


+ 2
- 2
TechbloxModdingAPI/Utility/GameState.cs View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace TechbloxModdingAPI.Utility
{
/// <summary>
/// Utility to get the state of the current Gamecraft game
/// Utility to get the state of the current Techblox game
/// </summary>
public static class GameState
{
@@ -34,7 +34,7 @@ namespace TechbloxModdingAPI.Utility
/// <summary>
/// Is a game loaded?
/// </summary>
/// <returns>Whether Gamecraft has a game open (false = Main Menu)</returns>
/// <returns>Whether Techblox has a game open (false = Main Menu)</returns>
public static bool IsInGame()
{
return gameEngine.IsInGame;


+ 1
- 1
TechbloxModdingAPI/Utility/GameStateEngine.cs View File

@@ -12,7 +12,7 @@ namespace TechbloxModdingAPI.Utility
{
class GameStateEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine";
public string Name { get; } = "TechbloxModdingAPIGameStateGameEngine";

public EntitiesDB entitiesDB { set; private get; }



+ 14
- 14
TechbloxModdingAPI/Utility/Logging.cs View File

@@ -9,8 +9,8 @@ using System.Threading.Tasks;
namespace TechbloxModdingAPI.Utility
{
/// <summary>
/// Utility class to access Gamecraft's built-in logging capabilities.
/// The log is saved to %APPDATA%\..\LocalLow\FreeJam\Gamecraft\Player.Log
/// Utility class to access Techblox's built-in logging capabilities.
/// The log is saved to %APPDATA%\..\LocalLow\FreeJam\Techblox\Player.Log
/// </summary>
public static class Logging
{
@@ -21,7 +21,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a regular message to Gamecraft's log
/// Write a regular message to Techblox's log
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -37,7 +37,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a debug message to Gamecraft's log
/// Write a debug message to Techblox's log
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -53,7 +53,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a debug message and object to Gamecraft's log
/// Write a debug message and object to Techblox's log
/// The reason this method exists in Svelto.Console is beyond my understanding
/// </summary>
/// <typeparam name="T">The type of the extra debug object</typeparam>
@@ -72,7 +72,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write an error message to Gamecraft's log
/// Write an error message to Techblox's log
/// </summary>
/// <param name="obj">The object to log</param>
/// <param name="extraData">The extra data to pass to the ILogger</param>
@@ -83,7 +83,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write an exception to Gamecraft's log and to the screen and exit game
/// Write an exception to Techblox's log and to the screen and exit game
/// </summary>
/// <param name="e">The exception to log</param>
/// <param name="extraData">The extra data to pass to the ILogger.
@@ -95,7 +95,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write an exception message to Gamecraft's log and to the screen and exit game
/// Write an exception message to Techblox's log and to the screen and exit game
/// </summary>
/// <param name="obj">The object to log</param>
/// <param name="e">The exception to log</param>
@@ -114,7 +114,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a warning message to Gamecraft's log
/// Write a warning message to Techblox's log
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -144,7 +144,7 @@ namespace TechbloxModdingAPI.Utility
// descriptive logging

/// <summary>
/// Write a descriptive message to Gamecraft's log only when the API is a Debug build
/// Write a descriptive message to Techblox's log only when the API is a Debug build
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -156,7 +156,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a descriptive message to Gamecraft's log including the current time and the calling method's name
/// Write a descriptive message to Techblox's log including the current time and the calling method's name
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -169,7 +169,7 @@ namespace TechbloxModdingAPI.Utility
// CLI logging

/// <summary>
/// Write a message to Gamecraft's command line
/// Write a message to Techblox's command line
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -185,7 +185,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write an error message to Gamecraft's command line
/// Write an error message to Techblox's command line
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -201,7 +201,7 @@ namespace TechbloxModdingAPI.Utility
}

/// <summary>
/// Write a warning message to Gamecraft's command line
/// Write a warning message to Techblox's command line
/// </summary>
/// <param name="obj">The object to log</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]


+ 2
- 2
TechbloxModdingAPI/Utility/VersionTracking.cs View File

@@ -61,7 +61,7 @@ namespace TechbloxModdingAPI.Utility
[Obsolete]
internal class VersionTrackingEngine : IEventEmitterEngine
{
public string Name { get; } = "GamecraftModdingAPIVersionTrackingGameEngine";
public string Name { get; } = "TechbloxModdingAPIVersionTrackingGameEngine";

public EntitiesDB entitiesDB { set; private get; }

@@ -104,7 +104,7 @@ namespace TechbloxModdingAPI.Utility
[Obsolete]
public class ModVersionDescriptor: SerializableEntityDescriptor<ModVersionDescriptor._ModVersionDescriptor>
{
[HashName("GamecraftModdingAPIVersionV0")]
[HashName("TechbloxModdingAPIVersionV0")]
public class _ModVersionDescriptor : IEntityDescriptor
{
public IComponentBuilder[] componentsToBuild { get; } = new IComponentBuilder[]{


Loading…
Cancel
Save