コード例 #1
0
ファイル: game_save.cpp プロジェクト: fluffbeast/wesnoth-old
game_save_oos::game_save_oos(bool& ignore_all,
							   std::string& filename,
							   const std::string& title,
							   const std::string& message)
{
	register_label("lblTitle", true, title);
	register_text("txtFilename", false, filename, true);
	register_label("lblMessage", true, message);
	register_bool("ignore_all", true, ignore_all);

	/* Always need the ignore_all flag. */
	set_always_save_fields(true);
}
コード例 #2
0
teditor_edit_label::teditor_edit_label(std::string& text,
									   bool& immutable,
									   bool& visible_fog,
									   bool& visible_shroud)
{
	// std::string text = label.text();
	// bool immutable = label.immutable();


	// std::string label     = old_label ? old_label->text()              : "";
	// std::string team_name = old_label ? old_label->team_name()         : "";
	// bool visible_shroud   = old_label ? old_label->visible_in_shroud() :
	// false;
	// bool visible_fog      = old_label ? old_label->visible_in_fog()    :
	// true;
	// bool immutable        = old_label ? old_label->immutable()         :
	// true;

	register_text("label", true, text, true);
	register_bool("immutable_toggle", true, immutable);
	register_bool("visible_fog_toggle", true, visible_fog);
	register_bool("visible_shroud_toggle", true, visible_shroud);
}
コード例 #3
0
ファイル: resize_map.cpp プロジェクト: ArtBears/wesnoth
teditor_resize_map::teditor_resize_map(int& width,
									   int& height,
									   EXPAND_DIRECTION& expand_direction,
									   bool& copy_edge_terrain)
	: width_(register_integer("width", true, width))
	, height_(register_integer("height", true, height))
	, old_width_(width)
	, old_height_(height)
	, expand_direction_(expand_direction)
{
	register_bool("copy_edge_terrain", false, copy_edge_terrain);

	register_label("old_width", false, std::to_string(width));
	register_label("old_height", false, std::to_string(height));
}
コード例 #4
0
ファイル: mp_login.cpp プロジェクト: asimonov-im/wesnoth
tmp_login::tmp_login(const std::string& label, const bool focus_password)
{
	register_label("login_label", false, label);
	register_text("user_name"
			, true
			, &preferences::login
			, &preferences::set_login
			, !focus_password);

	register_text("password"
			, true
			, &preferences::password
			, NULL /* The password box returns '*' as value. */
			, focus_password);

	register_bool("remember_password"
			, false
			, &preferences::remember_password
			, &preferences::set_remember_password);
}
コード例 #5
0
teditor_edit_side::teditor_edit_side(int side,
									 std::string& id,
									 std::string& name,
									 int& gold,
									 int& income,
									 int& village_income,
									 int& village_support,
									 bool& fog,
									 bool& share_view,
									 bool& shroud,
									 bool& share_maps,
									 team::CONTROLLER& controller,
									 int controller_num,
									 bool& no_leader,
									 bool& hidden)
	: controller_(controller)
{
	std::stringstream side_stream;
	side_stream << side;
	register_label("side_number", true, side_stream.str(), true);

	register_text("team_name", true, id, true);
	register_text("user_team_name", true, name, true);

	register_integer("gold", true, gold);
	register_integer("income", true, income);

	register_integer("village_income", true, village_income);
	register_integer("village_support", true, village_support);

	register_integer("controller_number_player", true, controller_num);

	register_bool("fog", true, fog);
	register_bool("share_view", true, share_view);

	register_bool("shroud", true, shroud);
	register_bool("share_maps", true, share_maps);

	register_bool("no_leader", true, no_leader);
	register_bool("hidden", true, hidden);
}
コード例 #6
0
ファイル: edit_label.cpp プロジェクト: ArtBears/wesnoth
tedit_label::tedit_label(std::string& label, bool& team_only)
{
	register_text("label", true, label, true);
	register_bool("team_only_toggle", true, team_only);
}
コード例 #7
0
tgame_delete::tgame_delete()
    : chk_dont_ask_again_(register_bool("dont_ask_again"))
    , dont_ask_again_(false)
{}
コード例 #8
0
ファイル: mathmap_common.c プロジェクト: WoodMath/mathmap
userval_info_t*
arg_decls_to_uservals (filter_t *filter, arg_decl_t *arg_decls)
{
    userval_info_t *infos = NULL;

    while (arg_decls != 0)
    {
	userval_info_t *result = 0;

	if (lookup_userval(infos, arg_decls->name) != NULL)
	{
	    sprintf(error_string, _("The argument `%s' is declared more than once."), arg_decls->name);
	    error_region = arg_decls->region;
	    JUMP(1);
	}

	switch (arg_decls->type)
	{
	    case ARG_TYPE_INT :
		if (arg_decls->v.integer.have_limits)
		    result = register_int_const(&infos, arg_decls->name,
						arg_decls->v.integer.min, arg_decls->v.integer.max,
						arg_decls->v.integer.default_value);
		else
		    result = register_int_const(&infos, arg_decls->name, -100000, 100000, 0);
		break;

	    case ARG_TYPE_FLOAT :
		if (arg_decls->v.floating.have_limits)
		    result = register_float_const(&infos, arg_decls->name,
						  arg_decls->v.floating.min, arg_decls->v.floating.max,
						  arg_decls->v.floating.default_value);
		else
		    result = register_float_const(&infos, arg_decls->name, -1.0, 1.0, 0.0);
		break;

	    case ARG_TYPE_BOOL :
		result = register_bool(&infos, arg_decls->name, arg_decls->v.boolean.default_value);
		break;

	    case ARG_TYPE_COLOR :
		result = register_color(&infos, arg_decls->name);
		break;

	    case ARG_TYPE_GRADIENT :
		result = register_gradient(&infos, arg_decls->name);
		break;

	    case ARG_TYPE_CURVE :
		result = register_curve(&infos, arg_decls->name);
		break;

	    case ARG_TYPE_FILTER :
		assert(0);

	    case ARG_TYPE_IMAGE :
		result = register_image(&infos, arg_decls->name,
					image_flags_from_options(arg_decls->options));
		break;

	    default :
		assert(0);
	}

	if (result == 0)
	{
	    sprintf(error_string, _("Conflict for argument %s."), arg_decls->name);
	    error_region = arg_decls->region;
	    JUMP(1);
	}

	arg_decls = arg_decls->next;
    }

    return infos;
}
コード例 #9
0
ファイル: game_save.cpp プロジェクト: oys0317/opensanguo
tgame_save_oos::tgame_save_oos(const std::string& title, const std::string& filename, const std::string& message)
	: tgame_save_message(title, filename, message),
	btnIgnoreAll_(register_bool("ignore_all", false)),
	ignore_all_(false)
{}