Changeset 655


Ignore:
Timestamp:
10/15/10 10:24:51 (9 years ago)
Author:
beliar
Message:

Patch by Beliar

  • Adapted main menu to new screen clearing behaviour of fife. Added a container that is shown behind the menu.
  • Changed MainMenu? from Container to VBox
Location:
trunk/game
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/gui/main_menu.xml

    r651 r655  
    55 * Total height should be num_button*20 + (num_button-1)*3 + 2*7 
    66--> 
    7  
    8 <Container name="MainMenu" background_image="gui/main_menu/main_menu_background_under_buttons.png" position_technique="center:center" size="320,340"> 
    9   <ImageButton name="continueButton" up_image="gui/main_menu/continue_disabled.png" position="0,4" /> 
    10   <ImageButton name="newButton" up_image="gui/main_menu/new_game_plain.png" hover_image="gui/main_menu/new_game_hovered.png" down_image="gui/main_menu/new_game_pressed.png" position="0,60" /> 
    11   <ImageButton name="loadButton" up_image="gui/main_menu/load_game_plain.png" hover_image="gui/main_menu/load_game_hovered.png" down_image="gui/main_menu/load_game_pressed.png" position="0,116"/> 
    12   <ImageButton name="optionsButton" up_image="gui/main_menu/options_plain.png" hover_image="gui/main_menu/options_hovered.png" down_image="gui/main_menu/options_pressed.png" position="0,172" /> 
    13   <ImageButton name="creditsButton" up_image="gui/main_menu/credits_disabled.png" position="0,228" /> 
    14   <ImageButton name="quitButton"  up_image="gui/main_menu/exit_plain.png" hover_image="gui/main_menu/exit_hovered.png" down_image="gui/main_menu/exit_pressed.png" position="0,284"/> 
    15 </Container> 
     7<VBox name="MainMenuMenu" padding="0" background_image="gui/main_menu/main_menu_background_under_buttons.png" position_technique="center:center" size="320,340"> 
     8  <ImageButton name="continueButton" up_image="gui/main_menu/continue_disabled.png"/> 
     9  <ImageButton name="newButton" up_image="gui/main_menu/new_game_plain.png" hover_image="gui/main_menu/new_game_hovered.png" down_image="gui/main_menu/new_game_pressed.png"/> 
     10  <ImageButton name="loadButton" up_image="gui/main_menu/load_game_plain.png" hover_image="gui/main_menu/load_game_hovered.png" down_image="gui/main_menu/load_game_pressed.png"/> 
     11  <ImageButton name="optionsButton" up_image="gui/main_menu/options_plain.png" hover_image="gui/main_menu/options_hovered.png" down_image="gui/main_menu/options_pressed.png"/> 
     12  <ImageButton name="creditsButton" up_image="gui/main_menu/credits_disabled.png"/> 
     13  <ImageButton name="quitButton"  up_image="gui/main_menu/exit_plain.png" hover_image="gui/main_menu/exit_hovered.png" down_image="gui/main_menu/exit_pressed.png"/> 
     14</VBox> 
  • trunk/game/scripts/mainmenuview.py

    r653 r655  
    4040    def showMenu(self): 
    4141        """"Shows the main menu""" 
     42        self.main_menu_background.show() 
    4243        self.main_menu.show() 
    4344         
     
    4546        """"Hides the main menu""" 
    4647        self.main_menu.hide() 
     48        self.main_menu_background.hide() 
    4749 
    4850    def initalizeMainMenu(self, new_game, load_game, quit_game): 
    4951        """Initialized the main menu and sets the callbacks""" 
     52        self.main_menu_background = pychan.loadXML("gui/main_menu_background.xml") 
     53        screen_mode = self.engine.getCurrentScreenMode() 
     54        self.main_menu_background.width = screen_mode.getWidth() 
     55        self.main_menu_background.height = screen_mode.getHeight() 
    5056        self.main_menu = pychan.loadXML("gui/main_menu.xml") 
     57        self.main_menu.adaptLayout() 
    5158        self.new_game_callback = new_game 
    5259        self.load_game_callback = load_game 
Note: See TracChangeset for help on using the changeset viewer.