Skip to content
Open
Show file tree
Hide file tree
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
43 changes: 25 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,36 @@ <h3 class="panel-title">Your shooting ability</h3>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Course defaults</h3>
</div>
<div class="panel-body">
<div class="form-group">
<label for="metimp" class="col-sm-4 control-label">Metric / Imperial :</label>
<div class="col-sm-4">
<div class="btn-group" id="metimp">
<button type="button" id="btnImperial" class="btn btn-info active">Yards</button>
<button type="button" id="btnMetric" class="btn btn-default">Metres</button>
</div>
<div class="panel-heading">
<h3 class="panel-title">Course defaults</h3>
</div>
<div class="panel-body">
<div class="form-group">
<label for="metimp" class="col-sm-4 control-label">Metric / Imperial :</label>
<div class="col-sm-4">
<div class="btn-group" id="metimp">
<button type="button" id="btnImperial" class="btn btn-info active">Yards</button>
<button type="button" id="btnMetric" class="btn btn-default">Metres</button>
</div>
<p class="help-block">Target distance display</p>
</div>
<div class="form-group">
<label for="txtFixedWind" class="col-sm-4 control-label">Fixed wind speed (mph) :</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="txtFixedWind" placeholder="mph" min="1" max="20" step="1">
</div>
<p class="help-block">leave blank to accept the course default</p>
<p class="help-block">Target distance display</p>
</div>
<div class="form-group">
<label for="txtKnockDelay" class="col-sm-4 control-label">Knockout delay (s):</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="txtKnockDelay" placeholder="s" min="1" max="20" step="1">
</div>
<p class="help-block">leave blank to disable delay</p>
</div>
<div class="form-group">
<label for="txtFixedWind" class="col-sm-4 control-label">Fixed wind speed (mph) :</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="txtFixedWind" placeholder="mph" min="1" max="20" step="1">
</div>
<p class="help-block">leave blank to accept the course default</p>
</div>
</div>
</div>

<button type="submit" class="btn btn-primary btn-lg pull-right" id="btnSaveSettings">Continue&nbsp;<i class="glyphicon glyphicon-chevron-right"></i></button>
</form>
Expand Down
4 changes: 2 additions & 2 deletions script/gamecontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ GameControl.prototype = function(){
target.knockover();
scorecard.markTarget(self.currentTargetNumber,true);
scorecard.setScore(++self.score);
},400);
},400+1000*settings.data.KnockDelay);
} else if ( pelletStrikeRadius < (self.courseInfo.course[self.currentTargetNumber-1].killzone + 4)/2 ) {
scorecard.message("-- SPLIT --");
scorecard.markTarget(self.currentTargetNumber,false);
Expand All @@ -196,7 +196,7 @@ GameControl.prototype = function(){

setTimeout(function(){
_getNextTarget.call(self);
},2000);
},2000+1000*settings.data.KnockDelay);
};


Expand Down
9 changes: 8 additions & 1 deletion script/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ var Settings = function() {
ScopeErrorAt55 : 2,
CrossHair: "mildot",
Units: "y",
ScopeMag: 16
ScopeMag: 16,
KnockDelay: 0
};

self.FixedWind = 0;
Expand Down Expand Up @@ -99,6 +100,9 @@ Settings.prototype = function () {

var txtFixedWind = document.getElementById("txtFixedWind");
txtFixedWind.value = self.FixedWind > 0 ? self.FixedWind : "";

var txtKnockDelay = document.getElementById("txtKnockDelay");
txtKnockDelay.value = self.data.KnockDelay > 0 ? self.data.KnockDelay : "";

if( self.data.Units === "m" ) {
document.getElementById("btnMetric").className = "btn btn-info active";
Expand Down Expand Up @@ -143,6 +147,9 @@ Settings.prototype = function () {

var txtFixedWind = document.getElementById("txtFixedWind");
self.FixedWind = txtFixedWind.value !== ""?parseFloat(txtFixedWind.value):0;

var txtKnockDelay = document.getElementById("txtKnockDelay");
self.data.KnockDelay = txtKnockDelay.value !== ""?parseFloat(txtKnockDelay.value):0;

self.crossHairData = getCrossHairData(self.data.CrossHair);

Expand Down