public void SetSkillGainRate(SkillGainRate skillGainRate) { if (skillGainRate == SkillGainRate.Unknown) { throw new InvalidOperationException("Unknown is not valid Wurm config value"); } string replacement = "skillgain_minimum="; if (skillGainRate == SkillGainRate.Never) { replacement += "0"; } if (skillGainRate == SkillGainRate.PerInteger) { replacement += "1"; } if (skillGainRate == SkillGainRate.Per0D1) { replacement += "2"; } if (skillGainRate == SkillGainRate.Per0D01) { replacement += "3"; } if (skillGainRate == SkillGainRate.Per0D001) { replacement += "4"; } if (skillGainRate == SkillGainRate.Always) { replacement += "5"; } RewriteFile(@"skillgain_minimum=\d", replacement); }
public void SetSkillGainRate(SkillGainRate skillGainRate) { if (skillGainRate == SkillGainRate.Unknown) { throw new InvalidOperationException("Unknown is not valid Wurm config value"); } string replacement = "skillgain_minimum="; if (skillGainRate == SkillGainRate.Never) replacement += "0"; if (skillGainRate == SkillGainRate.PerInteger) replacement += "1"; if (skillGainRate == SkillGainRate.Per0D1) replacement += "2"; if (skillGainRate == SkillGainRate.Per0D01) replacement += "3"; if (skillGainRate == SkillGainRate.Per0D001) replacement += "4"; if (skillGainRate == SkillGainRate.Always) replacement += "5"; this.RewriteFile(@"skillgain_minimum=\d", replacement); }
void Refresh() { lock (locker) { var result = configReader.ReadValues(); customTimerSource = result.CustomTimerSource; execSource = result.ExecSource; keyBindSource = result.KeyBindSource; autoRunSource = result.AutoRunSource; ircLoggingType = result.IrcLoggingType; otherLoggingType = result.OtherLoggingType; eventLoggingType = result.EventLoggingType; skillGainRate = result.SkillGainRate; noSkillMessageOnAlignmentChange = result.NoSkillMessageOnAlignmentChange; noSkillMessageOnFavorChange = result.NoSkillMessageOnFavorChange; saveSkillsOnQuit = result.SaveSkillsOnQuit; timestampMessages = result.TimestampMessages; HasBeenRead = true; } onConfigChanged.Trigger(); }
void Refresh() { lock (locker) { var result = this.configReader.ReadValues(); this.customTimerSource = result.CustomTimerSource; this.execSource = result.ExecSource; this.keyBindSource = result.KeyBindSource; this.autoRunSource = result.AutoRunSource; this.ircLoggingType = result.IrcLoggingType; this.otherLoggingType = result.OtherLoggingType; this.eventLoggingType = result.EventLoggingType; this.skillGainRate = result.SkillGainRate; this.noSkillMessageOnAlignmentChange = result.NoSkillMessageOnAlignmentChange; this.noSkillMessageOnFavorChange = result.NoSkillMessageOnFavorChange; this.saveSkillsOnQuit = result.SaveSkillsOnQuit; this.timestampMessages = result.TimestampMessages; this.HasBeenRead = true; } onConfigChanged.Trigger(); }