Skip to content

Commit

Permalink
1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Feb 28, 2019
1 parent b4fea26 commit 737a4cd
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 81 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<!-- [![Vue](https://img.shields.io/badge/dynamic/json.svg?label=vue&url=https%3A%2F%2Fraw.githubusercontent.com%2Ftoyobayashi%2Fmishiro%2Fmaster%2Fapp%2Fpackage.json&query=%24.dependencies.vue&colorB=41b883)](https://vuejs.org/)
[![Webpack](https://img.shields.io/badge/dynamic/json.svg?label=webpack&url=https%3A%2F%2Fraw.githubusercontent.com%2Ftoyobayashi%2Fmishiro%2Fmaster%2Fapp%2Fpackage.json&query=%24.devDependencies.webpack&colorB=55a7dd)](https://webpack.js.org/) -->

<font color="green" size=5>**Available >= [1.8.2](https://github.com/toyobayashi/mishiro/releases/tag/v1.8.2)**</font>
<font color="green" size=5>**Available >= [1.8.4](https://github.com/toyobayashi/mishiro/releases/tag/v1.8.4)**</font>

<font color="red" size=5>**Unavailable < [1.8.2](https://github.com/toyobayashi/mishiro/releases/tag/v1.8.2)**</font>
<font color="red" size=5>**Unavailable < [1.8.4](https://github.com/toyobayashi/mishiro/releases/tag/v1.8.4)**</font>

[Release Download](https://github.com/toyobayashi/mishiro/releases) __(Do not install mishiro in a path which includes Chinese or Japanese characters)__
[中文](https://github.com/toyobayashi/mishiro/blob/master/README_CN.md)
Expand Down
57 changes: 26 additions & 31 deletions app/package-lock.json

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

4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mishiro",
"version": "1.8.3",
"version": "1.8.4",
"description": "mishiro",
"main": "./public/mishiro.main.js",
"scripts": {
Expand Down Expand Up @@ -76,7 +76,7 @@
"electron-github-asar-updater": "^2.0.0",
"fs-extra": "^7.0.1",
"marked": "^0.5.2",
"mishiro-core": "^1.5.2",
"mishiro-core": "^1.5.3",
"request": "^2.88.0",
"sqlite3": "^4.0.6"
}
Expand Down
53 changes: 27 additions & 26 deletions app/src/ts/renderer/mishiro-idol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import InputText from '../../vue/component/InputText.vue'
import getPath from './get-path'
import * as fs from 'fs-extra'
import * as path from 'path'
import { ipcRenderer, shell } from 'electron'
import { /* ipcRenderer, */ shell } from 'electron'
import { MasterData } from '../main/on-master-read'
import { Vue, Component, Prop } from 'vue-property-decorator'
import { ProgressInfo } from 'mishiro-core'
import { unpackTexture2D } from './unpack-texture-2d'
// import { unpackTexture2D } from './unpack-texture-2d'

const { cardDir, voiceDir } = getPath

Expand Down Expand Up @@ -410,40 +410,41 @@ export default class extends Vue {

// try {
if (!fs.existsSync(cardDir(`bg_${id}.png`))) {
let hash: string = ipcRenderer.sendSync('searchManifest', `card_bg_${id}.unity3d`)[0].hash
downloadResult = await this.dler.downloadAsset(
hash,
cardDir(`card_bg_${id}`),
(progressing || (prog => { this.imgProgress = prog.loading }))
)
if (downloadResult) {
this.imgProgress = 99.99
fs.removeSync(cardDir(`card_bg_${id}`))
await unpackTexture2D(cardDir(`card_bg_${id}.unity3d`))
return cardDir(`bg_${id}.png`)
} else {
// throw new Error('abort')
return ''
}
}
return cardDir(`bg_${id}.png`)
// let hash: string = ipcRenderer.sendSync('searchManifest', `card_bg_${id}.unity3d`)[0].hash
// downloadResult = await this.dler.downloadAsset(
// hash,
// cardDir(`card_bg_${id}`),
// (progressing || (prog => { this.imgProgress = prog.loading }))
// )
// if (downloadResult) {
// this.imgProgress = 99.99
// fs.removeSync(cardDir(`card_bg_${id}`))
// await unpackTexture2D(cardDir(`card_bg_${id}.unity3d`))
// return cardDir(`bg_${id}.png`)
// } else {
// // throw new Error('abort')
// return ''
// }
// }
// return cardDir(`bg_${id}.png`)
// } catch (_err) {
// // downloadResult = await this.dler.downloadOne(
// // this.getCardUrl(id),
// // cardDir(`bg_${id}.png`),
// // (progressing || (prog => { this.imgProgress = prog.loading }))
// // )
// if (_err.message !== 'abort') {
// downloadResult = await this.dler.downloadSpread(
// id.toString(),
// cardDir(`bg_${id}.png`),
// (progressing || (prog => { this.imgProgress = prog.loading }))
// )
// return downloadResult
downloadResult = await this.dler.downloadSpread(
id.toString(),
cardDir(`bg_${id}.png`),
(progressing || (prog => { this.imgProgress = prog.loading }))
)
return downloadResult
// } else {
// throw _err
// }
// }
}
return cardDir(`bg_${id}.png`)
}
toggle (practice: string) {
switch (practice) {
Expand Down
38 changes: 18 additions & 20 deletions app/src/ts/renderer/mishiro-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ipcRenderer, Event } from 'electron'
import getPath from './get-path'
import MishiroIdol from './mishiro-idol'
import ThePlayer from './the-player'
import { unpackTexture2D } from './unpack-texture-2d'
// import { unpackTexture2D } from './unpack-texture-2d'

const { manifestPath, masterPath, bgmDir, iconDir } = getPath

Expand Down Expand Up @@ -124,27 +124,25 @@ export default class extends Vue {
// })
// }

getGachaIcon (icons: { name: string; hash: string; [x: string]: any }[]) {
return new Promise(async (resolve, _reject) => {
for (let i = 0; i < icons.length; i++) {
let cacheName = iconDir(path.parse(icons[i].name).name)
this.text = icons[i].name + ' ' + i + '/' + icons.length
this.loading = 100 * i / icons.length
if (!fs.existsSync(cacheName + '.png')) {
try {
let asset = await this.dler.downloadAsset(icons[i].hash, cacheName)
if (asset) {
fs.removeSync(cacheName)
await unpackTexture2D(asset)
}
} catch (err) {
console.log(err)
continue
}
async getGachaIcon (icons: { name: string; hash: string; [x: string]: any }[]) {
for (let i = 0; i < icons.length; i++) {
let cacheName = iconDir(path.parse(icons[i].name).name)
this.text = icons[i].name + ' ' + i + '/' + icons.length
this.loading = 100 * i / icons.length
if (!fs.existsSync(cacheName + '.png')) {
try {
// let asset = await this.dler.downloadAsset(icons[i].hash, cacheName)
// if (asset) {
// fs.removeSync(cacheName)
// await unpackTexture2D(asset)
// }
await this.dler.downloadIcon(icons[i].name.slice(5, 5 + 6), cacheName + '.png')
} catch (err) {
console.log(err)
continue
}
}
resolve()
})
}
}

mounted () {
Expand Down

0 comments on commit 737a4cd

Please sign in to comment.