Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 private void SpriteRemapsWindowRemapChanged(object sender, SpriteRemapsWindow.RemapEventArgs e)
 {
     if (_shouldPaint)
         PaintSprite();
 }