static void PerformRedo(Player p) { UndoDrawOpEntry[] entries = p.DrawOps.Items; if (entries.Length == 0) { p.Message("You have no &T/Undo %Sor &T/Undo [seconds] %Sto redo."); return; } for (int i = entries.Length - 1; i >= 0; i--) { UndoDrawOpEntry entry = entries[i]; if (entry.DrawOpName != "UndoSelf") { continue; } p.DrawOps.Remove(entry); RedoSelfDrawOp op = new RedoSelfDrawOp(); op.Start = entry.Start; op.End = entry.End; DrawOpPerformer.Do(op, null, p, new Vec3S32[] { Vec3U16.MinVal, Vec3U16.MaxVal }); p.Message("Redo performed."); return; } p.Message("No &T/Undo %Sor &T/Undo [timespan] %Scalls were " + "found in the last 200 draw operations."); }
static void PerformRedo(Player p) { UndoDrawOpEntry[] entries = p.DrawOps.Items; if (entries.Length == 0) { Player.SendMessage(p, "You have no %T/undo%S or %T/undo <seconds>%S to redo."); return; } for (int i = entries.Length - 1; i >= 0; i--) { UndoDrawOpEntry entry = entries[i]; if (entry.DrawOpName != "UndoSelf") { continue; } p.DrawOps.Remove(entry); RedoSelfDrawOp op = new RedoSelfDrawOp(); op.Start = entry.Start; op.End = entry.End; DrawOp.DoDrawOp(op, null, p, new [] { Vec3U16.MaxVal, Vec3U16.MaxVal }); Player.SendMessage(p, "Redo performed."); return; } Player.SendMessage(p, "No %T/undo%S or %T/undo <seconds>%S calls were " + "found in the last 200 draw operations."); }