Refactor main menu button group in kv file.
This commit is contained in:
parent
053430b77c
commit
0505a10045
|
@ -25,46 +25,48 @@ ScreenManager:
|
|||
size: self.size
|
||||
Label:
|
||||
size_hint_y: 0.1
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
MainMenuButtonGroup:
|
||||
size_hint_x: 0.9
|
||||
pos_hint: {'center_x': 0.5}
|
||||
Button:
|
||||
text: "New Game"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
root.manager.transition.direction = 'left'
|
||||
root.manager.current = 'game'
|
||||
Button:
|
||||
text: "Open Game"
|
||||
disabled: True
|
||||
size_hint_y: 0.1
|
||||
Button:
|
||||
text: "Save Game"
|
||||
disabled: True
|
||||
size_hint_y: 0.1
|
||||
Button:
|
||||
text: "About Game"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
root.manager.transition.direction = 'left'
|
||||
root.manager.current = 'info'
|
||||
Button:
|
||||
text: "Settings"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
app.open_settings()
|
||||
Button:
|
||||
text: "Exit"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
app.stop()
|
||||
Label:
|
||||
text: "Version {}".format(justcheckers.__version__)
|
||||
size_hint_y: 0.1
|
||||
pos_hint: {'center_x': 0.9}
|
||||
|
||||
|
||||
<MainMenuButtonGroup@BoxLayout>:
|
||||
orientation: "vertical"
|
||||
Button:
|
||||
text: "New Game"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
root.parent.parent.manager.transition.direction = 'left'
|
||||
root.parent.parent.manager.current = 'game'
|
||||
Button:
|
||||
text: "Open Game"
|
||||
disabled: True
|
||||
size_hint_y: 0.1
|
||||
Button:
|
||||
text: "Save Game"
|
||||
disabled: True
|
||||
size_hint_y: 0.1
|
||||
Button:
|
||||
text: "About Game"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
root.parent.parent.manager.transition.direction = 'left'
|
||||
root.parent.parent.manager.current = 'info'
|
||||
Button:
|
||||
text: "Settings"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
app.open_settings()
|
||||
Button:
|
||||
text: "Exit"
|
||||
size_hint_y: 0.1
|
||||
on_press:
|
||||
app.stop()
|
||||
|
||||
<GameScreen@Screen>:
|
||||
name: 'game'
|
||||
Image:
|
||||
|
|
Loading…
Reference in New Issue