紧急更新,修复了无法将整首歌转换bdx的bug,其余bug正在发现。

This commit is contained in:
EillesWan 2022-04-03 21:38:17 +08:00
parent 2da06136c5
commit dd34ac9998
6 changed files with 11 additions and 15 deletions

View File

@ -186,7 +186,7 @@ def __main__():
print('音·创 正在启动……') print('音·创 正在启动……')
print('载入日志功能...') print('载入日志功能...')
from nmcsup.log import log from msctLib.log import log
from nmcsup.log import end from nmcsup.log import end
print('完成!') print('完成!')
@ -1299,7 +1299,6 @@ def __main__():
initialfile=dataset[0]['mainset']['PackName'] + '.bdx') initialfile=dataset[0]['mainset']['PackName'] + '.bdx')
maxHeight = 200 maxHeight = 200
print(maxHeight) # 使用变量
while True: while True:
maxHeight = tkinter.simpledialog.askinteger(title=READABLETEXT[28], maxHeight = tkinter.simpledialog.askinteger(title=READABLETEXT[28],
@ -1320,7 +1319,7 @@ def __main__():
log('获得文件名:' + fileName) log('获得文件名:' + fileName)
res = music2BDX(fileName, dire, dataset[0], ) res = music2BDX(fileName, dire, dataset[0], height = maxHeight )
log('转换结束!\n' + str(res)) log('转换结束!\n' + str(res))
tkinter.messagebox.showinfo(READABLETEXT[33], READABLETEXT[124].format(str(res))) tkinter.messagebox.showinfo(READABLETEXT[33], READABLETEXT[124].format(str(res)))

View File

@ -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 :param info : str
日志信息 日志信息
@ -66,12 +66,12 @@ def log(info:str = '',level : str = 'INFO', isPrinted:bool = False):
try: try:
if not os.path.exists('./log/'): if not os.path.exists('./logs/'):
os.makedirs('./log/') os.makedirs('./logs/')
outputinfo = f'{str(datetime.datetime.now())[11:19]}-[{level}] {info}' 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') f.write(outputinfo+'\n')
if isPrinted: if isPrinted:

View File

@ -12,7 +12,7 @@ import amulet
from amulet.api.block import Block from amulet.api.block import Block
from amulet.utils.world_utils import block_coords_to_chunk_coords as bc2cc from amulet.utils.world_utils import block_coords_to_chunk_coords as bc2cc
from amulet_nbt import TAG_String as ts from amulet_nbt import TAG_String as ts
from nmcsup.log import log from msctLib.log import log
def hans2pinyin(hans, style=3): def hans2pinyin(hans, style=3):
@ -33,11 +33,8 @@ def classList_conversion_SinglePlayer(List: list, ScoreboardName: str, playerSel
commands = [] commands = []
length = len(List) length = len(List)
j = 1 j = 1
print(List)
for k in range(len(List)): for k in range(len(List)):
i = List[k][0] i = List[k][0]
print(i)
print(type(i))
try: try:
commands.append( commands.append(
f"execute @a{playerSelection} ~ ~ ~ execute @s[scores={{{ScoreboardName}=" f"execute @a{playerSelection} ~ ~ ~ execute @s[scores={{{ScoreboardName}="
@ -54,7 +51,6 @@ def classList_conversion_SinglePlayer(List: list, ScoreboardName: str, playerSel
pass pass
# a += List[i][1] # a += List[i][1]
# commands.append("\n\n# 凌云我的世界开发团队 x 凌云软件开发团队 : W-YI金羿\n") # commands.append("\n\n# 凌云我的世界开发团队 x 凌云软件开发团队 : W-YI金羿\n")
print(commands)
return commands return commands
@ -268,6 +264,7 @@ def music2cmdBlocks(direction: Iterable, music: dict, isProsess: bool = False, h
:return 返回一个列表其中包含了音乐生成的所有的指令方块数据""" :return 返回一个列表其中包含了音乐生成的所有的指令方块数据"""
from msctspt.threadOpera import NewThread from msctspt.threadOpera import NewThread
allblocks = [] allblocks = []
'''需要放置的方块''' '''需要放置的方块'''
baseDire = direction 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'], cmdList = classList_conversion_SinglePlayer(track['notes'], track['set']['ScoreboardName'],
music['mainset']['PlayerSelect'], isProsess) music['mainset']['PlayerSelect'], isProsess)
if len(cmdList) == 0: if len(cmdList) == 0:
return return []
elif cmdList is []: elif cmdList is []:
return return []
dire = direction dire = direction
down = False down = False
'''当前是否为向下的阶段?''' '''当前是否为向下的阶段?'''
@ -317,7 +314,7 @@ def music2cmdBlocks(direction: Iterable, music: dict, isProsess: bool = False, h
threads = [] threads = []
for track in music['musics']: for track in music['musics']:
threads.append(NewThread(trackDealing,(direction,track))) threads.append(NewThread(trackDealing,(direction,track)))
threads[threads.__len__()-1].start() threads[-1].start()
direction[2] += 2 direction[2] += 2
for th in threads: for th in threads: