public void CreateDefault() { File.Create("keys.txt").Close(); binds = new DataFile("keys.txt"); //binds.AddData(); binds.Add(DButtons.MoveUp.ToString(), Keyboard.Key.W); binds.Add(DButtons.MoveDown.ToString(), Keyboard.Key.S); binds.Add(DButtons.MoveLeft.ToString(), Keyboard.Key.A); binds.Add(DButtons.MoveRight.ToString(), Keyboard.Key.D); binds.Add(DButtons.Menu.ToString(), Keyboard.Key.Escape); binds.Add(DButtons.DebugToggle.ToString(), Keyboard.Key.F2); binds.Add(DButtons.ConsoleToggle.ToString(), Keyboard.Key.Tilde); binds.SaveData(); }
protected override void OnIntialize() { Options = new DataFile("GameData\\client.config.txt"); int x = ScreenManager.Dimensions.X/2; int y = ScreenManager.Dimensions.X/4; Elements.Add(new Elements.TextBoxElement(this, new Vector2f(x,y), Color.White, Options.GetString("username"), true)); y += 40; Elements.Add(new Elements.TextBoxElement(this, new Vector2f(x, y), Color.White, Options.GetString("password"), true)); y += 40; Elements.Add(new Elements.SliderElement(this, new Vector2f(x, y), 0, 100, Options.GetInt32("volume"))); y += 40; Elements.Add(new Elements.ButtonElement(this, new Vector2f(x, y), "Save and Back", new EventHandler(SaveAndQuit))); y += 40; Elements.Add(new Elements.ButtonElement(this, new Vector2f(x, y), "Back", new EventHandler(Quit))); }
private void LoadBinds() { if (!File.Exists("keys.txt")) CreateDefault(); binds = new DataFile("keys.txt"); }
public DysClient(string username) { DataFile loaddata = new DataFile("Saves/" + username); }