BugFix
Changes: - Now pulls goal progress from correct object - Fixed incorrect acceptable animation range
This commit is contained in:
+6
-8
@@ -71,8 +71,8 @@ class ProgressBar {
|
|||||||
//Increment the animation ticker (plus an extra round of safety checks)
|
//Increment the animation ticker (plus an extra round of safety checks)
|
||||||
if ((new_val >= 0)
|
if ((new_val >= 0)
|
||||||
&& (new_val <= this.current_progress)
|
&& (new_val <= this.current_progress)
|
||||||
&& (this.anim_progress < this.max_progress)
|
&& (this.anim_progress <= this.max_progress)
|
||||||
&& (new_val < this.max_progress)) {
|
&& (new_val <= this.max_progress)) {
|
||||||
this.anim_progress = new_val;
|
this.anim_progress = new_val;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -233,8 +233,6 @@ function communicate(websocket, book_bar) {
|
|||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
// INITIALIZE CLASS HERE
|
// INITIALIZE CLASS HERE
|
||||||
book_bar.animStart();
|
book_bar.animStart();
|
||||||
//setTimeout(() => book_bar.animEnd(), 30000);
|
|
||||||
//book_bar.simStart();
|
|
||||||
|
|
||||||
websocket.onopen = () => {
|
websocket.onopen = () => {
|
||||||
websocket.send(
|
websocket.send(
|
||||||
@@ -259,16 +257,16 @@ function communicate(websocket, book_bar) {
|
|||||||
switch (event.method) {
|
switch (event.method) {
|
||||||
case "setTimer":
|
case "setTimer":
|
||||||
//do something with the new data
|
//do something with the new data
|
||||||
console.log("set timer: " + event);
|
console.log("set timer: " + args.reward_progress);
|
||||||
book_bar.setProgress(event.reward_progress);
|
book_bar.setProgress(args.reward_progress);
|
||||||
break;
|
break;
|
||||||
case "noTimer":
|
case "noTimer":
|
||||||
//do something default
|
//do something default
|
||||||
console.log("no timer: " + event);
|
console.log("no timer: " + args);
|
||||||
break;
|
break;
|
||||||
case "endTimer":
|
case "endTimer":
|
||||||
//do something for the final time
|
//do something for the final time
|
||||||
console.log("end timer: " + event);
|
console.log("end timer: " + args);
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported method requested: ${event.method}.`)
|
throw new Error(`Unsupported method requested: ${event.method}.`)
|
||||||
|
|||||||
Reference in New Issue
Block a user