mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2025-09-06 20:36:23 +00:00
除旧迎新,0.2.0大更新!
This commit is contained in:
@ -365,106 +365,6 @@ class midiConvert:
|
||||
def __score2time(self, score: int):
|
||||
return str(int(int(score / 20) / 60)) + ":" + str(int(int(score / 20) % 60))
|
||||
|
||||
# def __formProgressBar(
|
||||
# self,
|
||||
# maxscore: int,
|
||||
# scoreboardname: str,
|
||||
# progressbar: tuple = (
|
||||
# r"▶ %%N [ %%s/%^s %%% __________ %%t|%^t ]",
|
||||
# ("§e=§r", "§7=§r"),
|
||||
# ),
|
||||
# ) -> list:
|
||||
|
||||
# pgsstyle = progressbar[0]
|
||||
# """用于被替换的进度条原始样式"""
|
||||
|
||||
# """
|
||||
# | 标识符 | 指定的可变量 |
|
||||
# |---------|----------------|
|
||||
# | `%%N` | 乐曲名(即传入的文件名)|
|
||||
# | `%%s` | 当前计分板值 |
|
||||
# | `%^s` | 计分板最大值 |
|
||||
# | `%%t` | 当前播放时间 |
|
||||
# | `%^t` | 曲目总时长 |
|
||||
# | `%%%` | 当前进度比率 |
|
||||
# | `_` | 用以表示进度条占位|
|
||||
# """
|
||||
|
||||
# def __replace(
|
||||
# s: str, tobeReplaced: str, replaceWith: str, times: int, other: str
|
||||
# ):
|
||||
# if times == 0:
|
||||
# return s.replace(tobeReplaced, other)
|
||||
# if times == s.count(tobeReplaced):
|
||||
# return s.replace(tobeReplaced, replaceWith)
|
||||
# result = ""
|
||||
# t = 0
|
||||
# for i in s:
|
||||
# if i == tobeReplaced:
|
||||
# if t < times:
|
||||
# result += replaceWith
|
||||
# t += 1
|
||||
# else:
|
||||
# result += other
|
||||
# else:
|
||||
# result += i
|
||||
|
||||
# return result
|
||||
|
||||
# idlist = {
|
||||
# r"%%N": self.midFileName,
|
||||
# r"%%s": r"%%s",
|
||||
# r"%^s": str(maxscore),
|
||||
# r"%%t": r"%%t",
|
||||
# r"%^t": self.__score2time(maxscore),
|
||||
# r"%%%": r"%%%",
|
||||
# }
|
||||
|
||||
# ids = {}
|
||||
|
||||
# for i, j in idlist.items():
|
||||
# if i != j:
|
||||
# if i in pgsstyle:
|
||||
# pgsstyle = pgsstyle.replace(i, j)
|
||||
# else:
|
||||
# if i in pgsstyle:
|
||||
# ids[i] = True
|
||||
# else:
|
||||
# ids[i] = False
|
||||
|
||||
# del idlist
|
||||
|
||||
# pgblength = pgsstyle.count("_")
|
||||
# """进度条的“条”长度"""
|
||||
|
||||
# finalprgsbar = []
|
||||
|
||||
# for i in range(maxscore):
|
||||
# nowstr = pgsstyle
|
||||
# if ids[r"%%s"]:
|
||||
# nowstr = nowstr.replace(r"%%s", str(i + 1))
|
||||
# if ids[r"%%t"]:
|
||||
# nowstr = nowstr.replace(r"%%t", self.__score2time(i + 1))
|
||||
# if ids[r"%%%"]:
|
||||
# nowstr = nowstr.replace(
|
||||
# r"%%%", str(int((i + 1) / maxscore * 10000) / 100) + "%"
|
||||
# )
|
||||
|
||||
# countof_s = int((i + 1) / maxscore * pgblength)
|
||||
|
||||
# finalprgsbar.append(
|
||||
# "title @a[scores={"
|
||||
# + scoreboardname
|
||||
# + "="
|
||||
# + str(i + 1)
|
||||
# + "}] actionbar "
|
||||
# + __replace(
|
||||
# nowstr, "_", progressbar[1][0], countof_s, progressbar[1][1]
|
||||
# )
|
||||
# )
|
||||
|
||||
# return finalprgsbar
|
||||
|
||||
def __formProgressBar(
|
||||
self,
|
||||
maxscore: int,
|
||||
@ -1422,29 +1322,3 @@ class midiConvert:
|
||||
return (True, len(cmdlist), maxdelay, size, finalPos)
|
||||
|
||||
|
||||
# def isProgressBar(pgbarLike:str):
|
||||
# '''判断所输入数据是否为进度条式样数据
|
||||
# 注意,使用本函数时不得直接放在 if 后,正确用法如下:
|
||||
|
||||
# 判断是否是合规进度条样式数据:
|
||||
# ```
|
||||
# if isProgressBar(pgb) == False:
|
||||
# pass # 进度条样式错误
|
||||
# else:
|
||||
# pass # 进度条样式正确
|
||||
# ```
|
||||
# 当仅需要判断正确的情况时也最好这样写:
|
||||
# ```
|
||||
# if not isProgressBar(pgb) == False:
|
||||
# pass # 进度条样式正确
|
||||
# ```
|
||||
|
||||
# :param phbarLike:str
|
||||
# 所需判断的字符串
|
||||
# :return False | tuple
|
||||
# 是否为可读的进度条式样,如果是,则转换为进度条元组
|
||||
# '''
|
||||
# if pgbarLike.lower() in ('true','1'):
|
||||
# return (r"▶ %%N [ %%s/%^s %%% __________ %%t|%^t ]",("§e=§r", "§7=§r"),)
|
||||
# elif pgbarLike.lower() in ('false','0'):
|
||||
# return ()
|
||||
|
Reference in New Issue
Block a user