Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

Added a default implementation for the username block when offline #185

Merged
merged 1 commit into from
Jul 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/primitives/SensingPrims.as
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class SensingPrims {
primTable['isLoud'] = function(b:*):* { return app.runtime.isLoud() };
primTable['timestamp'] = primTimestamp;
primTable['timeAndDate'] = function(b:*):* { return app.runtime.getTimeString(interp.arg(b, 0)) };
primTable['getUserName'] = function(b:*):* { return '' };

// sensor
primTable['sensor:'] = function(b:*):* { return app.runtime.getSensor(interp.arg(b, 0)) };
Expand Down Expand Up @@ -306,12 +307,12 @@ public class SensingPrims {
var obj:ScratchObj = interp.targetObj();
if (obj) app.runtime.showVarOrListFor(interp.arg(b, 0), true, obj);
}

private function primHideListWatcher(b:Block):* {
var obj:ScratchObj = interp.targetObj();
if (obj) app.runtime.hideVarOrListFor(interp.arg(b, 0), true, obj);
}

private function primTimestamp(b:Block):* {
const millisecondsPerDay:int = 24 * 60 * 60 * 1000;
const epoch:Date = new Date(2000, 0, 1); // Jan 1, 2000 (Note: Months are zero-based.)
Expand Down