Skip to content

Commit

Permalink
Allow changing default brush and transform
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 12, 2024
1 parent 7bd2ad3 commit 7d390c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions MCGalaxy/Commands/building/CmdAbort.cs
Expand Up @@ -15,6 +15,7 @@
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using MCGalaxy.Drawing.Brushes;
using MCGalaxy.Drawing.Transforms;

namespace MCGalaxy.Commands.Building
Expand All @@ -36,9 +37,10 @@ public sealed class CmdAbort : Command2
p.ModeBlock = Block.Invalid;
p.onTrain = false;
p.isFlying = false;
p.BrushName = "normal";

p.BrushName = Brush.DefaultBrush;
p.Transform = Transform.DefaultTransform;
p.DefaultBrushArgs = "";
p.Transform = NoTransform.Instance;

if (p.weapon != null) p.weapon.Disable();
p.Message("Every toggle or action was aborted.");
Expand Down
2 changes: 2 additions & 0 deletions MCGalaxy/Drawing/Brushes/Brush.cs
Expand Up @@ -23,6 +23,8 @@ namespace MCGalaxy.Drawing.Brushes
{
public abstract class Brush
{
public static string DefaultBrush = "Normal";

public abstract string Name { get; }
public virtual void Configure(DrawOp op, Player p) { }

Expand Down
2 changes: 2 additions & 0 deletions MCGalaxy/Drawing/Transform/Transform.cs
Expand Up @@ -24,6 +24,8 @@ namespace MCGalaxy.Drawing.Transforms
{
public abstract class Transform
{
public static Transform DefaultTransform = NoTransform.Instance;

public abstract string Name { get; }
public virtual void Configure(DrawOp op, Player p) { }

Expand Down
7 changes: 5 additions & 2 deletions MCGalaxy/Player/Player.Fields.cs
Expand Up @@ -16,6 +16,7 @@
using System.Collections.Generic;
using System.Net;
using MCGalaxy.Drawing;
using MCGalaxy.Drawing.Brushes;
using MCGalaxy.Drawing.Transforms;
using MCGalaxy.Events.PlayerEvents;
using MCGalaxy.Games;
Expand Down Expand Up @@ -50,10 +51,12 @@ public partial class Player : IDisposable {
public bool IsAfk, AutoAfk;
public bool cmdTimer;
public bool UsingWom;
public string BrushName = "Normal", DefaultBrushArgs = "";
public Transform Transform = NoTransform.Instance;
public string afkMessage;
public bool ClickToMark = true;

public string BrushName = Brush.DefaultBrush;
public Transform Transform = Transform.DefaultTransform;
public string DefaultBrushArgs = "";

/// <summary> Account name of the user, plus a trailing '+' if ClassiCubeAccountPlus is enabled </summary>
/// <remarks> Use 'truename' for displaying/logging, use 'name' for storing data </remarks>
Expand Down

0 comments on commit 7d390c5

Please sign in to comment.