Skip to content

Commit

Permalink
v0.8.0 pt.18
Browse files Browse the repository at this point in the history
- added trade_table auto-completions for v1.11
- changed version setting
  • Loading branch information
solvedDev committed Feb 22, 2019
1 parent 4ffa83f commit 3dd94a3
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/renderer/scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const APP_VERSION = "v0.8.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 MINECRAFT_VERSIONS = [ "v1.10", "v1.11" ]
export const MINECRAFT_VERSIONS = [ "v1.10", "v1.11" ];
export const MANIFEST_TEMPLATE = (name="", des="") => `{
"format_version": 1,
"header": {
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/scripts/constants/file_templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ export default [
wants: [
{
item: "",
quantity: 1
quantity: {}
},
{
item: "",
quantity: 1
quantity: {}
}
],
gives: [
{
item: "",
quantity: 1
quantity: {}
}
]
}
Expand All @@ -45,12 +45,12 @@ export default [
"Blank Loot Table": {
pools: [
{
rolls: 1,
rolls: {},
entries: [
{
type: "item",
name: "",
weight: 1,
weight: {},
functions: [
{
"function": ""
Expand Down
1 change: 0 additions & 1 deletion src/renderer/scripts/editor/VersionMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default class VersionMap {
* @param {String} version
*/
static convert(state_id, version) {
console.log(MAP)
if(MAP[state_id] === undefined || MAP[state_id][version] === undefined) return state_id;
return MAP[state_id][version];
}
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/scripts/editor/autoCompletions.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ class Provider {

if(path.includes("entities")) return this.start_state = "entity/main";
if(path.includes("loot_tables")) return this.start_state = "loot_table";
if(path.includes("trading")) return this.start_state = "trade_table";
if(path.includes("trading")) return this.start_state = "trade_table/main";
if(path.includes("spawn_rules")) return this.start_state = "spawn_rule/main";
}

get(path) {
path = path.replace("global",
VersionMap.convert(this.start_state, Store.state.Settings.target_version)
);
console.log(path, LIB);
let propose = this.walk(path.split("/"));

if(typeof propose == "string") {
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/store/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ function setup() {
use_tabs: true,
line_wraps: false,
auto_completions: true,
open_all_nodes: false
open_all_nodes: false,
default_project: "",
target_version: ""
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/store/data/settings
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"is_dev_mode":true,"is_dark_mode":true,"inversed_arrows":false,"use_tabs":true,"line_wraps":false,"auto_completions":true,"open_all_nodes":true,"default_project":"A Test","target_version":"v1.11"}
{"is_dev_mode":false,"is_dark_mode":true,"inversed_arrows":false,"use_tabs":true,"line_wraps":false,"auto_completions":true,"open_all_nodes":false,"default_project":"a test","target_version":"v1.10"}
6 changes: 5 additions & 1 deletion src/renderer/windows/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export default class SettingsWindow extends TabWindow {
title: "Editor"
},
content: [
new ReactiveDropdown(this, "target_version", MINECRAFT_VERSIONS ,{ text: "Target Version", key: `settings.editor.tab.target_version.${Math.random()}` }),
{
color: "grey",
text: "\nTarget Minecraft Version"
},
new ReactiveDropdown(this, "target_version", MINECRAFT_VERSIONS ,{ text: "Choose a version...", key: `settings.editor.tab.target_version.${Math.random()}` }),
new ReactiveSwitch(this, "use_tabs", { color: "light-green", text: "Use Tabs", key: `settings.editor.tab.tabs.${Math.random()}` }),
new ReactiveSwitch(this, "line_wraps", { color: "light-green", text: "Word Wrap", key: `settings.editor.tab.tabs.${Math.random()}` }),
new ReactiveSwitch(this, "open_all_nodes", { color: "light-green", text: "Open All Nodes", key: `settings.editor.tab.open_all_nodes.${Math.random()}` }),
Expand Down
7 changes: 6 additions & 1 deletion static/auto_completions/files.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[
"general",

"entity/main",
"entity/main_v1_11",
"entity/components",
"entity/v1_11",
"entity/annotations",
"entity/behavior",
"entity/filters",

"loot_table",
"trade_table",

"trade_table/main",
"trade_table/v1_11",

"spawn_rule/main",
"spawn_rule/main_v1_11",
"spawn_rule/general",
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions static/auto_completions/trade_table/v1_11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"tiers": {
"$dynamic.list.next_index": {
"trades": {
"$dynamic.list.next_index": {
"wants": {
"$dynamic.list.index_pair": {
"item": "$general.item_identifier",
"quantity": "$general.number",
"price_multiplier": "$general.decimal"
}
},
"gives": {
"0": {
"item": "$general.item_identifier",
"quantity": "$general.number",
"price_multiplier": "$general.decimal"
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions static/auto_completions/version_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
},
"spawn_rule/main":{
"v1.11": "spawn_rule/main_v1_11"
},
"trade_table/main": {
"v1.11": "trade_table/v1_11"
}
}

0 comments on commit 3dd94a3

Please sign in to comment.