[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth data/multiplayer.cfg src/multiplayer_cl...
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth data/multiplayer.cfg src/multiplayer_cl... |
Date: |
Sat, 18 Sep 2004 14:58:29 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 04/09/18 18:52:20
Modified files:
data : multiplayer.cfg
src : multiplayer_client.cpp multiplayer_client.hpp
multiplayer_connect.cpp multiplayer_connect.hpp
show_dialog.cpp show_dialog.hpp
src/widgets : combo.cpp
tools/castle-cutter: mk-all-castles.sh
Log message:
Added the ability to choose the leader on multiplayer
Added some random leader types (TO BE CHANGED by a competent era
designer :) )
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/data/multiplayer.cfg.diff?tr1=1.72&tr2=1.73&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.cpp.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.hpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.65&tr2=1.66&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.hpp.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.cpp.diff?tr1=1.92&tr2=1.93&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.hpp.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/combo.cpp.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/tools/castle-cutter/mk-all-castles.sh.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: wesnoth/data/multiplayer.cfg
diff -u wesnoth/data/multiplayer.cfg:1.72 wesnoth/data/multiplayer.cfg:1.73
--- wesnoth/data/multiplayer.cfg:1.72 Fri Sep 3 09:08:36 2004
+++ wesnoth/data/multiplayer.cfg Sat Sep 18 18:52:20 2004
@@ -27,6 +27,7 @@
[multiplayer_side]
name= _ "&human-general.png,Loyalists"
type=General
+ leader=General,Red Mage,White Mage
recruit=Cavalryman,Horseman,Spearman,Fencer,Heavy
Infantryman,Bowman,Mage,Naga
music="wesnoth-2.ogg"
terrain_liked=gcs
@@ -39,6 +40,7 @@
name= _ "&elvish-high-lord.png,Rebels"
type=Elvish High Lord
recruit=Elvish Fighter,Elvish Archer,Mage,Elvish Shaman,Elvish
Scout,Wose,Merman
+ leader=Elvish Lord,Elvish Hero,Elvish Captain,Wose
music="wesnoth-4.ogg"
terrain_liked=fwc
[ai]
@@ -49,6 +51,7 @@
[multiplayer_side]
name= _ "&orcish-warlord.png,Northerners"
type=Orcish Warlord
+ leader=Orcish Warlord,Orcish Assassin
recruit=Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish
Assassin,Saurian,Naga
music="wesnoth-5.ogg"
terrain_liked=hmw
@@ -60,6 +63,7 @@
[multiplayer_side]
name= _ "&undead-lich.png,Undead"
type=Lich
+ leader=Lich,Dark Adept
recruit=Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark
Adept,Ghoul
music="wesnoth-3.ogg"
terrain_liked=whc
@@ -71,6 +75,7 @@
[multiplayer_side]
name= _ "&dwarf-lord.png,Knalgan Alliance"
type=Dwarvish Lord
+ leader=Dwarvish Lord,Gryphon Master,Thug
recruit=Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish
Thunderer,Thief,Poacher,Footpad,Thug,Gryphon Rider
music="wesnoth-7.ogg"
terrain_liked=hm
@@ -82,6 +87,7 @@
[multiplayer_side]
name= _ "&drake-warrior.png,Drakes"
type=Drake Flameheart
+ leader=Drake Flameheart,Drake Warmage
recruit=Drake Fighter,Drake Slave,Drake Petit,Drake Burner,Drake
Mage,Drake Clasher
terrain_liked=hm
[ai]
Index: wesnoth/src/multiplayer_client.cpp
diff -u wesnoth/src/multiplayer_client.cpp:1.63
wesnoth/src/multiplayer_client.cpp:1.64
--- wesnoth/src/multiplayer_client.cpp:1.63 Mon Sep 13 03:16:19 2004
+++ wesnoth/src/multiplayer_client.cpp Sat Sep 18 18:52:20 2004
@@ -436,16 +436,27 @@
//if the client is allowed to choose their team,
instead of having
//it set by the server, do that here.
+ std::string leader;
+
if(allow_changes) {
+ std::vector<gui::preview_pane* > preview_panes;
+ leader_preview_pane leader_selector(disp,
&units_data, possible_sides);
+ preview_panes.push_back(&leader_selector);
+
choice = size_t(gui::show_dialog(disp,NULL,"",
- _("Choose your
side:"),gui::OK_ONLY,&choices));
+ _("Choose your
side:"),gui::OK_ONLY,&choices,&preview_panes));
+ leader = leader_selector.get_selected_leader();
}
assert(choice < possible_sides.size());
const config& chosen_side = *possible_sides[choice];
team_name = response["name"] = chosen_side["name"];
- response["type"] = chosen_side["type"];
+ if(leader.empty()) {
+ response["type"] = chosen_side["type"];
+ } else {
+ response["type"] = leader;
+ }
response["recruit"] = chosen_side["recruit"];
response["music"] = chosen_side["music"];
@@ -536,3 +547,234 @@
recorder.clear();
}
}
+
+leader_list_manager::leader_list_manager(const config::child_list& side_list,
+ const game_data* data, gui::combo* combo) :
+ combo_(combo), side_list_(side_list), data_(data)
+{
+#if 0
+ for(config::const_child_iterator itor = side_list.begin(); itor !=
side_list.end(); ++itor) {
+ std::cerr << "Child: " << *itor << "\n";
+ std::cerr << (**itor).write();
+ }
+#endif
+}
+
+void leader_list_manager::set_combo(gui::combo* combo)
+{
+ combo_ = combo;
+
+ if (combo_ != NULL) {
+ update_leader_list(0);
+ }
+}
+
+void leader_list_manager::update_leader_list(int side_index)
+{
+ const config& side = *side_list_[side_index];
+
+ leaders_.clear();
+
+ if(side["type"] == "random") {
+ if(combo_ != NULL) {
+ std::vector<std::string> dummy;
+ dummy.push_back("-");
+ combo_->enable(false);
+ combo_->set_items(dummy);
+ combo_->set_selected(0);
+ }
+ return;
+ } else {
+ if(combo_ != NULL)
+ combo_->enable(true);
+ }
+
+ if(!side["leader"].empty()) {
+ leaders_ = config::split(side["leader"]);
+ }
+
+ const std::string default_leader = side["type"];
+ int default_index = 0;
+
+ std::vector<std::string>::const_iterator itor;
+
+ for (itor = leaders_.begin(); itor != leaders_.end(); ++itor) {
+ if (*itor == default_leader) {
+ break;
+ }
+ default_index++;
+ }
+
+ if (default_index == leaders_.size()) {
+ leaders_.push_back(default_leader);
+ }
+
+ std::vector<std::string> leader_strings;
+
+ for(itor = leaders_.begin(); itor != leaders_.end(); ++itor) {
+
+ const game_data::unit_type_map& utypes = data_->unit_types;
+
+ //const std::string name =
data_->unit_types->find(*itor).language_name();
+ if (utypes.find(*itor) != utypes.end()) {
+ const std::string name =
utypes.find(*itor)->second.language_name();
+ const std::string image =
utypes.find(*itor)->second.image();
+
+ leader_strings.push_back("&" + image + "," + name);
+ } else {
+ leader_strings.push_back("?");
+ }
+ }
+
+ if(combo_ != NULL) {
+ combo_->set_items(leader_strings);
+ combo_->set_selected(default_index);
+ }
+}
+
+void leader_list_manager::set_leader(const std::string& leader)
+{
+ if(combo_ == NULL)
+ return;
+
+ int leader_index = 0;
+ for(std::vector<std::string>::const_iterator itor = leaders_.begin();
+ itor != leaders_.end(); ++itor) {
+ if (leader == *itor)
+ combo_->set_selected(leader_index);
+ ++leader_index;
+ }
+}
+
+std::string leader_list_manager::get_leader()
+{
+ if(combo_ == NULL)
+ return _("?");
+
+ if(combo_->selected() >= leaders_.size())
+ return _("?");
+
+ return leaders_[combo_->selected()];
+}
+
+namespace {
+ static const SDL_Rect leader_pane_position = {-260,-370,260,370};
+ static const int leader_pane_border = 10;
+}
+
+leader_preview_pane::leader_preview_pane(display& disp, const game_data* data,
+ const config::child_list& side_list) :
+ gui::preview_pane(disp),
+ side_list_(side_list), selection_(0),
+ leader_combo_(disp, std::vector<std::string>()),
+ leaders_(side_list, data, &leader_combo_),
+ data_(data)
+{
+
+ set_location(leader_pane_position);
+}
+
+void leader_preview_pane::process()
+{
+ int mousex, mousey;
+ const int mouse_flags = SDL_GetMouseState(&mousex,&mousey);
+ const bool left_button = mouse_flags&SDL_BUTTON_LMASK;
+
+ if(leader_combo_.process(mousex, mousey, left_button)) {
+ set_dirty();
+ }
+}
+
+void leader_preview_pane::draw()
+{
+ if(!dirty())
+ return;
+
+ bg_restore();
+
+ surface const screen = disp().video().getSurface();
+
+ const SDL_Rect area = { location().x+leader_pane_border,
location().y+leader_pane_border,
+ location().w-leader_pane_border*2,
location().h-leader_pane_border*2 };
+ SDL_Rect clip_area = area;
+ const clip_rect_setter clipper(screen,clip_area);
+
+ if(selection_ < side_list_.size()) {
+ const config& side = *side_list_[selection_];
+ std::string faction = side["name"];
+ const std::string recruits = side["recruit"];
+ const std::vector<std::string> recruit_list =
config::split(recruits);
+ std::ostringstream recruit_string;
+
+ if(faction[0] == font::IMAGE) {
+ int p = faction.find_first_of(",");
+ if(p != std::string::npos && p < faction.size())
+ faction = faction.substr(p+1);
+ }
+ std::string leader = leaders_.get_leader();
+
+ const game_data::unit_type_map& utypes = data_->unit_types;
+ std::string leader_name;
+ std::string image;
+
+ if (utypes.find(leader) != utypes.end()) {
+ leader_name =
utypes.find(leader)->second.language_name();
+ image = utypes.find(leader)->second.image();
+ }
+ for(std::vector<std::string>::const_iterator itor =
recruit_list.begin();
+ itor != recruit_list.end(); ++itor) {
+
+ if (utypes.find(*itor) != utypes.end()) {
+ if(itor != recruit_list.begin())
+ recruit_string << ", ";
+ recruit_string <<
utypes.find(*itor)->second.language_name();
+ }
+ }
+
+ SDL_Rect image_rect = {area.x,area.y,0,0};
+
+ surface unit_image(image::get_image(image, image::UNSCALED));
+
+ if(!unit_image.null()) {
+ image_rect.w = unit_image->w;
+ image_rect.h = unit_image->h;
+ SDL_BlitSurface(unit_image,NULL,screen,&image_rect);
+ }
+
+
font::draw_text(&disp(),area,16,font::NORMAL_COLOUR,faction,area.x + 80, area.y
+ 30);
+ const SDL_Rect leader_rect =
font::draw_text(&disp(),area,12,font::NORMAL_COLOUR,
+ _("Leader: "),area.x, area.y + 80);
+ font::draw_wrapped_text(&disp(),area,12,font::NORMAL_COLOUR,
+ _("Recruits: ") + recruit_string.str(),area.x,
area.y + 102,
+ area.w);
+
+ leader_combo_.set_location(leader_rect.x + leader_rect.w + 10,
leader_rect.y + (leader_rect.h - leader_combo_.height()) / 2);
+ }
+
+
+ set_dirty(false);
+}
+
+bool leader_preview_pane::show_above() const
+{
+ return false;
+}
+
+bool leader_preview_pane::left_side() const
+{
+ return false;
+}
+
+void leader_preview_pane::set_selection(int selection)
+{
+ selection_ = selection;
+ leaders_.update_leader_list(selection_);
+ set_dirty();
+ leader_combo_.set_dirty();
+}
+
+std::string leader_preview_pane::get_selected_leader()
+{
+ return leaders_.get_leader();
+}
+
Index: wesnoth/src/multiplayer_client.hpp
diff -u wesnoth/src/multiplayer_client.hpp:1.3
wesnoth/src/multiplayer_client.hpp:1.4
--- wesnoth/src/multiplayer_client.hpp:1.3 Mon Jun 14 18:40:54 2004
+++ wesnoth/src/multiplayer_client.hpp Sat Sep 18 18:52:20 2004
@@ -6,6 +6,8 @@
#include "gamestatus.hpp"
#include "network.hpp"
#include "unit_types.hpp"
+#include "show_dialog.hpp"
+#include "widgets/combo.hpp"
//function to play a game as a client, joining either another player who is
//hosting a game, or connecting to a server.
@@ -13,4 +15,46 @@
game_state& state, std::string& host);
+class leader_list_manager
+{
+public:
+ leader_list_manager(const config::child_list& side_list, const
game_data* data,
+ gui::combo* combo = NULL);
+
+ void set_combo(gui::combo* combo);
+ void update_leader_list(int side);
+ std::string get_leader();
+ void set_leader(const std::string& leader);
+ bool is_leader_ok(std::string leader);
+
+private:
+ std::vector<std::string> leaders_;
+ config::child_list side_list_;
+ const game_data* data_;
+ gui::combo* combo_;
+
+};
+
+class leader_preview_pane : public gui::preview_pane
+{
+public:
+ leader_preview_pane(display& disp, const game_data* data,
+ const config::child_list& side_list);
+
+ bool show_above() const;
+ bool left_side() const;
+ void set_selection(int index);
+ std::string get_selected_leader();
+
+private:
+ void draw();
+ void process();
+
+ const config::child_list side_list_;
+ gui::combo leader_combo_; // Must appear before the leader_list_manager
+ leader_list_manager leaders_;
+ int selection_;
+ const game_data* data_;
+};
+
#endif
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.65
wesnoth/src/multiplayer_connect.cpp:1.66
--- wesnoth/src/multiplayer_connect.cpp:1.65 Mon Sep 13 03:16:19 2004
+++ wesnoth/src/multiplayer_connect.cpp Sat Sep 18 18:52:20 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.65 2004/09/13 03:16:19 Sirp Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.66 2004/09/18 18:52:20 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -221,6 +221,9 @@
if(side["name"].empty())
side["name"] = (*possible_sides.front())["name"];
+ if(side["leader"].empty())
+ side["leader"] = (*possible_sides.front())["leader"];
+
if(side["type"].empty() && save_ == false)
side["type"] = (*possible_sides.front())["type"];
@@ -290,6 +293,8 @@
player_teams_.push_back(_("Team") + std::string(" ") +
team_name);
(**sd)["colour"] =
lexical_cast_default<std::string>(team_num+1);
+
+ player_leaders_.push_back(leader_list_manager(possible_sides,
data_));
}
std::string prefix;
@@ -392,6 +397,7 @@
combos_type_.clear();
combos_race_.clear();
+ combos_leader_.clear();
combos_team_.clear();
combos_color_.clear();
sliders_gold_.clear();
@@ -403,31 +409,35 @@
//Player number
font::draw_text(disp_,rect, 24, font::GOOD_COLOUR,
- (*sd)->values["side"], left+10,
top+53+(30*side_num));
+ (*sd)->values["side"], left+10,
top+53+(60*side_num));
//Player type
combos_type_.push_back(gui::combo(*disp_, player_types_));
- combos_type_.back().set_location(left+30,top+55+(30*side_num));
+ combos_type_.back().set_location(left+30,top+55+(60*side_num));
//Player race
combos_race_.push_back(gui::combo(*disp_, player_races_));
- combos_race_.back().set_location(left+145,top+55+(30*side_num));
+ combos_race_.back().set_location(left+145,top+55+(60*side_num));
+
+ //Player leader
+ combos_leader_.push_back(gui::combo(*disp_,
std::vector<std::string>()));
+
combos_leader_.back().set_location(left+145,top+85+(60*side_num));
//Player team
combos_team_.push_back(gui::combo(*disp_, player_teams_));
- combos_team_.back().set_location(left+260,top+55+(30*side_num));
+ combos_team_.back().set_location(left+260,top+55+(60*side_num));
combos_team_.back().set_selected(side_num);
//Player color
combos_color_.push_back(gui::combo(*disp_, player_colors_));
-
combos_color_.back().set_location(left+375,top+55+(30*side_num));
+
combos_color_.back().set_location(left+375,top+55+(60*side_num));
combos_color_.back().set_selected(side_num);
SDL_Rect r;
//Player gold
r.x = left+490;
- r.y = top+55+(30*side_num);
+ r.y = top+55+(60*side_num);
r.w = launch_.width()-5;
r.h = launch_.height();
sliders_gold_.push_back(gui::slider(*disp_, r));
@@ -441,6 +451,13 @@
"100", r.x, r.y);
}
+ //Doing this after creating the combos, because growing vectors may
+ //move their elements in memory, and we need a stable pointer
+ for(sd = sides.first; sd != sides.second; ++sd) {
+ const int side_num = sd - sides.first;
+ player_leaders_[side_num].set_combo(&combos_leader_[side_num]);
+ }
+
std::cerr << "done set_area()\n";
update_whole_screen();
@@ -497,10 +514,16 @@
//Player Faction
for (size_t m = 0; m != player_races_.size(); ++m) {
if (side["name"] == player_races_[m]) {
- combos_race_[n].set_selected(m);
+ if (combos_race_[n].selected() != m) {
+ combos_race_[n].set_selected(m);
+
player_leaders_[n].update_leader_list(m);
+ }
}
}
+ // Player leader
+ player_leaders_[n].set_leader(side["type"]);
+
//Player Team
const std::string& team_name = side["team_name"];
if(team_name != "" && isdigit(team_name[0]))
@@ -512,7 +535,7 @@
std::string str = side["gold"];
sliders_gold_[n].set_value(atoi(str.c_str()));
rect.x = rect_.x + 603;
- rect.y = rect_.y + 55 + (30 * n);
+ rect.y = rect_.y + 55 + (60 * n);
rect.w = 30;
rect.h = launch_.height();
gold_bg_[n].restore();
@@ -612,11 +635,13 @@
side["colour"] =
lexical_cast_default<std::string>(combos_color_[n].selected()+1);
}
+
//Player race
combos_race_[n].enable(!save_);
combos_team_[n].enable(!save_);
combos_color_[n].enable(!save_);
+ old_select = combos_race_[n].selected();
if(combos_race_[n].process(mousex, mousey, left_button)) {
const string_map& values =
possible_sides[combos_race_[n].selected()]->values;
for(string_map::const_iterator i = values.begin(); i !=
values.end(); ++i) {
@@ -624,6 +649,18 @@
side[i->first] = i->second;
}
level_changed = true;
+
+ if (combos_race_[n].selected() != old_select) {
+
player_leaders_[n].update_leader_list(combos_race_[n].selected());
+ }
+ }
+
+ //Player leader
+ if(combos_leader_[n].process(mousex, mousey, left_button)) {
+ std::stringstream str;
+ str << (combos_team_[n].selected()+1);
+ side["type"] = player_leaders_[n].get_leader();
+ level_changed = true;
}
//Player team
@@ -649,7 +686,7 @@
SDL_Rect rect;
rect.x = rect_.x + 603;
- rect.y = rect_.y + 55 + (30 * n);
+ rect.y = rect_.y + 55 + (60 * n);
rect.w = 30;
rect.h = launch_.height();
gold_bg_[n].restore();
Index: wesnoth/src/multiplayer_connect.hpp
diff -u wesnoth/src/multiplayer_connect.hpp:1.17
wesnoth/src/multiplayer_connect.hpp:1.18
--- wesnoth/src/multiplayer_connect.hpp:1.17 Mon May 24 16:27:16 2004
+++ wesnoth/src/multiplayer_connect.hpp Sat Sep 18 18:52:20 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.hpp,v 1.17 2004/05/24 16:27:16 Sirp Exp $ */
+/* $Id: multiplayer_connect.hpp,v 1.18 2004/09/18 18:52:20 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -14,6 +14,7 @@
#define MULTIPLAYER_CONNECT_H_INCLUDED
#include "multiplayer_lobby.hpp"
+#include "multiplayer_client.hpp"
#include "network.hpp"
#include "widgets/textbox.hpp"
#include "widgets/button.hpp"
@@ -81,8 +82,12 @@
std::vector<std::string> player_teams_;
std::vector<std::string> player_colors_;
+ //std::vector<std::vector<std::string> > player_leaders_;
+ std::vector<leader_list_manager> player_leaders_;
+
std::vector<gui::combo> combos_type_;
std::vector<gui::combo> combos_race_;
+ std::vector<gui::combo> combos_leader_;
std::vector<gui::combo> combos_team_;
std::vector<gui::combo> combos_color_;
std::vector<gui::slider> sliders_gold_;
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.92 wesnoth/src/show_dialog.cpp:1.93
--- wesnoth/src/show_dialog.cpp:1.92 Fri Sep 10 18:08:56 2004
+++ wesnoth/src/show_dialog.cpp Sat Sep 18 18:52:20 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.92 2004/09/10 18:08:56 silene Exp $ */
+/* $Id: show_dialog.cpp,v 1.93 2004/09/18 18:52:20 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -355,13 +355,13 @@
}
int show_dialog(display& disp, surface image,
- const std::string& caption, const std::string& msg,
- DIALOG_TYPE type,
+ const std::string& caption, const std::string&
msg,
+ DIALOG_TYPE type,
const std::vector<std::string>* menu_items_ptr,
const std::vector<preview_pane*>* preview_panes,
const std::string& text_widget_label,
std::string* text_widget_text,
- dialog_action* action, std::vector<check_item>* options, int
xloc, int yloc,
+ dialog_action* action, std::vector<check_item>*
options, int xloc, int yloc,
const std::string* dialog_style,
std::vector<dialog_button>* action_buttons,
const std::string& help_topic)
{
@@ -382,7 +382,7 @@
hotkey::basic_handler help_dispatcher(&disp,&helper);
const std::vector<std::string>& menu_items =
- (menu_items_ptr == NULL) ? std::vector<std::string>() :
*menu_items_ptr;
+ (menu_items_ptr == NULL) ? std::vector<std::string>() :
*menu_items_ptr;
static const int message_font_size = 16;
static const int caption_font_size = 18;
Index: wesnoth/src/show_dialog.hpp
diff -u wesnoth/src/show_dialog.hpp:1.39 wesnoth/src/show_dialog.hpp:1.40
--- wesnoth/src/show_dialog.hpp:1.39 Wed Aug 11 03:10:17 2004
+++ wesnoth/src/show_dialog.hpp Sat Sep 18 18:52:20 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.hpp,v 1.39 2004/08/11 03:10:17 Sirp Exp $ */
+/* $Id: show_dialog.hpp,v 1.40 2004/09/18 18:52:20 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -132,13 +132,13 @@
//index of the selection otherwise. If no menu is given, returns the index
//of the button that was pressed
int show_dialog(display& screen, surface image,
- const std::string& caption, const std::string& message,
- DIALOG_TYPE type=MESSAGE,
- const std::vector<std::string>* menu_items=NULL,
- const std::vector<preview_pane*>* preview_panes=NULL,
+ const std::string& caption, const std::string&
message,
+ DIALOG_TYPE type=MESSAGE,
+ const std::vector<std::string>* menu_items=NULL,
+ const std::vector<preview_pane*>*
preview_panes=NULL,
const std::string& text_widget_label="",
std::string* text_widget_text=NULL,
- dialog_action* action=NULL,
+ dialog_action* action=NULL,
std::vector<check_item>* options=NULL, int
xloc=-1, int yloc=-1,
const std::string* dialog_style=NULL,
std::vector<dialog_button>* buttons=NULL,
Index: wesnoth/src/widgets/combo.cpp
diff -u wesnoth/src/widgets/combo.cpp:1.18 wesnoth/src/widgets/combo.cpp:1.19
--- wesnoth/src/widgets/combo.cpp:1.18 Sun Aug 29 23:28:26 2004
+++ wesnoth/src/widgets/combo.cpp Sat Sep 18 18:52:20 2004
@@ -1,4 +1,4 @@
-/* $Id: combo.cpp,v 1.18 2004/08/29 23:28:26 Sirp Exp $ */
+/* $Id: combo.cpp,v 1.19 2004/09/18 18:52:20 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -24,7 +24,7 @@
combo::combo(display& disp, const std::vector<std::string>& items) :
items_(items), selected_(0), display_(&disp),
- button_(gui::button(disp, items[0]))
+ button_(gui::button(disp, items.empty() ? "" : items[0]))
{
}
Index: wesnoth/tools/castle-cutter/mk-all-castles.sh
diff -u wesnoth/tools/castle-cutter/mk-all-castles.sh:1.1
wesnoth/tools/castle-cutter/mk-all-castles.sh:1.2
--- wesnoth/tools/castle-cutter/mk-all-castles.sh:1.1 Mon Jun 7 19:21:03 2004
+++ wesnoth/tools/castle-cutter/mk-all-castles.sh Sat Sep 18 18:52:20 2004
@@ -1,15 +1,11 @@
#/bin/bash
-./mk-castle.sh -b castle-bg -c cutout-bg.png -o castle -t castle-walls.tmpl
castle.png
-./mk-castle.sh -b castle-fg -c cutout-fg.png -o castle -t castle-walls.tmpl
castle.png
+./mk-castle.sh -b castle -c cutout.png -o castle -t castle-walls.tmpl
castle.png
-./mk-castle.sh -b keep-bg -c cutout-bg.png -o castle -t keep1.tmpl keep1.png
-./mk-castle.sh -b keep-fg -c cutout-fg.png -o castle -t keep1.tmpl keep1.png
+./mk-castle.sh -b keep -c cutout.png -o castle -t keep1.tmpl keep1.png
-./mk-castle.sh -b keep-bg -c cutout-bg.png -o castle -t keep2.tmpl keep2.png
-./mk-castle.sh -b keep-fg -c cutout-fg.png -o castle -t keep2.tmpl keep2.png
+./mk-castle.sh -b keep -c cutout.png -o castle -t keep2.tmpl keep2.png
-./mk-castle.sh -b encampment-bg -c cutout-bg.png -o castle -t
castle-walls.tmpl encampment.png
-./mk-castle.sh -b encampment-fg -c cutout-fg.png -o castle -t
castle-walls.tmpl encampment.png
+./mk-castle.sh -b encampment -c cutout.png -o castle -t castle-walls.tmpl
encampment.png
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth data/multiplayer.cfg src/multiplayer_cl...,
Philippe Plantier <=