|
2 | 2 |
|
3 | 3 | from point.config.setting import Settings |
4 | 4 |
|
5 | | -ABOUT = [f'Author: {"Liang Chen Yu"}', |
6 | | - f'Email: {"lb2261981@mail.163.com"}'] |
7 | 5 | RANKING_FIELDS = {"name": "Name", "score": "Score", "date": "Time"} |
8 | 6 | RANKING_LIST_MIN_ROW = 6 |
9 | 7 |
|
10 | 8 |
|
11 | | -def about_menu(): |
12 | | - menu = game_menu.Menu( |
13 | | - center_content=False, |
14 | | - height=300, |
15 | | - mouse_visible=True, |
16 | | - theme=game_menu.themes.THEME_BLUE, |
17 | | - title='About', |
18 | | - width=600 |
19 | | - ) |
20 | | - for m in ABOUT: |
21 | | - menu.add.label(m, margin=(0, 0)) |
22 | | - menu.add.url(href="https://github.com/rexxar-liang/24points", title="help") |
23 | | - menu.add.label('') |
24 | | - menu.add.button('Return to Menu', game_menu.events.BACK) |
25 | | - return menu |
26 | | - |
27 | | - |
28 | 9 | class GameMenu: |
29 | 10 |
|
30 | 11 | def __init__(self, game): |
31 | 12 | self.game = game |
32 | 13 | self.settings = Settings() |
33 | 14 | self.font_file = self.settings.font_file |
34 | 15 |
|
| 16 | + def about_menu(self): |
| 17 | + menu = game_menu.Menu( |
| 18 | + center_content=False, |
| 19 | + height=300, |
| 20 | + mouse_visible=True, |
| 21 | + theme=game_menu.themes.THEME_BLUE, |
| 22 | + title='About', |
| 23 | + width=600, |
| 24 | + rows=6, |
| 25 | + columns=2 |
| 26 | + ) |
| 27 | + |
| 28 | + menu.add.label(" Author:", font_name=self.font_file) |
| 29 | + menu.add.label("", font_name=self.font_file) |
| 30 | + menu.add.label(" Artist:", font_name=self.font_file) |
| 31 | + menu.add.label(" Code: ", font_name=self.font_file) |
| 32 | + menu.add.label("", font_name=self.font_file) |
| 33 | + menu.add.label("") |
| 34 | + menu.add.url(href="https://github.com/rexxar-liang", align=game_menu.locals.ALIGN_LEFT, title="Rexxar Liang", |
| 35 | + font_name=self.font_file) |
| 36 | + menu.add.url(href="https://github.com/Anduin-Liang", align=game_menu.locals.ALIGN_LEFT, title="Anduin Liang", |
| 37 | + font_name=self.font_file) |
| 38 | + menu.add.label(title="m_marguerite", align=game_menu.locals.ALIGN_LEFT, font_name=self.font_file) |
| 39 | + menu.add.url(href="https://github.com/rexxar-liang/24points", align=game_menu.locals.ALIGN_LEFT, |
| 40 | + title="rexxar-liang/24points", |
| 41 | + font_name=self.font_file) |
| 42 | + menu.add.label("", font_name=self.font_file) |
| 43 | + menu.add.button('Return to Menu', game_menu.events.BACK, align=game_menu.locals.ALIGN_LEFT) |
| 44 | + return menu |
| 45 | + |
35 | 46 | def ranking_menu(self): |
36 | 47 | ranking_theme = game_menu.themes.THEME_BLUE.copy() |
37 | 48 | ranking_theme.scrollbar_cursor = game_menu.locals.CURSOR_HAND |
@@ -82,6 +93,6 @@ def show_menu(self): |
82 | 93 |
|
83 | 94 | menu.add.button('Play', self.game.play) |
84 | 95 | menu.add.button('Ranking', self.ranking_menu()) |
85 | | - menu.add.button("About", about_menu()) |
| 96 | + menu.add.button("About", self.about_menu()) |
86 | 97 | menu.add.button('Quit', game_menu.events.EXIT) |
87 | 98 | menu.mainloop(self.game.screen) |
0 commit comments