Ticket #99: quit_and_main_menu.patch

File quit_and_main_menu.patch, 3.1 KB (added by Elie De Brauwer <elie@…>, 10 years ago)

A patch to more properly lay out the main and quit dialogs

  • gui/hud_main_menu.xml

     
    1 <Container position_technique="center:center" size="145,173"> 
    2   <Button name="newButton" text="New Game" position="47,7" max_size="65,20" /> 
    3   <Button name="resumeButton" text="Resume Game" position="42,30" max_size="65,20"/> 
    4   <Button name="saveButton" text="Save Game" position="46,53" max_size="60,20"/> 
    5   <Button name="loadButton" text="Load Game" position="46,76" max_size="60,20"/> 
    6   <Button name="optionsButton" text="Options" position="53,99" max_size="45,20"/> 
    7   <Button name="helpButton" text="Help" position="60,122" max_size="40,20" /> 
    8   <Button name="quitButton" text="Quit" position="60,145" max_size="40,20" /> 
     1<!-- 
     2 * Buttons have a dimension of 95x20 pixels 
     3 * 3 pixels vertical spacing is foreseen between buttons 
     4 * 7 pixels spacing is foreseen above and below the buttons 
     5 * Total height should be num_button*20 + (num_button-1)*3 + 2*7 
     6--> 
     7 
     8<Container position_technique="center:center" size="145,172"> 
     9  <Button name="newButton"     text="New Game"    position="25,7" min_size="95,20" max_size="95,20" /> 
     10  <Button name="resumeButton"  text="Resume Game" position="25,30" min_size="95,20" max_size="95,20"/> 
     11  <Button name="saveButton"    text="Save Game"   position="25,53" min_size="95,20" max_size="95,20"/> 
     12  <Button name="loadButton"    text="Load Game"   position="25,76"  min_size="95,20" max_size="95,20"/> 
     13  <Button name="optionsButton" text="Options"     position="25,99" min_size="95,20" max_size="95,20"/> 
     14  <Button name="helpButton"    text="Help"        position="25,122" min_size="95,20" max_size="95,20" /> 
     15  <Button name="quitButton"    text="Quit"        position="25,145" min_size="95,20" max_size="95,20" /> 
    916</Container> 
  • scripts/hud.py

     
    287287        """Called when user requests to quit game. 
    288288           @return: None""" 
    289289 
    290         window = pychan.widgets.Window(title=unicode("Quit?")) 
     290        window = pychan.widgets.Window(title=unicode("Quit?"),min_size=(200,0)) 
    291291 
    292292        hbox = pychan.widgets.HBox() 
    293293        are_you_sure = "Are you sure you want to quit?" 
    294294        label = pychan.widgets.Label(text=unicode(are_you_sure)) 
    295295        yes_button = pychan.widgets.Button(name="yes_button",  
    296                                            text=unicode("Yes")) 
     296                                           text=unicode("Yes"), 
     297                                           min_size=(90,20), 
     298                                           max_size=(90,20)) 
    297299        no_button = pychan.widgets.Button(name="no_button", 
    298                                           text=unicode("No")) 
     300                                          text=unicode("No"), 
     301                                          min_size=(90,20), 
     302                                          max_size=(90,20)) 
    299303 
    300304        window.addChild(label) 
    301305        hbox.addChild(yes_button)