Exemple #1
0
    public void Load()
    {
        try
        {
            Logger.Log(Logger.Level.DEBUG, "[PatternEditor/Pattern] Creating sub patterns...");
            SubPatterns = new List <SubPattern>();
            foreach (var part in Info.Parts)
            {
                Logger.Log(Logger.Level.DEBUG, "[PatternEditor/Pattern] Creating sub pattern #" + SubPatterns.Count + " (X:" + part.X + ";Y:" + part.Y + ";W:" + part.Width + ";H:" + part.Height + ")");
                SubPatterns.Add(new SubPattern(this, part));
            }

            Editor.SetSize(CurrentSubPattern.Width, CurrentSubPattern.Height);
            CurrentSubPattern.SelectLayer(0);
            CurrentSubPattern.UpdateImage();
            NeedReparse = true;
            Editor.LayersChanged();
            Editor.SubPatternChanged(CurrentSubPattern.Part);
            Editor.Tools.HistoryChanged(CurrentSubPattern.History);
        }
        catch (System.Exception e)
        {
            Logger.Log(Logger.Level.ERROR, "[PatternEditor/Pattern] Error while loading: " + e.ToString());
        }
    }
Exemple #2
0
 public void NextSubPattern()
 {
     _CurrentSubPattern++;
     if (_CurrentSubPattern >= SubPatterns.Count)
     {
         _CurrentSubPattern = 0;
     }
     Editor.SetSize(CurrentSubPattern.Width, CurrentSubPattern.Height);
     CurrentSubPattern.UpdateImage();
     CurrentSubPattern.Selected();
     Editor.SubPatternChanged(CurrentSubPattern.Part);
     Editor.Tools.HistoryChanged(CurrentSubPattern.History);
 }
Exemple #3
0
    public void Load()
    {
        SubPatterns = new List <SubPattern>();
        foreach (var part in Info.Parts)
        {
            SubPatterns.Add(new SubPattern(this, part));
        }

        Editor.SetSize(CurrentSubPattern.Width, CurrentSubPattern.Height);
        CurrentSubPattern.SelectLayer(0);
        CurrentSubPattern.UpdateImage();
        this.RegeneratePreview();
        Editor.LayersChanged();
        Editor.SubPatternChanged(CurrentSubPattern.Part);
        Editor.Tools.HistoryChanged(CurrentSubPattern.History);
    }