Skip to content

Commit

Permalink
[v1.7.5] Merge pull request #267 from bridge-core/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
solvedDev authored Sep 1, 2020
2 parents e62a229 + 8a90c97 commit 2e61ca1
Show file tree
Hide file tree
Showing 41 changed files with 451 additions and 178 deletions.
55 changes: 55 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Frequently-Asked-Questions

There are many questions that are asked frequently within the bridge. Discord, and this document goes through them.

**How do I use custom commands in game?**

You can’t; bridge. custom commands are used only inside of the editor (functions, items, animations, animation controllers, entities) as they are compiled into normal
commands.

**After editing an animation in bridge., it stopped working. Why?**

This is a known issue that has to do with how bridge. handles arrays and objects. The automatic type detection fails where there is ambiguity between objects and
animations and both options are valid. Solution: Do not edit animations from Blockbench with bridge.; manually fix broken animations with a text editor.

**Something isn’t behaving properly with bridge. behavior. What should I do?**

Please verify your bridge. version is the latest, and then report it in **#bugs** (within the bridge. Discord, specifying the version, the problem, and what you were
doing when the problem occured). We will get back to you as soon as we can. In case you have a GitHub account, it is preferred that you open an issue here:
https://github.com/bridge-core/bridge./issues/new/choose

**Something is wrong with the bridge. auto completions.**

Follow the same steps as reporting improper bridge. behavior.

**My entity exists in game, but is invisible.**

If your entity has a shadow but is invisible, give it the `skeleton` material in the client entity file. If it has no shadow, you probably need to add a render
controller.

**My addon isn’t working. Why?**

There are lots of reasons an addon might not work. Before you ask in an addon help channel within the bridge. Discord, please turn on content logs and review any errors.

**How do I turn on content logs?**

In *Minecraft* settings under the Profile section, there are two settings: ”Enable Content Log GUI” and “Enable Content Log File.” We recommend turning both on while
testing.
![Enable content logs](https://github.com/bridge-core/bridge./blob/master/images/faq_1.png)

**How do I make a scripting GUI?**

There are currently no tutorials for this, but Mojang has released an example pack using a GUI. You can get the pack here: https://aka.ms/minecraftscripting_turnbased

**Is there a tutorial for…?**

You can check #addon-guides in the bridge. Discord. If there isn’t one there, the documentation (https://bedrock.dev) might help. If you still need help, ask in an
available #addon-help channel.

**Do I need experimental gameplay for…?**

As of 1.16.0, the following things require experimental gameplay:
* Biomes
* Features
* Feature rules
* Scripts
7 changes: 6 additions & 1 deletion app/renderer/src/Presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,10 @@ export async function expandPresetFile(

if (typeof original === 'string')
await fs.writeFile(to_path, `${original}\n${templ}`)
else await writeJSON(to_path, detachMerge({}, original, JSON.parse(templ)))
else
await writeJSON(
to_path,
detachMerge({}, original, JSON.parse(templ)),
true
)
}
2 changes: 1 addition & 1 deletion app/renderer/src/Project/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SETTINGS from '../../store/Settings'
import { on } from '../AppCycle/EventSystem'
import { getFormatVersions } from '../autoCompletions/components/VersionedTemplate/Common'

on('bridge:changedProject', () => {
on('bridge:onProjectChanged', () => {
ProjectConfig.prefix_cache = undefined
ProjectConfig.formatVersionCache = undefined
})
Expand Down
3 changes: 2 additions & 1 deletion app/renderer/src/TabSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class TabSystem {
file_name: curr_file_name,
folders: curr_folders,
} = projects[this.project][i]
if (file_path === tab.file_path) {

if (path.resolve(file_path) === path.resolve(tab.file_path)) {
Store.commit('removeLoadingWindow', { id: 'open-file' })
return this.select(i)
} else if (curr_file_name === file_name) {
Expand Down
8 changes: 6 additions & 2 deletions app/renderer/src/UI/Editor/JsonEditor/JsonInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
id="json-editing-input"
ref="input"
@keydown.enter.native="click"
v-on="autoApplyEdit ? { change: click } : null"
:disabled="file_navigation === 'global'"
v-if="type == 'edit'"
v-model="value"
Expand Down Expand Up @@ -107,14 +108,17 @@ export default {
provide_auto_completions() {
return this.$store.state.Settings.auto_completions
},
autoApplyEdit() {
return this.$store.state.Settings.automatically_apply_edits
},
},
methods: {
click(val) {
if (this.trigger_cooldown) return
if (this.value === '')
if (!this.value)
this.value = this.$refs.input.$el.querySelector('input').value
if (this.value === '' || !this.value) return
if (!this.value) return
let current = this.render_object.get(this.file_navigation)
let is_data_path = TabSystem.getSelected().content.isDataPath(
this.file_navigation
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/UI/Editor/JsonEditor/PredictingInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
methods: {
click(val, force) {
if (this.trigger_cooldown) return
if (this.value === '')
if (!this.value)
this.value =
val || this.$refs.input.$el.querySelector('input').value
if (
Expand Down
19 changes: 18 additions & 1 deletion app/renderer/src/UI/Editor/SingleFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
}"
>
<v-container v-if="file_viewer === 'image'">
<img class="image" :src="image" style="max-width: 100%;" />
<img
class="image"
:src="image"
:style="`width: ${zoom}%; cursor: zoom-in;`"
@click.left="zoomIn"
@click.right="zoomOut"
/>
</v-container>
<audio-player v-else-if="file_viewer === 'audio'" :src="audio" />
<model-editor
Expand Down Expand Up @@ -79,6 +85,7 @@ export default {
func: 'mcfunction',
html: 'text/html',
},
zoom: 50,
}
},
computed: {
Expand Down Expand Up @@ -167,6 +174,16 @@ export default {
mimetype: `${type}/${ext}`,
})
},
zoomIn() {
if (this.zoom != 100) {
this.zoom = this.zoom + 10
}
},
zoomOut() {
if (this.zoom != 10) {
this.zoom = this.zoom - 10
}
},
},
watch: {
content_as_string() {
Expand Down
52 changes: 33 additions & 19 deletions app/renderer/src/UI/Sidebar/Content/Explorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<v-layout align-center>
<span style="padding: 0 4px;">
<v-avatar tile size="36px">
<img :src="project_icon" />
<img :src="projectIcon" />
</v-avatar>
</span>

Expand Down Expand Up @@ -150,9 +150,11 @@ export default {
no_projects: false,
loaded_file_defs: FileType.LIB_LOADED,
disposable: null,
projectIcon: undefined,
}
},
mounted() {
this.projectIcon = this.loadProjectIcon()
this.$root.$on('refreshExplorer', () =>
EventBus.trigger('bridge:refreshExplorer')
)
Expand Down Expand Up @@ -203,30 +205,15 @@ export default {
value: p,
}))
},
project_icon() {
try {
return DataUrl.convert({
data: fsync.readFileSync(
this.base_path + this.selected + '/pack_icon.png'
),
mimetype: `image/png`,
})
} catch (e) {
return DataUrl.convert({
data: fsync.readFileSync(
__static + '/images/pack_icon.png'
),
mimetype: `image/png`,
})
}
},
},
methods: {
openProjectScreen() {
if (this.force_project_algorithm === undefined)
ProjectChooser.open()
},
async refresh(force_val) {
this.projectIcon = this.loadProjectIcon()
if (this.force_project_algorithm) {
if (force_val) this.selected = force_val
console.log('[REFRESH RP] ' + this.selected)
Expand Down Expand Up @@ -261,7 +248,7 @@ export default {
async loadDirectory(dir = this.selected, force_reload) {
let lw = new LoadingWindow().show()
if (this.explorer_type === 'explorer') {
EventBus.trigger('bridge:changedProject')
EventBus.trigger('bridge:onProjectChanged')
OmegaCache.init(dir)
LightningCache.init()
JSONFileMasks.resetMasks()
Expand Down Expand Up @@ -350,6 +337,33 @@ export default {
createRP() {
CreateRP.open()
},
loadProjectIcon() {
try {
return DataUrl.convert({
data: fsync.readFileSync(
path.join(
this.base_path,
this.selected,
'pack_icon.png'
)
),
mimetype: `image/png`,
})
} catch (e) {
return DataUrl.convert({
data: fsync.readFileSync(
path.join(__static, '/images/pack_icon.png')
),
mimetype: `image/png`,
})
}
},
},
watch: {
selected() {
this.projectIcon = this.loadProjectIcon()
},
},
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/UI/Toolbar/Category/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron'
import TabSystem from '../../../TabSystem'
import SettingsWindow from '../../../../windows/Settings'
import ExtensionBrowser from '../../../../windows/Extensions/Browser'
import { ImportOBJ } from '../../Windows/ImportOBJ/definition'
import { ImportOBJ } from '../../Windows/Tools/ImportOBJ/definition'
import LoadingWindow from '../../../../windows/LoadingWindow'
import FileSystem from '../../../FileSystem'
import { ImportFileMap } from '../../../plugins/scripts/modules/importFiles'
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/UI/Toolbar/Category/tools.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IAppMenu } from '../create'
import { GoToFile } from '../../Windows/GoToFile/definition'
import { GoToFile } from '../../Windows/Tools/GoToFile/definition'
import SnippetWindow from '../../../../windows/Snippets'
import PresetWindow from '../../../../windows/PresetWindow'

Expand Down
2 changes: 2 additions & 0 deletions app/renderer/src/UI/Windows/Common/Input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ export default {
methods: {
onClose() {
this.currentWindow.close()
this.inputValue = ''
},
onConfirm() {
this.currentWindow.close()
this.onConfirmCb(this.inputValue + this.expandText)
this.inputValue = ''
},
},
}
Expand Down
40 changes: 37 additions & 3 deletions app/renderer/src/UI/Windows/Layout/Base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@input="$emit('closeWindow')"
:persistent="isPersistent"
:hide-overlay="!blurBackground"
:max-width="isFullscreen ? maxWidth : width"
:max-width="isFullscreen ? maxWindowWidth : windowWidth"
content-class="no-overflow"
>
<v-card height="100%" width="100%" color="background">
Expand Down Expand Up @@ -42,8 +42,8 @@

<v-card-text
:style="
`padding-top: 12px; max-height: ${maxHeight}px; height: ${
isFullscreen ? maxHeight : height
`padding-top: 12px; max-height: ${maxWindowHeight}px; height: ${
isFullscreen ? maxWindowHeight : windowHeight
}px; overflow-y: auto;`
"
>
Expand Down Expand Up @@ -94,11 +94,45 @@ export default {
type: Number,
default: 800,
},
percentageHeight: Number,
percentageWidth: Number,
maxPercentageHeight: Number,
maxPercentageWidth: Number,
},
computed: {
isDarkMode() {
return this.$store.state.Appearance.is_dark_mode
},
windowWidth() {
if (this.percentageWidth == undefined) {
return this.width
} else {
return (window.innerWidth / 100) * this.percentageWidth
}
},
windowHeight() {
if (this.percentageHeight == undefined) {
return this.height
} else {
return (window.innerHeight / 100) * this.percentageHeight - 150
}
},
maxWindowHeight() {
if (this.maxPercentageHeight == undefined) {
return this.maxHeight
} else {
return (
(window.innerHeight / 100) * this.maxPercentageHeight - 150
)
}
},
maxWindowWidth() {
if (this.maxPercentageWidth == undefined) {
return this.maxWidth
} else {
return (window.innerWidth / 100) * this.maxPercentageWidth
}
},
},
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions app/renderer/src/UI/Windows/Project/Chooser/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}}
</div>

<div>{{ projectDescription }}</div>
<div class="text-wrap">{{ projectDescription }}</div>
</v-card-text>

<!-- <v-divider class="mx-4"></v-divider>
Expand Down Expand Up @@ -50,7 +50,7 @@ export default {
} catch {}
},
data: () => ({
projectImage: join(__static, '/images/pack_icon.png'),
projectImage: join(__static, 'images/pack_icon.png'),
}),
computed: {
Expand All @@ -67,4 +67,4 @@ export default {
}
</script>

<style></style>
<style scoped></style>
Loading

0 comments on commit 2e61ca1

Please sign in to comment.