void do_object_window() { object *obj=&Objects[Cur_object_index]; if ( MattWindow == NULL ) return; //------------------------------------------------------------ // Call the ui code.. //------------------------------------------------------------ ui_button_any_drawn = 0; ui_window_do_gadgets(MattWindow); if ( QuitButton->pressed || (last_keypress==KEY_ESC)) { if (InitialMode[0]->flag) obj->movement_type = MT_NONE; if (InitialMode[1]->flag) obj->movement_type = MT_SPINNING; obj->mtype.spin_rate.x = fl2f(atof(Xtext->text)); obj->mtype.spin_rate.y = fl2f(atof(Ytext->text)); obj->mtype.spin_rate.z = fl2f(atof(Ztext->text)); object_close_window(); return; } old_object = Cur_object_index; }
int object_dialog_handler(UI_DIALOG *, d_event *event, object_dialog *o) { dxxobject *obj=&Objects[Cur_object_index]; int keypress = 0; int rval = 0; if (event->type == EVENT_KEY_COMMAND) keypress = event_key_get(event); Assert(MattWindow != NULL); //------------------------------------------------------------ // Call the ui code.. //------------------------------------------------------------ ui_button_any_drawn = 0; if (event->type == EVENT_WINDOW_CLOSE) { d_free(o); MattWindow = NULL; return 0; } else if (event->type == EVENT_UI_DIALOG_DRAW) { ui_dprintf_at( MattWindow, 10, 132,"&X:" ); ui_dprintf_at( MattWindow, 10, 162,"&Y:" ); ui_dprintf_at( MattWindow, 10, 192,"&Z:" ); } if ( GADGET_PRESSED(o->quitButton) || (keypress==KEY_ESC)) { if (o->initialMode[0]->flag) obj->movement_type = MT_NONE; if (o->initialMode[1]->flag) obj->movement_type = MT_SPINNING; obj->mtype.spin_rate.x = fl2f(atof(o->xtext->text)); obj->mtype.spin_rate.y = fl2f(atof(o->ytext->text)); obj->mtype.spin_rate.z = fl2f(atof(o->ztext->text)); object_close_window(); return 1; } return rval; }