15 #include "AsteroidEditorDlg.h"
23 static char THIS_FILE[] = __FILE__;
26 #define ID_FIELD_MENU 9000
68 CDialog::DoDataExchange(pDX);
112 m = pMenu->GetSubMenu(0);
115 str.Format(
"Asteroid Field %d", i);
116 m->AppendMenu(MF_ENABLED | MF_STRING,
ID_FIELD_MENU + i, str);
121 m->CheckMenuItem(
ID_FIELD_MENU + cur_field, MF_BYCOMMAND | MF_CHECKED);
123 CDialog::OnInitMenu(pMenu);
136 return CDialog::OnCommand(wParam, lParam);
143 for (i=0; i<1 ; i++) {
168 if (
a_field[i].has_inner_bound) {
193 #define MIN_BOX_THICKNESS 400
201 MessageBox(
"Asteroid x min is greater than max");
207 MessageBox(
"Asteroid y min is greater than max");
213 MessageBox(
"Asteroid z min is greater than max");
218 if (
a_field[0].has_inner_bound) {
220 MessageBox(
"Asteroid x inner min is greater than inner max");
225 MessageBox(
"Asteroid y inner min is greater than inner max");
230 MessageBox(
"Asteroid z inner min is greater than inner max");
236 MessageBox(
"Asteroid x thickness from outer box to inner box must be > 400");
241 MessageBox(
"Asteroid x thickness from outer box to inner box must be > 400");
247 MessageBox(
"Asteroid y thickness from outer box to inner box must be > 400");
252 MessageBox(
"Asteroid y thickness from outer box to inner box must be > 400");
258 MessageBox(
"Asteroid z thickness from outer box to inner box must be > 400");
263 MessageBox(
"Asteroid z thickness from outer box to inner box must be > 400");
271 if ( (
a_field[0].field_debris_type[0] == -1) && (
a_field[0].field_debris_type[1] == -1) && (
a_field[0].field_debris_type[2] == -1) ) {
272 MessageBox(
"You must choose one or more types of ship debris");
280 if ( (
a_field[0].field_debris_type[0] == -1) && (
a_field[0].field_debris_type[1] == -1) && (
a_field[0].field_debris_type[2] == -1) ) {
281 MessageBox(
"You must choose one or more asteroid subtypes");
315 CDialog::OnInitDialog();
325 int num_asteroids,
idx, cur_choice;
341 vec3d vel_vec = {1.0f, 0.0f, 0.0f};
362 int cur_sel = ((CComboBox*)GetDlgItem(
Dlg_id[idx]))->GetCurSel();
363 if (cur_sel != CB_ERR) {
364 cur_choice = ((CComboBox*)GetDlgItem(
Dlg_id[idx]))->GetItemData(cur_sel);
373 if ( ((CButton *)GetDlgItem(
IDC_SUBTYPE1))->GetCheck() == 1) {
381 if ( ((CButton *)GetDlgItem(
IDC_SUBTYPE2))->GetCheck() == 1) {
389 if ( ((CButton *)GetDlgItem(
IDC_SUBTYPE3))->GetCheck() == 1) {
437 int j, k,
index, box_index;
442 box_index = ((CComboBox*)GetDlgItem(
Dlg_id[k]))->AddString(
"None");
443 ((CComboBox*)GetDlgItem(
Dlg_id[k]))->SetItemData(box_index, static_cast<DWORD_PTR>(-1));
456 name = CString(
Species_info[i].species_name) +
" " + debris_size[j];
462 box_index = ((CComboBox*)GetDlgItem(
Dlg_id[k]))->AddString(name);
463 ((CComboBox*)GetDlgItem(
Dlg_id[k]))->SetItemData(box_index, index);
469 int box_count, cur_box_data;
472 if (
a_field[cur_field].field_debris_type[idx] != -1) {
473 box_count = ((CComboBox*)GetDlgItem(
Dlg_id[idx]))->GetCount();
474 for (box_index=0; box_index<box_count; box_index++) {
475 cur_box_data = ((CComboBox*)GetDlgItem(
Dlg_id[idx]))->GetItemData(box_index);
476 if (cur_box_data ==
a_field[cur_field].field_debris_type[idx]) {
478 ((CComboBox*)GetDlgItem(
Dlg_id[idx]))->SetCurSel(box_index);
486 ((CButton*)GetDlgItem(
IDC_SUBTYPE1))->SetCheck(
a_field[cur_field].field_debris_type[0] == 1);
487 ((CButton*)GetDlgItem(
IDC_SUBTYPE2))->SetCheck(
a_field[cur_field].field_debris_type[1] == 1);
488 ((CButton*)GetDlgItem(
IDC_SUBTYPE3))->SetCheck(
a_field[cur_field].field_debris_type[2] == 1);
void record_window_data(window_data *wndd, CWnd *wnd)
virtual BOOL OnInitDialog()
afx_msg void OnFieldAsteroid()
float vm_vec_mag(const vec3d *v)
int init_window(window_data *wndd, CWnd *wnd, int adjust=0, int pre=0)
int Dlg_id[MAX_ACTIVE_DEBRIS_TYPES]
struct vec3d::@225::@227 xyz
UINT WPARAM LPARAM lParam
afx_msg void OnPassiveField()
afx_msg void OnEnableInnerBox()
CSpinButtonCtrl m_density_spin
int num_initial_asteroids
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
afx_msg void OnActiveField()
window_data Asteroid_wnd_data
void vm_vec_scale(vec3d *dest, float s)
BOOL m_enable_inner_bounds
field_type_t m_field_type
#define MIN_BOX_THICKNESS
afx_msg void OnEnableAsteroids()
asteroid_editor(CWnd *pParent=NULL)
void set_modified(BOOL arg)
GLuint const GLchar * name
debris_genre_t m_debris_genre
float vm_vec_dist_quick(const vec3d *v0, const vec3d *v1)
afx_msg void OnFieldShip()
int MessageBox(HWND h, const char *s1, const char *s2, int i)
SCP_vector< species_info > Species_info
debris_genre_t debris_genre
virtual void DoDataExchange(CDataExchange *pDX)
#define IDC_FIELD_ASTEROID
asteroid_field Asteroid_field
void clear_menu(CMenu *ptr)
#define IDC_ENABLE_ASTEROIDS
asteroid_field a_field[1]
#define MAX_ACTIVE_DEBRIS_TYPES
#define IDC_ENABLE_INNER_BOX
#define IDC_PASSIVE_FIELD
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam)