This commit is contained in:
bgArray 2022-01-29 22:02:42 +08:00
parent 255cc84ef3
commit 4b241dfc0b
20 changed files with 151 additions and 35 deletions

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

8
.idea/Musicreater.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,46 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="LongLine" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyArgumentEqualDefaultInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyAugmentAssignmentInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="false" level="WARNING" enabled_by_default="false">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="3.10" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMandatoryEncodingInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E501" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N803" />
<option value="N806" />
<option value="N813" />
<option value="N801" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="list.__getitem__" />
<option value="list.split" />
</list>
</option>
</inspection_tool>
</profile>
</component>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Musicreater.iml" filepath="$PROJECT_DIR$/.idea/Musicreater.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1182,7 +1182,7 @@ def __main__():
return
dire = [int(dire.split(' ')[0]), int(dire.split(' ')[1]), int(dire.split(' ')[2])]
except ValueError: # 测试完为ValueError故修改语法
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[120])
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[117])
continue
break
Outdire = tkinter.filedialog.askdirectory(title=READABLETEXT[29], initialdir=r'./')
@ -1253,7 +1253,7 @@ def __main__():
return
dire = [int(dire.split(' ')[0]), int(dire.split(' ')[1]), int(dire.split(' ')[2])]
except ValueError: # 测试完为ValueError故修改语法
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[120])
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[117])
continue
break

View File

