Skip to content

Commit

Permalink
Spaces & tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeldruck committed Jan 1, 2024
1 parent df9b140 commit acc910b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 48 deletions.
35 changes: 8 additions & 27 deletions scripts/Drawings/HarvestablesDrawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ export class HarvestablesDrawing extends DrawingUtils {

interpolate(harvestables, lpX, lpY ,t ) {




for (const harvestableOne of harvestables) {







const hX = -1 * harvestableOne.posX + lpX;
const hY = harvestableOne.posY - lpY;

Expand All @@ -29,42 +21,30 @@ export class HarvestablesDrawing extends DrawingUtils {

}




harvestableOne.hX = this.lerp(harvestableOne.hX, hX, t);
harvestableOne.hY = this.lerp(harvestableOne.hY, hY, t);






}

}
invalidate(ctx, harvestables) {





invalidate(ctx, harvestables) {
for (const harvestableOne of harvestables) {

if (harvestableOne.size <=0) {
if (harvestableOne.size <= 0) {
continue;

}


if (!this.settings.harvestingTiers[harvestableOne.tier - 1]) {
/*if (!this.settings.harvestingTiers[harvestableOne.tier - 1]) {
continue;
}
if (!this.settings.harvestingEnchants[harvestableOne.charges]) {
continue;
}
}*/


const type = harvestableOne.type;
Expand Down Expand Up @@ -102,11 +82,12 @@ export class HarvestablesDrawing extends DrawingUtils {
this.drawImageCustom(ctx, point.x, point.y, draw, 50);
}

if (this.settings.harvestingSize) {
// ???
/*if (this.settings.harvestingSize) {
this.drawText(point.x, point.y +25 + 10, harvestableOne.size, ctx);
}
}*/



Expand Down
23 changes: 2 additions & 21 deletions scripts/Utils/DrawingUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class DrawingUtils {

constructor(settings) {
this.settings = settings;
this.fontSize = "12px";
this.fontFamily = "Arial";
this.fontSize = "12px";
this.fontFamily = "Arial";
this.textColor = "white";
this.images = [];
}
Expand Down Expand Up @@ -81,25 +81,6 @@ class DrawingUtils {
else {
this.settings.preloadImageAndAddToList(src);
}



















}

transformPoint(x, y) {
Expand Down

0 comments on commit acc910b

Please sign in to comment.