2015-07-01 23:17:14 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2015-07-03 00:12:02 -04:00
|
|
|
|
using Mesen.GUI.Config;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Forms.NetPlay
|
|
|
|
|
{
|
|
|
|
|
public partial class frmPlayerProfile : BaseConfigForm
|
|
|
|
|
{
|
|
|
|
|
public frmPlayerProfile()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
this.txtPlayerName.Text = ConfigManager.Config.Profile.PlayerName;
|
|
|
|
|
this.picAvatar.Image = ConfigManager.Config.Profile.GetAvatarImage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void picAvatar_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
OpenFileDialog ofd = new OpenFileDialog();
|
|
|
|
|
ofd.Filter = "All supported image files (*.bmp, *.jpg, *.png)|*.bmp;*.jpg;*.png";
|
|
|
|
|
if(ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
|
|
|
|
try {
|
|
|
|
|
this.picAvatar.Image = Image.FromFile(ofd.FileName).ResizeImage(64, 64);
|
|
|
|
|
} catch {
|
|
|
|
|
MessageBox.Show("Invalid image format.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-07-03 00:12:02 -04:00
|
|
|
|
/*
|
2015-07-01 23:17:14 -04:00
|
|
|
|
protected override void UpdateConfig()
|
|
|
|
|
{
|
|
|
|
|
PlayerProfile profile = new PlayerProfile();
|
|
|
|
|
profile.PlayerName = this.txtPlayerName.Text;
|
|
|
|
|
profile.SetAvatar(this.picAvatar.Image);
|
|
|
|
|
ConfigManager.Config.Profile = profile;
|
2015-07-03 00:12:02 -04:00
|
|
|
|
}*/
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
}
|