joerkig

Untitled

Apr 13th, 2021
701
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.IO;
  2. using System.Text.RegularExpressions;
  3. using UnityEngine;
  4. using MelonLoader;
  5. using SG.Claymore.Interaction;//Where the Name and Description hide
  6.  
  7. namespace SimpleRewards
  8. {
  9.     public class MyMod : MelonMod
  10.     {
  11.         static void Blank(string position)
  12.         {
  13.             if (File.ReadAllText(MelonUtils.UserDataDirectory + "\\DisplayName" + position + ".txt") != null)
  14.             {
  15.                 File.WriteAllText(MelonUtils.UserDataDirectory + "\\DisplayName" + position + ".txt", null);
  16.                 File.WriteAllText(MelonUtils.UserDataDirectory + "\\DisplayDescription" + position + ".txt", null);
  17.             }
  18.         }
  19.         static void WriteInfo(string position)
  20.         {
  21.             string pattern = "(<script(\\s|\\S)*?<\\/script>)|(<style(\\s|\\S)*?<\\/style>)|(<!--(\\s|\\S)*?-->)|(<\\/?(\\s|\\S)*?>)";
  22.             GameObject gameObject = GameObject.Find("RewardSpawner/SpawnPoints/" + position);
  23.             if (gameObject != null)
  24.             {
  25.                 RewardInteractable rewardInteractable = gameObject.GetComponentInChildren<RewardInteractable>();
  26.                 if (rewardInteractable != null)
  27.                 {
  28.                     if (rewardInteractable.DisplayName.ToString() != File.ReadAllText(MelonUtils.UserDataDirectory + "\\DisplayName" + position + ".txt"))
  29.                     {
  30.                         File.WriteAllText(MelonUtils.UserDataDirectory + "\\DisplayName" + position + ".txt", rewardInteractable.DisplayName.ToString());
  31.                         File.WriteAllText(MelonUtils.UserDataDirectory + "\\DisplayDescription" + position + ".txt", Regex.Replace(rewardInteractable.DisplayDescription.ToString(), pattern, ""));
  32.                     }
  33.                 }
  34.             }
  35.         }
  36.         public override void OnLateUpdate()
  37.         {
  38.             WriteInfo("Left");
  39.             WriteInfo("Center");
  40.             WriteInfo("Right");
  41.         }
  42.         public override void OnSceneWasLoaded(int buildIndex, string sceneName)
  43.         {
  44.             Blank("Left");
  45.             Blank("Center");
  46.             Blank("Right");
  47.         }
  48.         public override void OnApplicationQuit()
  49.         {
  50.             Blank("Left");
  51.             Blank("Center");
  52.             Blank("Right");
  53.         }
  54.     }
  55. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×