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 c5b713fd1f - Show all commits

View File

@ -121,8 +121,16 @@ export class GameRuntime {
// скрипты (с маркером // @roblox-lua) теперь идут через ОДИН LuaSharedSandbox.
// .rbxl-скрипты распаковываем из JS-комментария-обёртки в чистый Lua.
const luaUserBatch = [];
// По умолчанию импортированные .rbxl-скрипты НЕ выполняются:
// - типичная Roblox-карта = 500-2000 скриптов, многие используют
// DataStore/Tool/PlayerGui/UserInputService, которых у нас нет;
// - даже с stub'ами сотни падений → tab подвисает;
// Юзер может включить через window.__RBXL_RUN_IMPORTED = true в консоли.
const runImportedRbxl = typeof window !== 'undefined' && window.__RBXL_RUN_IMPORTED === true;
let rbxlSkipped = 0;
for (const s of scripts) {
if (s && typeof s.code === 'string' && s.code.startsWith('// @roblox-lua')) {
if (!runImportedRbxl) { rbxlSkipped++; continue; }
const luaSource = unpackRobloxLuaCode(s.code);
if (luaSource && luaSource.trim()) {
luaUserBatch.push({
@ -212,6 +220,9 @@ export class GameRuntime {
if (rbxlImported > 0) {
this._log('info', `Запущено Roblox-Lua скриптов (импортированных): ${rbxlImported}`);
}
if (rbxlSkipped > 0) {
this._log('info', `Импортированных .rbxl-скриптов пропущено: ${rbxlSkipped}. Включить: window.__RBXL_RUN_IMPORTED = true`);
}
if (luaWritten > 0) {
this._log('info', `Запущено Lua-скриптов юзера: ${luaWritten}`);
}