[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.28,1.29 worldm
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.28,1.29 worldmap.cxx,1.37,1.38 worldmap.hxx,1.24,1.25 |
Date: |
1 Apr 2003 13:21:22 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv32123/src/worldmap
Modified Files:
manager.cxx worldmap.cxx worldmap.hxx
Log Message:
finished worldmap GUI
Index: manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/manager.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- manager.cxx 31 Mar 2003 21:52:03 -0000 1.28
+++ manager.cxx 1 Apr 2003 13:21:20 -0000 1.29
@@ -18,12 +18,14 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
+#include "../fonts.hxx"
#include "../gui/screen_manager.hxx"
#include "../gui/surface_button.hxx"
#include "../path_manager.hxx"
#include "../res_descriptor.hxx"
#include "../sound/sound.hxx"
#include "worldmap.hxx"
+#include "pingus.hxx"
#include "manager.hxx"
namespace WorldMapNS {
@@ -36,6 +38,7 @@
public:
WorldMapManagerCloseButton();
void on_click();
+ void draw (GraphicContext& gc);
};
class WorldMapManagerEnterButton
@@ -44,35 +47,57 @@
public:
WorldMapManagerEnterButton();
void on_click();
+ void draw (GraphicContext& gc);
};
WorldMapManagerCloseButton::WorldMapManagerCloseButton()
- : GUI::SurfaceButton(5, 5,
- ResDescriptor("menu/close_normal", "core"),
- ResDescriptor("menu/close_pressed", "core"),
- ResDescriptor("menu/close_highlight", "core"))
+ : GUI::SurfaceButton(0, 600 - 37,
+ ResDescriptor("worldmap/leave_button_normal", "core"),
+ ResDescriptor("worldmap/leave_button_pressed", "core"),
+ ResDescriptor("worldmap/leave_button_hover", "core"))
{
}
void
+WorldMapManagerCloseButton::draw (GraphicContext& gc)
+{
+ SurfaceButton::draw(gc);
+ gc.print_left(Fonts::chalk_small, 10, 580, "Leave?");
+}
+
+void
WorldMapManagerCloseButton::on_click()
{
ScreenManager::instance ()->pop_screen ();
}
WorldMapManagerEnterButton::WorldMapManagerEnterButton()
- : GUI::SurfaceButton(500, 10,
- ResDescriptor("menu/enterlevel", "core"),
- ResDescriptor("menu/enterlevel", "core"),
- ResDescriptor("menu/enterlevel", "core"))
+ : GUI::SurfaceButton(800 - 119, 600 - 37,
+ ResDescriptor("worldmap/enter_button_normal", "core"),
+ ResDescriptor("worldmap/enter_button_pressed", "core"),
+ ResDescriptor("worldmap/enter_button_hover", "core"))
{
}
void
+WorldMapManagerEnterButton::draw (GraphicContext& gc)
+{
+ if (WorldMapManager::instance()->get_worldmap()->get_pingus()->is_walking())
+ {
+ gc.draw(button_surface, x_pos, y_pos);
+ }
+ else
+ {
+ SurfaceButton::draw(gc);
+ gc.print_left(Fonts::chalk_small, 700, 580, "Enter?");
+ }
+}
+
+void
WorldMapManagerEnterButton::on_click()
{
WorldMapManager::instance()->get_worldmap()->enter_level();
- }
+}
WorldMapManager::WorldMapManager ()
: worldmap(0),
Index: worldmap.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/worldmap.cxx,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- worldmap.cxx 30 Mar 2003 22:09:33 -0000 1.37
+++ worldmap.cxx 1 Apr 2003 13:21:20 -0000 1.38
@@ -79,6 +79,8 @@
pingus->set_position(0);
add_drawable(pingus);
+
+ levelname_bg = PingusResource::load_surface("worldmap/levelname_bg", "core");
}
WorldMap::~WorldMap()
@@ -191,15 +193,35 @@
(*i)->draw (display_gc);
}
+ gc.draw(levelname_bg,
+ gc.get_width()/2 - levelname_bg.get_width()/2,
+ gc.get_height() - levelname_bg.get_height());
+
if (pingus->get_node() != NoNode)
{
LevelDot* leveldot =
dynamic_cast<LevelDot*>(path_graph->get_dot(pingus->get_node()));
if (leveldot)
- gc.print_center(Fonts::pingus_small,
- display_gc.get_width ()/2,
- display_gc.get_height() - 40,
-
System::translate(leveldot->get_plf()->get_levelname()));
+ {
+ gc.print_center(Fonts::chalk_small,
+ display_gc.get_width ()/2,
+ display_gc.get_height() - 20,
+
System::translate(leveldot->get_plf()->get_levelname()));
+ }
+ else
+ {
+ gc.print_center(Fonts::chalk_small,
+ display_gc.get_width ()/2,
+ display_gc.get_height() - 20,
+ "---");
+ }
+ }
+ else
+ {
+ gc.print_center(Fonts::chalk_small,
+ display_gc.get_width ()/2,
+ display_gc.get_height() - 20,
+ "...walking...");
}
Index: worldmap.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/worldmap.hxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- worldmap.hxx 30 Mar 2003 22:09:33 -0000 1.24
+++ worldmap.hxx 1 Apr 2003 13:21:20 -0000 1.25
@@ -20,6 +20,7 @@
#ifndef HEADER_PINGUS_WORLDMAP_WORLDMAP_HXX
#define HEADER_PINGUS_WORLDMAP_WORLDMAP_HXX
+#include <ClanLib/Display/Display/surface.h>
#include <vector>
#include "../libxmlfwd.hxx"
#include "stat.hxx"
@@ -49,6 +50,8 @@
private:
// FIXME: We should use a ScrollGC or something like that here
DisplayGraphicContext display_gc;
+
+ CL_Surface levelname_bg;
/** name of the file to parse */
std::string filename;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.28,1.29 worldmap.cxx,1.37,1.38 worldmap.hxx,1.24,1.25,
grumbel <=