add a setting section for voxel costs

This commit is contained in:
Stephen Birarda 2014-07-23 10:54:55 -07:00
parent 70c8ddf961
commit 1a13fbb437
2 changed files with 32 additions and 6 deletions

View file

@ -16,5 +16,25 @@
"default": false
}
}
},
"voxels": {
"label": "Voxels",
"assignment-types": [3],
"settings": {
"per-voxel-cost": {
"label": "Per Voxel Cost",
"help": "Credit cost to change each voxel",
"placeholder": "0.00001",
"default": "0.00001",
"input_addon": "₵"
},
"volume-cost": {
"label": "Volume Cost",
"help": "Credit cost to change each cubed meter of voxel space",
"placeholder": "0.0005",
"default": "0.0005",
"input_addon": "₵"
}
}
}
}

View file

@ -16,16 +16,22 @@
<% var setting_id = group_key + "." + setting_key %>
<label for="<%- setting_id %>" class="col-sm-2 control-label"><%- setting.label %></label>
<div class="col-sm-10">
<% if(setting.type) %>
<% if (setting.type === "checkbox") { %>
<% var checked_box = (values[group_key] || {})[setting_key] || setting.default %>
<input type="checkbox" id="<%- setting_id %>" <%- checked_box ? "checked" : "" %>>
<% } else { %>
<% if (setting.type === "checkbox") { %>
<% var checked_box = (values[group_key] || {})[setting_key] || setting.default %>
<input type="checkbox" id="<%- setting_id %>" <%- checked_box ? "checked" : "" %>>
<% } else { %>
<% if (setting.input_addon) { %>
<div class="input-group">
<div class="input-group-addon"><%- setting.input_addon %></div>
<% } %>
<input type="text" class="form-control" id="<%- setting_id %>"
placeholder="<%- setting.placeholder %>"
value="<%- (values[group_key] || {})[setting_key] %>">
<% if (setting.input_addon) { %>
</div>
<% } %>
<% } %>
</div>
<p class="help-block col-sm-offset-2 col-sm-10"><%- setting.help %></p>
</div>