Esempio n. 1
0
 private void RoR2Application_Awake(On.RoR2.RoR2Application.orig_Awake orig, RoR2Application self)
 {
     orig(self);
     if (!self.GetComponent <RadarEffectToggleModComponent>())
     {
         var component = self.gameObject.AddComponent <RadarEffectToggleModComponent>();
         component.prefab = Resources.Load <GameObject>("prefabs/effects/ActivateRadarTowerEffect");
         if (PostProcessing.Value || Kill.Value)
         {
             component.prefab.transform.Find("PP").gameObject.SetActive(false);
         }
         if (PointLight.Value || Kill.Value)
         {
             component.prefab.transform.Find("Point Light").gameObject.SetActive(false);
         }
         if (Shake.Value || Kill.Value)
         {
             foreach (var shakers in component.prefab.GetComponents <ShakeEmitter>())
             {
                 shakers.enabled = false;
             }
         }
         if (Kill.Value)
         {
             component.prefab.GetComponent <DestroyOnTimer>().duration = 0f;
         }
     }
 }
Esempio n. 2
0
 // Token: 0x060024B1 RID: 9393 RVA: 0x000A0008 File Offset: 0x0009E208
 private void OnDisable()
 {
     PauseScreenController.instancesList.Remove(this);
     if (PauseScreenController.instancesList.Count == 0 && PauseScreenController.paused)
     {
         Time.timeScale = PauseScreenController.oldTimeScale;
         PauseScreenController.paused = false;
         if (RoR2Application.onPauseEndGlobal != null)
         {
             RoR2Application.onPauseEndGlobal();
         }
     }
 }
Esempio n. 3
0
 // Token: 0x06001FF9 RID: 8185 RVA: 0x00096600 File Offset: 0x00094800
 private static void RequestLobbyListRefresh()
 {
     if (SteamLobbyFinder.awaitingLobbyRefresh)
     {
         return;
     }
     SteamLobbyFinder.awaitingLobbyRefresh = true;
     LobbyList.Filter filter = new LobbyList.Filter();
     filter.StringFilters["appid"]             = TextSerialization.ToStringInvariant(SteamLobbyFinder.steamClient.AppId);
     filter.StringFilters["build_id"]          = RoR2Application.GetBuildId();
     filter.StringFilters["qp"]                = "1";
     filter.StringFilters["total_max_players"] = TextSerialization.ToStringInvariant(RoR2Application.maxPlayers);
     LobbyList.Filter filter2 = filter;
     SteamLobbyFinder.steamClient.LobbyList.Refresh(filter2);
 }
Esempio n. 4
0
 // Token: 0x06002579 RID: 9593 RVA: 0x000A310C File Offset: 0x000A130C
 private void Start()
 {
     if (Client.Instance != null)
     {
         string text     = "Steam Build ID " + RoR2Application.GetBuildId();
         string betaName = Client.Instance.BetaName;
         if (!string.IsNullOrEmpty(betaName))
         {
             text = text + "[" + betaName + "]";
         }
         base.GetComponent <TextMeshProUGUI>().text = text;
         return;
     }
     UnityEngine.Object.Destroy(base.gameObject);
 }
        private IEnumerator AfterLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
        {
            yield return(orig(self));

            ApplyGeneralSettings();

            foreach (var survivorDef in ContentManager.survivorDefs)
            {
                var customSurvivor = new CustomSurvivor(survivorDef, Config, Logger);
                if (customSurvivor.Enabled.Value)
                {
                    customSurvivor.OverrideSurvivorBase();
                }
                _survivors.Add(customSurvivor);
            }
        }
Esempio n. 6
0
 // Token: 0x060024B0 RID: 9392 RVA: 0x0009FFAC File Offset: 0x0009E1AC
 private void OnEnable()
 {
     if (PauseScreenController.instancesList.Count == 0)
     {
         PauseScreenController.paused = NetworkServer.dontListen;
         if (PauseScreenController.paused)
         {
             if (RoR2Application.onPauseStartGlobal != null)
             {
                 RoR2Application.onPauseStartGlobal();
             }
             PauseScreenController.oldTimeScale = Time.timeScale;
             Time.timeScale = 0f;
         }
     }
     PauseScreenController.instancesList.Add(this);
 }
