public SpriteForm() { InitializeComponent(); _currentPath = Extensions.CheckDirectorySeparator(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); _spriteListWindow = new SpriteListWindow(); _spriteListWindow.SpriteChanged += SpriteListWindowSpriteChanged; _spritePreviewWindow = new SpritePreviewWindow(); _spriteDeltasWindow = new SpriteDeltasWindow(); _spriteDeltasWindow.CheckedDeltaItemsChanged += SpriteDeltasWindowCheckedDeltaItemsChanged; _spriteRemapsWindow = new SpriteRemapsWindow(); _spriteRemapsWindow.RemapChanged += SpriteRemapsWindowRemapChanged; _deserializeDockContent += DeserializeDockContent; var layoutFile = _currentPath + LayoutFile; try { dockPanel.LoadFromXml(layoutFile, _deserializeDockContent); } catch (Exception) { var stream = Assembly.GetAssembly(GetType()).GetManifestResourceStream(GetType().Namespace + ".Resources.SpriteFormDefaultLayout.xml"); dockPanel.LoadFromXml(stream, _deserializeDockContent); if (stream != null) stream.Close(); } //Thread LoadPalette(_currentPath + Globals.GraphicsSubDir + Path.DirectorySeparatorChar + Globals.PaletteSuffix + Globals.TextureImageFormat); LoadSprites(_currentPath + Globals.GraphicsSubDir + Path.DirectorySeparatorChar + Globals.SpritesSuffix + Globals.XmlFormat); LoadDeltas(_currentPath + Globals.GraphicsSubDir + Path.DirectorySeparatorChar + Globals.DeltasSuffix + Globals.XmlFormat); CreateSpriteData(_spriteListWindow.TextureAltas); }
private void SpriteDeltasWindowCheckedDeltaItemsChanged(object sender, SpriteDeltasWindow.CheckedDeltaItemsEventArgs e) { if (_shouldPaint) PaintSprite(); }