void show_ending_popup(int ending, int nextlevel) { if (ending == 1) // 1 = lose, for some reason { if (nextlevel == -1) // generic defeat { popup_dialog("Defeat!", "YOUR MEN ARE CRUSHED!"); } else // we're withdrawing to another level { char buf[255]; snprintf(buf, 255, "Retreating to Level %d\n(You may take this field later)", nextlevel); popup_dialog("Retreat!", buf); } } else if (ending == SCEN_TYPE_SAVE_ALL) // failed to save a guy { popup_dialog("Defeat!", "YOU ARE DEFEATED!\nYOU FAILED TO KEEP YOUR ALLY ALIVE"); } else if (ending == 0) // we won { if (myscreen->save_data.is_level_completed(myscreen->save_data.scen_num)) // this scenario is completed .. { char buf[255]; snprintf(buf, 255, "Moving on to Level %d", nextlevel); popup_dialog("Traveling on...", buf); } else { popup_dialog("Victory!", "You have won the battle!"); } } }
int display_options() { if (display_mode & WINDOWED_MODE_SET) display_mode |= WINDOWED_MODE; else display_mode &= ~WINDOWED_MODE; centre_dialog(options_dialog); return popup_dialog(options_dialog, -1); }
int edit_enemy_path(void) { char temp_type[10]=""; char temp_num[10]=""; int ans; DIALOG mission_dialog[] = { /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) */ { d_shadow_box_proc, 250, 150, 300, 110, FG_COLOR, BG_COLOR, 0, 0, 0, 0, NULL}, { d_button_proc, 310, 235, 53, 20, FG_COLOR, BG_COLOR, '\r', D_EXIT, 0, 0, "OK"}, { d_button_proc, 370, 235, 53, 20, FG_COLOR, BG_COLOR, 27, D_EXIT, 0, 0, "Cancel" }, { d_button_proc, 430, 235, 53, 20, FG_COLOR, BG_COLOR, 27, D_EXIT, 0, 0, "Edit" }, { d_text_proc, 255, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Number:"}, { d_text_proc, 315, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, temp_num}, { d_text_proc, 255, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Type:"}, { d_edit_proc, 320, 170, 33, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_type}, { d_text_proc, 255, 180, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "0=don't walk 1=turn at end"}, { d_text_proc, 255, 190, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "2=stop at end 3=end to first"}, { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL} }; sprintf(temp_num,"%d",enemy_path_chosen); sprintf(temp_type,"%d",enemy_data[current_enemy].movement_path[enemy_path_chosen].type); ans = popup_dialog(mission_dialog,-1); if(ans==1 || ans==3) { enemy_data[current_enemy].movement_path[enemy_path_chosen].type = atoi(temp_type); if(ans==3) { editmode_enemy_path(); return D_EXIT; } } return D_O_K; }
int clear_codes_proc(int msg, DIALOG *d, int c) { int ret; switch (msg) { case MSG_READ_CODES: case MSG_CLEAR_CODES: // if we are currently reading or clearing codes, and the button is enabled, if (!(d->flags & D_DISABLED)) { d->flags |= D_DISABLED; // disable the button return D_REDRAWME; } break; case MSG_READY: // if we're not reading or clearing codes, and the button is disabled, if (d->flags & D_DISABLED) { d->flags &= ~D_DISABLED; // enable it return D_REDRAWME; } break; } ret = d_button_proc(msg, d, c); if (ret == D_CLOSE) { while (!simulate && comport.status != READY) { if (alert("Port is not ready.", "Please check that you specified the correct port", "and that no other application is using it", "Configure &Port", "&Cancel", 'p', 'c') == 1) display_options(); // let the user choose correct settings else return D_REDRAWME; } // if user confirmed that he wants to erase the codes, if(popup_dialog(confirm_clear_dialog, 6) == 5) { if (simulate) trouble_codes_simulator(FALSE); else broadcast_dialog_message(MSG_CLEAR_CODES, 0); //send everyone MSG_CLEAR_CODES } return D_REDRAWME; } return ret; }
int UxPopupInterface(Widget wgt, XtGrabKind grab_flag) #endif { if (!(wgt = GetTrueToplevel(wgt))) return (UX_ERROR); if (XtIsSubclass(wgt, xmDialogShellWidgetClass)) { popup_dialog(wgt, grab_flag); } else { XtPopup(wgt, grab_flag); } return (UX_NO_ERROR); }
int edit_enemy_path_data(void) { char temp_path[10]=""; char temp_num[10]=""; int ans; DIALOG mission_dialog[] = { /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) */ { d_shadow_box_proc, 250, 150, 300, 110, FG_COLOR, BG_COLOR, 0, 0, 0, 0, NULL}, { d_button_proc, 310, 235, 53, 20, FG_COLOR, BG_COLOR, '\r', D_EXIT, 0, 0, "OK"}, { d_button_proc, 370, 235, 53, 20, FG_COLOR, BG_COLOR, 27, D_EXIT, 0, 0, "Cancel" }, { d_enemy_path_list_proc, 370, 160, 160, 50, FG_COLOR, BG_COLOR, 0, D_EXIT, 0, 0, enemy_path_list}, { d_text_proc, 255, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Number:"}, { d_text_proc, 315, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, temp_num}, { d_text_proc, 255, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Path:"}, { d_edit_proc, 320, 170, 33, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_path}, { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL} }; sprintf(temp_num,"%d",current_enemy); sprintf(temp_path,"%d",enemy_data[current_enemy].current_movement_path); ans = popup_dialog(mission_dialog,-1); if(ans==1) { enemy_data[current_enemy].current_movement_path= atoi(temp_path); } return D_O_K; }
void newGame() { static int configured = 0; if(!configured) { centre_dialog(dlg); configured = 1; } if(current_view != left_view) update(); if(popup_dialog(dlg, -1) != CANCEL) switch(BOARD_SELECTED) { case 0: shuffle(); break; case 1: loadLayoutFromFile(); break; default: loadLayout(BOARD_SELECTED - 2); } }
PRIVATE void props(Component *c, Generator *g) { Data *data = g->data; GtkWidget *min, *max, *step, *page; GtkWidget *vbox; vbox = gtk_vbox_new(FALSE, 2); min = build_entry(vbox, "Range Minimum:", data->min); max = build_entry(vbox, "Range Maximum:", data->max); step = build_entry(vbox, "Step Increment:", data->step); page = build_entry(vbox, "Page Increment:", data->page); if (popup_dialog(g->name, MSGBOX_OK | MSGBOX_CANCEL, 0, MSGBOX_OK, vbox, NULL, 0) == MSGBOX_OK) { data->min = atof(gtk_entry_get_text(GTK_ENTRY(min))); data->max = atof(gtk_entry_get_text(GTK_ENTRY(max))); data->step = atof(gtk_entry_get_text(GTK_ENTRY(step))); data->page = atof(gtk_entry_get_text(GTK_ENTRY(page))); g_list_foreach(g->controls, (GFunc) ctrl_setrange, NULL); g_list_foreach(g->controls, (GFunc) control_update_range, NULL); } }
PRIVATE void propgen(Component *c, Generator *g) { Data *data = g->data; GtkWidget *vb = gtk_vbox_new(FALSE, 5); GtkWidget *hb = gtk_hbox_new(TRUE, 5); GtkWidget *frame = gtk_frame_new("Sample File"); GtkWidget *label = gtk_label_new(data->filename ? data->filename : "<none>"); GtkWidget *reload_button = gtk_button_new_with_label("Reload"); GtkWidget *choose_button = gtk_button_new_with_label("Choose File..."); GtkWidget *save_toggle = gtk_check_button_new_with_label("Save sample with output"); gtk_container_add(GTK_CONTAINER(frame), vb); gtk_widget_show(vb); gtk_box_pack_start(GTK_BOX(vb), label, TRUE, TRUE, 0); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(vb), hb, TRUE, TRUE, 0); gtk_widget_show(hb); gtk_box_pack_start(GTK_BOX(vb), save_toggle, TRUE, TRUE, 0); gtk_widget_show(save_toggle); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(save_toggle), data->store_sample); gtk_box_pack_start(GTK_BOX(hb), reload_button, TRUE, TRUE, 0); gtk_widget_show(reload_button); gtk_box_pack_start(GTK_BOX(hb), choose_button, TRUE, TRUE, 0); gtk_widget_show(choose_button); gtk_signal_connect(GTK_OBJECT(reload_button), "clicked", GTK_SIGNAL_FUNC(reload_clicked), g); gtk_signal_connect(GTK_OBJECT(choose_button), "clicked", GTK_SIGNAL_FUNC(choose_clicked), g); gtk_object_set_data(GTK_OBJECT(choose_button), "FilenameLabel", label); popup_dialog("Properties", MSGBOX_DISMISS, 0, MSGBOX_DISMISS, frame, NULL, 0); data->store_sample = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(save_toggle)); }
static int save_proc(void) { char filename[1024]; char buffer[256], *p; BITMAP *bmp = NULL; int quality = 0, flags = 0; if (file_select_ex("Save as JPG", last_path, "jpg", 1024, (SCREEN_W * 2) / 3, (SCREEN_H * 2) / 3)) { strcpy(filename, last_path); for (p = last_path + strlen(last_path); (p >= last_path) && (*p != '/') && (*p != '\\'); p--) ; *(p + 1) = '\0'; set_dialog_color(settings_dialog, gui_fg_color, gui_bg_color); centre_dialog(settings_dialog); if (popup_dialog(settings_dialog, -1) < 0) return 0; quality = settings_dialog[QUALITY_SLIDER].d2 + 1; if (settings_dialog[SS_444_RADIO].flags & D_SELECTED) flags = JPG_SAMPLING_444; if (settings_dialog[SS_422_RADIO].flags & D_SELECTED) flags = JPG_SAMPLING_422; if (settings_dialog[SS_411_RADIO].flags & D_SELECTED) flags = JPG_SAMPLING_411; if (settings_dialog[GREYSCALE_CHECK].flags & D_SELECTED) flags |= JPG_GREYSCALE; if (settings_dialog[OPTIMIZE_CHECK].flags & D_SELECTED) flags |= JPG_OPTIMIZE; bmp = settings_dialog[PREVIEW].dp; if (save_jpg_ex(filename, bmp, NULL, quality, flags, progress_cb)) { sprintf(buffer, "Error saving JPG image (error code %d)", jpgalleg_error); alert("", buffer, "", "Ok", NULL, 0, 0); } } return 0; }
void GUITextEntryDialog::Show() { popup_dialog(internalDialog_, 4); }
void reset_chip() { centre_dialog(reset_chip_dialog); popup_dialog(reset_chip_dialog, -1); }
void ConnectDialog::_advanced_pressed() { popup_dialog(from_signal->get_text(), advanced->is_pressed()); }
/** * Shows unit-stats edit-dialog and allows to edit unit stats, * change name, and armour (=skin) */ void Editor::edit_soldier() { MouseRange temp_mouse_range(0, 0, SCREEN_W - 1, SCREEN_H - 1); DIALOG sol_dialog[] = { //(dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) { d_agup_shadow_box_proc, DX, DY, D_WIDTH, D_HEIGHT, FG, BG, 0, 0, 0, 0, NULL, NULL, NULL}, { d_agup_button_proc, DX + 130, DY + SSY + SH*13 + 4, 100, 20, FG, BG, 0, D_EXIT, 0, 0, (void *)_("OK"), NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + SSY - SH*1, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Name:"), NULL, NULL}, { d_agup_edit_proc, DX + SSX, DY + SSY - SH*1 - 4, 23*8, 16, FG, BG, 0, 0, MAN_NAME_LEN, 0, NULL, NULL, NULL}, { d_agup_text_proc, DX + 100, DY + SSY + SH*12 + 2, 100, 16, FG, BG, 0, 0, 0, 0, (void *)points_str, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + SSY + SH*0 + 1, STW, 16 + 4, FG, BG, 0, 0, 0, 0, (void *)_("Race:"), NULL, NULL}, { race_change_button_proc,DX + SSX, DY + SSY + SH*0 - 6, 0, 16 + 4, FG, BG, 0, D_EXIT, 0, 0, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + SSY + SH*1 + 1, STW, 16 + 4, FG, BG, 0, 0, 0, 0, (void *)_("Armour:"), NULL, NULL}, { armour_change_button_proc,DX + SSX, DY + SSY + SH*1 - 6, 0, 16 + 4, FG, BG, 0, D_EXIT, 0, 0, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + SSY + SH*2 + 1, STW, 16 + 4, FG, BG, 0, 0, 0, 0, (void *)_("Appearance:"), NULL, NULL}, { appearance_change_button_proc,DX + SSX, DY + SSY + SH*2 - 6, 0, 16 + 4, FG, BG, 0, D_EXIT, 0, 0, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*3, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Time Units"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*3, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*4, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Stamina"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*4, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*5, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Health"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*5, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*6, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Bravery"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*6, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*7, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Reactions"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*7, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*8, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Firing"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*8, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*9, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Throwing"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*9, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_rtext_proc, DX + STX, DY + STY + SH*10, STW, 16, FG, BG, 0, 0, 0, 0, (void *)_("Strength"), NULL, NULL}, { d_agup_slider_pro2, DX + SSX, DY + SSY + SH*10, SSW, 16, FG, BG, 0, 0, 100, 33, NULL, NULL, NULL}, { d_agup_ctext_proc, DX, DY + SH/2, D_WIDTH, 16, FG, BG, 0, 0, 0, 0, (void *)_("Edit soldier attributes"), NULL, NULL}, { d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL}, { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL} }; ::sol_dialog = sol_dialog; sol_dialog[D_BRAVERY].flags |= D_DISABLED; sol_dialog[D_NAME].dp = man->md.Name; sol_dialog[D_TIME].d2 = man->md.TimeUnits; sol_dialog[D_HEALTH].d2 = man->md.Health; sol_dialog[D_STAMINA].d2 = man->md.Stamina; sol_dialog[D_REACTION].d2 = man->md.Reactions; sol_dialog[D_STRENGTH].d2 = man->md.Strength; sol_dialog[D_FIRE_ACCUR].d2 = man->md.Firing; sol_dialog[D_THRU_ACCUR].d2 = man->md.Throwing; sol_dialog[D_BRAVERY].d2 = man->md.Bravery; points = sol_dialog[D_TIME].d2 + sol_dialog[D_HEALTH].d2 + sol_dialog[D_FIRE_ACCUR].d2 + sol_dialog[D_THRU_ACCUR].d2 + sol_dialog[D_STAMINA].d2 + (sol_dialog[D_STRENGTH].d2 * 2) + sol_dialog[D_REACTION].d2; sprintf(points_str, _("Points remain: %2d "), MAXPOINTS - points); sol_dialog[D_POINTS].fg = gui_fg_color; sol_dialog[D_POINTS].bg = gui_bg_color; while (mouse_b & 3) rest(1); if (man->md.SkinType == S_XCOM_0 || man->md.SkinType == S_XCOM_1 || man->md.SkinType == S_XCOM_2 || man->md.SkinType == S_XCOM_3) { appearance_names = appearance_names_human; armour_names = armour_names_human; if (man->md.Appearance >= 4) man->md.Appearance = 0; sol_dialog[D_RACE].d1 = 0; } else { appearance_names = appearance_names_alien; armour_names = armour_names_alien; if (man->md.SkinType == S_SECTOID) sol_dialog[D_RACE].d1 = 1; else if (man->md.SkinType == S_MUTON) sol_dialog[D_RACE].d1 = 2; else if (man->md.SkinType == S_SNAKEMAN) sol_dialog[D_RACE].d1 = 3; else if (man->md.SkinType == S_ETHEREAL) sol_dialog[D_RACE].d1 = 4; else if (man->md.SkinType == S_FLOATER) sol_dialog[D_RACE].d1 = 5; else if (man->md.SkinType == S_CHRYS) sol_dialog[D_RACE].d1 = 6; else sol_dialog[D_RACE].d1 = 7; man->md.fFemale = 0; if (man->md.SkinType != S_CHAMELEON) man->md.Appearance = 0; } switch (man->md.SkinType) { case S_XCOM_0 : sol_dialog[D_ARMOUR].d1 = 0; break; case S_XCOM_1 : sol_dialog[D_ARMOUR].d1 = 1; break; case S_XCOM_2 : sol_dialog[D_ARMOUR].d1 = 2; break; case S_XCOM_3 : sol_dialog[D_ARMOUR].d1 = 3; break; case S_SECTOID: sol_dialog[D_ARMOUR].d1 = 0; break; case S_SNAKEMAN: sol_dialog[D_ARMOUR].d1 = 0; break; //LAWYER: Snakeman case S_ETHEREAL: sol_dialog[D_ARMOUR].d1 = 0; break; //LAWYER: Ethereal case S_FLOATER: sol_dialog[D_ARMOUR].d1 = 0; break; //LAWYER: Floater case S_CHRYS: sol_dialog[D_ARMOUR].d1 = 0; break; //Kratos: Chryssalid default: sol_dialog[D_ARMOUR].d1 = 0; break; } sol_dialog[D_APPEARANCE].d1 = man->md.Appearance + (man->md.fFemale ? 4 : 0); fixup_unit_info(); set_dialog_color(sol_dialog, gui_fg_color, gui_bg_color); centre_dialog(sol_dialog); popup_dialog(sol_dialog, -1); switch (sol_dialog[D_RACE].d1) { case 0: man->md.fFemale = sol_dialog[D_APPEARANCE].d1 >= 4; man->md.Appearance = sol_dialog[D_APPEARANCE].d1 % 4; man->md.SkinType = sol_dialog[D_ARMOUR].d1 + 1; break; case 1: man->md.fFemale = 0; man->md.SkinType = S_SECTOID; break; case 2: man->md.fFemale = 0; man->md.SkinType = S_MUTON; break; case 3: man->md.fFemale = 0; man->md.SkinType = S_SNAKEMAN; //LAWYER: Snakeman!! break; case 4: man->md.fFemale = 0; man->md.SkinType = S_ETHEREAL; //LAWYER: Ethereal!! break; case 5: man->md.fFemale = 0; man->md.SkinType = S_FLOATER; //LAWYER: Floater!! break; case 6: man->md.fFemale = 0; man->md.SkinType = S_CHRYS; //Kratos: Chryssalid break; default: man->md.fFemale = 0; // Here too, even though it looks inconsistent man->md.SkinType = S_CHAMELEON; man->md.Appearance = sol_dialog[D_APPEARANCE].d1; break; } man->md.TimeUnits = sol_dialog[D_TIME].d2; man->md.Health = sol_dialog[D_HEALTH].d2; man->md.Stamina = sol_dialog[D_STAMINA].d2; man->md.Reactions = sol_dialog[D_REACTION].d2; man->md.Strength = sol_dialog[D_STRENGTH].d2; man->md.Firing = sol_dialog[D_FIRE_ACCUR].d2; man->md.Throwing = sol_dialog[D_THRU_ACCUR].d2; man->md.Bravery = sol_dialog[D_BRAVERY].d2; man->process_MANDATA(); ::sol_dialog = NULL; }
int edit_enemy(void) { char temp_angle[10]=""; char temp_energy[10]=""; char temp_active[10]=""; char temp_name[40]=""; char temp_action[10]=""; char temp_disappear[10]=""; char temp_num[10]=""; int ans; DIALOG mission_dialog[] = { /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) */ { d_shadow_box_proc, 250, 150, 300, 110, FG_COLOR, BG_COLOR, 0, 0, 0, 0, NULL}, { d_button_proc, 310, 235, 53, 20, FG_COLOR, BG_COLOR, '\r', D_EXIT, 0, 0, "OK"}, { d_button_proc, 370, 235, 53, 20, FG_COLOR, BG_COLOR, 27, D_EXIT, 0, 0, "Cancel" }, { d_mission_list_proc, 420, 160, 125, 20, FG_COLOR, BG_COLOR, 0, D_EXIT, 0, 0, mission_list}, { d_text_proc, 255, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Number:"}, { d_text_proc, 315, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, temp_num}, { d_text_proc, 255, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "active:"}, { d_edit_proc, 315, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_active}, { d_text_proc, 255, 180, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "name:"}, { d_edit_proc, 315, 180, 93, 20, FG_COLOR, BG_COLOR, 0, 0, 39, 0, temp_name}, { d_text_proc, 255, 190, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "action:"}, { d_edit_proc, 315, 190, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_action}, { d_text_proc, 255, 200, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "energy:"}, { d_edit_proc, 315, 200, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_energy}, { d_text_proc, 255, 210, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "angle:"}, { d_edit_proc, 315, 210, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_angle}, { d_text_proc, 255, 220, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "disappear:"}, { d_edit_proc, 335, 220, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_disappear}, { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL} }; sprintf(temp_num,"%d",current_enemy); sprintf(temp_active,"%d",enemy_data[current_enemy].active); sprintf(temp_angle,"%d",(int)enemy_data[current_enemy].angle); sprintf(temp_energy,"%d",(int)enemy_data[current_enemy].energy); sprintf(temp_action,"%d",enemy_data[current_enemy].action); sprintf(temp_disappear,"%d",enemy_data[current_enemy].disappear); sprintf(temp_name,"%s",enemy_data[current_enemy].name); mission_dialog[3].d1=enemy_data[current_enemy].current_mission; ans = popup_dialog(mission_dialog,-1); if(ans==1) { strcpy(enemy_data[current_enemy].name, temp_name); enemy_data[current_enemy].active = atoi(temp_active); enemy_data[current_enemy].angle = (float)atoi(temp_angle); enemy_data[current_enemy].energy = (float)atoi(temp_energy); enemy_data[current_enemy].action = atoi(temp_action); enemy_data[current_enemy].disappear = atoi(temp_disappear); enemy_data[current_enemy].current_mission=mission_dialog[3].d1; } return D_O_K; }
int edit_soundemitor(void) { int i; char temp_loop[10]=""; char temp_e_type[10]=""; char temp_s_type[10]=""; char temp_active[10]=""; char temp_num[10]=""; int ans; DIALOG mission_dialog[] = { /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) */ { d_shadow_box_proc, 250, 150, 300, 100, FG_COLOR, BG_COLOR, 0, 0, 0, 0, NULL}, { d_button_proc, 310, 225, 53, 20, FG_COLOR, BG_COLOR, '\r', D_EXIT, 0, 0, "OK"}, { d_button_proc, 370, 225, 53, 20, FG_COLOR, BG_COLOR, 27, D_EXIT, 0, 0, "Cancel" }, { d_soundbutton_proc,430, 225, 53, 20, FG_COLOR, BG_COLOR, 't', D_EXIT, 0, 0, "Test" }, { d_emitsound_list_proc, 370, 160, 160, 50, FG_COLOR, BG_COLOR, 0, 0, 0, 0, emitsound_list}, { d_text_proc, 255, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "Number:"}, { d_text_proc, 315, 160, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, temp_num}, { d_text_proc, 255, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "active:"}, { d_edit_proc, 315, 170, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_active}, { d_text_proc, 255, 180, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "e_type:"}, { d_edit_proc, 315, 180, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_e_type}, { d_text_proc, 255, 190, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "s_type:"}, { d_edit_proc, 315, 190, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_s_type}, { d_text_proc, 255, 200, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 0, 0, "loop:"}, { d_edit_proc, 315, 200, 53, 20, FG_COLOR, BG_COLOR, 0, 0, 5, 0, temp_loop}, { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL} }; sprintf(temp_num,"%d",current_soundemitor); for(i=0;i<num_of_sounds;i++) { if(strcmp(sound_info[i].name, map->soundemitor[current_soundemitor].sound_name)==0){ mission_dialog[4].d1=i; break;} else mission_dialog[4].d1=0; } sprintf(temp_active,"%d",map->soundemitor[current_soundemitor].active); sprintf(temp_e_type,"%d",map->soundemitor[current_soundemitor].emitor_type); sprintf(temp_s_type,"%d",map->soundemitor[current_soundemitor].sound_type); sprintf(temp_loop,"%d",map->soundemitor[current_soundemitor].loop); ans = popup_dialog(mission_dialog,-1); if(ans==1) { strcpy(map->soundemitor[current_soundemitor].sound_name, sound_info[emitsound_chosen].name); map->soundemitor[current_soundemitor].emitor_type = atoi(temp_e_type); map->soundemitor[current_soundemitor].active = atoi(temp_active); map->soundemitor[current_soundemitor].sound_type = atoi(temp_s_type); map->soundemitor[current_soundemitor].loop = atoi(temp_loop); } return D_O_K; }