W
weischbier
Guest
Ok, i try very hard to do this on my own.
I read through CodenameGamma's Guide carefully.
But i can't get the CC to save the Settings you can make in the GUI.
Here's the Code i use:
if anybody notice what i'm doing wrong, i would be happiest person on this planet!
because i'm at a point where it gets me frustrated...
greetz
weischbier
I read through CodenameGamma's Guide carefully.
But i can't get the CC to save the Settings you can make in the GUI.
Here's the Code i use:
PHP:
using System.IO;
using Styx;
using Styx.Helpers;
namespace Necrophilia
{
public class NecrophiliaSettings : Settings
{
public static readonly NecrophiliaSettings Instance = new NecrophiliaSettings();
public NecrophiliaSettings()
: base(Path.Combine(Logging.ApplicationPath, string.Format(@"CustomClasses/Config/MrBones-Settings-{0}.xml", StyxWoW.Me.Name)))
{
}
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
///////////////// <<General>> /////////////////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
//Spec Radio Box
[Setting, DefaultValue(false)]
public bool UseF { get; set; }//Frost PvE
[Setting, DefaultValue(false)]
public bool UseU { get; set; }//Frost PvP
[Setting, DefaultValue(false)]
public bool UsePvE { get; set; }//Unholy PvE
[Setting, DefaultValue(false)]
public bool UsePvP { get; set; }//Unholy PvP
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
///////////////// <<Frost>> ///////////////////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
}
}
PHP:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Styx.Helpers;
namespace Necrophilia
{
public partial class NecrophiliaGUI : Form
{
public NecrophiliaGUI()
{
InitializeComponent();
}
private void NecrophiliaGUI_Load(object sender, EventArgs e)
{
NecrophiliaSettings.Instance.Load();
UsecbF.Checked = NecrophiliaSettings.Instance.UseF;
UsecbU.Checked = NecrophiliaSettings.Instance.UseU;
UsecbPvE.Checked = NecrophiliaSettings.Instance.UsePvE;
UsecbPvP.Checked = NecrophiliaSettings.Instance.UsePvP;
}
private void NecrophiliaGUI_FormClosing(object sender, FormClosingEventArgs e)
{
//General
NecrophiliaSettings.Instance.UseF = UsecbF.Checked;
NecrophiliaSettings.Instance.UseU = UsecbU.Checked;
NecrophiliaSettings.Instance.UsePvP = UsecbPvE.Checked;
NecrophiliaSettings.Instance.UsePvE = UsecbPvP.Checked;
Deathknight.Instance.Settings.Save();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void UsecbF_CheckedChanged(object sender, EventArgs e)
{
NecrophiliaSettings.Instance.UseF = UsecbF.Checked;
}
private void UsecbU_CheckedChanged(object sender, EventArgs e)
{
NecrophiliaSettings.Instance.UseU = UsecbU.Checked;
}
private void UsecbPvE_CheckedChanged(object sender, EventArgs e)
{
NecrophiliaSettings.Instance.UsePvE = UsecbPvE.Checked;
}
private void UsecbPvP_CheckedChanged(object sender, EventArgs e)
{
NecrophiliaSettings.Instance.UsePvP = UsecbPvP.Checked;
}
}
}
if anybody notice what i'm doing wrong, i would be happiest person on this planet!
because i'm at a point where it gets me frustrated...
greetz
weischbier