mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 09:27:34 +00:00
parent
dffe97e158
commit
3d1e602337
@ -3,8 +3,7 @@ import lodash from 'lodash'
|
|||||||
import cfgData from './cfg/CfgData.js'
|
import cfgData from './cfg/CfgData.js'
|
||||||
import { Version } from '#miao'
|
import { Version } from '#miao'
|
||||||
|
|
||||||
//const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
const _path = import.meta.dirname + '/../../../'
|
|
||||||
const _cfgPath = `${_path}/plugins/miao-plugin/components/`
|
const _cfgPath = `${_path}/plugins/miao-plugin/components/`
|
||||||
let cfg = {}
|
let cfg = {}
|
||||||
let miaoCfg = {}
|
let miaoCfg = {}
|
||||||
|
@ -2,8 +2,7 @@ import lodash from 'lodash'
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import util from 'node:util'
|
import util from 'node:util'
|
||||||
|
|
||||||
//const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
const _path = import.meta.dirname + '/../../../'
|
|
||||||
const getRoot = (root = '') => {
|
const getRoot = (root = '') => {
|
||||||
if (!root) {
|
if (!root) {
|
||||||
root = `${_path}/`
|
root = `${_path}/`
|
||||||
|
@ -20,15 +20,14 @@ export default class ProfileDmg extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static dmgRulePath (name, game = 'gs') {
|
static dmgRulePath (name, game = 'gs') {
|
||||||
//const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
const _path = import.meta.dirname + '/../'
|
|
||||||
let dmgFile = [
|
let dmgFile = [
|
||||||
{ file: 'calc_user', name: '自定义伤害' },
|
{ file: 'calc_user', name: '自定义伤害' },
|
||||||
{ file: 'calc_auto', name: '组团伤害', test: () => Common.cfg('teamCalc') },
|
{ file: 'calc_auto', name: '组团伤害', test: () => Common.cfg('teamCalc') },
|
||||||
{ file: 'calc', name: '喵喵' }
|
{ file: 'calc', name: '喵喵' }
|
||||||
]
|
]
|
||||||
for (let ds of dmgFile) {
|
for (let ds of dmgFile) {
|
||||||
let path = `${_path}/resources/meta-${game}/character/${name}/${ds.file}.js`
|
let path = `${_path}/plugins/miao-plugin/resources/meta-${game}/character/${name}/${ds.file}.js`
|
||||||
if (ds.test && !ds.test()) {
|
if (ds.test && !ds.test()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { Data } from '#miao'
|
|||||||
import lodash from 'lodash'
|
import lodash from 'lodash'
|
||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
|
|
||||||
const charPath = import.meta.dirname + '../../../resources/meta-gs/character'
|
const charPath = process.cwd() + '/plugins/miao-plugin/resources/meta-gs/character'
|
||||||
let cfgMap = {
|
let cfgMap = {
|
||||||
char: {},
|
char: {},
|
||||||
async init () {
|
async init () {
|
||||||
|
@ -17,10 +17,10 @@ import Button from './Button.js'
|
|||||||
|
|
||||||
for (let game of ['gs', 'sr']) {
|
for (let game of ['gs', 'sr']) {
|
||||||
for (let type of ['artifact', 'character', 'material', 'weapon']) {
|
for (let type of ['artifact', 'character', 'material', 'weapon']) {
|
||||||
let file = `${import.meta.dirname}/../resources/meta-${game}/${type}/index.js`
|
let file = `./plugins/miao-plugin/resources/meta-${game}/${type}/index.js`
|
||||||
if (fs.existsSync(file)) {
|
if (fs.existsSync(file)) {
|
||||||
try {
|
try {
|
||||||
await import(`file://${file}`)
|
await import(`file://${process.cwd()}/${file}`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user