doing stuff
[ld42_outofspace] / src / menuscr.cc
index 7e910c4..00b0aa2 100644 (file)
@@ -34,14 +34,14 @@ bool MenuScreen::init()
        bn_start = new goatkit::Button;
        bn_start->set_position(xpos, ypos += vsep);
        bn_start->set_size(bnwidth, bnheight);
-       bn_start->set_text("Start");
+       bn_start->set_text("Don't Panic!");
        bn_start->set_callback(goatkit::EV_CLICK, bn_handler, (void*)BN_START);
        ui.add_widget(bn_start);
 
        bn_exit = new goatkit::Button;
        bn_exit->set_position(xpos, ypos += vsep);
        bn_exit->set_size(bnwidth, bnheight);
-       bn_exit->set_text("Exit");
+       bn_exit->set_text("Panic");
        bn_exit->set_callback(goatkit::EV_CLICK, bn_handler, (void*)BN_EXIT);
        ui.add_widget(bn_exit);
 
@@ -113,6 +113,18 @@ void MenuScreen::reshape(int x, int y)
 
 void MenuScreen::keyboard(int key, bool pressed)
 {
+       if(pressed) {
+               switch(key) {
+               case KEY_ESC:
+                       exit_pending = true;
+                       ui.hide();
+                       return;
+
+               default:
+                       break;
+               }
+       }
+
        ui.sysev_keyboard(key, pressed);
 }