mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2024-11-11 01:27:35 +08:00
紧急更新,修复了无法将整首歌转换bdx的bug,其余bug正在发现。
This commit is contained in:
parent
2da06136c5
commit
dd34ac9998
@ -186,7 +186,7 @@ def __main__():
|
||||
print('音·创 正在启动……')
|
||||
|
||||
print('载入日志功能...')
|
||||
from nmcsup.log import log
|
||||
from msctLib.log import log
|
||||
from nmcsup.log import end
|
||||
print('完成!')
|
||||
|
||||
@ -1299,7 +1299,6 @@ def __main__():
|
||||
initialfile=dataset[0]['mainset']['PackName'] + '.bdx')
|
||||
|
||||
maxHeight = 200
|
||||
print(maxHeight) # 使用变量
|
||||
|
||||
while True:
|
||||
maxHeight = tkinter.simpledialog.askinteger(title=READABLETEXT[28],
|
||||
@ -1320,7 +1319,7 @@ def __main__():
|
||||
|
||||
log('获得文件名:' + fileName)
|
||||
|
||||
res = music2BDX(fileName, dire, dataset[0], )
|
||||
res = music2BDX(fileName, dire, dataset[0], height = maxHeight )
|
||||
log('转换结束!\n' + str(res))
|
||||
tkinter.messagebox.showinfo(READABLETEXT[33], READABLETEXT[124].format(str(res)))
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -48,7 +48,7 @@ StrStartTime = str(datetime.datetime.now()).replace(':', '_')[:-7]
|
||||
'''字符串型的程序开始时间'''
|
||||
|
||||
|
||||
def log(info:str = '',level : str = 'INFO', isPrinted:bool = False):
|
||||
def log(info:str = '',level : str = 'INFO', isPrinted:bool = True):
|
||||
'''将信息连同当前时间载入日志
|
||||
:param info : str
|
||||
日志信息
|
||||
@ -66,12 +66,12 @@ def log(info:str = '',level : str = 'INFO', isPrinted:bool = False):
|
||||
|
||||
try:
|
||||
|
||||
if not os.path.exists('./log/'):
|
||||
os.makedirs('./log/')
|
||||
if not os.path.exists('./logs/'):
|
||||
os.makedirs('./logs/')
|
||||
|
||||
outputinfo = f'{str(datetime.datetime.now())[11:19]}-[{level}] {info}'
|
||||
|
||||
with open('./log/'+StrStartTime+'.msct.log', 'a',encoding='UTF-8') as f:
|
||||
with open('./logs/'+StrStartTime+'.msct.log', 'a',encoding='UTF-8') as f:
|
||||
f.write(outputinfo+'\n')
|
||||
|
||||
if isPrinted:
|
||||
|
Binary file not shown.
@ -12,7 +12,7 @@ import amulet
|
||||
from amulet.api.block import Block
|
||||
from amulet.utils.world_utils import block_coords_to_chunk_coords as bc2cc
|
||||
from amulet_nbt import TAG_String as ts
|
||||
from nmcsup.log import log
|
||||
from msctLib.log import log
|
||||
|
||||
|
||||
def hans2pinyin(hans, style=3):
|
||||
@ -33,11 +33,8 @@ def classList_conversion_SinglePlayer(List: list, ScoreboardName: str, playerSel
|
||||
commands = []
|
||||
length = len(List)
|
||||
j = 1
|
||||
print(List)
|
||||
for k in range(len(List)):
|
||||
i = List[k][0]
|
||||
print(i)
|
||||
print(type(i))
|
||||
try:
|
||||
commands.append(
|
||||
f"execute @a{playerSelection} ~ ~ ~ execute @s[scores={{{ScoreboardName}="
|
||||
@ -54,7 +51,6 @@ def classList_conversion_SinglePlayer(List: list, ScoreboardName: str, playerSel
|
||||
pass
|
||||
# a += List[i][1]
|
||||
# commands.append("\n\n# 凌云我的世界开发团队 x 凌云软件开发团队 : W-YI(金羿)\n")
|
||||
print(commands)
|
||||
return commands
|
||||
|
||||
|
||||
@ -268,6 +264,7 @@ def music2cmdBlocks(direction: Iterable, music: dict, isProsess: bool = False, h
|
||||
:return 返回一个列表,其中包含了音乐生成的所有的指令方块数据"""
|
||||
from msctspt.threadOpera import NewThread
|
||||
|
||||
|
||||
allblocks = []
|
||||
'''需要放置的方块'''
|
||||
baseDire = direction
|
||||
@ -279,9 +276,9 @@ def music2cmdBlocks(direction: Iterable, music: dict, isProsess: bool = False, h
|
||||
cmdList = classList_conversion_SinglePlayer(track['notes'], track['set']['ScoreboardName'],
|
||||
music['mainset']['PlayerSelect'], isProsess)
|
||||
if len(cmdList) == 0:
|
||||
return
|
||||
return []
|
||||
elif cmdList is []:
|
||||
return
|
||||
return []
|
||||
dire = direction
|
||||
down = False
|
||||
'''当前是否为向下的阶段?'''
|
||||
@ -317,7 +314,7 @@ def music2cmdBlocks(direction: Iterable, music: dict, isProsess: bool = False, h
|
||||
threads = []
|
||||
for track in music['musics']:
|
||||
threads.append(NewThread(trackDealing,(direction,track)))
|
||||
threads[threads.__len__()-1].start()
|
||||
threads[-1].start()
|
||||
direction[2] += 2
|
||||
|
||||
for th in threads:
|
||||
|
Loading…
Reference in New Issue
Block a user