/**************************************************************** ... *****************************************************************/ static void select_random_race(void) { /* try to find a free nation */ /* FIXME: this code should be done another way. -ev */ while (1) { unsigned int race_toggle_index = fc_rand(nation_count()); if (!is_nation_playable(nation_by_number(race_toggle_index)) || !nation_by_number(race_toggle_index)->is_available || nation_by_number(race_toggle_index)->player) { continue; } if (XtIsSensitive(races_toggles[race_toggle_index])) { x_simulate_button_click(races_toggles[race_toggle_index]); break; } } }
/**************************************************************** ... *****************************************************************/ void connectdlg_key_connect(Widget w) { x_simulate_button_click(connectdlg_connect_button); }
/**************************************************************** ... *****************************************************************/ void racesdlg_key_ok(Widget w) { Widget ok = XtNameToWidget(XtParent(XtParent(w)), "*racesokcommand"); if (ok) x_simulate_button_click(ok); }
/**************************************************************** ... *****************************************************************/ void inputdlg_key_ok(Widget w) { x_simulate_button_click(XtNameToWidget(XtParent(w), "iokcommand")); }