~ubuntu-branches/ubuntu/precise/pingus/precise

« back to all changes in this revision

Viewing changes to src/pingus_menu.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Goulais
  • Date: 2004-08-09 10:26:00 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040809102600-lg2q9lfars0q1p42
Tags: 0.6.0-8
Applied patch from Andreas Jochens (Closes: #263992)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  $Id: pingus_menu.cxx,v 1.19 2003/04/10 16:01:02 grumbel Exp $
 
2
//
 
3
//  Pingus - A free Lemmings clone
 
4
//  Copyright (C) 1999 Ingo Ruhnke <grumbel@gmx.de>
 
5
//
 
6
//  This program is free software; you can redistribute it and/or
 
7
//  modify it under the terms of the GNU General Public License
 
8
//  as published by the Free Software Foundation; either version 2
 
9
//  of the License, or (at your option) any later version.
 
10
//
 
11
//  This program is distributed in the hope that it will be useful,
 
12
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
//  GNU General Public License for more details.
 
15
//
 
16
//  You should have received a copy of the GNU General Public License
 
17
//  along with this program; if not, write to the Free Software
 
18
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 
 
20
#include <ClanLib/Display/Display/display.h>
 
21
#include <config.h>
 
22
#include "menu_button.hxx"
 
23
#include "pingus_resource.hxx"
 
24
#include "debug.hxx"
 
25
#include "pingus_menu_manager.hxx"
 
26
#include "gui/gui_manager.hxx"
 
27
 
 
28
PingusMenu::PingusMenu (PingusMenuManager* m)
 
29
  : PingusSubMenu (m)
 
30
{
 
31
  is_init = false;
 
32
}
 
33
 
 
34
void
 
35
PingusMenu::preload ()
 
36
{
 
37
  if (!is_init)
 
38
    {
 
39
      //pout << "PingusMenu::init ()" << std::endl;
 
40
      //event_enabled = true;
 
41
      is_init = true;
 
42
 
 
43
      background = PingusResource::load_surface("misc/logo", "core");
 
44
 
 
45
      //gui_manager->add(new OptionsButton(this));
 
46
      /*if (game_finished)
 
47
        gui_manager->add(new CreditButton(this));*/
 
48
      //gui_manager->add(new MultiplayerButton(this));
 
49
      //gui_manager->add(new ThemeButton(this));
 
50
 
 
51
      gui_manager->add(new QuitButton(this));
 
52
      gui_manager->add(new StoryButton(this));
 
53
      gui_manager->add(new EditorButton (this));
 
54
    }
 
55
}
 
56
 
 
57
PingusMenu::~PingusMenu()
 
58
{
 
59
}
 
60
 
 
61
void
 
62
PingusMenu::on_resize(int w, int h)
 
63
{
 
64
  pout << "Width: " << w << " Height: " << h << std::endl;
 
65
}
 
66
 
 
67
void
 
68
PingusMenu::on_escape_press ()
 
69
{
 
70
  get_manager ()->show_exit_menu ();
 
71
}
 
72
 
 
73
void
 
74
PingusMenu::draw_foreground(GraphicContext& gc)
 
75
{
 
76
  if (gc.get_height() == 480)
 
77
    {
 
78
      gc.draw(background, 
 
79
              (gc.get_width()/2) - (background.get_width()/2), 
 
80
              20);
 
81
    }
 
82
  else
 
83
    {
 
84
      gc.draw(background, (gc.get_width()/2) - (background.get_width()/2), 
 
85
              CL_Display::get_height()/10);
 
86
    }
 
87
#ifdef OFFICIAL_PINGUS_BUILD
 
88
  gc.print_left(Fonts::pingus_small, 20, CL_Display::get_height()-100, 
 
89
                "Pingus version "VERSION", Copyright (C) 2003 Ingo Ruhnke <grumbel@gmx.de>\n");
 
90
#else
 
91
  gc.print_left(Fonts::pingus_small, 20, CL_Display::get_height()-100, 
 
92
                "Pingus version "VERSION" (debian build), Copyright (C) 2003 Ingo Ruhnke <grumbel@gmx.de>\n");
 
93
#endif
 
94
  gc.print_left(Fonts::pingus_small, 20, CL_Display::get_height()-70, 
 
95
                "Pingus comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome\n"
 
96
                "to redistribute it under certain conditions; see the file COPYING for details.\n");
 
97
}
 
98
 
 
99
/* EOF */