当前位置: 首页>>代码示例>>C++>>正文


C++ twindow::close方法代码示例

本文整理汇总了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();
	}
}
开发者ID:CliffsDover,项目名称:wesnoth,代码行数:7,代码来源:lobby.cpp

示例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();
	}
}
开发者ID:CliffsDover,项目名称:wesnoth,代码行数:7,代码来源:lobby.cpp

示例3: cancel

void tmp_side_wait::cancel(twindow& window)
{
	legacy_result_ = QUIT;
	window.close();
}
开发者ID:hyrio,项目名称:War-Of-Kingdom,代码行数:5,代码来源:mp_side_wait.cpp

示例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);
}
开发者ID:hyrio,项目名称:War-Of-Kingdom,代码行数:91,代码来源:mp_side_wait.cpp

示例5: kick_ban_button_callback

void tlobby_player_info::kick_ban_button_callback(twindow& w)
{
	do_kick_ban(true);
	w.close();
}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:5,代码来源:player_info.cpp

示例6: check_status_button_callback

void tlobby_player_info::check_status_button_callback(twindow& w)
{
	chat_.send_command("query", "status " + info_.name);
	w.close();
}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:5,代码来源:player_info.cpp

示例7: start_whisper_button_callback

void tlobby_player_info::start_whisper_button_callback(twindow& w)
{
	result_open_whisper_ = true;
	w.close();
}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:5,代码来源:player_info.cpp

示例8: create_button_callback

void tlobby_main::create_button_callback(twindow& window)
{
	legacy_result_ = CREATE;
	window.close();
}
开发者ID:CliffsDover,项目名称:wesnoth,代码行数:5,代码来源:lobby.cpp

示例9: set_retval

void tsystem::set_retval(twindow& window, int val)
{
	retval_ = val;
	window.close();
}
开发者ID:SkyPrayerStudio,项目名称:War-Of-Kingdom,代码行数:5,代码来源:system.cpp


注:本文中的twindow::close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。