[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp display.cpp reports.cpp
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp display.cpp reports.cpp |
Date: |
Sun, 21 Aug 2005 13:56:29 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/08/21 17:56:29
Modified files:
src : dialogs.cpp display.cpp reports.cpp
Log message:
Fixed issues with the previous commit.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.106&tr2=1.107&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.325&tr2=1.326&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/reports.cpp.diff?tr1=1.68&tr2=1.69&r1=text&r2=text
Patches:
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.106 wesnoth/src/dialogs.cpp:1.107
--- wesnoth/src/dialogs.cpp:1.106 Sat Jul 2 21:37:18 2005
+++ wesnoth/src/dialogs.cpp Sun Aug 21 17:56:28 2005
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.106 2005/07/02 21:37:18 ott Exp $ */
+/* $Id: dialogs.cpp,v 1.107 2005/08/21 17:56:28 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -751,8 +751,7 @@
for(std::vector<attack_type>::const_iterator at_it =
attacks.begin();
at_it != attacks.end(); ++at_it) {
- details << "\n"
- << gettext(at_it->name().c_str())
+ details << "\n" << at_it->name()
<< " (" << gettext(at_it->type().c_str()) <<
")\n";
if (!at_it->special().empty())
details << gettext(at_it->special().c_str());
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.325 wesnoth/src/display.cpp:1.326
--- wesnoth/src/display.cpp:1.325 Sun Aug 21 16:22:15 2005
+++ wesnoth/src/display.cpp Sun Aug 21 17:56:28 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.325 2005/08/21 16:22:15 gruikya Exp $ */
+/* $Id: display.cpp,v 1.326 2005/08/21 17:56:28 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -992,143 +992,6 @@
reportSurfaces_[report_num].assign(NULL);
}
}
-
-#if 0
-void display::draw_unit_details(int x, int y, const gamemap::location& loc,
- const unit& u, SDL_Rect& description_rect, int profilex, int profiley,
- SDL_Rect* clip_rect)
-{
- if(teams_.empty())
- return;
-
- tooltips::clear_tooltips(description_rect);
-
- SDL_Rect clipRect = clip_rect != NULL ? *clip_rect : screen_area();
-
- const surface
background(image::get_image(game_config::rightside_image,image::UNSCALED));
- const surface
background_bot(image::get_image(game_config::rightside_image_bot,image::UNSCALED));
-
- if(background == NULL || background_bot == NULL)
- return;
-
- surface const screen(screen_.getSurface());
-
- if(description_rect.w > 0 && description_rect.x >= mapx()) {
- SDL_Rect srcrect = description_rect;
- srcrect.y -= background->h;
- srcrect.x -= mapx();
-
-
SDL_BlitSurface(background_bot,&srcrect,screen,&description_rect);
- update_rect(description_rect);
- }
-
- std::string status = _("healthy");
- if(map_.on_board(loc) &&
- u.invisible(map_.underlying_terrain(map_[loc.x][loc.y]),
- status_.get_time_of_day().lawful_bonus,loc,
- units_,teams_)) {
- status = font::GOOD_TEXT + _("invisible");
- }
-
- if(u.has_flag("slowed")) {
- status = font::BAD_TEXT + _("slowed");
- }
-
- if(u.has_flag("poisoned")) {
- status = font::BAD_TEXT + _("poisoned");
- }
-
- std::stringstream details;
- details << font::LARGE_TEXT << u.description() << "\n"
- << font::LARGE_TEXT << u.type().language_name()
- << "\n" << font::SMALL_TEXT << "(" << _("level") << " "
- << u.type().level() << ")\n"
- << status << "\n"
- <<
string_table[unit_type::alignment_description(u.type().alignment())]
- << "\n"
- << u.traits_description() << "\n";
-
- const std::vector<std::string>& abilities = u.type().abilities();
- for(std::vector<std::string>::const_iterator a = abilities.begin(); a
!= abilities.end(); ++a) {
- details << *a << "\n";
- }
-
- //display in green/white/red depending on hitpoints
- if(u.hitpoints() <= u.max_hitpoints()/3)
- details << font::BAD_TEXT;
- else if(u.hitpoints() > 2*(u.max_hitpoints()/3))
- details << font::GOOD_TEXT;
-
- details << _("HP: ") << u.hitpoints()
- << "/" << u.max_hitpoints() << "\n";
-
- if(u.can_advance() == false) {
- details << _("XP: ") << u.experience() << "/-";
- } else {
- //if killing a unit the same level as us would level us up,
- //then display in green
- if(u.max_experience() - u.experience() <
game_config::kill_experience) {
- details << font::GOOD_TEXT;
- }
-
- details << _("XP: ") << u.experience() << "/" <<
u.max_experience();
- }
-
- details << "\n"
- << _("Moves: ") << u.movement_left() << "/"
- << u.total_movement()
- << "\n";
-
- const std::vector<attack_type>& attacks = u.attacks();
- for(std::vector<attack_type>::const_iterator at_it = attacks.begin();
- at_it != attacks.end(); ++at_it) {
-
- const t_string& lang_weapon = at_it->name();
- const std::string& lang_type = at_it->type();
- const std::string& lang_special = at_it->special();
- details << "\n"
- << (lang_weapon.empty() ?
at_it->name():lang_weapon) << " ("
- << (lang_type.empty() ?
at_it->type():lang_type) << ")\n"
- << (lang_special.empty() ?
at_it->special():lang_special)<<"\n"
- << at_it->damage() << "-" <<
at_it->num_attacks() << " -- "
- << (at_it->range() == attack_type::SHORT_RANGE ?
- _("melee") :
- _("ranged"));
-
- details << "\n\n";
- }
-
- //choose the font size based on how much room we have to play
- //with on the right-side panel
- const size_t font_size = this->y() >= 700 ? 13 : 10;
-
- description_rect =
font::draw_text(&screen_,clipRect,font_size,font::NORMAL_COLOUR,
- details.str(),x,y);
-
- update_rect(description_rect);
-
- y += description_rect.h;
-
- const surface
profile(image::get_image(u.type().image(),image::UNSCALED));
-
- if(profile == NULL)
- return;
-
- //blit the unit profile
- {
- const size_t profilew = 50;
- const size_t profileh = 50;
- SDL_Rect srcrect = {
(profile->w-profilew)/2,(profile->h-profileh)/2,
- profilew,profileh };
- SDL_Rect dstrect = srcrect;
- dstrect.x = profilex;
- dstrect.y = profiley;
- SDL_BlitSurface(profile,&srcrect,video().getSurface(),&dstrect);
-
- update_rect(profilex,profiley,profilew,profileh);
- }
-}
-#endif
void display::draw_minimap(int x, int y, int w, int h)
{
Index: wesnoth/src/reports.cpp
diff -u wesnoth/src/reports.cpp:1.68 wesnoth/src/reports.cpp:1.69
--- wesnoth/src/reports.cpp:1.68 Wed Jul 20 08:22:37 2005
+++ wesnoth/src/reports.cpp Sun Aug 21 17:56:28 2005
@@ -1,4 +1,4 @@
-/* $Id: reports.cpp,v 1.68 2005/07/20 08:22:37 ott Exp $ */
+/* $Id: reports.cpp,v 1.69 2005/08/21 17:56:28 gruikya Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -203,12 +203,11 @@
const std::vector<attack_type>& attacks = u->second.attacks();
for(std::vector<attack_type>::const_iterator at_it =
attacks.begin();
at_it != attacks.end(); ++at_it) {
- const std::string& lang_weapon =
gettext(at_it->name().c_str());
const std::string& lang_type =
gettext(at_it->type().c_str());
- str << lang_weapon << " (" << lang_type << ")\n";
+ str << at_it->name() << " (" << lang_type << ")\n";
- tooltip << lang_weapon << " (" << lang_type << ")\n";
+ tooltip << at_it->name() << " (" << lang_type << ")\n";
//find all the unit types on the map, and show this
weapon's bonus against all the different units
std::set<std::string> seen_units;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src dialogs.cpp display.cpp reports.cpp,
Philippe Plantier <=