Added http success msg

http extensions cannot currently display a meaningful 'green dot' msg
such as 'WeDo connected' as the javascript extensions can. Therefore add
an http ext.success msg in an identical style to the existing 'yellow
dot' ext.failure msg.
This commit is contained in:
scraxe 2014-06-02 11:04:01 +01:00
parent 9b4b1d1f07
commit 1e9af83aa4
2 changed files with 3 additions and 1 deletions

View file

@ -266,7 +266,7 @@ public class ExtensionManager {
var msecsSinceLastResponse:uint = getTimer() - ext.lastPollResponseTime;
if (msecsSinceLastResponse > 500) indicator.setColorAndMsg(0xE00000, 'Cannot find helper app');
else if (ext.problem != '') indicator.setColorAndMsg(0xE0E000, ext.problem);
else indicator.setColorAndMsg(0x00C000, 'Okay');
else indicator.setColorAndMsg(0x00C000, ext.success);
}
else if(app.jsEnabled) {
var retval:Object = ExternalInterface.call('ScratchExtensions.getStatus', ext.name);
@ -531,6 +531,7 @@ public class ExtensionManager {
}
}
if ('_problem' == key) ext.problem = line.slice(9);
if ('_success' == key) ext.success = line.slice(9);
} else { // sensor value
var val:String = tokens[1];
var n:Number = Number(val);

View file

@ -58,6 +58,7 @@ public class ScratchExtension {
public var stateVars:Object = {};
public var lastPollResponseTime:int;
public var problem:String = '';
public var success:String = 'Okay';
public var nextID:int;
public var busy:Array = [];
public var waiting:Dictionary = new Dictionary(true);