Changeset 515:1b1bd4f39e5c


Ignore:
Timestamp:
Sep 7, 2013, 5:47:48 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
c17e06c8a3c615154b36eb1cdd3c5371893054ed
Message:

Ask before quitting the level editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r513 r515  
    2525from albow.widget import Widget
    2626from albow.controls import Button, Label, CheckBox
    27 from albow.dialogs import alert, Dialog
     27from albow.dialogs import alert, Dialog, ask
    2828from albow.layout import Row
    2929from albow.fields import TextField
     
    10751075
    10761076        y = SCREEN[1] - MENU_BUTTON_HEIGHT - MENU_PAD
    1077         quit_but = Button('Quit', action=self.quit)
     1077        quit_but = Button('Quit', action=self.do_quit)
    10781078        quit_but.rect = BUTTON_RECT.copy()
    10791079        quit_but.rect.move_ip(MENU_LEFT, y)
     
    11681168
    11691169        y = SCREEN[1] - MENU_BUTTON_HEIGHT - MENU_PAD
    1170         quit_but = Button('Quit', action=self.quit)
     1170        quit_but = Button('Quit', action=self.do_quit)
    11711171        quit_but.rect = BUTTON_RECT.copy()
    11721172        quit_but.rect.move_ip(MENU_LEFT, y)
     
    11771177    def key_down(self, ev):
    11781178        if ev.key == pgl.K_ESCAPE:
    1179             self.quit()
     1179            self.do_quit()
    11801180        elif ev.key == pgl.K_s:
    11811181            self.save()
    11821182        else:
    11831183            self.level_widget.key_down(ev)
     1184
     1185    def do_quit(self):
     1186        res = ask("Really Quit?")
     1187        if res == "OK":
     1188            self.quit()
    11841189
    11851190    def save(self):
Note: See TracChangeset for help on using the changeset viewer.