diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Musicreater.iml b/.idea/Musicreater.iml new file mode 100644 index 0000000..2946dc0 --- /dev/null +++ b/.idea/Musicreater.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..a2a5d19 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,46 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8d93904 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b125bed --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9661ac7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/1.pkl b/1.pkl deleted file mode 100644 index bb555bb..0000000 Binary files a/1.pkl and /dev/null differ diff --git a/Musicreater.py b/Musicreater.py index 8bbcce6..7322474 100644 --- a/Musicreater.py +++ b/Musicreater.py @@ -225,15 +225,15 @@ def __main__(): print('加载菜单命令...') def exitapp(): - if os.path.isfile("1.pkl"): - # os.remove("1.pkl") - pass global is_save if is_save is not True: if tkinter.messagebox.askyesno(title=READABLETEXT[1], message=READABLETEXT[106]): SaveProject() log('程序正常退出') + if os.path.isfile("1.pkl"): + os.remove("1.pkl") + try: global dataset del dataset @@ -294,8 +294,14 @@ def __main__(): SaveAsNewProject() return else: + save_list = [dataset] + try: + with open("1.pkl", 'rb') as r: + save_list.append(pickle.load(r)) + except FileNotFoundError: + pass with open(ProjectName, 'wb') as f: - pickle.dump(dataset, f) + pickle.dump(save_list, f) tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(ProjectName)) global is_save is_save = True @@ -330,8 +336,15 @@ def __main__(): if fn is None or fn == '': return Project_Name = fn + save_list = [dataset] + try: + with open("1.pkl", 'rb') as r: + save_list.append(pickle.load(r)) + except FileNotFoundError: + pass + print(save_list) with open(Project_Name, 'wb') as f: - pickle.dump(dataset[0], f) + pickle.dump(save_list, f) tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(Project_Name)) global is_save is_save = True @@ -398,15 +411,28 @@ def __main__(): if fn is None or fn == '': return else: + # print(fn) fn = fn[0] + # print(fn) + log("尝试打开:" + fn) try: try: with open(fn, 'rb') as C: - dataset[0] = pickle.load(C) - except IndexError: + global dataset + # print(pickle.load(C)) + read = pickle.load(C) # 重要的事情说三遍!!!pickle.load只能load一次,所以多load几次就有bug,要一次读完! + # 重要的事情说三遍!!!pickle.load只能load一次,所以多load几次就有bug,要一次读完! + # 重要的事情说三遍!!!pickle.load只能load一次,所以多load几次就有bug,要一次读完! + # print(read) + dataset = read[0] + pkl1 = read[1] + log("读取新文件成功") + with open("1.pkl", 'wb') as w: + pickle.dump(pkl1, w) + except KeyError: with open(fn, 'rb') as C: - dataset[0] = pickle.load(C)[0] - + dataset[0] = pickle.load(C) + log("读取新文件成功") except pickle.UnpicklingError: # 程序规范修改:根据新的语法标准:except后面不能没有错误类型,测试后改为: # pickle.UnpicklingError print(READABLETEXT[8].format(fn)) @@ -721,8 +747,17 @@ def __main__(): if file is None or file == '': log('取消') return - from bgArrayLib.sy_resourcesPacker import scatteredPack - scatteredPack(file) + from bgArrayLib.sy_resourcesPacker import resources_pathSetting + result = resources_pathSetting(file) + print(result) + if result[0] is False: + if result[1] == 1: + tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[157]) + if result[1] == 2: + tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[158]) + else: + from bgArrayLib.sy_resourcesPacker import scatteredPack + scatteredPack(file) import zipfile from msctspt.funcOpera import makeNewFunDir @@ -745,6 +780,21 @@ def __main__(): shutil.move('./manifest.json', './temp/') shutil.rmtree('./temp/') + def changeResourcesPath(): + file = tkinter.filedialog.askdirectory(title=READABLETEXT[27], initialdir=r'./') + if file is None or file == '': + log('取消') + return + from bgArrayLib.sy_resourcesPacker import resources_pathSetting + result = resources_pathSetting(file) + print(result) + if result[0] is False: + if result[1] == 1: + tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[157]) + if result[1] == 2: + tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[158]) + else: + tkinter.messagebox.showinfo(title=READABLETEXT[1], message=READABLETEXT[159]) # 转为空方块世界 def ToBlockWorldEpt(): @@ -1178,8 +1228,9 @@ def __main__(): # 窗口部分 print('增加窗口元素...') global root + global __version__ - root.title(READABLETEXT[41].format(VER[1] + VER[0])) + root.title(READABLETEXT[41].format(__version__)) root.geometry('900x900') # 像素 print('完成!') @@ -1432,6 +1483,7 @@ def __main__(): helpmenu.add_command(label=READABLETEXT[85], command=ClearLog) helpmenu.add_command(label=READABLETEXT[86], command=resetver) helpmenu.add_command(label=READABLETEXT[152], command=end) + helpmenu.add_command(label=READABLETEXT[156], command=changeResourcesPath) helpmenu.add_separator() # 分隔符 diff --git a/README.md b/README.md index 1396742..a11cc3f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 金羿 (Eilles):主要作者,开发了音·创主体机器前身“函数音乐生成器”、“世界音创”。 -bgArray “诸葛亮与八卦阵”:修复bug,改进代码美观度等。 +bgArray “诸葛亮与八卦阵”:修复bug,改进代码美观度,增加新功能,更改数据格式等。 ### 软件架构 @@ -64,13 +64,31 @@ python3 Musicreater.py 2. 看得懂简体中文字的不一定全会用 3. 最好要懂一点点英文 + +### 诸葛亮与八卦阵的说明(不必要) + +1. 首先!这里的提示是给想使用多音色资源包的人的,如果你想请下载 神羽资源包(神羽自己的链接):https://pan.baidu.com/s/11uoq5zwN7c3rX-98DqVpJg +提取码:ek3t +2. 下载到你自己电脑上某个位置,注意并不需要放置于本项目下。音色资源包较大,可以选取只下载: +`神羽资源包_乐器、音源的资源包\羽音缭绕-midiout_25.0` 这个文件夹。 +3. 也可以只下载其中的: + `神羽资源包_乐器\音源的资源包\羽音缭绕-midiout_25.0\mcpack(国际版推荐)格式_25.0` 或者: + `神羽资源包_乐器\音源的资源包\羽音缭绕-midiout_25.0\zip格式_25.0` +4. 接下来就是关键了:在音创中绑定资源包 +5. 首先,先打开音创->帮助与疑问->[神羽资源包位置选择]:选择文件夹... 这时候, +会跳出选择框,关键来了,选择:***你的mcpack(国际版推荐)_25.0文件夹或zip格式_25.0文件夹,外面的!文件夹!注意是外面的文件夹!!*** + 举个例子:我的文件路径是这样的: + `L:\shenyu\音源的资源包\羽音缭绕-midiout_25.0`这里面有:`神羽资源包_25.0_使用方法.xls`、 + `mcpack(国际版推荐)格式_25.0`、`zip格式_25.0`两个文件夹和一个.xls文件,而你在音创中 + 也应该选择这个文件夹:**L:\shenyu\音源的资源包\羽音缭绕-midiout_25.0** + ### 致谢 1. 感谢由 [Fuckcraft](https://github.com/fuckcraft) “鸣凤鸽子”等 带来的我的世界websocket服务器功能 2. 感谢 昀梦\ 找出指令生成错误bug并指正 3. 感谢由 Charlie_Ping “查理平” 带来的bdx转换功能 4. 感谢由 CMA_2401PT 带来的 BDXWorkShop 供本程序对于bdx操作的指导 -5. +5. 感谢由 Miracle Plume “神羽” \带来的基岩版资源包 6. 感谢广大群友为此程序提供的测试等支持 7. 若您对我们有所贡献但您的名字没有显示在此列表中,请联系我! @@ -79,4 +97,8 @@ python3 Musicreater.py 1. QQ 2647547478 2. 电邮 EillesWan2006@163.com W-YI_DoctorYI@outlook.com EillesWan@outlook.com -3. 微信 WYI_DoctorYI \ No newline at end of file +3. 微信 WYI_DoctorYI + +### 作者 诸葛亮与八卦阵 联系方式 + +1. QQ 4740437765 \ No newline at end of file diff --git a/bgArrayLib/__pycache__/__init__.cpython-39.pyc b/bgArrayLib/__pycache__/__init__.cpython-39.pyc index 727712a..fe1e90c 100644 Binary files a/bgArrayLib/__pycache__/__init__.cpython-39.pyc and b/bgArrayLib/__pycache__/__init__.cpython-39.pyc differ diff --git a/bgArrayLib/__pycache__/bpm.cpython-39.pyc b/bgArrayLib/__pycache__/bpm.cpython-39.pyc index 7b635ed..5c12cda 100644 Binary files a/bgArrayLib/__pycache__/bpm.cpython-39.pyc and b/bgArrayLib/__pycache__/bpm.cpython-39.pyc differ diff --git a/bgArrayLib/__pycache__/namesConstant.cpython-39.pyc b/bgArrayLib/__pycache__/namesConstant.cpython-39.pyc index 2d96be4..32d3520 100644 Binary files a/bgArrayLib/__pycache__/namesConstant.cpython-39.pyc and b/bgArrayLib/__pycache__/namesConstant.cpython-39.pyc differ diff --git a/bgArrayLib/__pycache__/sy_resourcesPacker.cpython-39.pyc b/bgArrayLib/__pycache__/sy_resourcesPacker.cpython-39.pyc index 6cf2a36..05517b7 100644 Binary files a/bgArrayLib/__pycache__/sy_resourcesPacker.cpython-39.pyc and b/bgArrayLib/__pycache__/sy_resourcesPacker.cpython-39.pyc differ diff --git a/bgArrayLib/resourcesPath.rpposi b/bgArrayLib/resourcesPath.rpposi new file mode 100644 index 0000000..0830f11 --- /dev/null +++ b/bgArrayLib/resourcesPath.rpposi @@ -0,0 +1 @@ +L:/shenyu/ԴԴ/-midiout_25.0 \ No newline at end of file diff --git a/bgArrayLib/sy_resourcesPacker.py b/bgArrayLib/sy_resourcesPacker.py index 634f1ba..5e9d646 100644 --- a/bgArrayLib/sy_resourcesPacker.py +++ b/bgArrayLib/sy_resourcesPacker.py @@ -30,10 +30,11 @@ manifest = { def resources_pathSetting(newPath: str = ""): if not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and newPath == "": return [False, 1] # 1:没有路径文件 - elif not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and newPath != "": + elif newPath != "": # not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and path = newPath + print(path) with open("./bgArrayLib/resourcesPath.rpposi", 'w') as w: - path = w.write(path) + w.write(path) if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path): return [True, path, 1] # 1:都有 elif "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" not in os.listdir(path): @@ -42,7 +43,7 @@ def resources_pathSetting(newPath: str = ""): return [True, path, 3] # 3:有zip else: return [False, 2] # 2:路径文件指示错误 - if os.path.isfile("./bgArrayLib/resourcesPath.rpposi"): + if os.path.isfile("./bgArrayLib/resourcesPath.rpposi" and newPath == ""): with open("./bgArrayLib/resourcesPath.rpposi", 'r') as f: path = f.read() if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path): diff --git a/languages/__pycache__/__init__.cpython-39.pyc b/languages/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..7ebf6f0 Binary files /dev/null and b/languages/__pycache__/__init__.cpython-39.pyc differ diff --git a/languages/__pycache__/lang.cpython-39.pyc b/languages/__pycache__/lang.cpython-39.pyc new file mode 100644 index 0000000..db46249 Binary files /dev/null and b/languages/__pycache__/lang.cpython-39.pyc differ diff --git a/languages/__pycache__/zhCN.cpython-39.pyc b/languages/__pycache__/zhCN.cpython-39.pyc new file mode 100644 index 0000000..c7edc2e Binary files /dev/null and b/languages/__pycache__/zhCN.cpython-39.pyc differ diff --git a/languages/zhCN.py b/languages/zhCN.py index 6c2ecd0..3af1d06 100644 --- a/languages/zhCN.py +++ b/languages/zhCN.py @@ -168,5 +168,9 @@ READABLETEXT = { 153: "生成新函数包至...", 154: "生成新函数附加包文件至...", 155: "生成新函数附加包文件,并将神羽资源包以散包形式放置至...", + 156: "[神羽资源包位置选择]:选择文件夹...", + 157: "没有路径文件(.rpposi文件),请仔细阅读Readme或先试用:帮助与疑问->[神羽资源包位置选择]:选择文件夹... 方法添加路径文件吧!", + 158: "有路径文件(.rpposi文件),但路径指示错误,请仔细阅读Readme或先用:帮助与疑问->[神羽资源包位置选择]:选择文件夹... 更改路径!", + 159: "更改路径文件(.rpposi文件)成功!!" } diff --git a/msctspt/__pycache__/__init__.cpython-39.pyc b/msctspt/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..5ed360f Binary files /dev/null and b/msctspt/__pycache__/__init__.cpython-39.pyc differ diff --git a/msctspt/__pycache__/bugReporter.cpython-39.pyc b/msctspt/__pycache__/bugReporter.cpython-39.pyc new file mode 100644 index 0000000..4f78f75 Binary files /dev/null and b/msctspt/__pycache__/bugReporter.cpython-39.pyc differ diff --git a/msctspt/__pycache__/threadOpera.cpython-39.pyc b/msctspt/__pycache__/threadOpera.cpython-39.pyc new file mode 100644 index 0000000..7c778a0 Binary files /dev/null and b/msctspt/__pycache__/threadOpera.cpython-39.pyc differ diff --git a/msctspt/bugReporter.py b/msctspt/bugReporter.py index 71ff912..119b555 100644 --- a/msctspt/bugReporter.py +++ b/msctspt/bugReporter.py @@ -97,7 +97,7 @@ class version: ) """当前所需库,有一些是开发用的,用户不需要安装""" - version = ('0.0.1', 'Delta',) + version = ('0.1.0', 'Delta',) """当前版本""" def __init__(self) -> None: diff --git a/nmcsup/__pycache__/__init__.cpython-39.pyc b/nmcsup/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..fb15f92 Binary files /dev/null and b/nmcsup/__pycache__/__init__.cpython-39.pyc differ diff --git a/nmcsup/__pycache__/const.cpython-39.pyc b/nmcsup/__pycache__/const.cpython-39.pyc new file mode 100644 index 0000000..fa93dcd Binary files /dev/null and b/nmcsup/__pycache__/const.cpython-39.pyc differ diff --git a/nmcsup/__pycache__/log.cpython-39.pyc b/nmcsup/__pycache__/log.cpython-39.pyc new file mode 100644 index 0000000..44d2b05 Binary files /dev/null and b/nmcsup/__pycache__/log.cpython-39.pyc differ diff --git a/nmcsup/__pycache__/nmcreader.cpython-39.pyc b/nmcsup/__pycache__/nmcreader.cpython-39.pyc new file mode 100644 index 0000000..7c4025e Binary files /dev/null and b/nmcsup/__pycache__/nmcreader.cpython-39.pyc differ diff --git a/nmcsup/__pycache__/vers.cpython-39.pyc b/nmcsup/__pycache__/vers.cpython-39.pyc new file mode 100644 index 0000000..4475b85 Binary files /dev/null and b/nmcsup/__pycache__/vers.cpython-39.pyc differ diff --git a/resources/MSCT Dev Log.txt b/resources/MSCT Dev Log.txt index b3a8152..2d21574 100644 --- a/resources/MSCT Dev Log.txt +++ b/resources/MSCT Dev Log.txt @@ -30,9 +30,16 @@ Copyright © W-YI 2022 新更新日志 + Delta 0.1.0 +2022 1 27 +1.完成了多音色的支持,但仍需修改 + + Delta 0.0.2 +2022 1 19 +1.纠正几乎所有语法 Delta 0.0.1 -2021 1 3 +2022 1 3 1.新增对翻译字符串的支持 2.把所有需要翻译的字符串用双引号字符串表示,其余全是单引号字符串 2.2.累死我了,我错了我错了,饶了我吧,以后一定遵守代码规范