[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Feuerkraft-CVS] rev 303 - in trunk: data data/images src
From: |
Ingo Ruhnke |
Subject: |
[Feuerkraft-CVS] rev 303 - in trunk: data data/images src |
Date: |
Sat, 06 Dec 2003 16:27:53 +0100 |
Author: grumbel
Date: 2003-12-06 16:27:52 +0100 (Sat, 06 Dec 2003)
New Revision: 303
Added:
trunk/data/images/dialogspike.png
Modified:
trunk/data/feuerkraft.scm
trunk/data/feuerkraft.xml
trunk/src/communication_dialog.cxx
trunk/src/communication_dialog.hxx
Log:
- cleaned up in-game dialogs a bit
Modified: trunk/data/feuerkraft.scm
===================================================================
--- trunk/data/feuerkraft.scm 2003-12-06 14:49:01 UTC (rev 302)
+++ trunk/data/feuerkraft.scm 2003-12-06 15:27:52 UTC (rev 303)
@@ -298,10 +298,10 @@
(inexact->exact target-x)
(inexact->exact target-y))
- (comm-send-message 'wingman "On my way to "
- (inexact->exact target-x)
- " "
- (inexact->exact target-y)))))
+ (comm-unit-message 75
+ (format #f "On my way to ~a ~a"
+ (inexact->exact target-x)
+ (inexact->exact target-y))))))
(menu-add-item comm-menu "Bomb Attack!"
(lambda ()
Modified: trunk/data/feuerkraft.xml
===================================================================
--- trunk/data/feuerkraft.xml 2003-12-06 14:49:01 UTC (rev 302)
+++ trunk/data/feuerkraft.xml 2003-12-06 15:27:52 UTC (rev 303)
@@ -15,6 +15,10 @@
<image file="images/keys.png" />
</sprite>
+ <sprite name="dialogspike">
+ <image file="images/dialogspike.png" />
+ </sprite>
+
<sprite name="rocket_smoke">
<image file="images/rocket_smoke.png" />
</sprite>
Added: trunk/data/images/dialogspike.png
===================================================================
(Binary files differ)
Property changes on: trunk/data/images/dialogspike.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/communication_dialog.cxx
===================================================================
--- trunk/src/communication_dialog.cxx 2003-12-06 14:49:01 UTC (rev 302)
+++ trunk/src/communication_dialog.cxx 2003-12-06 15:27:52 UTC (rev 303)
@@ -22,6 +22,7 @@
#include "fonts.hxx"
#include "unit.hxx"
#include "view.hxx"
+#include "resource_manager.hxx"
#include "game_obj_manager.hxx"
#include "communication_dialog.hxx"
@@ -30,7 +31,7 @@
CommunicationDialog::CommunicationDialog()
{
current_ = this;
-
+ spike = resources->get_sprite("feuerkraft/dialogspike");
}
CommunicationDialog::~CommunicationDialog()
@@ -49,25 +50,18 @@
CL_Rect bbox = font.bounding_rect(0, 0, i->second.text);
FloatVector2d unit_pos =
View::current()->world_to_screen(unit->get_pos());
- FloatVector2d dialog_pos = unit_pos + FloatVector2d(0, -
50-bbox.get_height());
+ FloatVector2d dialog_pos = unit_pos + FloatVector2d(0, -60 -
bbox.get_height());
- CL_Display::draw_line((int)unit_pos.x, (int)unit_pos.y-40,
- (int)dialog_pos.x, (int)dialog_pos.y+20,
- CL_Color(0,0,0, 100));
+ spike.draw((int)unit_pos.x-15, (int)unit_pos.y-40);
- CL_Display::draw_line((int)unit_pos.x, (int)unit_pos.y-40,
- (int)dialog_pos.x-20, (int)dialog_pos.y+20,
- CL_Color(0,0,0, 100));
-
- CL_Display::fill_rect(CL_Rect(CL_Point(int(dialog_pos.x -
bbox.get_width()/2),
- int(dialog_pos.y -
bbox.get_height())),
+ CL_Display::fill_rect(CL_Rect(CL_Point(int(dialog_pos.x -
bbox.get_width()/2 - 10),
+ int(dialog_pos.y - 10)),
CL_Size(bbox.get_width() + 20,
bbox.get_height() + 20)),
- //CL_Color(85,85,0, 230));
CL_Color(0,0,0, 100));
- font.set_alignment(origin_bottom_center);
- font.draw(int(dialog_pos.x+10), int(dialog_pos.y+10),
i->second.text);
+ font.set_alignment(origin_top_center);
+ font.draw(int(dialog_pos.x), int(dialog_pos.y), i->second.text);
}
}
}
Modified: trunk/src/communication_dialog.hxx
===================================================================
--- trunk/src/communication_dialog.hxx 2003-12-06 14:49:01 UTC (rev 302)
+++ trunk/src/communication_dialog.hxx 2003-12-06 15:27:52 UTC (rev 303)
@@ -21,6 +21,7 @@
#define HEADER_COMMUNICATION_DIALOG_HXX
#include <map>
+#include <ClanLib/Display/sprite.h>
#include "gui_obj.hxx"
/** */
@@ -35,6 +36,7 @@
typedef std::map<int, Message> Messages;
Messages messages;
+ CL_Sprite spike;
static CommunicationDialog* current_;
public:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Feuerkraft-CVS] rev 303 - in trunk: data data/images src,
Ingo Ruhnke <=