コード例 #1
0
ファイル: fe-rosters.c プロジェクト: ailin-nemui/irssi-xmpp
static void
sig_roster_show(XMPP_SERVER_REC *server)
{
	GSList *gl, *ul;
	XMPP_ROSTER_GROUP_REC *group;
	XMPP_ROSTER_USER_REC *user;

	g_return_if_fail(IS_XMPP_SERVER(server));
	show_begin_of_roster(server);
	for (gl = server->roster; gl != NULL; gl = gl->next) {
		group = gl->data;
		/* don't show groups with only offline users */
		for (ul = group->users; ul != NULL
		    && !user_is_shown(ul->data); ul = ul->next);
		if (ul == NULL)
			continue;
		show_group(server, group);
		 for (ul = group->users; ul != NULL; ul = ul->next) {
			user = ul->data;
			if (user_is_shown(user))
				show_user(server, user);
		}
	}
	printformat_module(MODULE_NAME, server, NULL, MSGLEVEL_CRAP,
	    XMPPTXT_END_OF_ROSTER);
}
コード例 #2
0
ファイル: WNDOIO.C プロジェクト: AnimatorPro/Animator-Pro
LONG do_reqloop(Wscreen *screen,register Menuhdr *mh,Button *initb,
			    Menuhdr *pull, FUNC default_doclick)