Esempio n. 7
0
        private IEnumerator AfterLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
        {
            yield return(orig(self));

            ApplyGeneralSettings();

            foreach (var survivorDef in ContentManager.survivorDefs)
            {
                var plusSurvivor = _plusSurvivors
                                   .FirstOrDefault(survivor => survivor.CachedName.Equals(survivorDef.cachedName));
                if (plusSurvivor == null)
                {
                    Logger.LogInfo(survivorDef.cachedName + " is not supported by CharacterCustomizerPlus!");
                    continue;
                }
                plusSurvivor.InitContent(survivorDef);
                Logger.LogInfo("Loaded values for " + plusSurvivor.CommonName);
            }

            if (!CreateReadme.Value)
            {
                yield break;
            }
            var markdown = new StringBuilder("# Config Values\n");

            markdown.AppendLine("## General");
            markdown.AppendLine(CreateReadme.ToMarkdownString());

            foreach (var customSurvivor in _plusSurvivors)
            {
                markdown.AppendLine("# " + customSurvivor.CommonName);
                var markdownLines = customSurvivor.MarkdownConfigEntries
                                    .Select(markdownDef => markdownDef.ToMarkdownString()).ToList();

                markdownLines.Sort();

                foreach (var markdownLine in markdownLines)
                {
                    markdown.AppendLine(markdownLine);
                }
            }

            System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\config_values.md",
                                        markdown.ToString());
        }
Esempio n. 8
0
 private static void RoR2Application_OnLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
 {
     orig(self);
     LoadBanks();
 }
Esempio n. 9
0
        private void CheckIfUsedOnRightGameVersion(On.RoR2.RoR2Application.orig_Awake orig, RoR2Application self)
        {
            orig(self);

            var buildId = Application.version;

            if (GameBuildId == buildId)
            {
                return;
            }

            Logger.LogWarning($"This version of R2API was built for build id \"{GameBuildId}\", you are running \"{buildId}\".");
            Logger.LogWarning("Should any problems arise, please check for a new version before reporting issues.");
        }
Esempio n. 10
0
        private void RoR2Application_OnLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
        {
            orig(self);

            AddBank();
        }
Esempio n. 11
0
        private void RoR2Application_Update(On.RoR2.RoR2Application.orig_Update orig, RoR2Application self)
        {
            var codename = ItemCatalog.GetItemDef(ItemIndex.Bear)?.nameToken;

            if (codename != null)
            {
                var name = Language.GetString(codename);
                if (name != codename)
                {
                    if (SurvivorCatalog.allSurvivorDefs != null)
                    {
                        if (SurvivorCatalog.allSurvivorDefs.Count() != 0)
                        {
                            var tmp = new Dictionary <string, bool>();
                            configitem("!Item!", "examplecharacter_example", tmp);
                            var survivors = SurvivorCatalog.allSurvivorDefs;
                            for (ItemIndex i = 0; i < ItemIndex.Count; i++)
                            {
                                var item = ItemCatalog.GetItemDef(i);
                                if (item.hidden == false)
                                {
                                    var itemdic = new Dictionary <string, bool>();
                                    dropping.Add(i, itemdic);
                                    var itemname = Language.GetString(item.nameToken);
                                    configitem(itemname, "ALL", itemdic);
                                    foreach (var survivor in survivors)
                                    {
                                        configitem(itemname, survivor.descriptionToken, itemdic);
                                    }
                                }
                            }
                            On.RoR2.RoR2Application.Update -= RoR2Application_Update;
                        }
                    }
                }
            }
        }
Esempio n. 12
0
 private System.Collections.IEnumerator RoR2Application_OnLoad1(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
 {
     orig(self);
     LoadBanks();
     yield break;
 }
Esempio n. 13
0
 internal static void FilePollUpdateHook(On.RoR2.RoR2Application.orig_Update orig, RoR2Application self)
 {
     orig(self);
     filePollingStopwatch += Time.unscaledDeltaTime;
     if (filePollingStopwatch >= filePollingRate)
     {
         filePollingStopwatch = 0;
         foreach (ConfigFile cfl in observedFiles.Keys.ToList())
         {
             var thisup = System.IO.File.GetLastWriteTime(cfl.ConfigFilePath);
             if (observedFiles[cfl] < thisup)
             {
                 observedFiles[cfl] = thisup;
                 TILER2Plugin._logger.LogDebug("A config file tracked by AutoItemConfig has been changed: " + cfl.ConfigFilePath);
                 cfl.Reload();
             }
         }
     }
 }
Esempio n. 14
0
 private void RoR2Application_Update(On.RoR2.RoR2Application.orig_Update orig, RoR2Application self)
 {
     orig(self);
     stopwatch -= Time.deltaTime;
     if (stopwatch <= 0f)
     {
         stopwatch = 1f;
         if (userProfile.HasUnlockable(Defib.unlockable) &&
             userProfile.HasUnlockable(ShootToHeal.unlockable) &&
             userProfile.HasUnlockable(Pinball.unlockable) &&
             userProfile.HasUnlockable(Lodestone.unlockable))
         {
             Grant();
         }
     }
 }
Esempio n. 15
0
 private static void RoR2Application_OnLoad(On.RoR2.RoR2Application.orig_OnLoad orig, RoR2Application self)
 {
     orig(self);
     //must be after OnLoad as it must be after the initialization of the init bank
     AddBank();
 }