-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
188 lines (168 loc) · 5.63 KB
/
settings.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import asset
import pygame
setting_font = pygame.font.Font(asset.font["NeoDunggeunmo"], 22)
class root():
def __init__(self):
self.main = None
self.selection:list = None
self.localization:dict = None
self.color = (255, 255, 255)
self.selected = False
self.selection_index:int = 0
def reload(self, main=None, selection=None, text_render=None):
self.main = main
self.selection = selection
self.text_render = text_render
def isSelect(self, select=None):
if select != None:
self.selected = select
if self.selected:
self.color = (86, 255, 86)
else:
self.color = (255, 255, 255)
def next(self):
if len(self.selection) - 1 == self.selection_index:
self.selection_index = 0
else:
self.selection_index += 1
self.main = self.selection[self.selection_index]
def render_update(self, lang):
self.text_render = setting_font.render(str(self.localization[lang][self.selection_index]), True, self.color)
return self.text_render
# 기본 설정
class Mode(root):
def __init__(self):
super().__init__()
self.selection = ["Normal", "Poison", "Radiation", "MIXED"]
self.localization = {
"En-US": ["Normal", "Poison", "Radiation", "MIXED"],
"Ko-KR": ["일반", "독성", "방사성", "믹스"]
}
self.main = self.selection[self.selection_index]
class Difficulty(root):
def __init__(self):
super().__init__()
self.selection = [2, 3, 4, 1]
self.localization = {
"En-US": [2, 3, 4, 1],
"Ko-KR": [2, 3, 4, 1]
}
self.main = self.selection[self.selection_index]
class PlayerType(root):
def __init__(self):
super().__init__()
self.selection = ["Single", "Multi"]
self.localization = {
"En-US": ["Solo", "Duo"],
"Ko-KR": ["솔로", "듀오"]
}
self.main = self.selection[self.selection_index]
class ScoreType(root):
def __init__(self):
super().__init__()
self.selection = ["Count", "Difficulty"]
self.localization = {
"En-US": ["Count", "Difficulty"],
"Ko-KR": ["일반","난이도순"]
}
self.selection_index = 0;
self.main = self.selection[self.selection_index]
class UseSound(root):
def __init__(self):
super().__init__()
self.selection = [True, False]
self.localization = {
"En-US": ["On", "Off"],
"Ko-KR": ["켜기", "끄기"]
}
self.main = self.selection[self.selection_index]
class Volume(root):
def __init__(self):
super().__init__()
self.selection = [60, 80, 100, 0, 20, 40]
self.localization = {
"En-US": [60, 80, 100, 0, 20, 40],
"Ko-KR": [60, 80, 100, 0, 20, 40]
}
self.main = self.selection[self.selection_index]
class BackgroundTheme(root):
def __init__(self):
super().__init__()
self.selection = ["LIGHT", "DARK"]
self.localization = {
"En-US": ["Light", "Dark"],
"Ko-KR": ["라이트", "다크"]
}
self.main = self.selection[self.selection_index]
class BackgroundSolid(root):
def __init__(self):
super().__init__()
self.selection = [False, True]
self.localization = {
"En-US": ["Off", "On"],
"Ko-KR": ["끄기", "켜기"]
}
self.main = self.selection[self.selection_index]
class FpsShow(root):
def __init__(self):
super().__init__()
self.selection = [False, True]
self.localization = {
"En-US": ["Off", "On"],
"Ko-KR": ["끄기", "켜기"]
}
self.main = self.selection[self.selection_index]
class FpsSet(root):
def __init__(self):
super().__init__()
self.selection = [144, 10, 20, 30, 60]
self.localization = {
"En-US": [144, 10, 20, 30, 60],
"Ko-KR": [144, 10, 20, 30, 60]
}
self.main = self.selection[self.selection_index]
class Language(root):
def __init__(self):
super().__init__()
self.selection = ["Ko-KR", "En-US"]
self.localization = {
"En-US": ["Korean", "English"],
"Ko-KR": ["한국어", "영어"]
}
self.main = self.selection[self.selection_index]
def settings_next():
global settings_index
if len(list(settings.keys())) - 1 == settings_index:
settings_index = 0
settings[list(settings.keys())[settings_index]].isSelect(True)
settings[list(settings.keys())[len(settings.keys()) - 1]].isSelect(False)
else:
settings_index += 1
settings[list(settings.keys())[settings_index]].isSelect(True)
settings[list(settings.keys())[settings_index - 1]].isSelect(False)
def settings_exit():
global settings_index
settings_index = 0
for i in settings.keys():
settings[i].isSelect(False)
settings["mode"].isSelect(True)
def settings_reset():
for i in settings.keys():
settings[i].selection_index = 0
settings[i].main = settings[i].selection[settings[i].selection_index]
settings_index: int = 0
settings: dict = {
# in-game
"mode": Mode(),
"difficulty": Difficulty(),
"player_type": PlayerType(),
"score_type": ScoreType(),
"background_theme": BackgroundTheme(),
"background_solid": BackgroundSolid(),
# preference
"use_sound": UseSound(),
"volume": Volume(),
"fps_show": FpsShow(),
"fps_set": FpsSet(),
"language": Language(),
}