-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initialization thingies + seatruck sleeper rename
- Loading branch information
1 parent
baceedb
commit faa25cf
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using JetBrains.Annotations; | ||
|
||
namespace SCHIZO.Attributes; | ||
|
||
[AttributeUsage(AttributeTargets.Method, Inherited = false)] | ||
[MeansImplicitUse] | ||
public sealed class InitializeModAttribute : Attribute | ||
{ | ||
public static void Run() | ||
{ | ||
IEnumerable<MethodInfo> methods = PLUGIN_ASSEMBLY.GetTypes() | ||
.SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) | ||
.Where(m => m.GetCustomAttribute<InitializeModAttribute>() != null); | ||
|
||
foreach (MethodInfo method in methods) | ||
{ | ||
LOGGER.LogInfo($"Calling initialization method {method.DeclaringType}.{method.Name}"); | ||
method.Invoke(null, null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Nautilus.Handlers; | ||
using SCHIZO.Attributes; | ||
|
||
namespace SCHIZO.Tweaks; | ||
|
||
public static class SeatruckSleeperModuleRename | ||
{ | ||
[InitializeMod] | ||
public static void Apply() | ||
{ | ||
LanguageHandler.SetTechTypeName(TechType.SeaTruckSleeperModule, "Seatruck Jukebox Module"); | ||
LanguageHandler.SetTechTypeName(TechType.SeaTruckSleeperModuleFragment, "Seatruck Jukebox Module Fragment"); | ||
LanguageHandler.SetLanguageLine("Ency_SeaTruckSleeperModule", "Seatruck Jukebox Module"); | ||
LanguageHandler.SetLanguageLine("PilotSeaTruckSleeperModule", "Pilot Jukebox Module"); | ||
} | ||
} |