davcin

Star Wars - Fully Functional Lightsabers - Patch - RimWorld

Apr 25th, 2020
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 KB | None | 0 0
  1. /*
  2. Star Wars - Fully Functional Lightsabers - Patch - Removes the glow effect from Star Wars - Fully Functional Lightsabers.
  3. (https://steamcommunity.com/sharedfiles/filedetails/?id=2074246443)
  4. Star Wars - Fully Functional Lightsabers
  5. (https://steamcommunity.com/sharedfiles/filedetails/?id=918200645)
  6. */
  7. using HarmonyLib;
  8. using RimWorld;
  9. using System;
  10. using System.Reflection;
  11. using SWSaber;
  12. using Verse;
  13.  
  14. namespace SWSaberPatch {
  15.  
  16.     [StaticConstructorOnStartup]
  17.     public static class SWSaberPatch {
  18.  
  19.         static SWSaberPatch() {
  20.  
  21.             var harmony = new Harmony("rimworld.davcin.projectjedi.lightsabers.patch");
  22.  
  23.             var mg = typeof(CompLightsaberActivatableEffect).GetMethod("MakeGlower", BindingFlags.Instance | BindingFlags.Public);
  24.             if (mg == null) {
  25.                 throw new Exception("Failed to get method to patch.");
  26.             }
  27.             var pmg = typeof(SWSaberPatch).GetMethod("PatchedMakeGlower", BindingFlags.Static | BindingFlags.Public);
  28.             if (pmg == null) {
  29.                 throw new Exception("Failed to get patch method.");
  30.             }
  31.             harmony.Patch(mg, new HarmonyMethod(pmg), null);
  32.  
  33.             Log.Message("[SWSaberPatch]: Star Wars - Fully Functional Lightsabers patched.");
  34.         }
  35.  
  36.         public static bool PatchedMakeGlower() {
  37.             return false;
  38.         }
  39.        
  40.     }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment