Skip to content

Commit

Permalink
"package" option now shows loading window
Browse files Browse the repository at this point in the history
+ automatic id generation for loading windows
  • Loading branch information
solvedDev committed May 10, 2019
1 parent 093e044 commit 996896c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/renderer/components/sidebar/content/Explorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import TabSystem from '../../../scripts/TabSystem';
import ZipFolder from "zip-a-folder";
import fs from "fs";
import LoadingWindow from '../../../windows/LoadingWindow';
export default {
name: "content-explorer",
Expand Down Expand Up @@ -164,14 +165,13 @@
new CreateProjectWindow();
},
packageProject() {
let lw = new LoadingWindow();
let project = this.selected;
let path = this.base_path + project;
ZipFolder.zipFolder(path, `${path}.mcpack`, err => {
if(err) throw err;
fs.rename(`${path}.mcpack`, `${path}/${project}.mcpack`, (err) => {
if(err) throw err;
this.$root.$emit("refreshExplorer");
})
ZipFolder.zipFolder(path, `${path}\\${project}.mcpack`, err => {
if(err) console.error(err);
this.refresh();
lw.close();
});
},
openInExplorer() {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/windows/LoadingWindow.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import ContentWindow from "../scripts/commonWindows/Content";
import Store from "../store/index";
import uuidv4 from "uuid/v4";

export default class LoadingWindow extends ContentWindow {
constructor(id) {
constructor(id=uuidv4()) {
super({
options: {
is_visible: false,
Expand Down

0 comments on commit 996896c

Please sign in to comment.