public Mod(IProxyMod userMod, Assembly assembly) { this.m_customInjects = new List <object>(); this.userMod = userMod; this.assembly = assembly; Enabled = true; }
private static void loadMods() { if (!Directory.Exists("mods")) { return; } var modDlls = Directory.GetFiles("mods", "*.dll", SearchOption.AllDirectories); foreach (var path in modDlls) { var mod = Assembly.LoadFrom(path); var userModType = (from type in mod.GetTypes() where typeof(IProxyMod).IsAssignableFrom(type) select type).FirstOrDefault(); if (userModType != null) { log.InfoFormat("Mod found: {0}", path.Replace("mods\\", String.Empty)); IProxyMod userMod = Activator.CreateInstance(userModType) as IProxyMod; m_mods.AddMod(userMod, mod); } } m_mods.LoadModAssemblies(); }
public ModSettingsForm(ISettingsProvider settingsProvider, IProxyMod mod) { InitializeComponent(); this.settingsProvider = settingsProvider; this.mod = mod; Text = String.Format("{0} - Settings", mod.Name); var nextHeight = 60; foreach (var setting in settingsProvider.GetValues()) { Controls.Add(new SettingsControl(setting.Key, setting.Value)); Controls[Controls.Count - 1].Location = new Point(12, nextHeight); nextHeight += 30; } this.saveButton.Location = new Point(376, nextHeight); this.Size = new Size(474, nextHeight + 30); this.DialogResult = System.Windows.Forms.DialogResult.No; }
private void selectItem(string mod) { selectedMod = mods[mod]; updateInfo(); }