From 195d7643476a8a6f881d626f79eb7d34f2f8af61 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 24 Mar 2009 00:27:46 +0000 Subject: [PATCH] Allow flushing and notifying to be suppressed when a value is set. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5689 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/Config.as | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/util/Config.as b/src/as/com/threerings/util/Config.as index f7cdbdaa2..51f552c9c 100644 --- a/src/as/com/threerings/util/Config.as +++ b/src/as/com/threerings/util/Config.as @@ -79,15 +79,18 @@ public class Config extends EventDispatcher /** * Returns the value specified. */ - public function setValue (name :String, value :Object) :void + public function setValue ( + name :String, value :Object, notify :Boolean = true, flush :Boolean = true) :void { _data[name] = value; - if (_so != null) { + if (flush && _so != null) { _so.flush(); // flushing is not strictly necessary } // dispatch an event corresponding - dispatchEvent(new ConfigValueSetEvent(name, value)); + if (notify) { + dispatchEvent(new ConfigValueSetEvent(name, value)); + } } /**