mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Get rid of 'builtins' file since its useless and causes performance issues
This commit is contained in:
@@ -5,7 +5,6 @@ import { Application } from "../../application";
|
||||
import { AdProviderInterface } from "../ad_provider";
|
||||
import { createLogger } from "../../core/logging";
|
||||
import { ClickDetector } from "../../core/click_detector";
|
||||
import { performanceNow } from "../../core/builtins";
|
||||
import { clamp } from "../../core/utils";
|
||||
import { T } from "../../translations";
|
||||
|
||||
@@ -52,7 +51,7 @@ export class AdinplayAdProvider extends AdProviderInterface {
|
||||
return (
|
||||
this.getHasAds() &&
|
||||
!this.videoAdResolveFunction &&
|
||||
performanceNow() - this.lastVideoAdShowTime > minimumTimeBetweenVideoAdsMs
|
||||
performance.now() - this.lastVideoAdShowTime > minimumTimeBetweenVideoAdsMs
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,7 +140,7 @@ export class AdinplayAdProvider extends AdProviderInterface {
|
||||
showVideoAd() {
|
||||
assert(this.getHasAds(), "Called showVideoAd but ads are not supported!");
|
||||
assert(!this.videoAdResolveFunction, "Video ad still running, can not show again!");
|
||||
this.lastVideoAdShowTime = performanceNow();
|
||||
this.lastVideoAdShowTime = performance.now();
|
||||
document.body.appendChild(this.adContainerMainElement);
|
||||
this.adContainerMainElement.classList.add("visible");
|
||||
this.adContainerMainElement.classList.remove("waitingForFinish");
|
||||
@@ -167,7 +166,7 @@ export class AdinplayAdProvider extends AdProviderInterface {
|
||||
this.videoAdResolveTimer = null;
|
||||
|
||||
// When the ad closed, also set the time
|
||||
this.lastVideoAdShowTime = performanceNow();
|
||||
this.lastVideoAdShowTime = performance.now();
|
||||
resolve();
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Application } from "../../application";
|
||||
/* typehints:end */
|
||||
|
||||
import { AdProviderInterface } from "../ad_provider";
|
||||
import { performanceNow } from "../../core/builtins";
|
||||
import { createLogger } from "../../core/logging";
|
||||
|
||||
const minimumTimeBetweenVideoAdsMs = G_IS_DEV ? 1 : 5 * 60 * 1000;
|
||||
@@ -45,7 +44,7 @@ export class GamedistributionAdProvider extends AdProviderInterface {
|
||||
return (
|
||||
this.getHasAds() &&
|
||||
!this.videoAdResolveFunction &&
|
||||
performanceNow() - this.lastVideoAdShowTime > minimumTimeBetweenVideoAdsMs
|
||||
performance.now() - this.lastVideoAdShowTime > minimumTimeBetweenVideoAdsMs
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,7 +83,7 @@ export class GamedistributionAdProvider extends AdProviderInterface {
|
||||
showVideoAd() {
|
||||
assert(this.getHasAds(), "Called showVideoAd but ads are not supported!");
|
||||
assert(!this.videoAdResolveFunction, "Video ad still running, can not show again!");
|
||||
this.lastVideoAdShowTime = performanceNow();
|
||||
this.lastVideoAdShowTime = performance.now();
|
||||
|
||||
console.log("🎬 Gamedistribution: Start ad");
|
||||
try {
|
||||
@@ -104,7 +103,7 @@ export class GamedistributionAdProvider extends AdProviderInterface {
|
||||
this.videoAdResolveTimer = null;
|
||||
|
||||
// When the ad closed, also set the time
|
||||
this.lastVideoAdShowTime = performanceNow();
|
||||
this.lastVideoAdShowTime = performance.now();
|
||||
resolve();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user