bedrock-development
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -87,3 +87,30 @@ "use strict"; | ||
let contents = yield ((0, github_1.requestURL)(item.download_url)); | ||
//TODO handle adding ui files, item_texture, and terrain_texture | ||
//TODO item_texture, and terrain_texture | ||
if (/hud_screen.json$/.test(path)) { | ||
try { | ||
let hud_screen = yield (0, file_manager_1.readJSONFromFile)(`${Global.project_rp}ui/hud_screen.json`); | ||
if (hud_screen.length) { | ||
let import_hud = JSONC.parse(contents.data); | ||
let new_hud = Object.assign(Object.assign({}, import_hud), hud_screen[0].json); | ||
new_hud['root_panel']['modifications'] = [...import_hud['root_panel']['modifications'], ...hud_screen[0].json['root_panel']['modifications']]; | ||
(0, file_manager_1.writeFileFromJSON)(path, new_hud, true); | ||
continue; | ||
} | ||
} | ||
catch (error) { | ||
} | ||
} | ||
if (/_ui_defs.json$/.test(path)) { | ||
try { | ||
let _ui_defs = yield (0, file_manager_1.readJSONFromFile)(`${Global.project_rp}ui/_ui_defs.json`); | ||
if (_ui_defs.length) { | ||
let import_defs = JSONC.parse(contents.data); | ||
let new_defs = { ui_defs: [...import_defs['ui_defs'], ..._ui_defs[0].json['ui_defs']] }; | ||
(0, file_manager_1.writeFileFromJSON)(path, new_defs, true); | ||
continue; | ||
} | ||
} | ||
catch (error) { | ||
} | ||
} | ||
// Handle json Files | ||
@@ -90,0 +117,0 @@ if (/.json$/.test(path)) { |
{ | ||
"name": "bedrock-development", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "APIs for creating and editing files related to Minecraft Bedrock development.", | ||
@@ -5,0 +5,0 @@ "main": "bin/index.js", |
@@ -49,4 +49,30 @@ import * as Global from './globals'; | ||
//TODO handle adding ui files, item_texture, and terrain_texture | ||
//TODO item_texture, and terrain_texture | ||
if (/hud_screen.json$/.test(path)) { | ||
try { | ||
let hud_screen = await readJSONFromFile(`${Global.project_rp}ui/hud_screen.json`); | ||
if (hud_screen.length) { | ||
let import_hud: any = JSONC.parse(contents.data); | ||
let new_hud = {...import_hud, ...hud_screen[0].json}; | ||
new_hud['root_panel']['modifications'] = [...import_hud['root_panel']['modifications'], ...hud_screen[0].json['root_panel']['modifications']] | ||
writeFileFromJSON(path, new_hud, true); | ||
continue; | ||
} | ||
} catch (error) { | ||
} | ||
} | ||
if (/_ui_defs.json$/.test(path)) { | ||
try { | ||
let _ui_defs = await readJSONFromFile(`${Global.project_rp}ui/_ui_defs.json`); | ||
if (_ui_defs.length) { | ||
let import_defs: any = JSONC.parse(contents.data); | ||
let new_defs = {ui_defs: [...import_defs['ui_defs'], ..._ui_defs[0].json['ui_defs']]}; | ||
writeFileFromJSON(path, new_defs, true); | ||
continue; | ||
} | ||
} catch (error) { | ||
} | ||
} | ||
// Handle json Files | ||
@@ -53,0 +79,0 @@ if (/.json$/.test(path)) { |
211496
3775