@ -116,40 +116,40 @@ READABLETEXT = {
# 103:"",
# 104:"",
105: "找不到或无法读取文件😢:{}",
106: "您当前的项目已修改但未存储,是否先保存当前项目?",
107: "项目已经存储至:{}",
108: "音·创工程文件",
109: "任意类型",
110: "函数音创工程文件",
111: "MMFM0.0.6版本工程文件",
112: "全部类型",
113: "钢琴声音的音频文件",
114: "Midi文件",
115: "文本文件",
116: "请输入坐标:",
117: "您输入的格式有误,请重新输入!",
118: "我的世界指令函数文件",
119: "请输入执行链生成坐标:",
120: "您输入的格式有误,请重新输入。",
105: "Error with finding or reading file😢:{}",
106: "Project is unsaved, save before close?",
107: "Saved in: {}",
108: "Musicreater Project",
109: "Any Type",
110: "NoteFunCreater Project",
111: "MMFM (V0.0.6) Project",
112: "All Types",
113: ".MP3 file(piano sound)",
114: "Midi file",
115: "Text file",
116: "Position Inpution",
117: "Format Error❌, please Reinput!",
118: ".MCFUNCTION",
119: "The position of the ChainCB for execution:",
# 120: "",
121: "您的函数文件不大于一万条指令,无需进行分割操作。",
122: "请输入执行链生成相对坐标:",
123: "FastBuilder结构文件",
124: "转换结束!\n{}",
123: "FastBuilder Structure",
124: "Done!\n{}",
125: "一秒,音乐走几拍?",
126: "按下确认后在游戏中使用connect指令连接localhost:8080即可播放",
127: "请输入区域选择的开始坐标:",
128: "请输入区域选择的结束坐标:",
129: "所选区块导出时是否需要保留空气方块?",
130: "音·创结构文件",
131: "文件已生成\n{}",
132: "文件无法生成\n{}\n{}",
133: "本功能尚未开发。",
134: "您的称呼",
135: "您的联系方式",
136: "您对问题的描述",
137: "在程序结束后将清除日志及临时文件信息。",
138: "在程序结束后将不会清除日志及临时文件信息。",
131: "Done😃\n{}",
132: "Failed❌\n{}\n{}",
133: "Have not developed yet...",
134: "Your name",
135: "Your contact",
136: "Your description of Problem",
137: "Log file will be cleared when you exit.",
138: "Log file will NOT be cleared when you exit.",
139: "修改包名",
140: "修改音乐标题",
141: "修改玩家选择器\n注意!要加上中括号“[]”",
@ -158,5 +158,23 @@ READABLETEXT = {
144: "修改本音轨所用乐器",
145: "您输入的乐器并非游戏内置乐器,是否继续用您输入的字符作为乐器?",
146: "修改本音轨生成的文件名",
# -----2022.1.25更新
147: "生成新文件至...",
148: "从midi导入音轨且用新方法解析",
149: "Open New: Musicreater Project...",
150: "保存为新项目",
151: "另存为新项...",
152: "(开发调试)关闭本次日志记录",
153: "生成新函数包至...",
154: "生成新函数附加包文件至...",
155: "生成新函数附加包文件,并将神羽资源包以散包形式放置至...",
156: "[神羽资源包位置选择]:选择文件夹...",
157: "没有路径文件(.rpposi文件)请仔细阅读Readme或先试用帮助与疑问->[神羽资源包位置选择]:选择文件夹... 方法添加路径文件吧!",
158: "有路径文件(.rpposi文件)但路径指示错误请仔细阅读Readme或先用帮助与疑问->[神羽资源包位置选择]:选择文件夹... 更改路径!",
159: "更改路径文件(.rpposi文件)成功!!",
160: "从midi导入音轨且用类方法解析",
161: "打开 类方法: 音·创项目...",
162: "保存为类方法项目",
163: "另存为类方法项...",
}

View File

@ -119,7 +119,7 @@ READABLETEXT = {
105: "找不到或无法读取文件😢:{}",
106: "您当前的项目已修改但未存储,是否先保存当前项目?",
107: "项目已经存储至:{}",
108: ["音·创工程文件", "新:音·创工程文件", "音·创测试文件"],
108: "音·创工程文件",
109: "任意类型",
110: "函数音创工程文件",
111: "MMFM0.0.6版本工程文件",
@ -128,10 +128,10 @@ READABLETEXT = {
114: "Midi文件",
115: "文本文件",
116: "请输入坐标:",
117: "您输入的格式有误,请重新输入!",
117: "您输入的格式有误,请重新输入!",
118: "我的世界指令函数文件",
119: "请输入执行链生成坐标:",
120: "您输入的格式有误,请重新输入。",
# 120: "",
121: "您的函数文件不大于一万条指令,无需进行分割操作。",
122: "请输入执行链生成相对坐标:",
123: "FastBuilder结构文件",

View File

@ -72,14 +72,14 @@ def formCmdBlock(direction: list, command: str, particularValue: int, impluse: i
}
def note2bdx(filePath: str, dire: list, Notes: list, ScoreboardName: str, Instrument: str, PlayerSelect: str = '',
isProsess: bool = False, height: int = 200):
def note2bdx(filePath: str, dire: list, Notes: list, ScoreboardName: str, Instrument: str,
PlayerSelect: str = '', isProsess: bool = False, height: int = 200):
"""使用方法同Note2Cmd
:param 参数说明
filePath: 生成.bdx文件的位置
dire: 指令方块在地图中生成的起始位置相对位置
Notes: list[ list[ float我的世界playsound指令音调 , float延续时常单位s ] ] 格式存储的音符列表
例如Musicreater.py的(dataset[0]['musics'][NowMusic]['notes'])
例如Musicreater.py的(dataset[0]['musics'][NowMusic]['notes'])
ScoreboardName: 用于执行的计分板名称
Instrument: 播放的乐器
PlayerSelect: 执行的玩家选择器
@ -124,6 +124,23 @@ def note2bdx(filePath: str, dire: list, Notes: list, ScoreboardName: str, Instru
return BdxConverter(filePath, 'Build by RyounMusicreater', blocks)
def music2BDX(filePath: str, dire: list, Notes: list, ScoreboardName: str, Instrument: str,
PlayerSelect: str = '', isProsess: bool = False, height: int = 200):
"""使用方法同Note2Cmd
:param 参数说明
filePath: 生成.bdx文件的位置
dire: 指令方块在地图中生成的起始位置相对位置
Notes: list[ list[ float我的世界playsound指令音调 , float延续时常单位s ] ] 格式存储的音符列表
例如Musicreater.py的(dataset[0]['musics'][NowMusic]['notes'])
ScoreboardName: 用于执行的计分板名称
Instrument: 播放的乐器
PlayerSelect: 执行的玩家选择器
isProsess: 是否显示进度条会很卡
height: 生成结构的最高高度
:return 返回一个BdxConverter类实际上没研究过同时在指定位置生成.bdx文件"""
pass
def note2webs(Notes: list, Instrument: str, speed: float = 5.0, PlayerSelect: str = '', isProsess: bool = False):
"""传入音符在oaclhost:8080上建立websocket服务器以供我的世界connect/wssever指令连接
:param 参数说明
@ -162,7 +179,7 @@ def note2webs(Notes: list, Instrument: str, speed: float = 5.0, PlayerSelect: st
def note2RSworld(world: str, startpos: list, notes: list, instrument: str, speed: float = 2.5,
posadder: list = [1, 0, 0], baseblock: str = 'stone'): # -> bool
posadder: iterable = (1, 0, 0), baseblock: str = 'stone'): # -> bool
"""传入音符,生成以音符盒存储的红石音乐
:param 参数说明
world: 地图文件的路径