private static KeyValuePair <CustomOption, Type> CreateStringRoleOption <TRole>(string name, params string[] values) where TRole : RoleGeneric <TRole>, new() { return(new KeyValuePair <CustomOption, Type>( CustomOption.AddString(Role.GetName <TRole>() + ": " + name, values), typeof(TRole))); }
public override void Load() { foreach (Role role in Roles) { // RoleAllowSpawns.Add(GetRoleAllowSpawnOption(role)); RoleSpawnChances.Add(CreateRoleSpawnChanceOption(role)); } for (var i = 0; i < RoleSlots.Length; i++) { RoleSlots[i] = CustomOption.AddString("Role Slot " + (i + 1), new[] { "Crew", "Crew Investigative", "Crew Killing", "Crew Protective", "Crew Support", "Mafia", "Mafia Deception", "Mafia Killing", "Mafia Support", "Neutral", "Neutral Benign", "Neutral Chaos", "Neutral Evil", "Neutral Killing" }); } OptionPage.CreateOptionPage(GeneralOptions); OptionPage.CreateOptionPage(RoleSlots); OptionPage.CreateOptionPage(RoleSpawnChances.Values); OptionPage.CreateOptionPage(RoleCooldowns.Values); OptionPage.CreateOptionPage(RoleDurations.Values); OptionPage.CreateOptionPage(RoleOptions.Keys); // Disable the https://github.com/DorCoMaNdO/Reactor-Essentials watermark. // The code said that you were allowed, as long as you provided credit elsewhere. // I added a link in the Credits of the GitHub page, and I'm also mentioning it here. // If the owner of this library has any problems with this, just message me on discord and we'll find a solution // BothLine#9610 CustomOption.ShamelessPlug = false; Harmony.PatchAll(); }