feat(rbxl): XML-������ ������ .rbxl + Day/Night + Tool/Mouse/Backpack flow #38

Closed
min wants to merge 39 commits from feat/rbxl-xml-parser-import into main
Showing only changes of commit 6bec44d778 - Show all commits

View File

@ -910,10 +910,15 @@ export function registerRobloxShim(lua, opts) {
lighting.FogColor = new RbxColor3(0.75, 0.75, 0.75); lighting.FogColor = new RbxColor3(0.75, 0.75, 0.75);
lighting._minutes = 14 * 60; lighting._minutes = 14 * 60;
lighting.GetMinutesAfterMidnight = function () { return lighting._minutes; }; lighting.GetMinutesAfterMidnight = function () { return lighting._minutes; };
let _lastLightSent = 0;
lighting.SetMinutesAfterMidnight = function (m) { lighting.SetMinutesAfterMidnight = function (m) {
lighting._minutes = (Number(m) || 0) % 1440; lighting._minutes = (Number(m) || 0) % 1440;
lighting.ClockTime = lighting._minutes / 60; lighting.ClockTime = lighting._minutes / 60;
// Шлём в GameRuntime для обновления реального неба Babylon // Тротлинг: не чаще раза в 250мс. Скрипты Day/Night обновляют это
// каждый кадр (100+ Hz), это убивает WASM.
const now = performance.now();
if (now - _lastLightSent < 250) return;
_lastLightSent = now;
send('lightingTimeUpdate', { hour: lighting.ClockTime }); send('lightingTimeUpdate', { hour: lighting.ClockTime });
}; };
lighting.GetMoonDirection = function () { return new RbxVector3(0, 1, 0); }; lighting.GetMoonDirection = function () { return new RbxVector3(0, 1, 0); };