/***** call to open put up a requestor menu and input loop on the stack ***
 * will disable all input switching to other windows until it is removed 
 * via mb_close_ok() etc and will always re-show the group if it is all hidden
 * by a feelme or optme it will restore the mouse settings to the ones
 * present on entry it will return the retcode from the last menu close
 * or group close (on the current group) or Err_abort if it was canceled
 * by a right click or space bar */
{
Mouset mset;
Mugroup mg;
Menuwndo *mw;
Menuwndo *hitwndo;
register Dlnode *next;
int altmouset;

	if(screen->glevel)
		enable_wrefresh(screen);
	get_mouset(&mset);
	push_group(screen,&mg);
	mg.flags |= MUG_REQUESTOR;

	if((mg.retcode = startloop_open(&mg,mh,initb,pull)) < 0)
		goto error;

	find_menu_cursor(&mg);

	while(mg.num_menus)
	{
		if(!(mg.non_hidden))
			show_group(&mg);  /* make sure something is visible */

		if(icb.mcurs_up <= 0)
			display_cursor();

		mac_wait_input(ANY_INPUT,ANY_INPUT&(~MMOVE));

		hitwndo = NULL; /* no hits yet */
		altmouset = 0;

		for(mh = (Menuhdr *)(mg.menuhdrs.head);
		    NULL != (next = ((Dlnode *)mh)->next);
			mh = (Menuhdr *)next )
		{
			mh = TOSTRUCT(Menuhdr,node,mh);

			if((mw = mh->mw) != NULL)
			{
				if(hitwndo == NULL) /* first one hit is it */
				{
					if(cursin_menu(mh))
					{
						hitwndo = mw;
						load_wndo_iostate(&(mw->w));
					}
				}
			}
			if(ISINPUT(KEYHIT & mh->ioflags)) /* keys take priority */ 
			{
				if(mw != NULL)
				{
					altmouset = 1;
					load_wndo_mouset(&(mw->w));
					if(do_wndodoit(&mw->w))
						goto reset_mouse;
				}
				else if(mh->flags & MENU_KEYSONHIDE) /* always get keys */
				{
					if(do_doitfunc(screen,mh->domenu,mh))
						goto reset_mouse;
				}
			}
		}

		if(hitwndo != NULL)
		{
			if(ISINPUT(hitwndo->w.ioflags & ~KEYHIT))
			{
				if(!do_wndodoit(&hitwndo->w))
					goto check_default_io;
				goto continue_big_loop;
			}
		}

		/* if we got to here we didn't hit a window or do a key !! 
		 * check for abort ! */

		if((!hitwndo && JSTHIT(MBRIGHT)) || (JSTHIT(KEYHIT) && is_abortkey()))
		{
			do_doitfunc(screen,do_closegroup,&mg);
			break;
		}

	check_default_io:

		if( default_doclick != NULL 
			&& JSTHIT(ANY_CLICK)
			&& do_doitfunc(screen,default_doclick,NULL))
		{
			goto reset_mouse;
		}

		if(altmouset)
			goto reset_mouse;

		if(hitwndo == NULL)
			load_wndo_iostate(NULL);

		goto continue_big_loop;

	reset_mouse:
		find_menu_cursor(&mg);

	continue_big_loop:
		continue;
	}
	if(icb.mcurs_up > 0)
		undisplay_cursor();
error:
	pop_group(&mg);
	load_mouset(&mset);
	if(screen->glevel)
		{
		disable_wrefresh(screen);
		}
	return(mg.retcode);
}
コード例 #3
0
ファイル: options.cpp プロジェクト: geoo89/Lix
void OptionMenu::calc_self()
{
    // Bei geaendertem Spielernamen die neue Userdatei laden.
    // Die alte wird jedoch nicht gespeichert. Dazu muss man erst auf OK
    // klicken und das Optionsmenue erneut aufrufen.
    // Ob der Name zu lang ist, prueft User::get_name().
    if (user_name.get_text() != gloB->user_name) {
        gloB->user_name    = user_name.get_text();
        useR->load();
        useR->option_group = GROUP_GENERAL; // da sind wir ja
        reset_elements();
    }

    /////////////////////////
    // Angeklickte Buttons //
    /////////////////////////

    if (button_okay.get_clicked() || hardware.get_mr()) {
        const int res_fx = atoi(screen_resolution_x.get_text().c_str());
        const int res_fy = atoi(screen_resolution_y.get_text().c_str());
        const int res_wx = atoi(screen_windowed_x.get_text().c_str());
        const int res_wy = atoi(screen_windowed_y.get_text().c_str());
        const bool full  = gloB->screen_fullscreen_now;

        // Only call set_screen_mode() if it's necessary. The main menu
        // flickers for a very short time. A different screen_scaling option
        // should also call the function, because the function sets
        // glob_gfx.h's clear_screen_at_next_blit to true, to clear option
        // menu remainders on the screen borders.
        bool call_ssm = false;
        if (       useR->screen_scaling != screen_scaling.get_number()
                   ||(  full && gloB->screen_resolution_x != res_fx)
                   ||(  full && gloB->screen_resolution_y != res_fy)
                   ||(! full && gloB->screen_windowed_x   != res_wx)
                   ||(! full && gloB->screen_windowed_y   != res_wy)) call_ssm = true;

        bool reload_gralib = (
                                 useR->gui_color_red   != gui_color_red  .get_number()
                                 || useR->gui_color_green != gui_color_green.get_number()
                                 || useR->gui_color_blue  != gui_color_blue .get_number() );

        // Die Werte aller Checkboxen und Buttons in die Optionen schreiben
        // Die Konfigurationsdatei wird gegen eventuelle Abstuerze oder
        // Allegro-Abschuesse schon am Ende dieser Abarbeitung gespeichert.
        gloB->user_name_ask          = user_name_ask.get_checked();
        gloB->replay_auto_single     = replay_auto_single.get_checked();
        gloB->replay_auto_multi      = replay_auto_multi.get_checked();
        gloB->replay_auto_max        = replay_auto_max.get_number();

        if (useR->language != language_nr)
            Language::set(useR->language = language_nr);

        useR->mouse_speed       = mouse_speed       .get_number();
        useR->scroll_speed_edge = scroll_speed_edge .get_number();
        useR->scroll_speed_click= scroll_speed_click.get_number();
        useR->scroll_edge       = scroll_edge       .get_checked();
        useR->scroll_right      = scroll_right      .get_checked();
        useR->scroll_middle     = scroll_middle     .get_checked();
        useR->replay_cancel     = replay_cancel     .get_checked();
        useR->replay_cancel_at  = replay_cancel_at  .get_number();
        useR->allow_builder_queuing   = allow_builder_queuing   .get_checked();
        useR->avoid_builder_queuing   = avoid_builder_queuing   .get_checked();
        useR->avoid_batter_to_exploder= avoid_batter_to_exploder.get_checked();
        useR->prioinv_middle          = prioinv_middle          .get_checked();
        useR->prioinv_right           = prioinv_right           .get_checked();

        useR->key_force_left       = key_force_left      .get_scancode();
        useR->key_force_right      = key_force_right     .get_scancode();
        useR->key_rate_minus       = key_rate_minus      .get_scancode();
        useR->key_rate_plus        = key_rate_plus       .get_scancode();
        useR->key_pause            = key_pause           .get_scancode();
        useR->key_speed_back_one   = key_speed_back_one  .get_scancode();
        useR->key_speed_back_many  = key_speed_back_many .get_scancode();
        useR->key_speed_ahead_one  = key_speed_ahead_one .get_scancode();
        useR->key_speed_ahead_many = key_speed_ahead_many.get_scancode();
        useR->key_speed_fast       = key_speed_fast      .get_scancode();
        useR->key_speed_turbo      = key_speed_turbo     .get_scancode();
        useR->key_restart          = key_restart         .get_scancode();
        useR->key_state_load       = key_state_load      .get_scancode();
        useR->key_state_save       = key_state_save      .get_scancode();
        useR->key_zoom             = key_zoom            .get_scancode();
        useR->key_chat             = key_chat            .get_scancode();
        useR->key_spec_tribe       = key_spec_tribe      .get_scancode();
        useR->key_nuke             = key_nuke            .get_scancode();
        useR->key_ga_exit          = key_ga_exit         .get_scancode();
        useR->key_scroll           = key_scroll          .get_scancode();
        useR->key_priority         = key_priority        .get_scancode();

        for (size_t i = 0; i < useR->skill_sort.size(); ++i) {
            LixEn::Ac ac = img_skill[i].get_skill();
            // set the user's sorting to the skill panel's order here
            useR->skill_sort[i] = ac;
            useR->key_skill[ac] = key_skill[i].get_scancode();
            // There's only the EXPLODER2 hotkey in the options menu, but
            // it shall control both hotkeys. This is a design barnacle,
            // the skills should be treated interally more like they were
            // only one. To the player, they should appear very different.
            if (ac == LixEn::EXPLODER2)
                useR->key_skill[LixEn::EXPLODER] = key_skill[i].get_scancode();
        }

        useR->key_ed_left        = ed_left       .get_scancode();
        useR->key_ed_right       = ed_right      .get_scancode();
        useR->key_ed_up          = ed_up         .get_scancode();
        useR->key_ed_down        = ed_down       .get_scancode();
        useR->key_ed_copy        = ed_copy       .get_scancode();
        useR->key_ed_delete      = ed_delete     .get_scancode();
        useR->key_ed_grid        = ed_grid       .get_scancode();
        useR->key_ed_sel_all     = ed_sel_all    .get_scancode();
        useR->key_ed_sel_frame   = ed_sel_frame  .get_scancode();
        useR->key_ed_sel_add     = ed_sel_add    .get_scancode();
        useR->key_ed_background  = ed_background .get_scancode();
        useR->key_ed_foreground  = ed_foreground .get_scancode();
        useR->key_ed_mirror      = ed_mirror     .get_scancode();
        useR->key_ed_rotate      = ed_rotate     .get_scancode();
        useR->key_ed_dark        = ed_dark       .get_scancode();
        useR->key_ed_noow        = ed_noow       .get_scancode();
        useR->key_ed_zoom        = ed_zoom       .get_scancode();
        useR->key_ed_help        = ed_help       .get_scancode();
        useR->key_ed_menu_size   = ed_menu_size  .get_scancode();
        useR->key_ed_menu_vars   = ed_menu_vars  .get_scancode();
        useR->key_ed_menu_skills = ed_menu_skills.get_scancode();
        useR->key_ed_add_terrain = ed_add_terrain.get_scancode();
        useR->key_ed_add_steel   = ed_add_steel  .get_scancode();
        useR->key_ed_add_hatch   = ed_add_hatch  .get_scancode();
        useR->key_ed_add_goal    = ed_add_goal   .get_scancode();
        useR->key_ed_add_deco    = ed_add_deco   .get_scancode();
        useR->key_ed_add_hazard  = ed_add_hazard .get_scancode();
        useR->key_ed_exit        = ed_exit       .get_scancode();
        useR->editor_grid_custom = ed_grid_custom.get_number();

        useR->key_me_okay           = me_okay              .get_scancode();
        useR->key_me_edit           = me_edit              .get_scancode();
        useR->key_me_export         = me_export            .get_scancode();
        useR->key_me_delete         = me_delete            .get_scancode();
        useR->key_me_up_dir         = me_up_dir            .get_scancode();
        useR->key_me_up_1           = me_up_1              .get_scancode();
        useR->key_me_up_5           = me_up_5              .get_scancode();
        useR->key_me_down_1         = me_down_1            .get_scancode();
        useR->key_me_down_5         = me_down_5            .get_scancode();
        useR->key_me_exit           = me_exit              .get_scancode();
        useR->key_me_main_single    = me_main_single       .get_scancode();
        useR->key_me_main_network   = me_main_network      .get_scancode();
        useR->key_me_main_replay    = me_main_replay       .get_scancode();
        useR->key_me_main_options   = me_main_options      .get_scancode();

        useR->screen_windowed       = screen_windowed      .get_checked();
        useR->screen_scaling        = screen_scaling       .get_number();
        useR->screen_border_colored = screen_border_colored.get_checked();
        useR->arrows_replay         = arrows_replay        .get_checked();
        useR->arrows_network        = arrows_network       .get_checked();
        useR->game_show_tooltips    = game_show_tooltips   .get_checked();
        useR->game_show_skill_keys  = game_show_skill_keys .get_checked();
        useR->debris_amount         = debris_amount        .get_number();
        useR->debris_type           = debris_type          .get_number();
        useR->gui_color_red         = gui_color_red        .get_number();
        useR->gui_color_green       = gui_color_green      .get_number();
        useR->gui_color_blue        = gui_color_blue       .get_number();

        gloB->screen_resolution_x = atoi(screen_resolution_x.get_text().c_str());
        gloB->screen_resolution_y = atoi(screen_resolution_y.get_text().c_str());
        gloB->screen_windowed_x   = atoi(screen_windowed_x  .get_text().c_str());
        gloB->screen_windowed_y   = atoi(screen_windowed_y  .get_text().c_str());
        gloB->screen_vsync        = screen_vsync            .get_checked();

        gloB->sound_load_driver = sound_load_driver.get_checked();
        useR->sound_volume = sound_volume     .get_number();

        // Use new resolution that's already written to globals
        if (call_ssm) set_screen_mode(gloB->screen_fullscreen_now,
                                          gloB->screen_modestr_now);
        if (reload_gralib) {
            make_all_colors();
            GraLib::deinitialize();
            GraLib::initialize(GraLib::LOAD_WITH_RECOLOR_LIX);
            // the mouse cursor must be recerated by the Menu class
        }

        gloB->save();
        useR->save();
        exit = true;
    }
    else if (button_cancel.get_clicked()) {
        exit = true;
    }

    for (size_t i = 0; i < GROUP_MAX; ++i)
        if (button_group[i].get_clicked())
            show_group(static_cast <OptionGroup> (i));

    // Eigentliche Schalter einer ausgewaehlten Optionsgruppe
    switch (useR->option_group) {

    case GROUP_GENERAL:
        if (language.get_clicked()) {
            ++language_nr;

            if (language_nr == Language::MAX) {
                language_nr = Language::ENGLISH;
            } else if (language_nr == Language::CUSTOM) {
                // argument of true means only try to load
                // the custom language's display name
                if (!Language::try_load_custom_language(true)) {
                    // reach here means unable to load custom
                    // language (eg. no data/translate.txt)
                    // go back to English
                    language_nr = Language::ENGLISH;
                }
            }
            language.set_text(Language::language_name[language_nr]);
        }
        break;

    case GROUP_CONTROLS: {
        if (!scroll_edge && !scroll_right && !scroll_middle) {
            if (scroll_edge.get_clicked()) scroll_right.set_checked();
            else                           scroll_edge .set_checked();
        }
        break;
    }

    case GROUP_HOTKEYS:
    case GROUP_GRAPHICS:
    case GROUP_SOUND:
        break;

    default:
        break;
    }
}
コード例 #4
0
ファイル: options.cpp プロジェクト: geoo89/Lix
OptionMenu::OptionMenu()
    :
    Window(0, 0, LEMSCR_X, LEMSCR_Y, Language::option_title),
    exit                  (false),
    hotkey_add_counter    (0),

    // GT is a define macro, see above this function
    button_okay           (LEMSCR_X/2 - 150, 440, button_xl),
    button_cancel         (LEMSCR_X/2 +  10, 440, button_xl),
    pointers              (GROUP_MAX),

    user_name             (other_x, 100, button_xl, Texttype::ALLOW_UNICODE),
    user_name_ask         (check_x, 100),
    language              (other_x, 130, button_xl),
    language_nr           (useR->language),
    replay_auto_single    (check_x, 190),
    replay_auto_multi     (check_x, 220),
    replay_auto_max       (other_x, 190, button_xl, 3, 0, 500),
    desc_user_name        (other_nx, 100, Language::option_user_name),
    desc_user_name_ask    (check_nx, 100, Language::option_user_name_ask),
    desc_language         (other_nx, 130, Language::option_language),
    desc_replay_auto_single(check_nx,190, Language::option_replay_auto_single),
    desc_replay_auto_multi(check_nx, 220, Language::option_replay_auto_multi),
    desc_replay_auto_max  (other_nx, 190, Language::option_replay_auto_max),

    mouse_speed           (other_x, 100, button_xl, 2, 1, 80),
    scroll_speed_edge     (other_x, 130, button_xl, 2, 1, 40),
    scroll_speed_click    (other_x, 160, button_xl, 2, 1, 60),
    scroll_edge           (check_x, 100),
    scroll_right          (check_x, 130),
    scroll_middle         (check_x, 160),
    replay_cancel         (check_x, 190),
    replay_cancel_at      (other_x, 190, button_xl, 2, 0, 90),
    allow_builder_queuing (check_x, 250),
    avoid_builder_queuing (check_x, 280),
    avoid_batter_to_exploder(check_x, 310),
    prioinv_middle        (check_x, 340),
    prioinv_right         (check_x, 370),
    desc_mouse_speed      (other_nx, 100, Language::option_mouse_speed),
    desc_scroll_speed_edge(other_nx, 130, Language::option_scroll_speed_edge),
    desc_scroll_speed_click(other_nx,160, Language::option_scroll_speed_click),
    desc_scroll_edge      (check_nx, 100, Language::option_scroll_edge),
    desc_scroll_right     (check_nx, 130, Language::option_scroll_right),
    desc_scroll_middle    (check_nx, 160, Language::option_scroll_middle),
    desc_replay_cancel    (check_nx, 190, Language::option_replay_cancel),
    desc_replay_cancel_at (other_nx, 190, Language::option_replay_cancel_at),
    desc_allow_builder_queuing   (check_nx, 250, Language::option_allow_builder_queuing),
    desc_avoid_builder_queuing   (check_nx, 280, Language::option_avoid_builder_queuing),
    desc_avoid_batter_to_exploder(check_nx, 310, Language::option_avoid_batter_to_exploder),
    desc_prioinv_middle   (check_nx, 340, Language::option_prioinv_middle),
    desc_prioinv_right    (check_nx, 370, Language::option_prioinv_right),

    // Some of the following buttons will be moved again.
    img_skill(useR->skill_sort.size(), SkillButton(9999, 9999, 40)),
    key_skill(useR->skill_sort.size(), KeyButton  (9999, 9999, 40)),

    key_force_left        (key_b1, 200, key_xl),
    key_force_right       (key_b1, 220, key_xl),

    key_pause             (key_b1, 260, key_xl),

    key_restart           (key_b1, 300, key_xl),
    key_state_load        (key_b1, 320, key_xl),
    key_state_save        (key_b1, 340, key_xl),

    key_rate_minus        (key_b2, 200, key_xl),
    key_rate_plus         (key_b2, 220, key_xl),

    key_speed_back_one    (key_b2, 260, key_xl),
    key_speed_back_many   (key_b2, 280, key_xl),
    key_speed_ahead_one   (key_b2, 300, key_xl),
    key_speed_ahead_many  (key_b2, 320, key_xl),
    key_speed_fast        (key_b2, 340, key_xl),
    key_speed_turbo       (key_b2, 360, key_xl),

    key_nuke              (key_b3, 200, key_xl),
    key_ga_exit           (key_b3, 220, key_xl),
    key_zoom              (key_b3, 260, key_xl),
    key_chat              (key_b3, 280, key_xl),
    key_spec_tribe        (key_b3, 300, key_xl),
    key_scroll            (key_b3, 320, key_xl),
    key_priority          (key_b3, 340, key_xl),

    desc_key_force_left   (key_t1, 200, Language::option_key_force_left),
    desc_key_force_right  (key_t1, 220, Language::option_key_force_right),
    desc_key_pause        (key_t1, 260, Language::option_key_pause),
    desc_key_restart      (key_t1, 300, Language::option_key_restart),
    desc_key_state_load   (key_t1, 320, Language::option_key_state_load),
    desc_key_state_save   (key_t1, 340, Language::option_key_state_save),

    desc_key_rate_minus   (key_t2, 200, Language::option_key_rate_minus),
    desc_key_rate_plus    (key_t2, 220, Language::option_key_rate_plus),
    desc_key_speed_back_one  (key_t2, 260, Language::option_key_speed_back_one),
    desc_key_speed_back_many (key_t2, 280, Language::option_key_speed_back_many),
    desc_key_speed_ahead_one (key_t2, 300, Language::option_key_speed_ahead_one),
    desc_key_speed_ahead_many(key_t2, 320, Language::option_key_speed_ahead_many),
    desc_key_speed_fast   (key_t2, 340, Language::option_key_speed_fast),
    desc_key_speed_turbo  (key_t2, 360, Language::option_key_speed_turbo),

    desc_key_nuke         (key_t3, 200, Language::option_key_nuke),
    desc_key_ga_exit      (key_t3, 220, Language::win_game_title),
    desc_key_zoom         (key_t3, 260, Language::option_key_zoom),
    desc_key_chat         (key_t3, 280, Language::option_key_chat),
    desc_key_spec_tribe   (key_t3, 300, Language::option_key_spec_tribe),
    desc_key_scroll       (key_t3, 320, Language::option_key_scroll),
    desc_key_priority     (key_t3, 340, Language::option_key_priority),

    ed_left               (key_b1, 100, key_xl),
    ed_right              (key_b1, 120, key_xl),
    ed_up                 (key_b1, 140, key_xl),
    ed_down               (key_b1, 160, key_xl),
    ed_copy               (key_b1, 200, key_xl),
    ed_delete             (key_b1, 220, key_xl),
    ed_grid               (key_b1, 240, key_xl),
    ed_sel_all            (key_b2, 100, key_xl),
    ed_sel_frame          (key_b2, 120, key_xl),
    ed_sel_add            (key_b2, 140, key_xl),
    ed_background         (key_b2, 180, key_xl),
    ed_foreground         (key_b2, 200, key_xl),
    ed_mirror             (key_b2, 220, key_xl),
    ed_rotate             (key_b2, 240, key_xl),
    ed_dark               (key_b2, 260, key_xl),
    ed_noow               (key_b2, 280, key_xl),
    ed_zoom               (key_b1, 260, key_xl),
    ed_help               (key_b1, 280, key_xl),
    ed_menu_size          (key_b3, 100, key_xl),
    ed_menu_vars          (key_b3, 120, key_xl),
    ed_menu_skills        (key_b3, 140, key_xl),
    ed_add_terrain        (key_b3, 180, key_xl),
    ed_add_steel          (key_b3, 200, key_xl),
    ed_add_hatch          (key_b3, 220, key_xl),
    ed_add_goal           (key_b3, 240, key_xl),
    ed_add_deco           (key_b3, 260, key_xl),
    ed_add_hazard         (key_b3, 280, key_xl),
    ed_exit               (key_b3, 320, key_xl),
    ed_grid_custom        (key_b1, 320, button_xl, 2, 1, 64),
    desc_ed_left          (key_t1, 100, Language::option_ed_left),
    desc_ed_right         (key_t1, 120, Language::option_ed_right),
    desc_ed_up            (key_t1, 140, Language::option_ed_up),
    desc_ed_down          (key_t1, 160, Language::option_ed_down),
    desc_ed_copy          (key_t1, 200, Language::option_ed_copy),
    desc_ed_delete        (key_t1, 220, Language::option_ed_delete),
    desc_ed_grid          (key_t1, 240, Language::option_ed_grid),
    desc_ed_sel_all       (key_t2, 100, Language::option_ed_sel_all),
    desc_ed_sel_frame     (key_t2, 120, Language::option_ed_sel_frame),
    desc_ed_sel_add       (key_t2, 140, Language::option_ed_sel_add),
    desc_ed_background    (key_t2, 180, Language::option_ed_background),
    desc_ed_foreground    (key_t2, 200, Language::option_ed_foreground),
    desc_ed_mirror        (key_t2, 220, Language::option_ed_mirror),
    desc_ed_rotate        (key_t2, 240, Language::option_ed_rotate),
    desc_ed_dark          (key_t2, 260, Language::option_ed_dark),
    desc_ed_noow          (key_t2, 280, Language::option_ed_noow),
    desc_ed_zoom          (key_t1, 260, Language::option_ed_zoom),
    desc_ed_help          (key_t1, 280, Language::option_ed_help),
    desc_ed_menu_size     (key_t3, 100, Language::option_ed_menu_size),
    desc_ed_menu_vars     (key_t3, 120, Language::option_ed_menu_vars),
    desc_ed_menu_skills   (key_t3, 140, Language::option_ed_menu_skills),
    desc_ed_add_terrain   (key_t3, 180, Language::option_ed_add_terrain),
    desc_ed_add_steel     (key_t3, 200, Language::option_ed_add_steel),
    desc_ed_add_hatch     (key_t3, 220, Language::option_ed_add_hatch),
    desc_ed_add_goal      (key_t3, 240, Language::option_ed_add_goal),
    desc_ed_add_deco      (key_t3, 260, Language::option_ed_add_deco),
    desc_ed_add_hazard    (key_t3, 280, Language::option_ed_add_hazard),
    desc_ed_exit          (key_t3, 320, Language::common_exit),
    desc_ed_grid_custom   (key_b1 + button_xl + 20, 320, Language::option_ed_grid_custom),

    me_okay               (key_b1, 100, key_xl),
    me_edit               (key_b1, 130, key_xl),
    me_export             (key_b1, 160, key_xl),
    me_delete             (key_b1, 190, key_xl),
    me_up_dir             (key_b1, 220, key_xl),
    me_up_1               (key_b1, 250, key_xl),
    me_up_5               (key_b1, 280, key_xl),
    me_down_1             (key_b1, 310, key_xl),
    me_down_5             (key_b1, 340, key_xl),
    me_exit               (key_b1, 370, key_xl),
    me_main_single        (key_b2, 100, key_xl),
    me_main_network       (key_b2, 130, key_xl),
    me_main_replay        (key_b2, 160, key_xl),
    me_main_options       (key_b2, 190, key_xl),
    desc_me_okay          (key_t1, 100, Language::option_key_me_okay),
    desc_me_edit          (key_t1, 130, Language::option_key_me_edit),
    desc_me_export        (key_t1, 160, Language::option_key_me_export),
    desc_me_delete        (key_t1, 190, Language::option_key_me_delete),
    desc_me_up_dir        (key_t1, 220, Language::option_key_me_up_dir),
    desc_me_up_1          (key_t1, 250, Language::option_key_me_up_1),
    desc_me_up_5          (key_t1, 280, Language::option_key_me_up_5),
    desc_me_down_1        (key_t1, 310, Language::option_key_me_down_1),
    desc_me_down_5        (key_t1, 340, Language::option_key_me_down_5),
    desc_me_exit          (key_t1, 370, Language::option_key_me_exit),
    desc_me_main_single   (key_t2, 100, Language::browser_single_title),
    desc_me_main_network  (key_t2, 130, Language::win_lobby_title),
    desc_me_main_replay   (key_t2, 160, Language::browser_replay_title),
    desc_me_main_options  (key_t2, 190, Language::option_title),

    screen_resolution_x   (other_x, 100, button_xl/2, Texttype::ALLOW_ONLY_ASCII),
    screen_resolution_y   (370,     100, button_xl/2, Texttype::ALLOW_ONLY_ASCII),
    screen_windowed_x     (other_x, 130, button_xl/2, Texttype::ALLOW_ONLY_ASCII),
    screen_windowed_y     (370,     130, button_xl/2, Texttype::ALLOW_ONLY_ASCII),
    screen_windowed       (check_x, 130),
    screen_scaling        (other_x, 160, button_xl),
    screen_border_colored (check_x, 160),
    screen_vsync          (check_x, 100),
    arrows_replay         (check_x, 220),
    arrows_network        (check_x, 250),
    game_show_tooltips    (check_x, 280),
    game_show_skill_keys  (check_x, 310),
    debris_amount         (other_x, 220, button_xl),
    debris_type           (other_x, 250, button_xl),
    gui_color_red         (other_x, 280, button_xl),
    gui_color_green       (other_x, 310, button_xl),
    gui_color_blue        (other_x, 340, button_xl),
    desc_screen_resolution(other_nx, 100, Language::option_screen_resolution),
    desc_screen_windowed_res(other_nx, 130, Language::option_screen_windowed_res),
    desc_screen_windowed  (check_nx, 130, Language::option_screen_windowed),
    desc_screen_scaling   (other_nx, 160, Language::option_screen_scaling),
    desc_screen_border_colored(check_nx, 160, Language::option_screen_border_colored),
    desc_screen_vsync     (check_nx, 100, Language::option_screen_vsync),
    desc_arrows_replay    (check_nx, 220, Language::option_arrows_replay),
    desc_arrows_network   (check_nx, 250, Language::option_arrows_network),
    desc_game_show_tooltips(check_nx, 280, Language::option_game_show_tooltips),
    desc_game_show_skill_keys(check_nx, 310, Language::option_game_show_skill_keys),
    desc_debris_amount    (other_nx, 220, Language::option_debris_amount),
    desc_debris_type      (other_nx, 250, Language::option_debris_type),
    desc_gui_color_red    (other_nx, 280, Language::option_gui_color_red),
    desc_gui_color_green  (other_nx, 310, Language::option_gui_color_green),
    desc_gui_color_blue   (other_nx, 340, Language::option_gui_color_blue),

    desc_option_gfx_zero  (20,       380, Language::option_gfx_zero),
    desc_option_gfx_info  (20,       400, Language::option_info),

    sound_load_driver     (check_x, 100),
    sound_volume          (other_x, 100, button_xl, 2, 0, 20),
    desc_sound_load_driver(check_nx, 100, Language::option_sound_load_driver),
    desc_sound_volume     (other_nx, 100, Language::option_sound_volume),
    desc_sound_info       (20,       400, Language::option_info_sound)
{
    // Standardwerte fuer alle Checkboxes und Buttons
    button_okay           .set_text(Language::common_ok);
    button_cancel         .set_text(Language::common_cancel);
    button_okay           .set_hotkey(useR->key_me_okay);
    button_cancel         .set_hotkey(useR->key_me_exit);

    for (size_t i = 0; i < GROUP_MAX; ++i) {
        TextButton temp(i*80 + 40, 40, 80);
        temp.set_text(Language::option_group[i]);
        button_group.push_back(temp);
    }

    replay_auto_max       .set_step_sml( 5);
    replay_auto_max       .set_step_med(50);

    gui_color_red         .set_macro_color();
    gui_color_green       .set_macro_color();
    gui_color_blue        .set_macro_color();

    pointers[GROUP_GENERAL ].push_back(&user_name);
    pointers[GROUP_GENERAL ].push_back(&user_name_ask);
    pointers[GROUP_GENERAL ].push_back(&language);
    pointers[GROUP_GENERAL ].push_back(&replay_auto_single);
    pointers[GROUP_GENERAL ].push_back(&replay_auto_multi);
    pointers[GROUP_GENERAL ].push_back(&replay_auto_max);
    pointers[GROUP_GENERAL ].push_back(&desc_user_name);
    pointers[GROUP_GENERAL ].push_back(&desc_user_name_ask);
    pointers[GROUP_GENERAL ].push_back(&desc_language);
    pointers[GROUP_GENERAL ].push_back(&desc_replay_auto_single);
    pointers[GROUP_GENERAL ].push_back(&desc_replay_auto_multi);
    pointers[GROUP_GENERAL ].push_back(&desc_replay_auto_max);

    pointers[GROUP_CONTROLS].push_back(&scroll_edge);
    pointers[GROUP_CONTROLS].push_back(&scroll_right);
    pointers[GROUP_CONTROLS].push_back(&scroll_middle);
    pointers[GROUP_CONTROLS].push_back(&mouse_speed);
    pointers[GROUP_CONTROLS].push_back(&scroll_speed_edge);
    pointers[GROUP_CONTROLS].push_back(&scroll_speed_click);
    pointers[GROUP_CONTROLS].push_back(&replay_cancel);
    pointers[GROUP_CONTROLS].push_back(&replay_cancel_at);
    pointers[GROUP_CONTROLS].push_back(&allow_builder_queuing);
    pointers[GROUP_CONTROLS].push_back(&avoid_builder_queuing);
    pointers[GROUP_CONTROLS].push_back(&avoid_batter_to_exploder);
    pointers[GROUP_CONTROLS].push_back(&prioinv_middle);
    pointers[GROUP_CONTROLS].push_back(&prioinv_right);
    pointers[GROUP_CONTROLS].push_back(&desc_mouse_speed);
    pointers[GROUP_CONTROLS].push_back(&desc_scroll_speed_edge);
    pointers[GROUP_CONTROLS].push_back(&desc_scroll_speed_click);
    pointers[GROUP_CONTROLS].push_back(&desc_scroll_edge);
    pointers[GROUP_CONTROLS].push_back(&desc_scroll_right);
    pointers[GROUP_CONTROLS].push_back(&desc_scroll_middle);
    pointers[GROUP_CONTROLS].push_back(&desc_replay_cancel);
    pointers[GROUP_CONTROLS].push_back(&desc_replay_cancel_at);
    pointers[GROUP_CONTROLS].push_back(&desc_allow_builder_queuing);
    pointers[GROUP_CONTROLS].push_back(&desc_avoid_builder_queuing);
    pointers[GROUP_CONTROLS].push_back(&desc_avoid_batter_to_exploder);
    pointers[GROUP_CONTROLS].push_back(&desc_prioinv_middle);
    pointers[GROUP_CONTROLS].push_back(&desc_prioinv_right);

    pointers[GROUP_HOTKEYS ].push_back(&key_force_left);
    pointers[GROUP_HOTKEYS ].push_back(&key_force_right);
    pointers[GROUP_HOTKEYS ].push_back(&key_rate_minus);
    pointers[GROUP_HOTKEYS ].push_back(&key_rate_plus);
    pointers[GROUP_HOTKEYS ].push_back(&key_pause);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_back_one);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_back_many);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_ahead_one);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_ahead_many);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_fast);
    pointers[GROUP_HOTKEYS ].push_back(&key_speed_turbo);
    pointers[GROUP_HOTKEYS ].push_back(&key_restart);
    pointers[GROUP_HOTKEYS ].push_back(&key_state_load);
    pointers[GROUP_HOTKEYS ].push_back(&key_state_save);
    pointers[GROUP_HOTKEYS ].push_back(&key_zoom);
    pointers[GROUP_HOTKEYS ].push_back(&key_chat);
    pointers[GROUP_HOTKEYS ].push_back(&key_spec_tribe);
    pointers[GROUP_HOTKEYS ].push_back(&key_nuke);
    pointers[GROUP_HOTKEYS ].push_back(&key_ga_exit);
    pointers[GROUP_HOTKEYS ].push_back(&key_scroll);
    pointers[GROUP_HOTKEYS ].push_back(&key_priority);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_force_left);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_force_right);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_rate_minus);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_rate_plus);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_pause);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_back_one);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_back_many);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_ahead_one);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_ahead_many);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_fast);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_speed_turbo);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_restart);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_state_load);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_state_save);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_zoom);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_chat);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_spec_tribe);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_nuke);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_ga_exit);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_scroll);
    pointers[GROUP_HOTKEYS ].push_back(&desc_key_priority);

    // here, we rely on useR->skill_sort to have exactly one of each
    // displayable and keybinable skill
    for (size_t i = 0; i < useR->skill_sort.size(); ++i) {
        img_skill[i].set_x(40 + 40*i);
        img_skill[i].set_y(100);
        img_skill[i].set_skill(useR->skill_sort[i]);
        img_skill[i].set_number(LixEn::infinity);

        // Kludge, this disables displaying it down.
        // There should be a differently-worded method for it.
        img_skill[i].set_hot();

        key_skill[i].set_x(img_skill[i].get_x());
        key_skill[i].set_y(img_skill[i].get_y() + img_skill[i].get_yl());

        pointers[GROUP_HOTKEYS].push_back(&img_skill[i]);
        pointers[GROUP_HOTKEYS].push_back(&key_skill[i]);
    }

    pointers[GROUP_EDITOR  ].push_back(&ed_left);
    pointers[GROUP_EDITOR  ].push_back(&ed_right);
    pointers[GROUP_EDITOR  ].push_back(&ed_up);
    pointers[GROUP_EDITOR  ].push_back(&ed_down);
    pointers[GROUP_EDITOR  ].push_back(&ed_copy);
    pointers[GROUP_EDITOR  ].push_back(&ed_delete);
    pointers[GROUP_EDITOR  ].push_back(&ed_grid);
    pointers[GROUP_EDITOR  ].push_back(&ed_sel_all);
    pointers[GROUP_EDITOR  ].push_back(&ed_sel_frame);
    pointers[GROUP_EDITOR  ].push_back(&ed_sel_add);
    pointers[GROUP_EDITOR  ].push_back(&ed_foreground);
    pointers[GROUP_EDITOR  ].push_back(&ed_background);
    pointers[GROUP_EDITOR  ].push_back(&ed_mirror);
    pointers[GROUP_EDITOR  ].push_back(&ed_rotate);
    pointers[GROUP_EDITOR  ].push_back(&ed_dark);
    pointers[GROUP_EDITOR  ].push_back(&ed_noow);
    pointers[GROUP_EDITOR  ].push_back(&ed_zoom);
    pointers[GROUP_EDITOR  ].push_back(&ed_help);
    pointers[GROUP_EDITOR  ].push_back(&ed_menu_size);
    pointers[GROUP_EDITOR  ].push_back(&ed_menu_vars);
    pointers[GROUP_EDITOR  ].push_back(&ed_menu_skills);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_terrain);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_steel);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_hatch);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_goal);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_deco);
    pointers[GROUP_EDITOR  ].push_back(&ed_add_hazard);
    pointers[GROUP_EDITOR  ].push_back(&ed_exit);
    pointers[GROUP_EDITOR  ].push_back(&ed_grid_custom);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_left);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_right);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_up);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_down);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_copy);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_delete);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_grid);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_sel_all);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_sel_frame);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_sel_add);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_foreground);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_background);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_mirror);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_rotate);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_dark);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_noow);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_zoom);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_help);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_menu_size);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_menu_vars);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_menu_skills);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_terrain);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_steel);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_hatch);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_goal);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_deco);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_add_hazard);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_exit);
    pointers[GROUP_EDITOR  ].push_back(&desc_ed_grid_custom);

    pointers[GROUP_MENU    ].push_back(&me_okay);
    pointers[GROUP_MENU    ].push_back(&me_edit);
    pointers[GROUP_MENU    ].push_back(&me_export);
    pointers[GROUP_MENU    ].push_back(&me_delete);
    pointers[GROUP_MENU    ].push_back(&me_up_dir);
    pointers[GROUP_MENU    ].push_back(&me_up_1);
    pointers[GROUP_MENU    ].push_back(&me_up_5);
    pointers[GROUP_MENU    ].push_back(&me_down_1);
    pointers[GROUP_MENU    ].push_back(&me_down_5);
    pointers[GROUP_MENU    ].push_back(&me_exit);
    pointers[GROUP_MENU    ].push_back(&me_main_single);
    pointers[GROUP_MENU    ].push_back(&me_main_network);
    pointers[GROUP_MENU    ].push_back(&me_main_replay);
    pointers[GROUP_MENU    ].push_back(&me_main_options);
    pointers[GROUP_MENU    ].push_back(&desc_me_okay);
    pointers[GROUP_MENU    ].push_back(&desc_me_edit);
    pointers[GROUP_MENU    ].push_back(&desc_me_export);
    pointers[GROUP_MENU    ].push_back(&desc_me_delete);
    pointers[GROUP_MENU    ].push_back(&desc_me_up_dir);
    pointers[GROUP_MENU    ].push_back(&desc_me_up_1);
    pointers[GROUP_MENU    ].push_back(&desc_me_up_5);
    pointers[GROUP_MENU    ].push_back(&desc_me_down_1);
    pointers[GROUP_MENU    ].push_back(&desc_me_down_5);
    pointers[GROUP_MENU    ].push_back(&desc_me_exit);
    pointers[GROUP_MENU    ].push_back(&desc_me_main_single);
    pointers[GROUP_MENU    ].push_back(&desc_me_main_network);
    pointers[GROUP_MENU    ].push_back(&desc_me_main_replay);
    pointers[GROUP_MENU    ].push_back(&desc_me_main_options);

    screen_scaling          .add_text (Language::option_screen_scaling_stretch);
    screen_scaling          .add_text (Language::option_screen_scaling_aspect);
    screen_scaling          .add_text (Language::option_screen_scaling_integer);
    debris_amount           .add_text (Language::option_debris_amount_none);
    debris_amount           .add_text (Language::option_debris_amount_own);
    debris_amount           .add_text (Language::option_debris_amount_all);
    debris_type             .add_text (Language::option_debris_type_stars);
    debris_type             .add_text (Language::option_debris_type_pixels);
    pointers[GROUP_GRAPHICS].push_back(&screen_resolution_x);
    pointers[GROUP_GRAPHICS].push_back(&screen_resolution_y);
    pointers[GROUP_GRAPHICS].push_back(&screen_windowed_x);
    pointers[GROUP_GRAPHICS].push_back(&screen_windowed_y);
    pointers[GROUP_GRAPHICS].push_back(&screen_windowed);
    pointers[GROUP_GRAPHICS].push_back(&screen_scaling);
    pointers[GROUP_GRAPHICS].push_back(&screen_border_colored);
    pointers[GROUP_GRAPHICS].push_back(&screen_vsync);
    pointers[GROUP_GRAPHICS].push_back(&arrows_replay);
    pointers[GROUP_GRAPHICS].push_back(&arrows_network);
    pointers[GROUP_GRAPHICS].push_back(&game_show_tooltips);
    pointers[GROUP_GRAPHICS].push_back(&game_show_skill_keys);
    pointers[GROUP_GRAPHICS].push_back(&debris_amount);
    pointers[GROUP_GRAPHICS].push_back(&debris_type);
    pointers[GROUP_GRAPHICS].push_back(&gui_color_red);
    pointers[GROUP_GRAPHICS].push_back(&gui_color_green);
    pointers[GROUP_GRAPHICS].push_back(&gui_color_blue);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_resolution);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_windowed_res);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_windowed);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_scaling);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_border_colored);
    pointers[GROUP_GRAPHICS].push_back(&desc_screen_vsync);
    pointers[GROUP_GRAPHICS].push_back(&desc_arrows_replay);
    pointers[GROUP_GRAPHICS].push_back(&desc_arrows_network);
    pointers[GROUP_GRAPHICS].push_back(&desc_game_show_tooltips);
    pointers[GROUP_GRAPHICS].push_back(&desc_game_show_skill_keys);
    pointers[GROUP_GRAPHICS].push_back(&desc_debris_amount);
    pointers[GROUP_GRAPHICS].push_back(&desc_debris_type);
    pointers[GROUP_GRAPHICS].push_back(&desc_gui_color_red);
    pointers[GROUP_GRAPHICS].push_back(&desc_gui_color_green);
    pointers[GROUP_GRAPHICS].push_back(&desc_gui_color_blue);
    pointers[GROUP_GRAPHICS].push_back(&desc_option_gfx_zero);
    pointers[GROUP_GRAPHICS].push_back(&desc_option_gfx_info);

    pointers[GROUP_SOUND]   .push_back(&sound_load_driver);
    pointers[GROUP_SOUND]   .push_back(&sound_volume);
    pointers[GROUP_SOUND]   .push_back(&desc_sound_load_driver);
    pointers[GROUP_SOUND]   .push_back(&desc_sound_volume);
    pointers[GROUP_SOUND]   .push_back(&desc_sound_info);

    // Add everything as children
    for (size_t i = 0; i < GROUP_MAX; ++i) {
        add_child(button_group[i]);
        for (std::vector <Element*> ::iterator itr = pointers[i].begin();
                itr != pointers[i].end(); ++itr) {
            (**itr).set_undraw_color(color[COL_API_M]);
            add_child(**itr);
        }
    }
    add_child(button_okay);
    add_child(button_cancel);

    reset_elements();
    show_group(static_cast <OptionGroup> (useR->option_group));

    Manager::add_elder(this);
}