Skip to content

Commit

Permalink
[v1.7.12] Merge pull request #289 from bridge-core/dev
Browse files Browse the repository at this point in the history
solvedDev authored Nov 12, 2020
2 parents 9bdf35a + e8c455e commit 5d6a163
Showing 27 changed files with 634 additions and 23 deletions.
12 changes: 6 additions & 6 deletions app/main/communicator.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import {
OpenDialogOptions,
} from 'electron'
import { dialog } from 'electron'
import fs from 'fs'
import { promises as fs } from 'fs'
import { DefaultDir } from '../shared/DefaultDir'
import { download } from 'electron-dl'
import path from 'path'
@@ -37,15 +37,15 @@ ipcMain.handle(
}
)

ipcMain.on('saveAsFileDialog', async (event, { path, content }) => {
ipcMain.handle('saveAsFileDialog', async (event, { path, content }) => {
let { filePath, canceled } = await dialog.showSaveDialog({
defaultPath: path.replace(/\//g, '\\'),
})

if (!canceled)
fs.writeFile(filePath, content, err => {
if (err) throw err
})
if (canceled) return false

await fs.writeFile(filePath, content)
return true
})

ipcMain.on('chooseDefaultDirectory', async (event, args) => {
9 changes: 6 additions & 3 deletions app/renderer/src/AppCycle/startUp.ts
Original file line number Diff line number Diff line change
@@ -15,16 +15,21 @@ import { loadDependency } from './fetchDeps'

export default async function startUp() {
SETTINGS.setup()

// Load toolbar
setupDefaultMenus()

// Start listening for online and offline events
CONNECTION.startListening()

createAppUpdateNotification()

//Setup auto-completions
Provider.loadAssets(
await loadDependency('auto-completions.js'),
await loadDependency('file-definitions.js')
)

setupDefaultMenus()
if (process.env.NODE_ENV !== 'development') {
let discordMsg = createNotification({
icon: 'mdi-discord',
@@ -38,8 +43,6 @@ export default async function startUp() {
})
}

createAppUpdateNotification()

if (process.env.NODE_ENV !== 'development') {
let getting_started = createNotification({
icon: 'mdi-help-circle-outline',
4 changes: 2 additions & 2 deletions app/renderer/src/FileSystem.ts
Original file line number Diff line number Diff line change
@@ -49,13 +49,13 @@ export default class FileSystem {
if (open) this.addAsTab(path, content, 0, content)
trigger('bridge:finishedSaving', path, true, false)
}
static basicSaveAs(
static async basicSaveAs(
path: string,
content: string,
update = false,
open = true
) {
ipcRenderer.send('saveAsFileDialog', { path, content })
return await ipcRenderer.invoke('saveAsFileDialog', { path, content })
}

static async open(file_path: string, is_immutable = false) {
7 changes: 4 additions & 3 deletions app/renderer/src/TabSystem.ts
Original file line number Diff line number Diff line change
@@ -558,8 +558,9 @@ class TabSystem {

//Load .no-cache file
const shouldBeCached = await useCache(current.file_path)
let shouldSetSaved = true
if (!shouldBeCached) {
FileSystem[fsMethod](
await FileSystem[fsMethod](
current.file_path,
await this.getSaveContent(
current,
@@ -570,7 +571,7 @@ class TabSystem {
)
} else {
let comment_char = FileType.getCommentChar(current.file_path)
FileSystem[fsMethod](
shouldSetSaved = await FileSystem[fsMethod](
current.file_path,
`${comment_char}bridge-file-version: #${
current.file_version
@@ -583,7 +584,7 @@ class TabSystem {
)
}

this.setCurrentSaved()
if (shouldSetSaved) this.setCurrentSaved()
win.close()
}
saveCurrentAs() {
3 changes: 1 addition & 2 deletions app/renderer/src/UI/Sidebar/Content/Explorer.vue
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ export default {
projectIcon: undefined,
}
},
mounted() {
created() {
this.projectIcon = this.loadProjectIcon()
this.$root.$on('refreshExplorer', () =>
EventBus.trigger('bridge:refreshExplorer')
@@ -171,7 +171,6 @@ export default {
destroyed() {
this.$root.$off('refreshExplorer')
EventBus.off('bridge:refreshExplorer', this.refresh)
EventBus.off('bridge:selectProject', this.selectProject)
EventBus.off('bridge:loadedFileDefs', this.onFileDefsLoaded)
this.disposables.forEach(disposable => disposable.dispose())
2 changes: 1 addition & 1 deletion app/shared/app_version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
* Current bridge. app version
*/
export default 'v1.7.11'
export default 'v1.7.12'
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "1.7.11",
"version": "1.7.12",
"author": "solvedDev <solveddev@gmail.com>",
"description": "A powerful add-on editor",
"license": "GNU",
13 changes: 13 additions & 0 deletions static/file_creator/texture_set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"icon": "mdi-texture",
"title": "Texture Set",
"extension": "json",
"path": "textures/blocks/",

"templates": {
"Blank Texture Set": {
"format_version": {},
"minecraft:texture_set": {}
}
}
}
8 changes: 8 additions & 0 deletions static/highlighter/texture_set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"set": {},
"define": {
"keywords": ["minecraft"],
"titles": ["format_version"],
"symbols": []
}
}
4 changes: 3 additions & 1 deletion static/presets/item_beta/item.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,9 @@
"nutrition": 4,
"saturation_modifier": "low"
},
"minecraft:icon": "{{PROJ_PREFIX}}_{{IDENTIFIER}}",
"minecraft:icon": {
"texture": "{{PROJ_PREFIX}}_{{IDENTIFIER}}"
},
"minecraft:use_animation": "eat",
"minecraft:render_offsets": "apple"
}
Loading

0 comments on commit 5d6a163

Please sign in to comment.