本文整理汇总了C++中twindow::close方法的典型用法代码示例。如果您正苦于以下问题:C++ twindow::close方法的具体用法?C++ twindow::close怎么用?C++ twindow::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twindow
的用法示例。
在下文中一共展示了twindow::close方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: join_global_button_callback
void tlobby_main::join_global_button_callback(twindow& window)
{
if(do_game_join(gamelistbox_->get_selected_row(), false)) {
legacy_result_ = JOIN;
window.close();
}
}
示例2: observe_global_button_callback
void tlobby_main::observe_global_button_callback(twindow& window)
{
if(do_game_join(gamelistbox_->get_selected_row(), true)) {
legacy_result_ = OBSERVE;
window.close();
}
}
示例3: cancel
void tmp_side_wait::cancel(twindow& window)
{
legacy_result_ = QUIT;
window.close();
}
示例4: join_game
void tmp_side_wait::join_game(twindow& window, bool observe)
{
// if we have got valid side data
// the first condition is to make sure that we don't have another
// WML message with a side-tag in it
while (!level_.has_attribute("version") || !level_.child("side")) {
level_.clear();
// below function has BUG!!!
network::connection data_res = dialogs::network_receive_dialog(disp_, _("Getting game data..."), level_);
if (!data_res) {
legacy_result_ = QUIT;
window.close();
return;
}
mp::check_response(data_res, level_);
if (level_.child("leave_game")) {
legacy_result_ = QUIT;
window.close();
return;
}
}
if (!observe) {
//search for an appropriate vacant slot. If a description is set
//(i.e. we're loading from a saved game), then prefer to get the side
//with the same description as our login. Otherwise just choose the first
//available side.
const config *side_choice = NULL;
int side_num = -1, nb_sides = 0;
BOOST_FOREACH (const config &sd, level_.child_range("side")) {
if (sd["controller"] == "network" && sd["current_player"].empty()) {
if (!side_choice) { // found the first empty side
side_choice = &sd;
side_num = nb_sides;
}
if (sd["current_player"] == preferences::login()) {
side_choice = &sd;
side_num = nb_sides;
break; // found the preferred one
}
}
++nb_sides;
}
if (!side_choice) {
legacy_result_ = QUIT;
window.close();
return;
}
bool allow_changes = (*side_choice)["allow_changes"].to_bool(true);
//if the client is allowed to choose their team, instead of having
//it set by the server, do that here.
std::string leader_choice, gender_choice;
int faction_choice = 0;
if(allow_changes) {
events::event_context context;
const config &era = level_.child("era");
/** @todo Check whether we have the era. If we don't inform the user. */
if (!era)
throw config::error(_("No era information found."));
/*
config::const_child_itors possible_sides = era.child_range("multiplayer_side");
if (possible_sides.first == possible_sides.second) {
set_result(QUIT);
throw config::error(_("No multiplayer sides found"));
return;
}
*/
int color = side_num;
const std::string color_str = (*side_choice)["color"].str();
if (!color_str.empty())
color = game_config::color_info(color_str).index() - 1;
config faction;
config& change = faction.add_child("change_faction");
change["name"] = preferences::login();
change["faction"] = 0; // now, it is ignored
change["leader"] = "random"; // now, it is ignored
change["gender"] = "random"; // now, it is ignored
network::send_data(lobby->chat, faction);
}
}
generate_menu(window);
}
示例5: kick_ban_button_callback
void tlobby_player_info::kick_ban_button_callback(twindow& w)
{
do_kick_ban(true);
w.close();
}
示例6: check_status_button_callback
void tlobby_player_info::check_status_button_callback(twindow& w)
{
chat_.send_command("query", "status " + info_.name);
w.close();
}
示例7: start_whisper_button_callback
void tlobby_player_info::start_whisper_button_callback(twindow& w)
{
result_open_whisper_ = true;
w.close();
}
示例8: create_button_callback
void tlobby_main::create_button_callback(twindow& window)
{
legacy_result_ = CREATE;
window.close();
}
示例9: set_retval
void tsystem::set_retval(twindow& window, int val)
{
retval_ = val;
window.close();
}