Skip to content

Commit

Permalink
Explicitly state scene requirements in instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislawAntol committed Jun 17, 2015
1 parent a4e0d2a commit 1ae1a0f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
54 changes: 53 additions & 1 deletion site/abstract_scenes_v002.html
Expand Up @@ -114,7 +114,7 @@ <h2 style="color:black; margin:0 0 0 0;">Help Us Create Clipart Illustrations!
<div class="noSelect" align=left id="top_bar" style="background-color:lightblue">
<span id="counter" class="topBar noSelect" style="color:black;">Scene</span>

<div class="buttonHolder noSelect" style="display:inline-block; padding-bottom:5px; padding-top:5px; padding-left:414px">
<div class="buttonHolder noSelect" style="display:inline-block; float:right;padding-bottom:0px; padding-top:3px; padding-right:10px;">
<input id="prevButton" type="button" name="Prev" value="Prev">
<input id="nextButton" type="button" name="Next" value="Next">
</div>
Expand Down Expand Up @@ -204,6 +204,57 @@ <h2 style="color:black; margin:0 0 0 0;">Help Us Create Clipart Illustrations!
document.getElementById('exToggle').onclick = hideExamples;
}

function write_obj_reqs() {
var origText = 'Also need at least: ';
if (objectTypeOrder != undefined) {
reqStr = origText;
for (i = 0; i < objectTypeOrder.length; i++) {
var objCat = objectTypeOrder[i];
curReq = numObjTypeReqs[objCat];
curReqOn = curReqsOn[objCat];
if (curReqOn && curReq > 0) {
var objText;
if (objCat == 'human') {
if (curReq == 1) {
objText = 'person';
} else {
objText = 'people';
}
} else if (objCat == 'animal') {
if (curReq == 1) {
objText = 'animal';
} else {
objText = 'animals';
}
} else if (objCat == 'largeObject') {
if (curReq == 1) {
objText = 'large object';
} else {
objText = 'large objects';
}
} else if (objCat == 'smallObject') {
if (curReq == 1 ) {
objText = 'small object';
} else {
objText = 'small objects';
}
} else {
if (curReq == 1) {
objText = 'Object';
} else {
objText = 'Objects';
}
}
reqStr += curReq + ' ' + objText + ', ';
}
}
if (reqStr.length > origText.length) {
reqStr = reqStr.slice(0, -2);
document.getElementById('counter').innerHTML += ' - ' + reqStr;
}
}
}

function update_instructions() {
if (curSceneTypeBase == "Living") {
titleStr = "(<b style='color:red;'>" + "Living/Dining Room" + "</b>)";
Expand All @@ -229,6 +280,7 @@ <h2 style="color:black; margin:0 0 0 0;">Help Us Create Clipart Illustrations!
}

select_good();
write_obj_reqs();
}

update_instructions();
Expand Down
5 changes: 5 additions & 0 deletions site/abstract_scenes_v002_head.js
Expand Up @@ -82,6 +82,11 @@ var NUM_GOOD_EXAMPLES = 5;
// Maybe not good to do...
var ex_total = NUM_GOOD_EXAMPLES+1;

// Names of the object types (e.g., smallObject)
// in a defined order that governs their index
// into availableObject
var objectTypeOrder;

// These come from scene_config.json!
// Will be overwritten in reset_scene()
var minNumObj = 1; // How many clipart objects they need to use.
Expand Down
5 changes: 1 addition & 4 deletions site/abstract_scenes_v002_main.js
Expand Up @@ -2,10 +2,7 @@
var init_time;

var NUM_TABS = 0;
// Names of the object types (e.g., smallObject)
// in a defined order that governs their index
// into availableObject
var objectTypeOrder;

// objectType name -> idx for menu stuff
var objectTypeToIdx;
var numObjTypeShow;
Expand Down

0 comments on commit 1ae1a0f

Please sign in to comment.