public void SetFontSetting(string Key, FontSetting FontSetting) { if (FontSetting.EnableList[0]) { GamePermanentCFG.SetValue("FloatingText", Key + "_MinYVelocity", FontSetting.MinYVelocity.ToString()); } if (FontSetting.EnableList[1]) { GamePermanentCFG.SetValue("FloatingText", Key + "_MaxYVelocity", FontSetting.MaxYVelocity.ToString()); } if (FontSetting.EnableList[2]) { GamePermanentCFG.SetValue("FloatingText", Key + "_ContinualForceY", FontSetting.ContinualForceY.ToString()); } if (FontSetting.EnableList[3]) { GamePermanentCFG.SetValue("FloatingText", Key + "_Decay", FontSetting.Decay.ToString()); } if (FontSetting.EnableList[4]) { GamePermanentCFG.SetValue("FloatingText", Key + "_ShrinkTime", FontSetting.ShrinkTime.ToString()); } if (FontSetting.EnableList[5]) { GamePermanentCFG.SetValue("FloatingText", Key + "_ShrinkScale", FontSetting.ShrinkScale.ToString()); } }
public FontSetting GetFontSetting(string Key) { FontSetting FontSetting = new FontSetting(); FontSetting.EnableList[0] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_MinYVelocity"), out FontSetting.MinYVelocity); FontSetting.EnableList[1] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_MaxYVelocity"), out FontSetting.MaxYVelocity); FontSetting.EnableList[2] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ContinualForceY"), out FontSetting.ContinualForceY); FontSetting.EnableList[3] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_Decay"), out FontSetting.Decay); FontSetting.EnableList[4] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ShrinkTime"), out FontSetting.ShrinkTime); FontSetting.EnableList[5] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ShrinkScale"), out FontSetting.ShrinkScale); return(FontSetting); }
private void FontSettingComboBox_SelectedIndexChanged(object sender, EventArgs e) { string FontName = Enum.ToObject(typeof(FontNameHandle), FontSettingComboBox.SelectedIndex).ToString(); FontSetting FontSetting = FontControl.GetFontSetting(FontName); MinYVelocityTextBox.Enabled = FontSetting.EnableList[0]; MaxYVelocityTextBox.Enabled = FontSetting.EnableList[1]; ContinualForceYTextBox.Enabled = FontSetting.EnableList[2]; DecayTextBox.Enabled = FontSetting.EnableList[3]; ShrinkTimeTextBox.Enabled = FontSetting.EnableList[4]; ShrinkScaleTextBox.Enabled = FontSetting.EnableList[5]; MinYVelocityTextBox.Text = FontSetting.MinYVelocity.ToString(); MaxYVelocityTextBox.Text = FontSetting.MaxYVelocity.ToString(); ContinualForceYTextBox.Text = FontSetting.ContinualForceY.ToString(); DecayTextBox.Text = FontSetting.Decay.ToString(); ShrinkTimeTextBox.Text = FontSetting.ShrinkTime.ToString(); ShrinkScaleTextBox.Text = FontSetting.ShrinkScale.ToString(); ErrorProvider.SetError(SaveFontSettingButton, ""); }
private void SaveFontSettingButton_Click(object sender, EventArgs e) { string FontName = Enum.ToObject(typeof(FontNameHandle), FontSettingComboBox.SelectedIndex).ToString(); FontSetting FontSetting = new FontSetting(); FontSetting.EnableList[0] = MinYVelocityTextBox.Enabled; FontSetting.EnableList[1] = MaxYVelocityTextBox.Enabled; FontSetting.EnableList[2] = ContinualForceYTextBox.Enabled; FontSetting.EnableList[3] = DecayTextBox.Enabled; FontSetting.EnableList[4] = ShrinkTimeTextBox.Enabled; FontSetting.EnableList[5] = ShrinkScaleTextBox.Enabled; FontSetting.MinYVelocity = double.Parse(MinYVelocityTextBox.Text); FontSetting.MaxYVelocity = double.Parse(MaxYVelocityTextBox.Text); FontSetting.ContinualForceY = double.Parse(ContinualForceYTextBox.Text); FontSetting.Decay = double.Parse(DecayTextBox.Text); FontSetting.ShrinkTime = double.Parse(ShrinkTimeTextBox.Text); FontSetting.ShrinkScale = double.Parse(ShrinkScaleTextBox.Text); FontControl.SetFontSetting(FontName, FontSetting); ErrorProvider.SetError(SaveFontSettingButton, ""); }
public void SetFontSetting(string Key, FontSetting FontSetting) { if (FontSetting.EnableList[0]) GamePermanentCFG.SetValue("FloatingText", Key + "_MinYVelocity", FontSetting.MinYVelocity.ToString()); if (FontSetting.EnableList[1]) GamePermanentCFG.SetValue("FloatingText", Key + "_MaxYVelocity", FontSetting.MaxYVelocity.ToString()); if (FontSetting.EnableList[2]) GamePermanentCFG.SetValue("FloatingText", Key + "_ContinualForceY", FontSetting.ContinualForceY.ToString()); if (FontSetting.EnableList[3]) GamePermanentCFG.SetValue("FloatingText", Key + "_Decay", FontSetting.Decay.ToString()); if (FontSetting.EnableList[4]) GamePermanentCFG.SetValue("FloatingText", Key + "_ShrinkTime", FontSetting.ShrinkTime.ToString()); if (FontSetting.EnableList[5]) GamePermanentCFG.SetValue("FloatingText", Key + "_ShrinkScale", FontSetting.ShrinkScale.ToString()); }
public FontSetting GetFontSetting(string Key) { FontSetting FontSetting = new FontSetting(); FontSetting.EnableList[0] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_MinYVelocity"), out FontSetting.MinYVelocity); FontSetting.EnableList[1] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_MaxYVelocity"), out FontSetting.MaxYVelocity); FontSetting.EnableList[2] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ContinualForceY"), out FontSetting.ContinualForceY); FontSetting.EnableList[3] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_Decay"), out FontSetting.Decay); FontSetting.EnableList[4] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ShrinkTime"), out FontSetting.ShrinkTime); FontSetting.EnableList[5] = Double.TryParse(GamePermanentCFG.GetValue("FloatingText", Key + "_ShrinkScale"), out FontSetting.ShrinkScale); return FontSetting; }