-
+
settings
diff --git a/src/renderer/scripts/constants.js b/src/renderer/scripts/constants.js
index 66270848f..869a89105 100644
--- a/src/renderer/scripts/constants.js
+++ b/src/renderer/scripts/constants.js
@@ -8,6 +8,7 @@ export const APP_VERSION = "v0.9.0";
export const WEB_APP_DATA = "https://solveddev.github.io/bridge-data/";
export const WEB_APP_PLUGINS = "https://solveddev.github.io/bridge-plugins/";
export const FILE_TEMPLATES = IMP_FILE_TEMPLATES;
+export const DOC_LIST = [ "entities", "addons", "moLang", "UI", "scripting", "particles", "animations" ];
export const MINECRAFT_VERSIONS = JSON.parse(fs.readFileSync(__static + "\\auto_completions\\versions.json").toString());
export const MANIFEST_TEMPLATE = (name="", des="") => `{
"format_version": 1,
diff --git a/src/renderer/scripts/documentation/main.js b/src/renderer/scripts/documentation/main.js
new file mode 100644
index 000000000..f27753f4b
--- /dev/null
+++ b/src/renderer/scripts/documentation/main.js
@@ -0,0 +1,86 @@
+//@ts-check
+import { WEB_APP_DATA, DOC_LIST } from "../constants";
+
+class DocumentationLoader {
+ constructor() {
+ this.html_data = {};
+ this.loading_status = 0;
+ this.loadData();
+ }
+
+ get progress() {
+ return (this.loading_status / DOC_LIST.length) * 100;
+ }
+ get finished_loading() {
+ return this.loading_status === DOC_LIST.length;
+ }
+
+ /**
+ * @param {String} type
+ */
+ get(type) {
+ return this.html_data[type];
+ }
+
+ loadData() {
+ this.loading_status = 0;
+ DOC_LIST.forEach(doc => {
+ fetch(`${WEB_APP_DATA}documentation/${doc}.html`)
+ .then(data => data.text())
+ .then(str => {
+ //this.html_data[doc] = document.implementation.createHTMLDocument(doc);
+ //this.html_data[doc].body.innerHTML = str;
+ this.html_data[doc] = str;
+ window.setTimeout(() => this.loading_status++, this.loading_status*100 + 1000);
+ });
+ });
+ }
+}
+
+export const DOC_WINDOW = new (class {
+ constructor() {
+ this.type = "";
+ this.loaded_type = "not_equal";
+ this.is_open = false;
+ this.loading = false;
+ }
+
+ /**
+ * @param {String} type
+ */
+ set(type) {
+ this.type = type;
+ }
+ get() {
+ return this.type;
+ }
+ equals() {
+ return this.loaded_type === this.type;
+ }
+ update() {
+ this.loaded_type = this.type;
+ }
+
+ /**
+ * @param {String} type
+ */
+ open(type) {
+ this.loading = true;
+ window.setTimeout(() => {
+ if(type !== undefined) this.type = type;
+ this.is_open = true;
+
+
+ //@ts-ignore
+ if(typeof this.onOpen === "function") this.onOpen(this.type);
+
+ this.loading = false;
+ }, 150);
+ }
+ close() {
+ this.is_open = false;
+ }
+})();
+
+
+export const DOC_LOADER = new DocumentationLoader();
\ No newline at end of file
diff --git a/src/renderer/scripts/editor/autoCompletions.js b/src/renderer/scripts/editor/autoCompletions.js
index 285c2dad6..ee0d4f7fc 100644
--- a/src/renderer/scripts/editor/autoCompletions.js
+++ b/src/renderer/scripts/editor/autoCompletions.js
@@ -166,7 +166,10 @@ class Provider {
}
});
- if(!str.includes("$dynamic")) this.walk(prev_path)[key] = result;
+ if(!str.includes("$dynamic")) {
+ let walked = this.walk(prev_path);
+ if(typeof walked === "object") walked[key] = result;
+ }
return result;
}
diff --git a/src/renderer/store/data/settings b/src/renderer/store/data/settings
index a748d8e65..f7cb82540 100644
--- a/src/renderer/store/data/settings
+++ b/src/renderer/store/data/settings
@@ -1 +1 @@
-{"is_dev_mode":false,"is_dark_mode":false,"inversed_arrows":false,"use_tabs":true,"line_wraps":false,"auto_completions":true,"open_all_nodes":false,"default_project":"test","target_version":"v1.11"}
\ No newline at end of file
+{"is_dev_mode":false,"is_dark_mode":false,"inversed_arrows":false,"use_tabs":true,"line_wraps":false,"auto_completions":true,"open_all_nodes":false,"default_project":"FunctionScripts","target_version":"v1.11"}
\ No newline at end of file
diff --git a/src/renderer/store/modules/SidebarMenu.js b/src/renderer/store/modules/SidebarMenu.js
index d9bc2e5d1..9cdb9c60e 100644
--- a/src/renderer/store/modules/SidebarMenu.js
+++ b/src/renderer/store/modules/SidebarMenu.js
@@ -11,6 +11,11 @@ const state = {
icon: "folder",
menu_type: "explorer"
},
+ {
+ title: "Documentation",
+ icon: "mdi-book-open-page-variant",
+ menu_type: "documentation"
+ },
{
title: "Extensions",
icon: "extension",
diff --git a/static/auto_completions/entity/v1_11.json b/static/auto_completions/entity/v1_11.json
index 98225364d..2aeadcee5 100644
--- a/static/auto_completions/entity/v1_11.json
+++ b/static/auto_completions/entity/v1_11.json
@@ -24,6 +24,17 @@
"within_radius": "$general.number",
"follow_distance": "$general.number"
},
+ "minecraft:behavior.hide": {
+ "priority": "$general.number",
+ "speed_multiplier": "$general.decimal",
+ "poi_type": "$general.poi_type",
+ "duration": "$general.number"
+ },
+ "minecraft.behavior.move_to_poi": {
+ "priority": "$general.number",
+ "speed_multiplier": "$general.decimal",
+ "poi_type": "$general.poi_type"
+ },
"minecraft:behavior.knockback_roar": {
"priority": "$general.number",
"attack_time": "$general.decimal",
@@ -55,7 +66,7 @@
},
"minecraft:angry": {
"broadcast_targets": {
- "$dynamic.list.next_index": "$general.entity_identifier"
+ "$dynamic.list.next_index": {}
}
},
"minecraft:break_blocks": {
@@ -75,7 +86,8 @@
"minecraft:economy_trade_table": {
"display_name": {},
"table": "$dynamic.trade_table_files",
- "new_screen": "$general.boolean"
+ "new_screen": "$general.boolean",
+ "hero_demand_discount": "$general.number"
},
"minecraft:scheduler": {
"min_delay_secs": "$general.number",
diff --git a/static/auto_completions/general.json b/static/auto_completions/general.json
index 5d9407d7e..063ff6dd4 100644
--- a/static/auto_completions/general.json
+++ b/static/auto_completions/general.json
@@ -60,6 +60,7 @@
"potion_number_id": [
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "34", "35", "36", "37", "38", "39", "40", "41"
],
+ "poi_type": [ "bed" ],
"slot_type": [ "slot.weapon.offhand", "slot.armor.chest" ],
"particle_name": [
"mobspellambient", "villagerangry", "blockbreak", "blockdust", "bubble", "evaporation", "crit", "dragonbreath", "driplava", "dripwater", "reddust", "spell", "mobappearance", "enchantingtable", "endrod", "mobspell", "largeexplode", "hugeexplosion", "fallingdust", "fireworksspark", "waterwake", "flame", "villagerhappy", "heart", "mobspellinstantaneous", "iconcrack", "slime", "snowballpoof", "largesmoke", "lava", "mobflame", "townaura", "nautilus", "note", "explode", "portal", "rainsplash", "smoke", "watersplash", "ink", "terrain", "totem", "trackingemitter", "witchspell"