public EdoMain() { //static initialization for SFX replacement definitions //these still need to be runtime due to mod paths. //if these get big enough they will cause lag on game entry, //so they will need to be moved to EdoMod.cs // //values are based on 10-game, 4-player sessions. (3 deaths * 10 rounds = 30 deaths/session avg.) _sfxr["death"] = new[] { Tuple.Create(2f / 30f, Mod.GetPath <EdoMod>("SFX\\RobloxDeath")), //2 per session Tuple.Create(1f / 120f, Mod.GetPath <EdoMod>("SFX\\RobloxDeathSlow")) //1 per 4 sessions }; //some stuff left over from UFFMod a long time age; should probably be cleaned up but I'm too lazy teamSpawnsDone = new Dictionary <TeamHat, Cape>(); //here so this gets added to the list of things to update each frame AutoUpdatables.Add(this); //because many things are effectively static, but AutoUpdatables requires this to be an object for frame updates instance = this; if (ModSettings.enableDangerousInjections) { //create a pointer to the '_sounds' field in the SFX class. FieldInfo sounds = typeof(SFX).GetField("_sounds", BindingFlags.Static | BindingFlags.NonPublic); _sounds = (Dictionary <string, SoundEffect>)sounds.GetValue(null); //store a backup of the intended sfx's foreach (string key in _sfxr.Keys) { _sounds_bak[key] = _sounds[key]; } //_sounds["shotgunFire2"] = _sounds[Mod.GetPath<EdoMod>("SFX\\MansNotQuack")]; } DuckGame.DevConsole.Log(ModLoader.currentModLoadString, Color.White); }
private void ExecuteOnceLoaded() { if (ModSettings.enableCustomIntro) { while (!(Level.current is EdoLogo) && !(Level.current is TeamSelect2)) { if (Level.current is CorptronLogo) { Level.current = new EdoLogo(); } Thread.Sleep(20); } } while (Level.current == null || !(Level.current.ToString() == "DuckGame.TitleScreen" || Level.current.ToString() == "DuckGame.TeamSelect2")) { Thread.Sleep(200); } Main = new EdoMain(); }