Skip to content

Commit 2a71a89

Browse files
committed
Flag to disable username.
1 parent 1b53939 commit 2a71a89

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

data/sample.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,4 @@ IsInputSorted=true
129129

130130
# OpenGL is experimental. Use at your own risk.
131131
UseOpenGL=false
132+
ShowUserName=true

data/twitter.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ IsInputSorted=true
130130

131131
# OpenGL is experimental. Use at your own risk.
132132
UseOpenGL=false
133+
ShowUserName=false

src/CodeSwarmConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public class CodeSwarmConfig {
102102
/** Controls where the config files are for the Physical Engine */
103103
public static final String PHYSICS_ENGINE_CONF_DIR = "PhysicsEngineConfigDir";
104104
public static final String IS_INPUT_SORTED_KEY = "IsInputSorted";
105+
public static final String SHOW_USER_NAME_KEY = "ShowUserName";
105106
/** Default regex and rgb values used to match anything not caught in the config file */
106107
public static String DEFAULT_COLOR_ASSIGN = "\"Misc\",\".*\",128,128,128,128,128,128";
107108

src/code_swarm.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public class code_swarm extends PApplet {
6969
// Data storage
7070
BlockingQueue<FileEvent> eventsQueue;
7171
boolean isInputSorted = false;
72+
boolean showUserName = false;
7273
protected static Map<String, FileNode> nodes;
7374
protected static Map<Pair<FileNode, PersonNode>, Edge> edges;
7475
protected static Map<String, PersonNode> people;
@@ -230,6 +231,7 @@ public void setup() {
230231
UPDATE_DELTA = (long) (86400000 / framesperday);
231232

232233
isInputSorted = cfg.getBooleanProperty(CodeSwarmConfig.IS_INPUT_SORTED_KEY);
234+
showUserName = cfg.getBooleanProperty(CodeSwarmConfig.SHOW_USER_NAME_KEY);
233235

234236
avatarFetcher = getAvatarFetcher(cfg.getStringProperty("AvatarFetcher"));
235237

@@ -1492,11 +1494,12 @@ public void draw() {
14921494
textFont(font);
14931495

14941496
fill(fontColor, life);
1495-
text(name, mPosition.x, mPosition.y+10);
1497+
if(showUserName)
1498+
text(name, mPosition.x, mPosition.y+10);
14961499
if (icon != null){
14971500
colorMode(RGB);
14981501
tint(255,255,255,max(0,life-80));
1499-
image(icon, mPosition.x-(avatarFetcher.size / 2), mPosition.y-(avatarFetcher.size - 5));
1502+
image(icon, mPosition.x-(avatarFetcher.size / 2), mPosition.y-(avatarFetcher.size - ( showUserName ? 5 : 15)));
15001503
}
15011504
}
15021505
}

0 commit comments

Comments
 (0)