Skip to content

Commit

Permalink
修改注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Aug 24, 2019
1 parent 530d481 commit 5915090
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/BaseManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export default abstract class BaseManager {
}

loadEnabled() {
Logger.warning(this.configPath)
this.loadedMap.set('majsoul_plus', this.defaultObject)
try {
this.enabled = JSON.parse(
Expand All @@ -107,7 +106,7 @@ export default abstract class BaseManager {
}

use(id: string, callback: (pack: MajsoulPlus.Metadata) => void = () => {}) {
// 资源包 ID 检查
// 拓展 ID 检查
if (!id.match(/^[_a-zA-Z0-9]+$/)) {
Logger.debug(`invalid ${this.name} id: ${id}`)
return this
Expand All @@ -116,19 +115,19 @@ export default abstract class BaseManager {
const folder = path.resolve(appDataDir, this.name, id)
const cfg = path.resolve(folder, `${this.name}.json`)

// 资源包目录存在性
// 拓展目录存在性
if (!fs.existsSync(folder) || !fs.statSync(folder).isDirectory()) {
Logger.debug(`${id} folder not found: ${folder}`)
return this
}

// 资源包配置文件存在性
// 拓展配置文件存在性
if (!fs.existsSync(cfg) || !fs.statSync(cfg).isFile()) {
Logger.debug(`${id} configuration file not found: ${cfg}`)
return this
}

// 获得资源包
// 获得拓展
let pack: MajsoulPlus.Metadata
try {
pack = JSON.parse(
Expand Down
4 changes: 1 addition & 3 deletions src/resourcepack/resourcepack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export function LoadResourcePack() {

// 扫描目录
const resourcepacks: string[] = getFoldersSync(Global.ResourceFolderPath)
resourcepacks.forEach(resourcepack =>
ResourcePackManager.load(resourcepack)
)
resourcepacks.forEach(resp => ResourcePackManager.load(resp))
ResourcePackManager.enableFromConfig()
ResourcePackManager.save()
}
Expand Down

0 comments on commit 5915090

Please sign in to comment.