From 7ab430a8d4986a46bfb506c3563ea0b75cf622ba Mon Sep 17 00:00:00 2001 From: microlith57 Date: Fri, 17 Apr 2026 17:36:35 +1200 Subject: [PATCH] add GlobalUsings option --- CelesteMod/.template.config/template.json | 11 +++++++++++ CelesteMod/Source/GlobalUsings.cs | 12 ++++++++++++ README.md | 1 + 3 files changed, 24 insertions(+) create mode 100644 CelesteMod/Source/GlobalUsings.cs diff --git a/CelesteMod/.template.config/template.json b/CelesteMod/.template.config/template.json index 75fdaed..545f7fe 100644 --- a/CelesteMod/.template.config/template.json +++ b/CelesteMod/.template.config/template.json @@ -42,6 +42,11 @@ "datatype": "bool", "defaultValue": "true" }, + "GlobalUsings": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "true" + }, "GitHub": { "type": "parameter", "datatype": "bool", @@ -110,6 +115,12 @@ "Source/CelesteModModuleSaveData.cs" ] }, + { + "condition": "(!GlobalUsings)", + "exclude": [ + "Source/GlobalUsings.cs" + ] + }, { "condition": "(!Legacy)", "include": [ diff --git a/CelesteMod/Source/GlobalUsings.cs b/CelesteMod/Source/GlobalUsings.cs new file mode 100644 index 0000000..82acb0a --- /dev/null +++ b/CelesteMod/Source/GlobalUsings.cs @@ -0,0 +1,12 @@ +global using System; +global using System.Collections; +global using System.Collections.Generic; +global using System.Linq; +global using UnreachableException = System.Diagnostics.UnreachableException; + +global using Microsoft.Xna.Framework; +global using Microsoft.Xna.Framework.Graphics; + +global using Monocle; + +global using Celeste.Mod.Entities; diff --git a/README.md b/README.md index 99244ab..b18a44b 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Available parameters: * `--Session` : Includes a blank `EverestModuleSession` class and configures the module to look for it. (Defaults to true) * `--SaveData` : Includes a blank `EverestModuleSaveData` class and configures the module to look for it. (Defaults to true) * `--Logging` : Sets logging level to `Info` specifically for release builds instead of the default `Verbose`. (Defaults to true) +* `--GlobalUsings` : Includes a `GlobalUsings.cs` with a set of common usings. (Defaults to true) * `--GitHub` : Generates a GitHub action for building your mod. (Defaults to false) * `--Legacy` : Generates a mod for use with legacy Everest. This is only required if you want people to use your mod on versions of Everest older than 4465. (Defaults to false)