void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) { type = type < 128 ? p.bindings[type] : type; RevertAndClearState(p, x, y, z); CatchPos cpos = (CatchPos)p.blockchangeObject; Level lvl = p.level; if (x == cpos.x && z == cpos.z) { Player.SendMessage(p, "No direction was selected"); return; } WriteDrawOp op = new WriteDrawOp(); op.Text = cpos.givenMessage; op.Scale = cpos.scale; op.Spacing = cpos.spacing; Brush brush = new SolidBrush(type, extType); if (!DrawOp.DoDrawOp(op, brush, p, cpos.x, cpos.y, cpos.z, x, y, z)) { return; } if (p.staticCommands) { p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1); } }
protected override DrawOp GetDrawOp(DrawArgs dArgs) { Player p = dArgs.Player; if (!p.CanUse("Write")) { p.Message("You must be able to use %T/Write %Sto use %T/WriteText."); return(null); } string[] args = dArgs.Message.SplitSpaces(3); if (args.Length < 3) { Help(p); return(null); } byte scale = 1, spacing = 1; if (!CommandParser.GetByte(p, args[0], "Scale", ref scale)) { return(null); } if (!CommandParser.GetByte(p, args[1], "Spacing", ref spacing)) { return(null); } WriteDrawOp op = new WriteDrawOp(); op.Scale = scale; op.Spacing = spacing; op.Text = args[2].ToUpper(); return(op); }
bool DoWrite(Player p, Vec3S32[] marks, object state, byte type, byte extType) { WriteArgs wArgs = (WriteArgs)state; if (marks[0].X == marks[1].X && marks[0].Z == marks[1].Z) { Player.Message(p, "No direction was selected"); return(false); } WriteDrawOp op = new WriteDrawOp(); op.Text = wArgs.message; op.Scale = wArgs.scale; op.Spacing = wArgs.spacing; Brush brush = new SolidBrush(type, extType); return(DrawOp.DoDrawOp(op, brush, p, marks)); }
bool DoWrite(Player p, Vec3S32[] marks, object state, ExtBlock block) { WriteArgs wArgs = (WriteArgs)state; if (marks[0].X == marks[1].X && marks[0].Z == marks[1].Z) { Player.Message(p, "No direction was selected"); return(false); } WriteDrawOp op = new WriteDrawOp(); op.Text = wArgs.message; op.Scale = wArgs.scale; op.Spacing = wArgs.spacing; Brush brush = new SolidBrush(block); DrawOpPerformer.Do(op, brush, p, marks); return(true); }