public Form1() { InitializeComponent(); customSkins[0] = new CustomSkin(skinConfigFiles[0]); customSkins[1] = new CustomSkin(skinConfigFiles[1]); customSkins[2] = new CustomSkin(skinConfigFiles[2]); skinForm = new SkinForm(); }
private void btnSelectFolder_Click(object sender, EventArgs e) { var openDialog = new OpenFileDialog { Filter = @"Image Files(*.PNG)|*.PNG" }; if (openDialog.ShowDialog() != DialogResult.OK) { return; } Image image; try { image = FromFile(openDialog.FileName); } catch { MessageBox.Show(strings.Select_UnableToOpen, strings.Message_Error, MessageBoxButtons.OK, MessageBoxIcon.Error); SetStatus(false); return; } if (image.Width != 512 && image.Height != 512) { MessageBox.Show(strings.Select_WrongResolution, strings.Message_Error, MessageBoxButtons.OK, MessageBoxIcon.Error); SetStatus(false); return; } pictureBox2.Image = image; pictureBox2.Invalidate(); _folderPath = string.Format("{1}{0}CustomSkins{0}Skin_{2}", Path.DirectorySeparatorChar, Directory.GetCurrentDirectory(), Path.GetFileNameWithoutExtension(openDialog.FileName)); if (!Directory.Exists(_folderPath)) { Directory.CreateDirectory(_folderPath); } if (File.Exists(_folderPath + Path.DirectorySeparatorChar + "icon.png")) { File.Delete(_folderPath + Path.DirectorySeparatorChar + "icon.png"); } File.Copy(openDialog.FileName, _folderPath + Path.DirectorySeparatorChar + "icon.png"); var dataPath = GetDataPath(_folderPath); _editing = File.Exists(dataPath) ? CustomSkin.FromFile(dataPath) : new CustomSkin(); _editing.FilePath = dataPath; SetStatus(true); UpdateTexts(); }
public static void SetSkin(CustomSkin skin) { GUISkin.Custom = new GUISkin(skin.Rules); }
public override int GetHashCode() { int num = 1; if (EntityId != 0) { num ^= EntityId.GetHashCode(); } if (EntityType != 0) { num ^= EntityType.GetHashCode(); } if (name_ != null) { num ^= Name.GetHashCode(); } if (defId_.HasValue) { num ^= DefId.GetHashCode(); } if (weaponId_.HasValue) { num ^= WeaponId.GetHashCode(); } if (genderId_.HasValue) { num ^= GenderId.GetHashCode(); } if (playerIndexInFight_.HasValue) { num ^= PlayerIndexInFight.GetHashCode(); } if (ownerId_.HasValue) { num ^= OwnerId.GetHashCode(); } if (teamId_.HasValue) { num ^= TeamId.GetHashCode(); } if (level_.HasValue) { num ^= Level.GetHashCode(); } num ^= ((object)properties_).GetHashCode(); if (position_ != null) { num ^= Position.GetHashCode(); } if (direction_.HasValue) { num ^= Direction.GetHashCode(); } num ^= ((object)Caracs).GetHashCode(); if (customSkin_ != null) { num ^= CustomSkin.GetHashCode(); } if (actionDoneThisTurn_.HasValue) { num ^= ActionDoneThisTurn.GetHashCode(); } if (_unknownFields != null) { num ^= ((object)_unknownFields).GetHashCode(); } return(num); }