Idented the message classes.
This commit is contained in:
parent
1d63f1b977
commit
6298ec7f0a
2 changed files with 190 additions and 274 deletions
|
@ -47,24 +47,24 @@
|
|||
namespace gui2 {
|
||||
|
||||
/*
|
||||
void trecall_message_::recall_pressed(twindow& window) {
|
||||
void trecall_message_::recall_pressed(twindow& window) {
|
||||
|
||||
tlistbox& input_list = find_widget<tlistbox> (&window, "unit_list", false);
|
||||
tlistbox& input_list = find_widget<tlistbox> (&window, "unit_list", false);
|
||||
|
||||
game_menu_handler_->do_recall(chosen_unit_);
|
||||
input_list.remove_row(input_list.get_selected_row());
|
||||
game_menu_handler_->do_recall(chosen_unit_);
|
||||
input_list.remove_row(input_list.get_selected_row());
|
||||
|
||||
if (unit_list_.empty()) {
|
||||
window.close();
|
||||
}
|
||||
if (unit_list_.empty()) {
|
||||
window.close();
|
||||
}
|
||||
|
||||
unit_list_.erase(unit_list_.begin() + input_list.get_selected_row());
|
||||
chosen_unit_ = &unit_list_[0];
|
||||
update_unit_list(window);
|
||||
input_list.set_dirty();
|
||||
window.set_dirty();
|
||||
}
|
||||
*/
|
||||
unit_list_.erase(unit_list_.begin() + input_list.get_selected_row());
|
||||
chosen_unit_ = &unit_list_[0];
|
||||
update_unit_list(window);
|
||||
input_list.set_dirty();
|
||||
window.set_dirty();
|
||||
}
|
||||
*/
|
||||
|
||||
void tunit_message_::profile_pressed() {
|
||||
const unit_type& t = *chosen_unit_->type();
|
||||
|
@ -72,28 +72,30 @@ void tunit_message_::profile_pressed() {
|
|||
}
|
||||
|
||||
void tunit_message_::help_pressed() {
|
||||
help::show_help(*resources::screen,"recruit_and_recall");
|
||||
help::show_help(*resources::screen, "recruit_and_recall");
|
||||
}
|
||||
|
||||
void trecall_message_::remove_pressed(CVideo& video, twindow& window) {
|
||||
tlistbox& unit_listbox = find_widget<tlistbox> (&window, "unit_list", false);
|
||||
tlistbox& unit_listbox =
|
||||
find_widget<tlistbox> (&window, "unit_list", false);
|
||||
|
||||
//If the unit is of level > 1, or is close to advancing,
|
||||
//we warn the player about it
|
||||
std::stringstream message;
|
||||
if (chosen_unit_->loyal()) {
|
||||
message << /*_*/("My lord, this unit is loyal and requires no upkeep! ")
|
||||
<< (chosen_unit_->gender() == unit_race::MALE ? /*_*/("Do you really want to dismiss him?")
|
||||
: /*_*/("Do you really want to dismiss her?"));
|
||||
message
|
||||
<< /*_*/("My lord, this unit is loyal and requires no upkeep! ")
|
||||
<< (chosen_unit_->gender() == unit_race::MALE ? /*_*/("Do you really want to dismiss him?")
|
||||
: /*_*/("Do you really want to dismiss her?"));
|
||||
} else if (chosen_unit_->level() > 1) {
|
||||
message
|
||||
<< /*_*/("My lord, this unit is an experienced one, having advanced levels! ")
|
||||
<< (chosen_unit_->gender() == unit_race::MALE ? /*_*/("Do you really want to dismiss him?")
|
||||
: /*_*/("Do you really want to dismiss her?"));
|
||||
: /*_*/("Do you really want to dismiss her?"));
|
||||
|
||||
} else if (chosen_unit_->experience() > chosen_unit_->max_experience() / 2) {
|
||||
message << /*_*/("My lord, this unit is close to advancing a level! ")
|
||||
<< (chosen_unit_->gender() == unit_race::MALE ? /*_*/("Do you really want to dismiss him?")
|
||||
message << /*_*/("My lord, this unit is close to advancing a level! ")
|
||||
<< (chosen_unit_->gender() == unit_race::MALE ? /*_*/("Do you really want to dismiss him?")
|
||||
: /*_*/("Do you really want to dismiss her?"));
|
||||
}
|
||||
|
||||
|
@ -107,7 +109,7 @@ void trecall_message_::remove_pressed(CVideo& video, twindow& window) {
|
|||
|
||||
game_menu_handler_->do_delete_recall(chosen_unit_);
|
||||
|
||||
// assert(unit_)
|
||||
// assert(unit_)
|
||||
int selected_row = unit_listbox.get_selected_row();
|
||||
|
||||
unit_listbox.remove_row(selected_row);
|
||||
|
@ -119,14 +121,15 @@ void trecall_message_::remove_pressed(CVideo& video, twindow& window) {
|
|||
return;
|
||||
}
|
||||
*chosen_unit_ = unit_list_[0];
|
||||
unit_listbox.select_row(0,true);
|
||||
unit_listbox.select_row(0, true);
|
||||
update_unit_list(window);
|
||||
unit_listbox.set_dirty();
|
||||
window.set_dirty();
|
||||
}
|
||||
|
||||
void tunit_message_::update_unit_list(twindow& window) {
|
||||
tlistbox& unit_listbox = find_widget<tlistbox> (&window, "unit_list", false);
|
||||
tlistbox& unit_listbox =
|
||||
find_widget<tlistbox> (&window, "unit_list", false);
|
||||
*chosen_unit_ = unit_list_[unit_listbox.get_selected_row()];
|
||||
|
||||
if (resources::game_map->on_board(chosen_unit_->get_location())) {
|
||||
|
@ -230,16 +233,15 @@ void trecall_message_::pre_show(CVideo& video, twindow& window) {
|
|||
tunit_message_::pre_show(video, window);
|
||||
|
||||
/*
|
||||
tbutton* recall_button = find_widget<tbutton> (&window, "recall", false,
|
||||
false);
|
||||
recall_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&trecall_message_::recall_pressed, this, boost::ref(window)));
|
||||
*/
|
||||
tbutton* recall_button = find_widget<tbutton> (&window, "recall", false,
|
||||
false);
|
||||
recall_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&trecall_message_::recall_pressed, this, boost::ref(window)));
|
||||
*/
|
||||
|
||||
tbutton* help_button = find_widget<tbutton> (&window, "help", false,
|
||||
false);
|
||||
help_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&tunit_message_::help_pressed, this));
|
||||
tbutton* help_button = find_widget<tbutton> (&window, "help", false, false);
|
||||
help_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&tunit_message_::help_pressed, this));
|
||||
|
||||
tbutton* remove_button = find_widget<tbutton> (&window, "remove", false,
|
||||
false);
|
||||
|
@ -266,9 +268,9 @@ void tunit_message_::pre_show(CVideo& video, twindow& window) {
|
|||
for (size_t i = 0; i < unit_list_.size(); i++) {
|
||||
unit& unit = unit_list_[i];
|
||||
|
||||
bool affordable = unit.cost() <= gold_ ;
|
||||
bool affordable = unit.cost() <= gold_;
|
||||
|
||||
std::string unit_mod = affordable ? unit.image_mods() : "~GS()" ;
|
||||
std::string unit_mod = affordable ? unit.image_mods() : "~GS()";
|
||||
std::string icon = (unit.absolute_image() + unit_mod);
|
||||
std::string type = unit.type_name();
|
||||
std::string name = unit.name();
|
||||
|
@ -294,10 +296,11 @@ void tunit_message_::pre_show(CVideo& video, twindow& window) {
|
|||
|
||||
std::string gold_color;
|
||||
|
||||
gold_color = affordable ? "green" : "red" ;
|
||||
gold_color = affordable ? "green" : "red";
|
||||
|
||||
std::ostringstream cost;
|
||||
cost << "<span color=\"" << gold_color << "\">" << unit.cost() << " " << /*_*/("Gold") << "</span>" ;
|
||||
cost << "<span color=\"" << gold_color << "\">" << unit.cost() << " "
|
||||
<< /*_*/("Gold") << "</span>";
|
||||
|
||||
// Add the data.
|
||||
data["cost"]["label"] = cost.str();
|
||||
|
@ -320,10 +323,9 @@ void tunit_message_::pre_show(CVideo& video, twindow& window) {
|
|||
void trecruit_message_::pre_show(CVideo& video, twindow& window) {
|
||||
tunit_message_::pre_show(video, window);
|
||||
|
||||
tbutton* help_button = find_widget<tbutton> (&window, "help", false,
|
||||
false);
|
||||
help_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&tunit_message_::help_pressed, this));
|
||||
tbutton* help_button = find_widget<tbutton> (&window, "help", false, false);
|
||||
help_button->connect_signal_mouse_left_click(boost::bind(
|
||||
&tunit_message_::help_pressed, this));
|
||||
|
||||
window.set_click_dismiss(false);
|
||||
}
|
||||
|
@ -371,8 +373,8 @@ void toption_message_::post_show(twindow& window) {
|
|||
|
||||
void tunit_message_::post_show(twindow& window) {
|
||||
if (!unit_list_.empty()) {
|
||||
*chosen_unit_ = unit_list_[find_widget<tlistbox> (&window, "unit_list",
|
||||
true).get_selected_row()];
|
||||
*chosen_unit_ = unit_list_[find_widget<tlistbox> (&window, "unit_list",
|
||||
true).get_selected_row()];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -381,7 +383,6 @@ void trecruit_message_::post_show(twindow& window) {
|
|||
chosen_type_ = chosen_unit_->type_id();
|
||||
}
|
||||
|
||||
//#ifdef EXPERIMENTAL
|
||||
twindow* ticon_message_left::build_window(CVideo& video) {
|
||||
return build(video, get_id(ICON_MESSAGE_LEFT));
|
||||
}
|
||||
|
@ -429,7 +430,6 @@ twindow* tunit_message_left::build_window(CVideo& video) {
|
|||
twindow* tunit_message_right::build_window(CVideo& video) {
|
||||
return build(video, get_id(UNIT_MESSAGE_RIGHT));
|
||||
}
|
||||
//#endif
|
||||
|
||||
//begin of the wrapper functions
|
||||
int show_icon_message(const bool left_side, CVideo& video,
|
||||
|
@ -517,12 +517,14 @@ int show_recall_message(const bool left_side, CVideo& video, const bool mirror,
|
|||
int show_recruit_message(const bool left_side, CVideo& video,
|
||||
const bool mirror, const std::vector<const unit_type*> type_list,
|
||||
int side_num, int gold) {
|
||||
std::string chosen_type_id;
|
||||
std::string chosen_type_id;
|
||||
std::auto_ptr<trecruit_message_> dlg;
|
||||
if (left_side) {
|
||||
dlg.reset(new trecruit_message_left(mirror, type_list, chosen_type_id, side_num, gold));
|
||||
dlg.reset(new trecruit_message_left(mirror, type_list, chosen_type_id,
|
||||
side_num, gold));
|
||||
} else {
|
||||
dlg.reset(new trecruit_message_right(mirror, type_list, chosen_type_id, side_num, gold));
|
||||
dlg.reset(new trecruit_message_right(mirror, type_list, chosen_type_id,
|
||||
side_num, gold));
|
||||
}
|
||||
assert(dlg.get());
|
||||
dlg->show(video);
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/* $Id: icon_message.hpp 39955 2009-11-26 05:32:48Z fendrin $ */
|
||||
/*
|
||||
Copyright (C) 2009 - 2010 by Fabian Mueller <fabianmueller5@gmx.de>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
Copyright (C) 2009 - 2010 by Fabian Mueller <fabianmueller5@gmx.de>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#ifndef GUI_DIALOGS_ICON_MESSAGE_HPP_INCLUDED
|
||||
#define GUI_DIALOGS_ICON_MESSAGE_HPP_INCLUDED
|
||||
|
@ -29,18 +29,12 @@ namespace gui2 {
|
|||
*
|
||||
* We have a separate sub class for left and right images.
|
||||
*/
|
||||
class ticon_message_
|
||||
: public tdialog
|
||||
{
|
||||
class ticon_message_: public tdialog {
|
||||
public:
|
||||
ticon_message_(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror)
|
||||
: title_(title)
|
||||
, image_("")
|
||||
, message_(message)
|
||||
, portrait_(portrait)
|
||||
, mirror_(mirror)
|
||||
{
|
||||
const std::string& portrait, const bool mirror) :
|
||||
title_(title), image_(""), message_(message), portrait_(portrait),
|
||||
mirror_(mirror) {
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -78,13 +72,11 @@ private:
|
|||
};
|
||||
|
||||
/** Shows a dialog with the portrait on the left side. */
|
||||
class ticon_message_left : public ticon_message_
|
||||
{
|
||||
class ticon_message_left: public ticon_message_ {
|
||||
public:
|
||||
ticon_message_left(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror)
|
||||
: ticon_message_(title, message, portrait, mirror)
|
||||
{
|
||||
const std::string& portrait, const bool mirror) :
|
||||
ticon_message_(title, message, portrait, mirror) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
|
@ -92,30 +84,24 @@ private:
|
|||
};
|
||||
|
||||
/** Shows a dialog with the portrait on the right side. */
|
||||
class ticon_message_right : public ticon_message_
|
||||
{
|
||||
class ticon_message_right: public ticon_message_ {
|
||||
public:
|
||||
ticon_message_right(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror)
|
||||
: ticon_message_(title, message, portrait, mirror)
|
||||
{
|
||||
const std::string& portrait, const bool mirror) :
|
||||
ticon_message_(title, message, portrait, mirror) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class toption_message_ : public ticon_message_
|
||||
{
|
||||
class toption_message_: public ticon_message_ {
|
||||
public:
|
||||
toption_message_(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<std::string>& option_list,
|
||||
int* chosen_option)
|
||||
: ticon_message_(title, message, portrait, mirror)
|
||||
, option_list_(option_list)
|
||||
, chosen_option_(chosen_option)
|
||||
{
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
std::string>& option_list, int* chosen_option) :
|
||||
ticon_message_(title, message, portrait, mirror), option_list_(
|
||||
option_list), chosen_option_(chosen_option) {
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -133,15 +119,13 @@ private:
|
|||
|
||||
};
|
||||
|
||||
class toption_message_left : public toption_message_
|
||||
{
|
||||
class toption_message_left: public toption_message_ {
|
||||
public:
|
||||
toption_message_left(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<std::string>& option_list,
|
||||
int* chosen_option)
|
||||
: toption_message_(title, message, portrait, mirror, option_list, chosen_option)
|
||||
{
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
std::string>& option_list, int* chosen_option) :
|
||||
toption_message_(title, message, portrait, mirror, option_list,
|
||||
chosen_option) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
|
@ -149,36 +133,28 @@ private:
|
|||
};
|
||||
|
||||
/** Shows a dialog with the portrait on the right side. */
|
||||
class toption_message_right : public toption_message_
|
||||
{
|
||||
class toption_message_right: public toption_message_ {
|
||||
public:
|
||||
toption_message_right(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<std::string>& option_list,
|
||||
int* chosen_option)
|
||||
: toption_message_(title, message, portrait, mirror, option_list, chosen_option)
|
||||
{
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
std::string>& option_list, int* chosen_option) :
|
||||
toption_message_(title, message, portrait, mirror, option_list,
|
||||
chosen_option) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class tinput_message_ : public ticon_message_
|
||||
{
|
||||
class tinput_message_: public ticon_message_ {
|
||||
public:
|
||||
tinput_message_(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror
|
||||
, const std::string& input_caption
|
||||
, std::string* input_text
|
||||
, const unsigned maximum_length)
|
||||
: ticon_message_(title, message, portrait, mirror)
|
||||
, input_caption_(input_caption)
|
||||
, input_text_(input_text)
|
||||
, input_maximum_lenght_(maximum_length)
|
||||
{
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::string& input_caption, std::string* input_text,
|
||||
const unsigned maximum_length) :
|
||||
ticon_message_(title, message, portrait, mirror), input_caption_(
|
||||
input_caption), input_text_(input_text), input_maximum_lenght_(
|
||||
maximum_length) {
|
||||
}
|
||||
private:
|
||||
|
||||
|
@ -198,16 +174,14 @@ private:
|
|||
void post_show(twindow& window);
|
||||
};
|
||||
|
||||
class tinput_message_left : public tinput_message_
|
||||
{
|
||||
class tinput_message_left: public tinput_message_ {
|
||||
public:
|
||||
tinput_message_left(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror
|
||||
, const std::string& input_caption
|
||||
, std::string* input_text
|
||||
, const unsigned maximum_length)
|
||||
: tinput_message_(title, message, portrait, mirror, input_caption, input_text, maximum_length)
|
||||
{
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::string& input_caption, std::string* input_text,
|
||||
const unsigned maximum_length) :
|
||||
tinput_message_(title, message, portrait, mirror, input_caption,
|
||||
input_text, maximum_length) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
|
@ -215,53 +189,42 @@ private:
|
|||
};
|
||||
|
||||
/** Shows a dialog with the portrait on the right side. */
|
||||
class tinput_message_right : public tinput_message_
|
||||
{
|
||||
class tinput_message_right: public tinput_message_ {
|
||||
public:
|
||||
tinput_message_right(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror
|
||||
, const std::string& input_caption
|
||||
, std::string* input_text
|
||||
, const unsigned maximum_length)
|
||||
: tinput_message_(title, message, portrait, mirror, input_caption, input_text, maximum_length)
|
||||
{
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::string& input_caption, std::string* input_text,
|
||||
const unsigned maximum_length) :
|
||||
tinput_message_(title, message, portrait, mirror, input_caption,
|
||||
input_text, maximum_length) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class tunit_message_ : public ticon_message_
|
||||
{
|
||||
class tunit_message_: public ticon_message_ {
|
||||
public:
|
||||
tunit_message_(const std::string& title,
|
||||
const std::string& message,
|
||||
const bool mirror,
|
||||
const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit)
|
||||
: ticon_message_(title, message, chosen_unit->transparent(), mirror)
|
||||
, unit_list_(unit_list) , chosen_unit_(chosen_unit), gold_(10000)
|
||||
{
|
||||
tunit_message_(const std::string& title, const std::string& message,
|
||||
const bool mirror, const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit) :
|
||||
ticon_message_(title, message, chosen_unit->transparent(), mirror),
|
||||
unit_list_(unit_list), chosen_unit_(chosen_unit), gold_(10000) {
|
||||
}
|
||||
|
||||
tunit_message_(const std::string& title,
|
||||
const std::string& message,
|
||||
const bool mirror,
|
||||
const std::vector<const unit_type*> type_list,
|
||||
unit* chosen_unit, int side_num, int gold)
|
||||
: ticon_message_(title, message, "", mirror)
|
||||
, chosen_unit_(chosen_unit)
|
||||
, gold_(gold)
|
||||
{
|
||||
tunit_message_(const std::string& title, const std::string& message,
|
||||
const bool mirror, const std::vector<const unit_type*> type_list,
|
||||
unit* chosen_unit, int side_num, int gold) :
|
||||
ticon_message_(title, message, "", mirror), chosen_unit_(chosen_unit),
|
||||
gold_(gold) {
|
||||
std::vector<const unit_type*>::const_iterator it;
|
||||
it = type_list.begin();
|
||||
|
||||
for (it = type_list.begin(); it != type_list.end(); it++)
|
||||
{
|
||||
for (it = type_list.begin(); it != type_list.end(); it++) {
|
||||
unit new_unit(resources::units, *it, side_num, false);
|
||||
unit_list_.push_back(new_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Handler for the profile button event. */
|
||||
void profile_pressed();
|
||||
|
@ -289,20 +252,14 @@ private:
|
|||
|
||||
};
|
||||
|
||||
class trecruit_message_ : public tunit_message_
|
||||
{
|
||||
class trecruit_message_: public tunit_message_ {
|
||||
public:
|
||||
trecruit_message_(const bool mirror,
|
||||
const std::vector<const unit_type*> type_list,
|
||||
std::string& chosen_type,
|
||||
int side_num, int gold)
|
||||
: tunit_message_(/*_*/("Recruit")
|
||||
, /*_*/("Select unit:")
|
||||
, mirror
|
||||
, type_list, &unit_, side_num, gold )
|
||||
, chosen_type_(chosen_type)
|
||||
, unit_(resources::units, type_list.front(), false, side_num)
|
||||
{
|
||||
std::string& chosen_type, int side_num, int gold) :
|
||||
tunit_message_(/*_*/("Recruit"), /*_*/("Select unit:"), mirror,
|
||||
type_list, &unit_, side_num, gold), chosen_type_(chosen_type),
|
||||
unit_(resources::units, type_list.front(), false, side_num) {
|
||||
}
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
|
@ -312,80 +269,67 @@ public:
|
|||
void post_show(twindow& window);
|
||||
|
||||
private:
|
||||
// std::vector<const unit_type*> type_list_;
|
||||
// std::vector<const unit_type*> type_list_;
|
||||
std::string& chosen_type_;
|
||||
unit unit_;
|
||||
void update_type_list(twindow& window);
|
||||
|
||||
};
|
||||
|
||||
class trecruit_message_left : public trecruit_message_
|
||||
{
|
||||
class trecruit_message_left: public trecruit_message_ {
|
||||
public:
|
||||
trecruit_message_left(const bool mirror,
|
||||
const std::vector<const unit_type*> type_list,
|
||||
std::string& chosen_type, int side_num, int gold)
|
||||
: trecruit_message_(mirror, type_list, chosen_type, side_num, gold)
|
||||
{
|
||||
std::string& chosen_type, int side_num, int gold) :
|
||||
trecruit_message_(mirror, type_list, chosen_type, side_num, gold) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class trecruit_message_right : public trecruit_message_
|
||||
{
|
||||
class trecruit_message_right: public trecruit_message_ {
|
||||
public:
|
||||
trecruit_message_right(const bool mirror,
|
||||
const std::vector<const unit_type*> type_list,
|
||||
std::string& chosen_type, int side_num, int gold)
|
||||
: trecruit_message_(mirror, type_list, chosen_type, side_num, gold)
|
||||
{
|
||||
trecruit_message_right(const bool mirror, const std::vector<
|
||||
const unit_type*> type_list, std::string& chosen_type,
|
||||
int side_num, int gold) :
|
||||
trecruit_message_(mirror, type_list, chosen_type, side_num, gold) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
|
||||
class tunit_message_left : public tunit_message_
|
||||
{
|
||||
class tunit_message_left: public tunit_message_ {
|
||||
public:
|
||||
tunit_message_left(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<unit>& unit_list, unit* chosen_unit)
|
||||
: tunit_message_(title, message, mirror, unit_list, chosen_unit)
|
||||
{
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
unit>& unit_list, unit* chosen_unit) :
|
||||
tunit_message_(title, message, mirror, unit_list, chosen_unit) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class tunit_message_right : public tunit_message_
|
||||
{
|
||||
class tunit_message_right: public tunit_message_ {
|
||||
public:
|
||||
tunit_message_right(const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<unit>& unit_list, unit* chosen_unit)
|
||||
: tunit_message_(title, message, mirror, unit_list, chosen_unit)
|
||||
{
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
unit>& unit_list, unit* chosen_unit) :
|
||||
tunit_message_(title, message, mirror, unit_list, chosen_unit) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class trecall_message_ : public tunit_message_
|
||||
{
|
||||
class trecall_message_: public tunit_message_ {
|
||||
public:
|
||||
trecall_message_(const bool mirror,
|
||||
const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit,
|
||||
events::menu_handler* game_menu_handler)
|
||||
: tunit_message_(/*_*/("Recall"),/*_*/("Select Unit:"), mirror, unit_list, chosen_unit)
|
||||
, game_menu_handler_(game_menu_handler)
|
||||
{
|
||||
trecall_message_(const bool mirror, const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit, events::menu_handler* game_menu_handler) :
|
||||
tunit_message_(/*_*/("Recall"),/*_*/("Select Unit:"), mirror,
|
||||
unit_list, chosen_unit), game_menu_handler_(game_menu_handler) {
|
||||
}
|
||||
private:
|
||||
/** The menu event manager that called us. */
|
||||
|
@ -405,39 +349,30 @@ private:
|
|||
|
||||
};
|
||||
|
||||
class trecall_message_left : public trecall_message_
|
||||
{
|
||||
class trecall_message_left: public trecall_message_ {
|
||||
public:
|
||||
trecall_message_left(const bool mirror,
|
||||
const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit,
|
||||
events::menu_handler* game_menu_handler)
|
||||
: trecall_message_(mirror, unit_list, chosen_unit, game_menu_handler)
|
||||
{
|
||||
trecall_message_left(const bool mirror, const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit, events::menu_handler* game_menu_handler) :
|
||||
trecall_message_(mirror, unit_list, chosen_unit, game_menu_handler) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
class trecall_message_right : public trecall_message_
|
||||
{
|
||||
class trecall_message_right: public trecall_message_ {
|
||||
public:
|
||||
trecall_message_right(const bool mirror,
|
||||
const std::vector<unit>& unit_list,
|
||||
unit* chosen_unit,
|
||||
events::menu_handler* game_menu_handler)
|
||||
: trecall_message_(mirror, unit_list, chosen_unit, game_menu_handler)
|
||||
{
|
||||
const std::vector<unit>& unit_list, unit* chosen_unit,
|
||||
events::menu_handler* game_menu_handler) :
|
||||
trecall_message_(mirror, unit_list, chosen_unit, game_menu_handler) {
|
||||
}
|
||||
private:
|
||||
/** Inherited from twml_message_. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//TODO find a way to reference to these docu in the other methods.
|
||||
//TODO find a way to reference to this documentation in the other methods.
|
||||
/**
|
||||
* Helper function to show a message with speaker portrait.
|
||||
*
|
||||
|
@ -449,71 +384,50 @@ private:
|
|||
* @param portrait Filename of the portrait.
|
||||
* @param mirror Does the portrait need to be mirrored?
|
||||
*/
|
||||
int show_icon_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const std::string& title
|
||||
, const std::string& message
|
||||
, const std::string& portrait
|
||||
, const bool mirror);
|
||||
int show_icon_message(const bool left_side, CVideo& video,
|
||||
const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param input_caption The caption for the optional input text
|
||||
* box. If this value != "" there is an input
|
||||
* and the input text parameter is mandatory.
|
||||
* @param input_text Pointer to the initial text value will be
|
||||
* set to the result.
|
||||
* @param maximum_length The maximum length of the text.
|
||||
*
|
||||
*/
|
||||
int show_input_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const std::string& title
|
||||
, const std::string& message
|
||||
, const std::string& portrait
|
||||
, const bool mirror
|
||||
, const std::string& input_caption
|
||||
, std::string* input_text
|
||||
, const unsigned maximum_length);
|
||||
*
|
||||
* @param input_caption The caption for the optional input text
|
||||
* box. If this value != "" there is an input
|
||||
* and the input text parameter is mandatory.
|
||||
* @param input_text Pointer to the initial text value will be
|
||||
* set to the result.
|
||||
* @param maximum_length The maximum length of the text.
|
||||
*
|
||||
*/
|
||||
int show_input_message(const bool left_side, CVideo& video,
|
||||
const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::string& input_caption, std::string* input_text,
|
||||
const unsigned maximum_length);
|
||||
|
||||
/*
|
||||
* @param option_list A list of options to select in the dialog.
|
||||
* @param chosen_option Pointer to the initially chosen option.
|
||||
* Will be set to the chosen_option when the
|
||||
* dialog closes.
|
||||
*/
|
||||
int show_option_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const std::string& title
|
||||
, const std::string& message
|
||||
, const std::string& portrait
|
||||
, const bool mirror
|
||||
, const std::vector<std::string>& option_list
|
||||
, int* chosen_option);
|
||||
* @param option_list A list of options to select in the dialog.
|
||||
* @param chosen_option Pointer to the initially chosen option.
|
||||
* Will be set to the chosen_option when the
|
||||
* dialog closes.
|
||||
*/
|
||||
int show_option_message(const bool left_side, CVideo& video,
|
||||
const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror, const std::vector<
|
||||
std::string>& option_list, int* chosen_option);
|
||||
|
||||
int show_unit_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const std::string& title
|
||||
, const std::string& message
|
||||
, const std::string& portrait
|
||||
, const bool mirror
|
||||
, const std::vector<unit>& unit_list
|
||||
, unit* chosen_unit);
|
||||
int show_unit_message(const bool left_side, CVideo& video,
|
||||
const std::string& title, const std::string& message,
|
||||
const std::string& portrait, const bool mirror,
|
||||
const std::vector<unit>& unit_list, unit* chosen_unit);
|
||||
|
||||
int show_recall_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const bool mirror
|
||||
, const std::vector<unit>& unit_list
|
||||
, unit* chosen_unit
|
||||
, events::menu_handler* menu_handler_);
|
||||
int show_recall_message(const bool left_side, CVideo& video, const bool mirror,
|
||||
const std::vector<unit>& unit_list, unit* chosen_unit,
|
||||
events::menu_handler* menu_handler_);
|
||||
|
||||
int show_recruit_message(const bool left_side
|
||||
, CVideo& video
|
||||
, const bool mirror
|
||||
, const std::vector<const unit_type*> type_list
|
||||
// , std::string& chosen_type
|
||||
, int side_num
|
||||
, int gold);
|
||||
int show_recruit_message(const bool left_side, CVideo& video,
|
||||
const bool mirror, const std::vector<const unit_type*> type_list
|
||||
// , std::string& chosen_type
|
||||
, int side_num, int gold);
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue