@@ -7,10 +7,13 @@
|
|
7
7
|
name: "needle-license",
|
8
8
|
enforce: 'pre',
|
9
9
|
async transform(src, id) {
|
10
|
-
|
10
|
+
const isNeedleEngineFile = id.includes("engine/engine_license") || id.includes("needle-tools_engine.js");
|
11
|
+
// sometimes the actual license parameter is in a unnamed chunk file
|
12
|
+
const isViteChunkFile = id.includes("chunk") && id.includes(".vite");
|
13
|
+
if (isNeedleEngineFile || isViteChunkFile) {
|
11
14
|
const needleConfig = await loadConfig();
|
12
15
|
if (needleConfig) {
|
13
|
-
if (needleConfig.hasProLicense
|
16
|
+
if (needleConfig.hasProLicense === true) {
|
14
17
|
src = src.replace("NEEDLE_ENGINE_COMMERCIAL_USE_LICENSE = false;", "NEEDLE_ENGINE_COMMERCIAL_USE_LICENSE = " + needleConfig.hasProLicense + ";");
|
15
18
|
return { code: src, map: null }
|
16
19
|
}
|
@@ -102,7 +102,7 @@
|
|
102
102
|
/**@deprecated use setTrigger */
|
103
103
|
SetTrigger(name: string | number) { this.setTrigger(name); }
|
104
104
|
setTrigger(name: string | number) {
|
105
|
-
console.log("
|
105
|
+
if(debug) console.log("SetTrigger", name);
|
106
106
|
this.runtimeAnimatorController?.setTrigger(name);
|
107
107
|
}
|
108
108
|
|
@@ -31,8 +31,8 @@
|
|
31
31
|
|
32
32
|
|
33
33
|
const licenseElementIdentifier = "needle-license-element";
|
34
|
-
const licenseDuration =
|
35
|
-
const licenseDelay =
|
34
|
+
const licenseDuration = 15000;
|
35
|
+
const licenseDelay = 500;
|
36
36
|
|
37
37
|
function onNonCommercialVersionDetected(ctx: IContext) {
|
38
38
|
setTimeout(() => insertNonCommercialUseHint(ctx), 2000);
|
@@ -67,7 +67,6 @@
|
|
67
67
|
|
68
68
|
licenseElement.title = "Needle Engine — non commercial version";
|
69
69
|
licenseElement.addEventListener("click", () => {
|
70
|
-
console.log("CLICK")
|
71
70
|
globalThis.open("https://needle.tools", "_blank");
|
72
71
|
});
|
73
72
|
|
@@ -162,6 +161,7 @@
|
|
162
161
|
mix-blend-mode: difference;
|
163
162
|
line-height: 1em;
|
164
163
|
margin-left: -3px;
|
164
|
+
text-shadow: 0 0 2px rgba(200,200,200, .3);
|
165
165
|
}
|
166
166
|
|
167
167
|
${selector} .text .non-commercial {
|
@@ -24,7 +24,7 @@
|
|
24
24
|
set radius(val: number) {
|
25
25
|
this._radius = val;
|
26
26
|
if (this.env)
|
27
|
-
this.env.
|
27
|
+
this.env.radius = val;
|
28
28
|
}
|
29
29
|
get radius(): number { return this._radius; }
|
30
30
|
private _radius: number = 100;
|