-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_data.py
110 lines (103 loc) · 3.36 KB
/
game_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import os
import csv
nowdir = os.getcwd()
def id_search_touch(parem_id):
"""
id找触摸板名称,返回值为名称
"""
parem_id = str(parem_id)
# 打开csv文件
with open(nowdir + f"\\hoshino\\modules\\sdvx_helper\\touch.csv", "r", encoding="utf-8") as f:
# 使用csv模块读取文件内容
reader = csv.reader(f)
# 逐行遍历文件内容
for row in reader:
# 获取第二列数值和第三列名称
num = row[0]
name = row[1]
# 判断数值是否匹配输入的parem_id
if num == parem_id:
return name
# 如果未找到匹配项,则返回None
f.close()
return None
def id_search_panel(parem_id):
"""
id找打歌面板名称,返回值为名称
"""
parem_id = str(parem_id)
# 打开csv文件
with open(nowdir + f"\\hoshino\\modules\\sdvx_helper\\panel.csv", "r", encoding="utf-8") as f:
# 使用csv模块读取文件内容
reader = csv.reader(f)
# 逐行遍历文件内容
for row in reader:
# 获取第二列数值和第三列名称
num = row[0]
name = row[1]
# 判断数值是否匹配输入的parem_id
if num == parem_id:
return name
# 如果未找到匹配项,则返回None
f.close()
return None
def id_search_stamp(parem_id):
"""
id找贴纸名称,返回值为名称
"""
parem_id = str(parem_id)
# 打开csv文件
with open(nowdir + f"\\hoshino\\modules\\sdvx_helper\\stamp.csv", "r", encoding="utf-8") as f:
# 使用csv模块读取文件内容
reader = csv.reader(f)
# 逐行遍历文件内容
for row in reader:
# 获取第二列数值和第三列名称
num = row[0]
name = row[1]
# 判断数值是否匹配输入的parem_id
if num == parem_id:
return name
# 如果未找到匹配项,则返回None
f.close()
return None
def id_search_theme(parem_id):
"""
id找主题名称,返回值为名称
"""
parem_id = str(parem_id)
# 打开csv文件
with open(nowdir + f"\\hoshino\\modules\\sdvx_helper\\theme.csv", "r", encoding="utf-8") as f:
# 使用csv模块读取文件内容
reader = csv.reader(f)
# 逐行遍历文件内容
for row in reader:
# 获取第二列数值和第三列名称
num = row[0]
name = row[1]
# 判断数值是否匹配输入的parem_id
if num == parem_id:
return name
# 如果未找到匹配项,则返回None
f.close()
return None
def id_search_bgm(parem_id):
"""
id找乐曲名称,返回值为名称
"""
parem_id = str(parem_id)
# 打开csv文件
with open(nowdir + f"\\hoshino\\modules\\sdvx_helper\\bgm.csv", "r", encoding="utf-8") as f:
# 使用csv模块读取文件内容
reader = csv.reader(f)
# 逐行遍历文件内容
for row in reader:
# 获取第二列数值和第三列名称
num = row[0]
name = row[1]
# 判断数值是否匹配输入的parem_id
if num == parem_id:
return name
# 如果未找到匹配项,则返回None
f.close()
return None