public Main() { //---About your Plugin---// config.Author = "Maxbuzz (n0!se & pr!mary)"; config.Name = "Plugin-Test"; config.Description = "something for fun !"; config.Version = "1.0"; //---Your Plugin's Commands---// Commands coms = new Commands(); coms.Add(new Command("start", @"/start", "Start Game")); coms.Add(new Command("finish", @"/finish", "Finish Game")); coms.Add(new Command("roll", @"/roll", "Roll in Game")); config.Commands = coms; }
public int SaveLayer(Paint paint) { _totalMatrices.Push(TotalMatrix); Commands?.Add(new SaveLayerCanvasCommand(_saveCount, paint)); _saveCount++; return(_saveCount); }
public int Save() { _totalMatrices.Push(TotalMatrix); Commands?.Add(new SaveCanvasCommand(_saveCount)); _saveCount++; return(_saveCount); }
public void Restore() { if (_totalMatrices.Count == 0) { Debug.WriteLine($"Invalid Save and Restore balance."); } else { TotalMatrix = _totalMatrices.Pop(); _saveCount--; } Commands?.Add(new RestoreCanvasCommand(_saveCount)); }
public void SetMatrix(Matrix matrix) { TotalMatrix = matrix; Commands?.Add(new SetMatrixCanvasCommand(matrix)); }
public void DrawTextOnPath(string text, Path path, float hOffset, float vOffset, Paint paint) { Commands?.Add(new DrawTextOnPathCanvasCommand(text, path, hOffset, vOffset, paint)); }
public void DrawText(string text, float x, float y, Paint paint) { Commands?.Add(new DrawTextCanvasCommand(text, x, y, paint)); }
public void DrawText(TextBlob textBlob, float x, float y, Paint paint) { Commands?.Add(new DrawTextBlobCanvasCommand(textBlob, x, y, paint)); }
public void DrawPath(Path path, Paint paint) { Commands?.Add(new DrawPathCanvasCommand(path, paint)); }
public void DrawImage(Image image, Rect source, Rect dest, Paint?paint = null) { Commands?.Add(new DrawImageCanvasCommand(image, source, dest, paint)); }
public void ClipRect(Rect rect, ClipOperation operation = ClipOperation.Intersect, bool antialias = false) { Commands?.Add(new ClipRectCanvasCommand(rect, operation, antialias)); }
public void ClipPath(ClipPath clipPath, ClipOperation operation = ClipOperation.Intersect, bool antialias = false) { Commands?.Add(new ClipPathCanvasCommand(clipPath, operation, antialias)); }
internal override void GenerateSubCommands() { Commands.Add(new acmdRenamePSMSchema(Controller, SchemaGuid, NewName)); }
public override void Load() { PreLoad(); var list = ReadHPGLCommandList(); RemoveFirstPenUp(list); RemoveLastPenUp(list); Smooth.CalculateAngles(list, null); if (LoadOptions.AutoScale) { var autoscale = new AutoScale { LoadOptions = LoadOptions, LoadX = this }; autoscale.AutoScaleList(list); } if (LoadOptions.SmoothType != LoadOptions.SmoothTypeEnum.NoSmooth) { var smooth = new Smooth { LoadOptions = LoadOptions, LoadX = this }; list = smooth.SmoothList(list); } if (LoadOptions.ConvertType != LoadOptions.ConvertTypeEnum.NoConvert) { var invert = new InvertLine { LoadOptions = LoadOptions, LoadX = this }; list = invert.ConvertInvert(list); } AddComment("PenMoveType", LoadOptions.PenMoveType.ToString()); switch (LoadOptions.PenMoveType) { case LoadOptions.PenType.CommandString: AddCommentForLaser(); break; case LoadOptions.PenType.ZMove: AddComment("PenDownSpeed", LoadOptions.EngraveDownSpeed); AddComment("PenUpPos", LoadOptions.EngravePosUp); AddComment("PenDownPos", LoadOptions.EngravePosDown); break; } AddComment("Speed", LoadOptions.MoveSpeed.ToString()); if (LoadOptions.PenMoveType == LoadOptions.PenType.ZMove) { AddCommands("M3"); if (LoadOptions.EngravePosInParameter) { Commands.AddCommand(new SetParameterCommand { ParameterNo = 1, GCodeAdd = LoadOptions.EngravePosUp.ToString(CultureInfo.InvariantCulture) }); Commands.AddCommand(new SetParameterCommand { ParameterNo = 2, GCodeAdd = LoadOptions.EngravePosDown.ToString(CultureInfo.InvariantCulture) }); } } if (LoadOptions.MoveSpeed.HasValue) { var setspeed = new G01Command(); setspeed.AddVariable('F', LoadOptions.MoveSpeed.Value); Commands.Add(setspeed); } foreach (var cmd in list) { if (!Command(cmd)) { Commands.Clear(); break; } } if (!_lastIsPenUp) { LoadPenUp(); } if (LoadOptions.PenMoveType == LoadOptions.PenType.ZMove) { AddCommands("M5"); } PostLoad(); }