mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2025-02-07 19:36:46 +08:00
我真的不鸽
This commit is contained in:
parent
325bb37210
commit
fff689446a
@ -9,9 +9,9 @@
|
||||
|
||||
"""
|
||||
音·创自动安装器 (Musicreater Auto Installer)
|
||||
对音·创的自动安装提供支持的独立软件
|
||||
对音·创的自动安装提供支持的工具
|
||||
Musicreater Auto Installer (音·创自动安装器)
|
||||
A software that used for installing Musicreater automatically
|
||||
A tool that used for installing Musicreater automatically
|
||||
|
||||
Copyright 2022 all the developers of Musicreater
|
||||
|
||||
@ -28,7 +28,6 @@ A software that used for installing Musicreater automatically
|
||||
limitations under the License.
|
||||
"""
|
||||
|
||||
# 代码写的并非十分的漂亮,还请大佬多多包涵;本软件源代码依照Apache软件协议公开
|
||||
|
||||
|
||||
# 下面为正文
|
||||
|
83
AutoInstaller/MSCT Launcher.py
Normal file
83
AutoInstaller/MSCT Launcher.py
Normal file
@ -0,0 +1,83 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# 音·创 开发交流群 861684859
|
||||
# Email EillesWan2006@163.com W-YI_DoctorYI@outlook.com EillesWan@outlook.com
|
||||
# 版权所有 金羿("Eilles Wan") & 诸葛亮与八卦阵("bgArray") & 鸣凤鸽子("MingFengPigeon")
|
||||
# 若需转载或借鉴 请依照 Apache 2.0 许可证进行许可
|
||||
|
||||
|
||||
"""
|
||||
音·创启动器 (Musicreater Launcher)
|
||||
对音·创的自动安装以及相应版本选择提供支持的工具
|
||||
Musicreater Launcher (音·创启动器)
|
||||
A tool that used for installing Musicreater automatically
|
||||
|
||||
Copyright 2022 all the developers of Musicreater
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an 'AS IS' BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
# 下面为正文
|
||||
|
||||
|
||||
from sys import platform
|
||||
|
||||
|
||||
def __mian__():
|
||||
if platform == 'win32':
|
||||
import wx
|
||||
# 主窗口类
|
||||
class MainFrame(wx.Frame):
|
||||
def __init__(self, parent, title):
|
||||
wx.Frame.__init__(self, id=wx.NewId(), parent=parent, title=title, size=(300, 500))
|
||||
|
||||
self.buttonMainVer = wx.Button(self, -1, u"音·创主版本", pos=(50, 20), style=1)
|
||||
|
||||
self.button_pkgver = wx.Button(self, -1, u"音·创库版本", pos=(50, 60))
|
||||
|
||||
self.Bind(wx.EVT_BUTTON, self.mainVer, self.buttonMainVer)
|
||||
self.buttonMainVer.SetDefault()
|
||||
|
||||
self.Bind(wx.EVT_BUTTON, self.pkgVer, self.button_pkgver)
|
||||
self.button_pkgver.SetDefault()
|
||||
|
||||
def mainVer(self, event):
|
||||
wx.MessageBox("音·创主版本尚在开发过程中,敬请期待!", "提示", wx.OK | wx.ICON_INFORMATION)
|
||||
|
||||
def pkgVer(self, event):
|
||||
downloadPkgVer()
|
||||
|
||||
|
||||
|
||||
app = wx.App(False)
|
||||
frame = MainFrame(None, "音·创 启动器")
|
||||
frame.Show()
|
||||
app.MainLoop()
|
||||
elif platform == 'linux':
|
||||
pass
|
||||
|
||||
|
||||
def downloadPkgVer():
|
||||
pass
|
||||
|
||||
# from git import Repo
|
||||
|
||||
# Repo.clone_from('','')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
__mian__()
|
||||
|
@ -147,7 +147,7 @@ class MainWindow(wx.Frame):
|
||||
except Exception as E:
|
||||
if self.debug:
|
||||
raise E
|
||||
log('无法读取菜单信息', 'WARRING')
|
||||
log('无法读取菜单信息', 'ERROR')
|
||||
# 如果不是空参数则新建菜单
|
||||
log('新建一个菜单')
|
||||
|
||||
|
@ -111,90 +111,3 @@ def _(text: str, debug: bool = False):
|
||||
return ''
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 启动语言编辑器
|
||||
import tkinter as tk
|
||||
from tkinter.filedialog import askopenfilename as askfilen
|
||||
|
||||
LANGNAME = _('LANGLOCALNAME')
|
||||
|
||||
|
||||
def _changeDefaultLang():
|
||||
global _TEXT
|
||||
global DEFAULTLANGUAGE
|
||||
|
||||
fileName = askfilen(title='选择所翻译的语言文件', initialdir=r'./',
|
||||
filetypes=[('音·创语言文件', '.lang'), ('所有文件', '*')],
|
||||
defaultextension='.lang',
|
||||
initialfile='.lang')
|
||||
_TEXT = __loadLanguage(fileName)
|
||||
DEFAULTLANGUAGE = _('LANGKEY')
|
||||
LANGNAME = _('LANGLOCALNAME')
|
||||
|
||||
orignText = ''
|
||||
transText = ''
|
||||
for i, j in _TEXT.items():
|
||||
orignText += i + '\n'
|
||||
transText += j + '\n'
|
||||
|
||||
Origntextbar.insert('end', orignText)
|
||||
Translatetextbar.insert('end', transText)
|
||||
|
||||
global setlangbutton
|
||||
setlangbutton['text'] = f'对标语言{LANGNAME}'
|
||||
|
||||
|
||||
def _autoSave(event=None):
|
||||
with open('autosave.tmp.txt', 'w', encoding='utf-8') as f:
|
||||
f.write(Translatetextbar.get(1.0, 'end'))
|
||||
print(str(event))
|
||||
|
||||
|
||||
root = tk.Tk()
|
||||
|
||||
root.geometry('600x500')
|
||||
|
||||
root.bind("<Motion>", _autoSave)
|
||||
|
||||
nowText = ''
|
||||
|
||||
Orignrame = tk.Frame(root, bd=2)
|
||||
Translaterame = tk.Frame(root, bd=2)
|
||||
|
||||
Orignscrollbar = tk.Scrollbar(Orignrame)
|
||||
Origntextbar = tk.Text(Orignrame, width=35, height=40)
|
||||
|
||||
Translatetextbar = tk.Text(Translaterame, width=40, height=37, undo=True)
|
||||
Translatescrollbar = tk.Scrollbar(Translaterame)
|
||||
|
||||
def ctrlZ():
|
||||
Translatetextbar.edit_undo()
|
||||
Translatetextbar.bind("<Control-z>", ctrlZ)
|
||||
|
||||
def ctrlY():
|
||||
Translatetextbar.edit_redo()
|
||||
Translatetextbar.bind("<Control-y>", ctrlY)
|
||||
|
||||
Translatetextbar.bind("<Control-s>", _autoSave)
|
||||
|
||||
tk.Button(Translaterame, text='保存', command=_autoSave).pack(side='bottom', fill='x')
|
||||
|
||||
tk.Label(Orignrame, text='中文原文').pack(side='top')
|
||||
Origntextbar.pack(side='left', fill='y')
|
||||
Orignscrollbar.pack(side='left', fill='y')
|
||||
|
||||
setlangbutton = tk.Button(Translaterame, text=f'对标语言{LANGNAME}', command=_changeDefaultLang)
|
||||
setlangbutton.pack(side='top')
|
||||
Translatescrollbar.pack(side='right', fill='y')
|
||||
Translatetextbar.pack(side='right', fill='y')
|
||||
|
||||
Orignscrollbar.config(command=Origntextbar.yview)
|
||||
Origntextbar.config(yscrollcommand=Orignscrollbar.set)
|
||||
|
||||
Translatescrollbar.config(command=Translatetextbar.yview)
|
||||
Translatetextbar.config(yscrollcommand=Translatescrollbar.set)
|
||||
|
||||
Orignrame.pack(side='left')
|
||||
Translaterame.pack(side='right')
|
||||
|
||||
tk.mainloop()
|
||||
|
@ -3,18 +3,22 @@
|
||||
# 使用 井字符 在每一行的开头编写注释
|
||||
# 注意!井字符请开头放,切勿含有空格
|
||||
# 也切勿在正文结尾放!
|
||||
# 注意其他标注:
|
||||
# F 开头 表示其正式(官方场合用上的)名称
|
||||
# t 开头 表示其为窗口标题
|
||||
# h 开头 表示其为窗口底部状态提示字符
|
||||
LANGKEY zh-CN
|
||||
LANGCHINESENAME 简体中文 中国大陆
|
||||
LANGENGLISHNAME Simplified Chinese, Chinese Mainland
|
||||
LANGLOCALNAME 简体中文 中国大陆
|
||||
MSCT 音·创
|
||||
F音创 音·创 Musicreater
|
||||
关于 音·创 - 关于
|
||||
t关于 音·创 - 关于
|
||||
开发者 - 开发人员 -
|
||||
译者 - 翻译人员 -
|
||||
确定 确定
|
||||
取消 取消
|
||||
关于 关于
|
||||
退出 退出
|
||||
h关于 音·创 和他可爱的作者们
|
||||
h关于 音·创 与其作者
|
||||
h退出 退出 音·创
|
@ -1,17 +1,25 @@
|
||||
# 音创创喵的 本地化语言文件
|
||||
# 音·创 本地化语言文件
|
||||
# 使用 空格 把键与对应文本隔开
|
||||
# 使用 井字符 在每一行的开头编写注释
|
||||
# 注意!井字符请开头放,切勿含有空格
|
||||
# 也切勿在正文结尾放!
|
||||
# 注意其他标注:
|
||||
# F 开头 表示其正式名称
|
||||
# t 开头 表示其为窗口标题
|
||||
# h 开头 表示其为窗口底部状态提示字符
|
||||
LANGKEY zh-ME
|
||||
LANGCHINESENAME 喵喵文 中国大陆
|
||||
LANGENGLIFHNAME Meow Catsese, China Mainland
|
||||
LANGLOCALNAME 喵喵喵~ 祖国喵~
|
||||
TRANSLATERS 金羿,Email EillesWan@outlook.com,QQ 2647547478
|
||||
MSCT 音创创喵~
|
||||
MSCT 音创创喵
|
||||
F音创 音·创 Musicreater
|
||||
关于 音创创喵的主人们
|
||||
凌云pairs 凌天之云创新我的世界开发团队\n×\n凌天之云创新计算机应用软件开发团队
|
||||
开发者 ~ 主人们 ~
|
||||
译者 ~ 爸爸妈妈们 ~
|
||||
确定 好哒~
|
||||
t关于 创创的主人
|
||||
开发者 - 创创的爸妈 -
|
||||
译者 - 创创的老师 -
|
||||
确定 好哒
|
||||
取消 算啦
|
||||
关于 小窝
|
||||
退出 再见啦
|
||||
h关于 想认识音创创喵的父母老师嘛
|
||||
h退出 和音创创喵说再见
|
||||
|
@ -9,9 +9,8 @@
|
||||
文件结构
|
||||
--------
|
||||
|
||||
从主文件调用display.py以实现显示,调用functions.py以使用功能
|
||||
|
||||
functions.py中会调取./addon/目录下的全部功能文件,这些功能文件必须先由./addon/addons.pkl来预先定义好
|
||||
主文件存有多个显示函数,通过`./resources/config.json`来配置临时文件等选项
|
||||
通过`config.json`预制的`theme`项目所指引的文件来获得主题包、`language`项目来控制
|
||||
|
||||
详细说明
|
||||
--------
|
||||
@ -70,7 +69,10 @@ functions.py中会调取./addon/目录下的全部功能文件,这些功能文
|
||||
```python
|
||||
menuWidgets: dist = { # 菜单项目
|
||||
str"菜单名" : dict{
|
||||
str"选项名"|None : <function>选项函数
|
||||
str"选项名"|None : (
|
||||
<function>选项函数,
|
||||
str"选项说明",
|
||||
)
|
||||
},
|
||||
...
|
||||
}
|
||||
|
0
resources/config.json
Normal file
0
resources/config.json
Normal file
Loading…
x
Reference in New Issue
Block a user