~renpytom/+junk/moonlight-walks

« back to all changes in this revision

Viewing changes to renpy-6.8.1/common/_layout/classic_navigation.rpym

  • Committer: tom
  • Date: 2009-01-16 06:05:20 UTC
  • Revision ID: tom-20090116060520-b27fyh0wxjxbev8v
Adding 6.8.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
init python:
 
2
 
 
3
    layout.provides('navigation')
 
4
 
 
5
    style.gm_nav_frame = Style(style.menu_frame, help="game menu navigation frame")
 
6
    style.gm_nav_box = Style(style.vbox, help="box containing game menu navigation buttons")
 
7
 
 
8
    style.gm_nav_button = Style(style.button, help="game menu navigation button")
 
9
    style.gm_nav_button_text = Style(style.button_text, help="game menu navigation button (text)")
 
10
 
 
11
    style.gm_nav_button.size_group = "gm_nav_button"
 
12
    
 
13
    style.gm_nav_frame.xpos = 5.0/6.0
 
14
    style.gm_nav_frame.xanchor = 0.5
 
15
    style.gm_nav_frame.ypos = 0.95
 
16
    style.gm_nav_frame.yanchor = 1.0
 
17
    
 
18
    def _navigation(screen=None):
 
19
 
 
20
        # Display the game menu background
 
21
        ui.window(style=style.gm_root[screen])
 
22
        ui.null()
 
23
 
 
24
        if screen is None:
 
25
            return
 
26
 
 
27
        # Display the navigation frame.
 
28
        ui.frame(style='gm_nav_frame')
 
29
        ui.vbox(focus='gm_nav', style='gm_nav_box')
 
30
 
 
31
        for e in config.game_menu:
 
32
 
 
33
            if len(e) == 4:
 
34
                 key, label, clicked, enabled = e
 
35
                 shown = "True"
 
36
            else:
 
37
                 key, label, clicked, enabled, shown = e
 
38
 
 
39
            if not eval(shown):
 
40
                continue
 
41
                 
 
42
            layout.button(label,
 
43
                          "gm_nav",
 
44
                          selected=(screen==key),
 
45
                          enabled=eval(enabled),
 
46
                          clicked=clicked)
 
47
 
 
48
        ui.close()
 
49
 
 
50
    layout.navigation = _navigation