Skip to content
Merged
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
11 changes: 0 additions & 11 deletions _variables/cck.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,5 @@
"executable": "https://unity.com/releases/editor/whats-new/2021.3.45f2#installs"
}
}
},
"cck4": {
"version": "v4.0.1",
"downloadUrl": "https://files.chilloutvr.net/cck/CCK_4.0.1_Release.unitypackage",
"unity": {
"install": {
"version": "2022.3.58f1",
"hub": "unityhub://2022.3.58f1/ed7f6eacb62e",
"executable": "https://unity.com/releases/editor/whats-new/2022.3.58f1#installs"
}
}
}
}
69 changes: 69 additions & 0 deletions docs/assets/javascripts/cck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// docs/assets/javascripts/cck.js
// Fetches live CCK info from the API and fills in any element marked with data-cck (text) or data-cck-href (link href)
// Runs on every page render, including mkdocs-material instant navigation.

(function () {
const API_URL = "https://api.chilloutvr.net/1/public/cck/info";

// Cache the response across instant-nav page changes so we don't refetch on every navigation. Set to null to force a
// refetch.
let cckPromise = null;

function fetchCck() {
if (!cckPromise) {
cckPromise = fetch(API_URL)
.then((r) => {
if (!r.ok) throw new Error("HTTP " + r.status);
return r.json();
})
.then((json) => {
const i = json.data.cckInfo;
return {
"cck4.version": i.cckVersion,
"cck4.downloadUrl": i.cckDownloadUrl,
"cck4.unity.version": i.unityVersion,
"cck4.unity.hub": i.unityHubInstallUrl,
"cck4.unity.executable": i.unityDownloadUrl,
};
})
.catch((e) => {
// Reset so a later page view can retry, then re-throw.
cckPromise = null;
throw e;
});
}
return cckPromise;
}

function populate(map) {
document.querySelectorAll("[data-cck]").forEach((el) => {
const v = map[el.dataset.cck];
if (v != null) el.textContent = v;
});
document.querySelectorAll("[data-cck-href]").forEach((el) => {
const v = map[el.dataset.cckHref];
if (v != null) el.setAttribute("href", v);
});
}

function run() {
// Skip work if there's nothing to fill on this page
if (!document.querySelector("[data-cck], [data-cck-href]")) return;
fetchCck()
.then(populate)
.catch((e) => console.error("CCK info fetch failed:", e));
}

// mkdocs-material exposes document$ (an RxJS observable) that emits on every page load AND every instant-navigation
// render. Prefer it when present
if (typeof document$ !== "undefined" && document$.subscribe) {
document$.subscribe(run);
} else {
// Fallback for non-instant-nav setups
if (document.readyState !== "loading") {
run();
} else {
document.addEventListener("DOMContentLoaded", run);
}
}
})();
2 changes: 1 addition & 1 deletion docs/cck/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ChilloutVR is currently running on **Unity Version {{ chilloutvr.unity.nativeVer
The CCK can be used with the following Unity Versions:

+ **{{ cck.cck3.unity.install.version }}** ({{ cck.cck3.version }})
+ **{{ cck.cck4.unity.install.version }}** ({{ cck.cck4.version }})
+ **<span data-cck="cck4.unity.version">…</span>** (v<span data-cck="cck4.version">…</span>)

### Still have more Questions?
Couldn't find what you were looking for?
Expand Down
12 changes: 6 additions & 6 deletions docs/cck/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ comparison below.

A rewrite with a modern build panel, content browser, account
switcher, and reworked build pipeline. No more play mode
to upload. Uses **Unity {{ cck.cck4.unity.install.version }}**.
to upload. Uses **Unity <span data-cck="cck4.unity.version">…</span>**.

Missing some translations, but all future
development is happening here.
Expand Down Expand Up @@ -48,17 +48,17 @@ comparison below.

##### Download CCK 4

[ :fontawesome-solid-download: Download Content Creation Kit {{ cck.cck4.version }}]({{ cck.cck4.downloadUrl }}){ .md-button .md-button--primary }
[ :fontawesome-solid-download: Download Content Creation Kit v<span data-cck="cck4.version">…</span>](#){ .md-button .md-button--primary data-cck-href="cck4.downloadUrl" }

##### Download Unity for CCK 4

CCK 4 requires a newer version of Unity. We recommend **Unity {{ cck.cck4.unity.install.version }}**
CCK 4 requires a newer version of Unity. We recommend **Unity <span data-cck="cck4.unity.version">…</span>**

[ :fontawesome-solid-download: Unity {{ cck.cck4.unity.install.version }} (Unity Hub)]({{ cck.cck4.unity.install.hub }}){ .md-button .md-button--primary }
[ :fontawesome-solid-download: Unity {{ cck.cck4.unity.install.version }} (Win-Executable)]({{ cck.cck4.unity.install.executable }}){ .md-button }
[ :fontawesome-solid-download: Unity <span data-cck="cck4.unity.version">…</span> (Unity Hub)](#){ .md-button .md-button--primary data-cck-href="cck4.unity.hub" }
[ :fontawesome-solid-download: Unity <span data-cck="cck4.unity.version">…</span> (Win-Executable)](#){ .md-button data-cck-href="cck4.unity.executable" }

!!! info "Reguarding the Unity Security Update Advisory"
**Unity {{ cck.cck4.unity.install.version }}** will be flagged by Unity Hub as vulnerable due to a recent Unity Security Update Advisory.
**Unity <span data-cck="cck4.unity.version">…</span>** will be flagged by Unity Hub as vulnerable due to a recent Unity Security Update Advisory.
This issue does not affect the Unity Editor and is specific to player builds only, so __it is safe to use this version__ for creating content in ChilloutVR.

=== "CCK 3 (Legacy)"
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ extra_css:
- assets/stylesheets/extra.css
extra_javascript:
- assets/javascripts/extra.js
- assets/javascripts/cck.js
extra:
generator: false
alternate:
Expand Down