示例#1
0
 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();
 }
示例#2
0
 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)));
 }
示例#3
0
 private void LoadBinds()
 {
     if (!File.Exists("keys.txt"))
         CreateDefault();
     binds = new DataFile("keys.txt");
 }
示例#4
0
 public DysClient(string username)
 {
     DataFile loaddata = new DataFile("Saves/" + username);
 }