From 88a048b682349ce15750c674608b9dd9f55cfe2e Mon Sep 17 00:00:00 2001 From: eos Date: Tue, 5 Feb 2013 17:04:07 +0000 Subject: [PATCH] - Disabling drag effects by default until crash issues are confirmed to be resolved. - Added a command to enable/disable the effects at runtime. --- Scripts/Commands/DragEffects.cs | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Scripts/Commands/DragEffects.cs diff --git a/Scripts/Commands/DragEffects.cs b/Scripts/Commands/DragEffects.cs new file mode 100644 index 000000000..ac5e4fcc8 --- /dev/null +++ b/Scripts/Commands/DragEffects.cs @@ -0,0 +1,38 @@ +using System; +using Server; + +namespace Server.Commands +{ + /* + * Temporary system to allow on-the-fly enabling and disabling + * of the drag effects, for investigating client crashes. + * + * By default the effects will be disabled. + */ + public static class DragEffects + { + public static void Initialize() + { + // Disable effects + Mobile.DragEffects = false; + + CommandSystem.Register( "DragEffects", AccessLevel.Administrator, new CommandEventHandler( DragEffects_OnCommand ) ); + } + + [Usage( "DragEffects [enable=false]" )] + [Description( "Enables or disables the item drag and drop effects." )] + public static void DragEffects_OnCommand( CommandEventArgs e ) + { + if ( e.Length == 0 ) + { + e.Mobile.SendMessage( "Drag effects are currently {0}.", Mobile.DragEffects ? "enabled" : "disabled" ); + } + else + { + Mobile.DragEffects = e.GetBoolean( 0 ); + + e.Mobile.SendMessage( "Drag effects have been {0}.", Mobile.DragEffects ? "enabled" : "disabled" ); + } + } + } +}