| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/editor/RobotEditWeaponsDialog.cpp $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:38 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Robot weapon battery dialog |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 35 3/02/99 7:23p Chris |
| 30 | * Add the 'fire at target' check box for weapon batteries |
| 31 | * |
| 32 | * 34 1/31/99 11:26p Chris |
| 33 | * added WBF_AIM_FVEC |
| 34 | * |
| 35 | * 33 1/25/99 8:51a Chris |
| 36 | * |
| 37 | * 32 11/13/98 12:30p Jason |
| 38 | * changes for weapons |
| 39 | * |
| 40 | * 31 11/10/98 6:18p Chris |
| 41 | * Improved AI - added support for manual max firing distances |
| 42 | * |
| 43 | * 30 11/03/98 6:37p Chris |
| 44 | * Started to add support for on/off and spray weapons for robots |
| 45 | * |
| 46 | * 29 10/19/98 8:11p Chris |
| 47 | * |
| 48 | * 28 10/19/98 7:51p Chris |
| 49 | * |
| 50 | * 27 10/19/98 7:38p Chris |
| 51 | * |
| 52 | * 26 10/19/98 7:20p Chris |
| 53 | * Added custom fire dot code |
| 54 | * |
| 55 | * 25 9/22/98 12:04p Matt |
| 56 | * Fixed bogus handling of OutrageMessageBox() results. |
| 57 | * |
| 58 | * 24 8/14/98 4:57p Jeff |
| 59 | * edit quad fire mask |
| 60 | * |
| 61 | * 23 8/14/98 3:32p Chris |
| 62 | * Added quad support |
| 63 | * |
| 64 | * 22 8/05/98 12:41p Chris |
| 65 | * Fixed a bug with zero turret wbs |
| 66 | * |
| 67 | * 21 4/09/98 2:23p Jason |
| 68 | * added guided/afterburner stuff |
| 69 | * |
| 70 | * 20 3/30/98 10:50a Chris |
| 71 | * I added support of random next firing masks |
| 72 | * |
| 73 | * 19 3/23/98 10:03a Chris |
| 74 | * Added independant wb animations |
| 75 | * |
| 76 | * 18 2/09/98 11:12a Chris |
| 77 | * Allowed for the edititng of multiple weapon batteries |
| 78 | * |
| 79 | * 17 2/04/98 12:35a Chris |
| 80 | * Fixed weapon battery stuff for non-turret'ed weapon batteries |
| 81 | * |
| 82 | * 16 1/23/98 6:25p Jason |
| 83 | * Got spray weapons working |
| 84 | * |
| 85 | * 15 1/23/98 12:31p Chris |
| 86 | * Fixed bug induced by Jason because of different dialog coding |
| 87 | * conventions |
| 88 | * |
| 89 | * $NoKeywords: $ |
| 90 | */ |
| 91 | |
| 92 | #include "stdafx.h" |
| 93 | #include "editor.h" |
| 94 | #include "RobotEditWeaponsDialog.h" |
| 95 | #include "weapon.h" |
| 96 | #include "string.h" |
| 97 | #include "polymodel.h" |
| 98 | #include "fix.h" |
| 99 | #include "weapon.h" |
| 100 | #include "soundload.h" |
| 101 | #include "soundpage.h" |
| 102 | #include "hlsoundlib.h" |
| 103 | #include "mono.h" |
| 104 | #include "pserror.h" |
| 105 | |
| 106 | #ifdef _DEBUG |
| 107 | #define new DEBUG_NEW |
| 108 | #undef THIS_FILE |
| 109 | static char THIS_FILE[] = __FILE__; |
| 110 | #endif |
| 111 | |
| 112 | ///////////////////////////////////////////////////////////////////////////// |
| 113 | // RobotEditWeaponsDialog dialog |
| 114 | |
| 115 | void RobotEditWeaponsDialog::NewWBSelected() { |
| 116 | char str[200]; |
| 117 | |
| 118 | m_current_turret_index = 0; |
| 119 | |
| 120 | sprintf(str, "Num Turrets for GB: %d", m_obj_pm->poly_wb[m_current_wb_index].num_turrets); |
| 121 | m_num_turrets_text = str; |
| 122 | |
| 123 | m_num_masks = m_obj_static_wb[m_current_wb_index].num_masks; |
| 124 | |
| 125 | m_ammo_usage = m_obj_static_wb[m_current_wb_index].ammo_usage; |
| 126 | m_energy_usage = m_obj_static_wb[m_current_wb_index].energy_usage; |
| 127 | |
| 128 | m_view_cone_angle = acos(m_obj_static_wb[m_current_wb_index].aiming_3d_dot) * (360.0 / PI); |
| 129 | m_max_distance = m_obj_static_wb[m_current_wb_index].aiming_3d_dist; |
| 130 | m_xz_plane_angle = acos(m_obj_static_wb[m_current_wb_index].aiming_XZ_dot) * (360.0 / PI); |
| 131 | |
| 132 | m_current_aiming_point = m_obj_static_wb[m_current_wb_index].aiming_gp_index; |
| 133 | m_anim_type = m_obj_static_wb[m_current_wb_index].flags & WBF_ANIM_MASKS; |
| 134 | |
| 135 | sprintf(str, "%d", m_current_wb_index + 1); |
| 136 | m_current_gb = str; |
| 137 | |
| 138 | UpdateTurretInfo(); |
| 139 | |
| 140 | // sprintf(str, "%d", m_obj_pm->poly_wb[m_current_wb_index].turret_index[m_current_turret_index]); |
| 141 | sprintf(str, "%d", m_current_turret_index + 1); |
| 142 | m_current_turret_combo = str; |
| 143 | |
| 144 | m_weapon_0_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[0]].name; |
| 145 | m_weapon_1_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[1]].name; |
| 146 | m_weapon_2_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[2]].name; |
| 147 | m_weapon_3_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[3]].name; |
| 148 | m_weapon_4_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[4]].name; |
| 149 | m_weapon_5_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[5]].name; |
| 150 | m_weapon_6_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[6]].name; |
| 151 | m_weapon_7_text = Weapons[m_obj_static_wb[m_current_wb_index].gp_weapon_index[7]].name; |
| 152 | |
| 153 | m_fire_sound_0_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[0]].name; |
| 154 | m_fire_sound_1_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[1]].name; |
| 155 | m_fire_sound_2_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[2]].name; |
| 156 | m_fire_sound_3_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[3]].name; |
| 157 | m_fire_sound_4_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[4]].name; |
| 158 | m_fire_sound_5_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[5]].name; |
| 159 | m_fire_sound_6_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[6]].name; |
| 160 | m_fire_sound_7_text = Sounds[m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[7]].name; |
| 161 | |
| 162 | m_mask_latency_0 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[0]; |
| 163 | m_mask_latency_1 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[1]; |
| 164 | m_mask_latency_2 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[2]; |
| 165 | m_mask_latency_3 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[3]; |
| 166 | m_mask_latency_4 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[4]; |
| 167 | m_mask_latency_5 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[5]; |
| 168 | m_mask_latency_6 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[6]; |
| 169 | m_mask_latency_7 = m_obj_static_wb[m_current_wb_index].gp_fire_wait[7]; |
| 170 | |
| 171 | m_gp77 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 7) != 0); |
| 172 | m_gp76 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 6) != 0); |
| 173 | m_gp75 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 5) != 0); |
| 174 | m_gp74 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 4) != 0); |
| 175 | m_gp73 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 3) != 0); |
| 176 | m_gp72 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 2) != 0); |
| 177 | m_gp71 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01 << 1) != 0); |
| 178 | m_gp70 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] & 0x01) != 0); |
| 179 | m_gp67 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 7) != 0); |
| 180 | m_gp66 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 6) != 0); |
| 181 | m_gp65 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 5) != 0); |
| 182 | m_gp64 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 4) != 0); |
| 183 | m_gp63 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 3) != 0); |
| 184 | m_gp62 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 2) != 0); |
| 185 | m_gp61 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01 << 1) != 0); |
| 186 | m_gp60 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] & 0x01) != 0); |
| 187 | m_gp57 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 7) != 0); |
| 188 | m_gp56 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 6) != 0); |
| 189 | m_gp55 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 5) != 0); |
| 190 | m_gp54 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 4) != 0); |
| 191 | m_gp53 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 3) != 0); |
| 192 | m_gp52 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 2) != 0); |
| 193 | m_gp51 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01 << 1) != 0); |
| 194 | m_gp50 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] & 0x01) != 0); |
| 195 | m_gp47 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 7) != 0); |
| 196 | m_gp46 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 6) != 0); |
| 197 | m_gp45 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 5) != 0); |
| 198 | m_gp44 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 4) != 0); |
| 199 | m_gp43 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 3) != 0); |
| 200 | m_gp42 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 2) != 0); |
| 201 | m_gp41 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01 << 1) != 0); |
| 202 | m_gp40 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] & 0x01) != 0); |
| 203 | m_gp37 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 7) != 0); |
| 204 | m_gp36 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 6) != 0); |
| 205 | m_gp35 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 5) != 0); |
| 206 | m_gp34 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 4) != 0); |
| 207 | m_gp33 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 3) != 0); |
| 208 | m_gp32 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 2) != 0); |
| 209 | m_gp31 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01 << 1) != 0); |
| 210 | m_gp30 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] & 0x01) != 0); |
| 211 | m_gp27 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 7) != 0); |
| 212 | m_gp26 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 6) != 0); |
| 213 | m_gp25 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 5) != 0); |
| 214 | m_gp24 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 4) != 0); |
| 215 | m_gp23 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 3) != 0); |
| 216 | m_gp22 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 2) != 0); |
| 217 | m_gp21 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01 << 1) != 0); |
| 218 | m_gp20 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] & 0x01) != 0); |
| 219 | m_gp17 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 7) != 0); |
| 220 | m_gp16 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 6) != 0); |
| 221 | m_gp15 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 5) != 0); |
| 222 | m_gp14 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 4) != 0); |
| 223 | m_gp13 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 3) != 0); |
| 224 | m_gp12 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 2) != 0); |
| 225 | m_gp11 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01 << 1) != 0); |
| 226 | m_gp10 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] & 0x01) != 0); |
| 227 | m_gp07 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 7) != 0); |
| 228 | m_gp06 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 6) != 0); |
| 229 | m_gp05 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 5) != 0); |
| 230 | m_gp04 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 4) != 0); |
| 231 | m_gp03 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 3) != 0); |
| 232 | m_gp02 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 2) != 0); |
| 233 | m_gp01 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01 << 1) != 0); |
| 234 | m_gp00 = ((m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] & 0x01) != 0); |
| 235 | |
| 236 | m_gpq7 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 7) != 0); |
| 237 | m_gpq6 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 6) != 0); |
| 238 | m_gpq5 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 5) != 0); |
| 239 | m_gpq4 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 4) != 0); |
| 240 | m_gpq3 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 3) != 0); |
| 241 | m_gpq2 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 2) != 0); |
| 242 | m_gpq1 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01 << 1) != 0); |
| 243 | m_gpq0 = ((m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask & 0x01) != 0); |
| 244 | |
| 245 | m_fire0_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[0]; |
| 246 | m_fire1_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[1]; |
| 247 | m_fire2_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[2]; |
| 248 | m_fire3_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[3]; |
| 249 | m_fire4_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[4]; |
| 250 | m_fire5_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[5]; |
| 251 | m_fire6_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[6]; |
| 252 | m_fire7_cycle_time = m_obj_static_wb[m_current_wb_index].anim_time[7]; |
| 253 | m_fire0_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[0]; |
| 254 | m_fire1_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[1]; |
| 255 | m_fire2_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[2]; |
| 256 | m_fire3_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[3]; |
| 257 | m_fire4_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[4]; |
| 258 | m_fire5_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[5]; |
| 259 | m_fire6_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[6]; |
| 260 | m_fire7_end_tick = m_obj_static_wb[m_current_wb_index].anim_end_frame[7]; |
| 261 | m_fire0_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[0]; |
| 262 | m_fire1_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[1]; |
| 263 | m_fire2_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[2]; |
| 264 | m_fire3_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[3]; |
| 265 | m_fire4_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[4]; |
| 266 | m_fire5_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[5]; |
| 267 | m_fire6_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[6]; |
| 268 | m_fire7_fire_tick = m_obj_static_wb[m_current_wb_index].anim_fire_frame[7]; |
| 269 | m_fire0_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[0]; |
| 270 | m_fire1_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[1]; |
| 271 | m_fire2_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[2]; |
| 272 | m_fire3_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[3]; |
| 273 | m_fire4_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[4]; |
| 274 | m_fire5_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[5]; |
| 275 | m_fire6_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[6]; |
| 276 | m_fire7_start_tick = m_obj_static_wb[m_current_wb_index].anim_start_frame[7]; |
| 277 | |
| 278 | m_spray_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_SPRAY) != 0); |
| 279 | m_guided = ((m_obj_static_wb[m_current_wb_index].flags & WBF_GUIDED) != 0); |
| 280 | m_user_timeout = ((m_obj_static_wb[m_current_wb_index].flags & WBF_USER_TIMEOUT) != 0); |
| 281 | m_random_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_RANDOM_FIRE_ORDER) != 0); |
| 282 | m_force_fvec_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_FIRE_FVEC) != 0); |
| 283 | m_force_target_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_FIRE_TARGET) != 0); |
| 284 | m_aim_fvec_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_AIM_FVEC) != 0); |
| 285 | m_onoff_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_ON_OFF) != 0); |
| 286 | |
| 287 | m_custom_view_cone_check = ((m_obj_static_wb[m_current_wb_index].flags & WBF_USE_CUSTOM_FOV) != 0); |
| 288 | m_custom_max_dist = ((m_obj_static_wb[m_current_wb_index].flags & WBF_USE_CUSTOM_MAX_DIST) != 0); |
| 289 | } |
| 290 | |
| 291 | RobotEditWeaponsDialog::RobotEditWeaponsDialog(otype_wb_info static_wb[], poly_model *pm, CWnd *pParent /*=NULL*/) |
| 292 | : CDialog(RobotEditWeaponsDialog::IDD, pParent) { |
| 293 | // CEdit *ebox; |
| 294 | char str[200]; |
| 295 | |
| 296 | m_obj_static_wb = static_wb; |
| 297 | m_obj_pm = pm; |
| 298 | |
| 299 | //{{AFX_DATA_INIT(RobotEditWeaponsDialog) |
| 300 | m_weapon_0_text = _T(""); |
| 301 | m_weapon_1_text = _T(""); |
| 302 | m_weapon_2_text = _T(""); |
| 303 | m_weapon_4_text = _T(""); |
| 304 | m_weapon_3_text = _T(""); |
| 305 | m_weapon_5_text = _T(""); |
| 306 | m_weapon_6_text = _T(""); |
| 307 | m_weapon_7_text = _T(""); |
| 308 | m_fire_sound_0_text = _T(""); |
| 309 | m_fire_sound_1_text = _T(""); |
| 310 | m_fire_sound_2_text = _T(""); |
| 311 | m_fire_sound_3_text = _T(""); |
| 312 | m_fire_sound_4_text = _T(""); |
| 313 | m_fire_sound_5_text = _T(""); |
| 314 | m_fire_sound_6_text = _T(""); |
| 315 | m_fire_sound_7_text = _T(""); |
| 316 | m_energy_usage = 0.0f; |
| 317 | m_ammo_usage = 0.0f; |
| 318 | m_spray_check = FALSE; |
| 319 | m_random_check = FALSE; |
| 320 | m_guided = FALSE; |
| 321 | m_gpq0 = FALSE; |
| 322 | m_gpq1 = FALSE; |
| 323 | m_gpq2 = FALSE; |
| 324 | m_gpq3 = FALSE; |
| 325 | m_gpq4 = FALSE; |
| 326 | m_gpq5 = FALSE; |
| 327 | m_gpq6 = FALSE; |
| 328 | m_gpq7 = FALSE; |
| 329 | m_custom_view_cone_check = FALSE; |
| 330 | m_onoff_check = FALSE; |
| 331 | m_custom_max_dist = FALSE; |
| 332 | m_user_timeout = FALSE; |
| 333 | m_force_fvec_check = FALSE; |
| 334 | m_aim_fvec_check = FALSE; |
| 335 | m_force_target_check = FALSE; |
| 336 | //}}AFX_DATA_INIT |
| 337 | |
| 338 | m_current_wb_index = 0; |
| 339 | |
| 340 | sprintf(str, "Total Gun Batteries: %d", m_obj_pm->num_wbs); |
| 341 | m_total_gb_text = str; |
| 342 | |
| 343 | sprintf(str, "Total Gun Points: %d", m_obj_pm->n_guns); |
| 344 | m_total_gp_text = str; |
| 345 | |
| 346 | NewWBSelected(); |
| 347 | } |
| 348 | |
| 349 | void RobotEditWeaponsDialog::DoDataExchange(CDataExchange *pDX) { |
| 350 | CDialog::DoDataExchange(pDX); |
| 351 | //{{AFX_DATA_MAP(RobotEditWeaponsDialog) |
| 352 | DDX_CBString(pDX, IDC_CURRENT_GB_COMBO, m_current_gb); |
| 353 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_0_EDIT, m_mask_latency_0); |
| 354 | DDV_MinMaxFloat(pDX, m_mask_latency_0, 0.0f, 100000.0f); |
| 355 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_1_EDIT, m_mask_latency_1); |
| 356 | DDV_MinMaxFloat(pDX, m_mask_latency_1, 0.0f, 100000.0f); |
| 357 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_2_EDIT, m_mask_latency_2); |
| 358 | DDV_MinMaxFloat(pDX, m_mask_latency_2, 0.0f, 100000.0f); |
| 359 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_3_EDIT, m_mask_latency_3); |
| 360 | DDV_MinMaxFloat(pDX, m_mask_latency_3, 0.0f, 100000.0f); |
| 361 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_4_EDIT, m_mask_latency_4); |
| 362 | DDV_MinMaxFloat(pDX, m_mask_latency_4, 0.0f, 100000.0f); |
| 363 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_5_EDIT, m_mask_latency_5); |
| 364 | DDV_MinMaxFloat(pDX, m_mask_latency_5, 0.0f, 100000.0f); |
| 365 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_6_EDIT, m_mask_latency_6); |
| 366 | DDV_MinMaxFloat(pDX, m_mask_latency_6, 0.0f, 100000.0f); |
| 367 | DDX_Text(pDX, IDC_GB_MASK_LATENCY_7_EDIT, m_mask_latency_7); |
| 368 | DDV_MinMaxFloat(pDX, m_mask_latency_7, 0.0f, 100000.0f); |
| 369 | DDX_Text(pDX, IDC_GB_NUM_MASKS_EDIT, m_num_masks); |
| 370 | DDV_MinMaxUInt(pDX, m_num_masks, 1, 8); |
| 371 | DDX_Text(pDX, IDC_TOTAL_GB_STATIC, m_total_gb_text); |
| 372 | DDX_Text(pDX, IDC_TOTAL_GP_STATIC, m_total_gp_text); |
| 373 | DDX_Text(pDX, IDC_NUM_GB_TURRETS_STATIC, m_num_turrets_text); |
| 374 | DDX_Check(pDX, IDC_GP_MASK_7_7, m_gp77); |
| 375 | DDX_Check(pDX, IDC_GP_MASK_7_6, m_gp76); |
| 376 | DDX_Check(pDX, IDC_GP_MASK_7_5, m_gp75); |
| 377 | DDX_Check(pDX, IDC_GP_MASK_7_4, m_gp74); |
| 378 | DDX_Check(pDX, IDC_GP_MASK_7_3, m_gp73); |
| 379 | DDX_Check(pDX, IDC_GP_MASK_7_2, m_gp72); |
| 380 | DDX_Check(pDX, IDC_GP_MASK_7_1, m_gp71); |
| 381 | DDX_Check(pDX, IDC_GP_MASK_7_0, m_gp70); |
| 382 | DDX_Check(pDX, IDC_GP_MASK_6_7, m_gp67); |
| 383 | DDX_Check(pDX, IDC_GP_MASK_6_6, m_gp66); |
| 384 | DDX_Check(pDX, IDC_GP_MASK_6_5, m_gp65); |
| 385 | DDX_Check(pDX, IDC_GP_MASK_6_4, m_gp64); |
| 386 | DDX_Check(pDX, IDC_GP_MASK_6_3, m_gp63); |
| 387 | DDX_Check(pDX, IDC_GP_MASK_6_2, m_gp62); |
| 388 | DDX_Check(pDX, IDC_GP_MASK_6_1, m_gp61); |
| 389 | DDX_Check(pDX, IDC_GP_MASK_6_0, m_gp60); |
| 390 | DDX_Check(pDX, IDC_GP_MASK_5_6, m_gp56); |
| 391 | DDX_Check(pDX, IDC_GP_MASK_5_7, m_gp57); |
| 392 | DDX_Check(pDX, IDC_GP_MASK_5_5, m_gp55); |
| 393 | DDX_Check(pDX, IDC_GP_MASK_5_4, m_gp54); |
| 394 | DDX_Check(pDX, IDC_GP_MASK_5_3, m_gp53); |
| 395 | DDX_Check(pDX, IDC_GP_MASK_5_2, m_gp52); |
| 396 | DDX_Check(pDX, IDC_GP_MASK_5_1, m_gp51); |
| 397 | DDX_Check(pDX, IDC_GP_MASK_5_0, m_gp50); |
| 398 | DDX_Check(pDX, IDC_GP_MASK_4_7, m_gp47); |
| 399 | DDX_Check(pDX, IDC_GP_MASK_4_6, m_gp46); |
| 400 | DDX_Check(pDX, IDC_GP_MASK_4_5, m_gp45); |
| 401 | DDX_Check(pDX, IDC_GP_MASK_4_4, m_gp44); |
| 402 | DDX_Check(pDX, IDC_GP_MASK_4_3, m_gp43); |
| 403 | DDX_Check(pDX, IDC_GP_MASK_4_2, m_gp42); |
| 404 | DDX_Check(pDX, IDC_GP_MASK_4_1, m_gp41); |
| 405 | DDX_Check(pDX, IDC_GP_MASK_4_0, m_gp40); |
| 406 | DDX_Check(pDX, IDC_GP_MASK_3_7, m_gp37); |
| 407 | DDX_Check(pDX, IDC_GP_MASK_3_6, m_gp36); |
| 408 | DDX_Check(pDX, IDC_GP_MASK_3_5, m_gp35); |
| 409 | DDX_Check(pDX, IDC_GP_MASK_3_4, m_gp34); |
| 410 | DDX_Check(pDX, IDC_GP_MASK_3_3, m_gp33); |
| 411 | DDX_Check(pDX, IDC_GP_MASK_3_2, m_gp32); |
| 412 | DDX_Check(pDX, IDC_GP_MASK_3_1, m_gp31); |
| 413 | DDX_Check(pDX, IDC_GP_MASK_3_0, m_gp30); |
| 414 | DDX_Check(pDX, IDC_GP_MASK_2_7, m_gp27); |
| 415 | DDX_Check(pDX, IDC_GP_MASK_2_6, m_gp26); |
| 416 | DDX_Check(pDX, IDC_GP_MASK_2_5, m_gp25); |
| 417 | DDX_Check(pDX, IDC_GP_MASK_2_4, m_gp24); |
| 418 | DDX_Check(pDX, IDC_GP_MASK_2_3, m_gp23); |
| 419 | DDX_Check(pDX, IDC_GP_MASK_2_2, m_gp22); |
| 420 | DDX_Check(pDX, IDC_GP_MASK_2_1, m_gp21); |
| 421 | DDX_Check(pDX, IDC_GP_MASK_2_0, m_gp20); |
| 422 | DDX_Check(pDX, IDC_GP_MASK_1_7, m_gp17); |
| 423 | DDX_Check(pDX, IDC_GP_MASK_1_6, m_gp16); |
| 424 | DDX_Check(pDX, IDC_GP_MASK_1_5, m_gp15); |
| 425 | DDX_Check(pDX, IDC_GP_MASK_1_4, m_gp14); |
| 426 | DDX_Check(pDX, IDC_GP_MASK_1_3, m_gp13); |
| 427 | DDX_Check(pDX, IDC_GP_MASK_1_2, m_gp12); |
| 428 | DDX_Check(pDX, IDC_GP_MASK_1_1, m_gp11); |
| 429 | DDX_Check(pDX, IDC_GP_MASK_1_0, m_gp10); |
| 430 | DDX_Check(pDX, IDC_GP_MASK_0_7, m_gp07); |
| 431 | DDX_Check(pDX, IDC_GP_MASK_0_6, m_gp06); |
| 432 | DDX_Check(pDX, IDC_GP_MASK_0_5, m_gp05); |
| 433 | DDX_Check(pDX, IDC_GP_MASK_0_4, m_gp04); |
| 434 | DDX_Check(pDX, IDC_GP_MASK_0_3, m_gp03); |
| 435 | DDX_Check(pDX, IDC_GP_MASK_0_2, m_gp02); |
| 436 | DDX_Check(pDX, IDC_GP_MASK_0_1, m_gp01); |
| 437 | DDX_Check(pDX, IDC_GP_MASK_0_0, m_gp00); |
| 438 | DDX_Text(pDX, IDC_TURRET_REACTION_TIME_STATIC, m_turret_reaction_time_text); |
| 439 | DDX_Text(pDX, IDC_TURRET_FOV_STATIC, m_turret_fov_text); |
| 440 | DDX_Text(pDX, IDC_TURRET_SPR_STATIC, m_turret_spr_text); |
| 441 | DDX_CBString(pDX, IDC_CURRET_TURRET_COMBO, m_current_turret_combo); |
| 442 | DDX_Text(pDX, IDC_TURRET_SOBJ_STATIC, m_turret_sobj_text); |
| 443 | DDX_Text(pDX, IDC_VIEW_CONE_ANGLE_EDIT, m_view_cone_angle); |
| 444 | DDV_MinMaxFloat(pDX, m_view_cone_angle, 1.f, 359.f); |
| 445 | DDX_Text(pDX, IDC_MAX_DISTANCE_EDIT, m_max_distance); |
| 446 | DDV_MinMaxFloat(pDX, m_max_distance, 1.f, 1.e+007f); |
| 447 | DDX_Text(pDX, IDC_XZ_PLANE_ANGLE_EDIT, m_xz_plane_angle); |
| 448 | DDV_MinMaxFloat(pDX, m_xz_plane_angle, 1.f, 359.f); |
| 449 | DDX_CBString(pDX, IDC_BARREL_0_COMBO, m_weapon_0_text); |
| 450 | DDX_CBString(pDX, IDC_BARREL_1_COMBO, m_weapon_1_text); |
| 451 | DDX_CBString(pDX, IDC_BARREL_2_COMBO, m_weapon_2_text); |
| 452 | DDX_CBString(pDX, IDC_BARREL_4_COMBO, m_weapon_4_text); |
| 453 | DDX_CBString(pDX, IDC_BARREL_3_COMBO, m_weapon_3_text); |
| 454 | DDX_CBString(pDX, IDC_BARREL_5_COMBO, m_weapon_5_text); |
| 455 | DDX_CBString(pDX, IDC_BARREL_6_COMBO, m_weapon_6_text); |
| 456 | DDX_CBString(pDX, IDC_BARREL_7_COMBO, m_weapon_7_text); |
| 457 | DDX_CBString(pDX, IDC_WB_FIRE0_SOUND_PULLDOWN, m_fire_sound_0_text); |
| 458 | DDX_CBString(pDX, IDC_WB_FIRE1_SOUND_PULLDOWN, m_fire_sound_1_text); |
| 459 | DDX_CBString(pDX, IDC_WB_FIRE2_SOUND_PULLDOWN, m_fire_sound_2_text); |
| 460 | DDX_CBString(pDX, IDC_WB_FIRE3_SOUND_PULLDOWN, m_fire_sound_3_text); |
| 461 | DDX_CBString(pDX, IDC_WB_FIRE4_SOUND_PULLDOWN, m_fire_sound_4_text); |
| 462 | DDX_CBString(pDX, IDC_WB_FIRE5_SOUND_PULLDOWN, m_fire_sound_5_text); |
| 463 | DDX_CBString(pDX, IDC_WB_FIRE6_SOUND_PULLDOWN, m_fire_sound_6_text); |
| 464 | DDX_CBString(pDX, IDC_WB_FIRE7_SOUND_PULLDOWN, m_fire_sound_7_text); |
| 465 | DDX_Text(pDX, IDC_ENERGY_USAGE_EDIT, m_energy_usage); |
| 466 | DDV_MinMaxFloat(pDX, m_energy_usage, 0.0f, 10000.f); |
| 467 | DDX_Text(pDX, IDC_AMMO_USAGE_EDIT, m_ammo_usage); |
| 468 | DDV_MinMaxFloat(pDX, m_ammo_usage, 0.f, 10000.f); |
| 469 | DDX_Check(pDX, IDC_SPRAY_CHECK, m_spray_check); |
| 470 | DDX_Text(pDX, IDC_WB_FIRE0_CYCLE_TIME, m_fire0_cycle_time); |
| 471 | DDX_Text(pDX, IDC_WB_FIRE1_CYCLE_TIME, m_fire1_cycle_time); |
| 472 | DDX_Text(pDX, IDC_WB_FIRE2_CYCLE_TIME, m_fire2_cycle_time); |
| 473 | DDX_Text(pDX, IDC_WB_FIRE3_CYCLE_TIME, m_fire3_cycle_time); |
| 474 | DDX_Text(pDX, IDC_WB_FIRE4_CYCLE_TIME, m_fire4_cycle_time); |
| 475 | DDX_Text(pDX, IDC_WB_FIRE5_CYCLE_TIME, m_fire5_cycle_time); |
| 476 | DDX_Text(pDX, IDC_WB_FIRE6_CYCLE_TIME, m_fire6_cycle_time); |
| 477 | DDX_Text(pDX, IDC_WB_FIRE7_CYCLE_TIME, m_fire7_cycle_time); |
| 478 | DDX_Text(pDX, IDC_WB_FIRE0_END_TICK, m_fire0_end_tick); |
| 479 | DDX_Text(pDX, IDC_WB_FIRE1_END_TICK, m_fire1_end_tick); |
| 480 | DDX_Text(pDX, IDC_WB_FIRE2_END_TICK, m_fire2_end_tick); |
| 481 | DDX_Text(pDX, IDC_WB_FIRE3_END_TICK, m_fire3_end_tick); |
| 482 | DDX_Text(pDX, IDC_WB_FIRE4_END_TICK, m_fire4_end_tick); |
| 483 | DDX_Text(pDX, IDC_WB_FIRE5_END_TICK, m_fire5_end_tick); |
| 484 | DDX_Text(pDX, IDC_WB_FIRE6_END_TICK, m_fire6_end_tick); |
| 485 | DDX_Text(pDX, IDC_WB_FIRE7_END_TICK, m_fire7_end_tick); |
| 486 | DDX_Text(pDX, IDC_WB_FIRE0_FIRE_TICK, m_fire0_fire_tick); |
| 487 | DDX_Text(pDX, IDC_WB_FIRE1_FIRE_TICK, m_fire1_fire_tick); |
| 488 | DDX_Text(pDX, IDC_WB_FIRE2_FIRE_TICK, m_fire2_fire_tick); |
| 489 | DDX_Text(pDX, IDC_WB_FIRE3_FIRE_TICK, m_fire3_fire_tick); |
| 490 | DDX_Text(pDX, IDC_WB_FIRE4_FIRE_TICK, m_fire4_fire_tick); |
| 491 | DDX_Text(pDX, IDC_WB_FIRE5_FIRE_TICK, m_fire5_fire_tick); |
| 492 | DDX_Text(pDX, IDC_WB_FIRE6_FIRE_TICK, m_fire6_fire_tick); |
| 493 | DDX_Text(pDX, IDC_WB_FIRE7_FIRE_TICK, m_fire7_fire_tick); |
| 494 | DDX_Text(pDX, IDC_WB_FIRE0_START_TICK, m_fire0_start_tick); |
| 495 | DDX_Text(pDX, IDC_WB_FIRE1_START_TICK, m_fire1_start_tick); |
| 496 | DDX_Text(pDX, IDC_WB_FIRE2_START_TICK, m_fire2_start_tick); |
| 497 | DDX_Text(pDX, IDC_WB_FIRE3_START_TICK, m_fire3_start_tick); |
| 498 | DDX_Text(pDX, IDC_WB_FIRE4_START_TICK, m_fire4_start_tick); |
| 499 | DDX_Text(pDX, IDC_WB_FIRE5_START_TICK, m_fire5_start_tick); |
| 500 | DDX_Text(pDX, IDC_WB_FIRE6_START_TICK, m_fire6_start_tick); |
| 501 | DDX_Text(pDX, IDC_WB_FIRE7_START_TICK, m_fire7_start_tick); |
| 502 | DDX_Check(pDX, IDC_WB_RANDOM_CHECK, m_random_check); |
| 503 | DDX_Check(pDX, IDC_GUIDED_CHECK, m_guided); |
| 504 | DDX_Check(pDX, IDC_GP_MASK_Q_0, m_gpq0); |
| 505 | DDX_Check(pDX, IDC_GP_MASK_Q_1, m_gpq1); |
| 506 | DDX_Check(pDX, IDC_GP_MASK_Q_2, m_gpq2); |
| 507 | DDX_Check(pDX, IDC_GP_MASK_Q_3, m_gpq3); |
| 508 | DDX_Check(pDX, IDC_GP_MASK_Q_4, m_gpq4); |
| 509 | DDX_Check(pDX, IDC_GP_MASK_Q_5, m_gpq5); |
| 510 | DDX_Check(pDX, IDC_GP_MASK_Q_6, m_gpq6); |
| 511 | DDX_Check(pDX, IDC_GP_MASK_Q_7, m_gpq7); |
| 512 | DDX_Check(pDX, IDC_VIEW_CONE_ANGLE_CHECK, m_custom_view_cone_check); |
| 513 | DDX_Check(pDX, IDC_ONOFF_CHECK, m_onoff_check); |
| 514 | DDX_Check(pDX, IDC_MAX_DISTANCE_CHECK, m_custom_max_dist); |
| 515 | DDX_Check(pDX, IDC_USER_TIMEOUT_CHECK, m_user_timeout); |
| 516 | DDX_Check(pDX, IDC_FORCE_TO_FVEC_CHECK, m_force_fvec_check); |
| 517 | DDX_Check(pDX, IDC_WBAIMFORWARD_CHECK, m_aim_fvec_check); |
| 518 | DDX_Check(pDX, IDC_FORCE_TO_TARGET_CHECK, m_force_target_check); |
| 519 | //}}AFX_DATA_MAP |
| 520 | |
| 521 | if (((CButton *)GetDlgItem(IDC_BARREL_0_RADIO))->GetCheck()) |
| 522 | m_current_aiming_point = 0; |
| 523 | if (((CButton *)GetDlgItem(IDC_BARREL_1_RADIO))->GetCheck()) |
| 524 | m_current_aiming_point = 1; |
| 525 | if (((CButton *)GetDlgItem(IDC_BARREL_2_RADIO))->GetCheck()) |
| 526 | m_current_aiming_point = 2; |
| 527 | if (((CButton *)GetDlgItem(IDC_BARREL_3_RADIO))->GetCheck()) |
| 528 | m_current_aiming_point = 3; |
| 529 | if (((CButton *)GetDlgItem(IDC_BARREL_4_RADIO))->GetCheck()) |
| 530 | m_current_aiming_point = 4; |
| 531 | if (((CButton *)GetDlgItem(IDC_BARREL_5_RADIO))->GetCheck()) |
| 532 | m_current_aiming_point = 5; |
| 533 | if (((CButton *)GetDlgItem(IDC_BARREL_6_RADIO))->GetCheck()) |
| 534 | m_current_aiming_point = 6; |
| 535 | if (((CButton *)GetDlgItem(IDC_BARREL_7_RADIO))->GetCheck()) |
| 536 | m_current_aiming_point = 7; |
| 537 | |
| 538 | if (((CButton *)GetDlgItem(IDC_WB_NO_ANIM_RADIO))->GetCheck()) |
| 539 | m_anim_type = 0; |
| 540 | if (((CButton *)GetDlgItem(IDC_WB_LOCAL_ANIM_RADIO))->GetCheck()) |
| 541 | m_anim_type = WBF_ANIM_LOCAL; |
| 542 | if (((CButton *)GetDlgItem(IDC_WB_MODEL_ANIM_RADIO))->GetCheck()) |
| 543 | m_anim_type = WBF_ANIM_FULL; |
| 544 | } |
| 545 | |
| 546 | BEGIN_MESSAGE_MAP(RobotEditWeaponsDialog, CDialog) |
| 547 | //{{AFX_MSG_MAP(RobotEditWeaponsDialog) |
| 548 | ON_EN_KILLFOCUS(IDC_GB_NUM_MASKS_EDIT, OnKillfocusGbNumMasksEdit) |
| 549 | ON_CBN_SELENDOK(IDC_CURRET_TURRET_COMBO, OnSelendokCurretTurretCombo) |
| 550 | ON_CBN_SELENDOK(IDC_CURRENT_GB_COMBO, OnSelendokCurrentGbCombo) |
| 551 | //}}AFX_MSG_MAP |
| 552 | END_MESSAGE_MAP() |
| 553 | |
| 554 | ///////////////////////////////////////////////////////////////////////////// |
| 555 | // RobotEditWeaponsDialog message handlers |
| 556 | |
| 557 | void RobotEditWeaponsDialog::UpdateDialog(void) { |
| 558 | char str[200]; |
| 559 | |
| 560 | if (!UpdateData(true)) |
| 561 | return; |
| 562 | |
| 563 | if (m_obj_pm->poly_wb[m_current_wb_index].num_turrets) { |
| 564 | sscanf(m_current_turret_combo.GetBuffer(0), "%d", &m_current_turret_index); |
| 565 | m_current_turret_index--; // Accounts for base 1 to base 0 array conversion |
| 566 | } else |
| 567 | m_current_turret_index = 0; |
| 568 | |
| 569 | UpdateTurretInfo(); |
| 570 | UpdateData(false); |
| 571 | |
| 572 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0) |
| 573 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[0]); |
| 574 | else |
| 575 | strcpy(str, "NA"); |
| 576 | ((CButton *)GetDlgItem(IDC_BARREL_0_RADIO))->SetWindowText(str); |
| 577 | |
| 578 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1) |
| 579 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[1]); |
| 580 | else |
| 581 | strcpy(str, "NA"); |
| 582 | ((CButton *)GetDlgItem(IDC_BARREL_1_RADIO))->SetWindowText(str); |
| 583 | |
| 584 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2) |
| 585 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[2]); |
| 586 | else |
| 587 | strcpy(str, "NA"); |
| 588 | ((CButton *)GetDlgItem(IDC_BARREL_2_RADIO))->SetWindowText(str); |
| 589 | |
| 590 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3) |
| 591 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[3]); |
| 592 | else |
| 593 | strcpy(str, "NA"); |
| 594 | ((CButton *)GetDlgItem(IDC_BARREL_3_RADIO))->SetWindowText(str); |
| 595 | |
| 596 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4) |
| 597 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[4]); |
| 598 | else |
| 599 | strcpy(str, "NA"); |
| 600 | ((CButton *)GetDlgItem(IDC_BARREL_4_RADIO))->SetWindowText(str); |
| 601 | |
| 602 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5) |
| 603 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[5]); |
| 604 | else |
| 605 | strcpy(str, "NA"); |
| 606 | ((CButton *)GetDlgItem(IDC_BARREL_5_RADIO))->SetWindowText(str); |
| 607 | |
| 608 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6) |
| 609 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[6]); |
| 610 | else |
| 611 | strcpy(str, "NA"); |
| 612 | ((CButton *)GetDlgItem(IDC_BARREL_6_RADIO))->SetWindowText(str); |
| 613 | |
| 614 | if (m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7) |
| 615 | sprintf(str, "Gun Point %d", m_obj_pm->poly_wb[m_current_wb_index].gp_index[7]); |
| 616 | else |
| 617 | strcpy(str, "NA"); |
| 618 | ((CButton *)GetDlgItem(IDC_BARREL_7_RADIO))->SetWindowText(str); |
| 619 | |
| 620 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_0)) |
| 621 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 622 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_1)) |
| 623 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 624 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_2)) |
| 625 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 626 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_3)) |
| 627 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 628 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_4)) |
| 629 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 630 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_5)) |
| 631 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 632 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_6)) |
| 633 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 634 | ((CButton *)GetDlgItem(IDC_GP_MASK_0_7)) |
| 635 | ->EnableWindow(m_num_masks > 0 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 636 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_0)) |
| 637 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 638 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_1)) |
| 639 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 640 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_2)) |
| 641 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 642 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_3)) |
| 643 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 644 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_4)) |
| 645 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 646 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_5)) |
| 647 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 648 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_6)) |
| 649 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 650 | ((CButton *)GetDlgItem(IDC_GP_MASK_1_7)) |
| 651 | ->EnableWindow(m_num_masks > 1 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 652 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_0)) |
| 653 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 654 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_1)) |
| 655 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 656 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_2)) |
| 657 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 658 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_3)) |
| 659 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 660 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_4)) |
| 661 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 662 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_5)) |
| 663 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 664 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_6)) |
| 665 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 666 | ((CButton *)GetDlgItem(IDC_GP_MASK_2_7)) |
| 667 | ->EnableWindow(m_num_masks > 2 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 668 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_0)) |
| 669 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 670 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_1)) |
| 671 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 672 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_2)) |
| 673 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 674 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_3)) |
| 675 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 676 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_4)) |
| 677 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 678 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_5)) |
| 679 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 680 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_6)) |
| 681 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 682 | ((CButton *)GetDlgItem(IDC_GP_MASK_3_7)) |
| 683 | ->EnableWindow(m_num_masks > 3 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 684 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_0)) |
| 685 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 686 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_1)) |
| 687 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 688 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_2)) |
| 689 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 690 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_3)) |
| 691 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 692 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_4)) |
| 693 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 694 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_5)) |
| 695 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 696 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_6)) |
| 697 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 698 | ((CButton *)GetDlgItem(IDC_GP_MASK_4_7)) |
| 699 | ->EnableWindow(m_num_masks > 4 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 700 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_0)) |
| 701 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 702 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_1)) |
| 703 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 704 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_2)) |
| 705 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 706 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_3)) |
| 707 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 708 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_4)) |
| 709 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 710 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_5)) |
| 711 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 712 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_6)) |
| 713 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 714 | ((CButton *)GetDlgItem(IDC_GP_MASK_5_7)) |
| 715 | ->EnableWindow(m_num_masks > 5 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 716 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_0)) |
| 717 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 718 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_1)) |
| 719 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 720 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_2)) |
| 721 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 722 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_3)) |
| 723 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 724 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_4)) |
| 725 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 726 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_5)) |
| 727 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 728 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_6)) |
| 729 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 730 | ((CButton *)GetDlgItem(IDC_GP_MASK_6_7)) |
| 731 | ->EnableWindow(m_num_masks > 6 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 732 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_0)) |
| 733 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 734 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_1)) |
| 735 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 736 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_2)) |
| 737 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 738 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_3)) |
| 739 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 740 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_4)) |
| 741 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 742 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_5)) |
| 743 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 744 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_6)) |
| 745 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 746 | ((CButton *)GetDlgItem(IDC_GP_MASK_7_7)) |
| 747 | ->EnableWindow(m_num_masks > 7 && m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 748 | |
| 749 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_0))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 750 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_1))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 751 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_2))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 752 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_3))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 753 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_4))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 754 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_5))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 755 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_6))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 756 | ((CButton *)GetDlgItem(IDC_GP_MASK_Q_7))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 757 | |
| 758 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_0_EDIT))->EnableWindow(m_num_masks > 0); |
| 759 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_1_EDIT))->EnableWindow(m_num_masks > 1); |
| 760 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_2_EDIT))->EnableWindow(m_num_masks > 2); |
| 761 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_3_EDIT))->EnableWindow(m_num_masks > 3); |
| 762 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_4_EDIT))->EnableWindow(m_num_masks > 4); |
| 763 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_5_EDIT))->EnableWindow(m_num_masks > 5); |
| 764 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_6_EDIT))->EnableWindow(m_num_masks > 6); |
| 765 | ((CEdit *)GetDlgItem(IDC_GB_MASK_LATENCY_7_EDIT))->EnableWindow(m_num_masks > 7); |
| 766 | |
| 767 | ((CComboBox *)GetDlgItem(IDC_BARREL_0_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 768 | ((CComboBox *)GetDlgItem(IDC_BARREL_1_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 769 | ((CComboBox *)GetDlgItem(IDC_BARREL_2_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 770 | ((CComboBox *)GetDlgItem(IDC_BARREL_3_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 771 | ((CComboBox *)GetDlgItem(IDC_BARREL_4_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 772 | ((CComboBox *)GetDlgItem(IDC_BARREL_5_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 773 | ((CComboBox *)GetDlgItem(IDC_BARREL_6_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 774 | ((CComboBox *)GetDlgItem(IDC_BARREL_7_COMBO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 775 | |
| 776 | ((CButton *)GetDlgItem(IDC_BARREL_0_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 0); |
| 777 | ((CButton *)GetDlgItem(IDC_BARREL_1_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 1); |
| 778 | ((CButton *)GetDlgItem(IDC_BARREL_2_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 2); |
| 779 | ((CButton *)GetDlgItem(IDC_BARREL_3_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 3); |
| 780 | ((CButton *)GetDlgItem(IDC_BARREL_4_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 4); |
| 781 | ((CButton *)GetDlgItem(IDC_BARREL_5_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 5); |
| 782 | ((CButton *)GetDlgItem(IDC_BARREL_6_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 6); |
| 783 | ((CButton *)GetDlgItem(IDC_BARREL_7_RADIO))->EnableWindow(m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 784 | |
| 785 | // ((CButton *)GetDlgItem(IDC_GP_MASK_7_7))->EnableWindow(m_num_masks > 7 && |
| 786 | //m_obj_pm->poly_wb[m_current_wb_index].num_gps > 7); |
| 787 | } |
| 788 | |
| 789 | void RobotEditWeaponsDialog::UpdateTurretInfo() { |
| 790 | char str[200]; |
| 791 | |
| 792 | if (m_obj_pm->poly_wb[m_current_wb_index].num_turrets == 0) { |
| 793 | m_turret_sobj_text = "0"; |
| 794 | m_turret_reaction_time_text = "0"; |
| 795 | m_turret_fov_text = "0"; |
| 796 | m_turret_spr_text = "0"; |
| 797 | |
| 798 | return; |
| 799 | } |
| 800 | |
| 801 | sprintf(str, "%d", m_obj_pm->poly_wb[m_current_wb_index].turret_index[m_current_turret_index]); |
| 802 | m_turret_sobj_text = str; |
| 803 | |
| 804 | sprintf( |
| 805 | str, "%.2f", |
| 806 | m_obj_pm->submodel[m_obj_pm->poly_wb[m_current_wb_index].turret_index[m_current_turret_index]].think_interval); |
| 807 | m_turret_reaction_time_text = str; |
| 808 | |
| 809 | sprintf(str, "%.2f", |
| 810 | m_obj_pm->submodel[m_obj_pm->poly_wb[m_current_wb_index].turret_index[m_current_turret_index]].fov * 720.0); |
| 811 | m_turret_fov_text = str; |
| 812 | |
| 813 | sprintf(str, "%.2f", |
| 814 | (1.0f / m_obj_pm->submodel[m_obj_pm->poly_wb[m_current_wb_index].turret_index[m_current_turret_index]].rps)); |
| 815 | m_turret_spr_text = str; |
| 816 | } |
| 817 | |
| 818 | BOOL RobotEditWeaponsDialog::OnInitDialog() { |
| 819 | CDialog::OnInitDialog(); |
| 820 | |
| 821 | int i; |
| 822 | char str[20]; |
| 823 | |
| 824 | SendDlgItemMessage(IDC_BARREL_0_COMBO, CB_RESETCONTENT, 0, 0); |
| 825 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 826 | if (Weapons[i].used) |
| 827 | SendDlgItemMessage(IDC_BARREL_0_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 828 | } |
| 829 | SendDlgItemMessage(IDC_BARREL_0_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_0_text); |
| 830 | |
| 831 | SendDlgItemMessage(IDC_BARREL_1_COMBO, CB_RESETCONTENT, 0, 0); |
| 832 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 833 | if (Weapons[i].used) |
| 834 | SendDlgItemMessage(IDC_BARREL_1_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 835 | } |
| 836 | SendDlgItemMessage(IDC_BARREL_1_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_1_text); |
| 837 | |
| 838 | SendDlgItemMessage(IDC_BARREL_2_COMBO, CB_RESETCONTENT, 0, 0); |
| 839 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 840 | if (Weapons[i].used) |
| 841 | SendDlgItemMessage(IDC_BARREL_2_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 842 | } |
| 843 | SendDlgItemMessage(IDC_BARREL_2_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_2_text); |
| 844 | |
| 845 | SendDlgItemMessage(IDC_BARREL_3_COMBO, CB_RESETCONTENT, 0, 0); |
| 846 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 847 | if (Weapons[i].used) |
| 848 | SendDlgItemMessage(IDC_BARREL_3_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 849 | } |
| 850 | SendDlgItemMessage(IDC_BARREL_3_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_3_text); |
| 851 | |
| 852 | SendDlgItemMessage(IDC_BARREL_4_COMBO, CB_RESETCONTENT, 0, 0); |
| 853 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 854 | if (Weapons[i].used) |
| 855 | SendDlgItemMessage(IDC_BARREL_4_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 856 | } |
| 857 | SendDlgItemMessage(IDC_BARREL_4_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_4_text); |
| 858 | |
| 859 | SendDlgItemMessage(IDC_BARREL_5_COMBO, CB_RESETCONTENT, 0, 0); |
| 860 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 861 | if (Weapons[i].used) |
| 862 | SendDlgItemMessage(IDC_BARREL_5_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 863 | } |
| 864 | SendDlgItemMessage(IDC_BARREL_5_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_5_text); |
| 865 | |
| 866 | SendDlgItemMessage(IDC_BARREL_6_COMBO, CB_RESETCONTENT, 0, 0); |
| 867 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 868 | if (Weapons[i].used) |
| 869 | SendDlgItemMessage(IDC_BARREL_6_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 870 | } |
| 871 | SendDlgItemMessage(IDC_BARREL_6_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_6_text); |
| 872 | |
| 873 | SendDlgItemMessage(IDC_BARREL_7_COMBO, CB_RESETCONTENT, 0, 0); |
| 874 | for (i = 0; i < MAX_WEAPONS; i++) { |
| 875 | if (Weapons[i].used) |
| 876 | SendDlgItemMessage(IDC_BARREL_7_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name); |
| 877 | } |
| 878 | SendDlgItemMessage(IDC_BARREL_7_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_weapon_7_text); |
| 879 | |
| 880 | SendDlgItemMessage(IDC_WB_FIRE0_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 881 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 882 | if (Sounds[i].used) |
| 883 | SendDlgItemMessage(IDC_WB_FIRE0_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 884 | } |
| 885 | SendDlgItemMessage(IDC_WB_FIRE0_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_0_text); |
| 886 | |
| 887 | SendDlgItemMessage(IDC_WB_FIRE1_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 888 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 889 | if (Sounds[i].used) |
| 890 | SendDlgItemMessage(IDC_WB_FIRE1_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 891 | } |
| 892 | SendDlgItemMessage(IDC_WB_FIRE1_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_1_text); |
| 893 | |
| 894 | SendDlgItemMessage(IDC_WB_FIRE2_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 895 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 896 | if (Sounds[i].used) |
| 897 | SendDlgItemMessage(IDC_WB_FIRE2_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 898 | } |
| 899 | SendDlgItemMessage(IDC_WB_FIRE2_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_2_text); |
| 900 | |
| 901 | SendDlgItemMessage(IDC_WB_FIRE3_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 902 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 903 | if (Sounds[i].used) |
| 904 | SendDlgItemMessage(IDC_WB_FIRE3_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 905 | } |
| 906 | SendDlgItemMessage(IDC_WB_FIRE3_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_3_text); |
| 907 | |
| 908 | SendDlgItemMessage(IDC_WB_FIRE4_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 909 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 910 | if (Sounds[i].used) |
| 911 | SendDlgItemMessage(IDC_WB_FIRE4_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 912 | } |
| 913 | SendDlgItemMessage(IDC_WB_FIRE4_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_4_text); |
| 914 | |
| 915 | SendDlgItemMessage(IDC_WB_FIRE5_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 916 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 917 | if (Sounds[i].used) |
| 918 | SendDlgItemMessage(IDC_WB_FIRE5_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 919 | } |
| 920 | SendDlgItemMessage(IDC_WB_FIRE5_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_5_text); |
| 921 | |
| 922 | SendDlgItemMessage(IDC_WB_FIRE6_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 923 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 924 | if (Sounds[i].used) |
| 925 | SendDlgItemMessage(IDC_WB_FIRE6_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 926 | } |
| 927 | SendDlgItemMessage(IDC_WB_FIRE6_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_6_text); |
| 928 | |
| 929 | SendDlgItemMessage(IDC_WB_FIRE7_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0); |
| 930 | for (i = 0; i < MAX_SOUNDS; i++) { |
| 931 | if (Sounds[i].used) |
| 932 | SendDlgItemMessage(IDC_WB_FIRE7_SOUND_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Sounds[i].name); |
| 933 | } |
| 934 | SendDlgItemMessage(IDC_WB_FIRE7_SOUND_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)m_fire_sound_7_text); |
| 935 | |
| 936 | SendDlgItemMessage(IDC_CURRENT_GB_COMBO, CB_RESETCONTENT, 0, 0); |
| 937 | for (i = 0; i < m_obj_pm->num_wbs; i++) { |
| 938 | sprintf(str, "%d", i + 1); |
| 939 | SendDlgItemMessage(IDC_CURRENT_GB_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)str); |
| 940 | } |
| 941 | itoa(m_current_wb_index + 1, str, 10); |
| 942 | SendDlgItemMessage(IDC_CURRENT_GB_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)str); |
| 943 | |
| 944 | SendDlgItemMessage(IDC_CURRET_TURRET_COMBO, CB_RESETCONTENT, 0, 0); |
| 945 | for (i = 0; i < m_obj_pm->poly_wb[m_current_wb_index].num_turrets; i++) { |
| 946 | sprintf(str, "%d", i + 1); |
| 947 | SendDlgItemMessage(IDC_CURRET_TURRET_COMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)str); |
| 948 | } |
| 949 | SendDlgItemMessage(IDC_CURRET_TURRET_COMBO, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR) "1"); |
| 950 | |
| 951 | ((CButton *)GetDlgItem(IDC_BARREL_0_RADIO))->SetCheck(m_current_aiming_point == 0); |
| 952 | ((CButton *)GetDlgItem(IDC_BARREL_1_RADIO))->SetCheck(m_current_aiming_point == 1); |
| 953 | ((CButton *)GetDlgItem(IDC_BARREL_2_RADIO))->SetCheck(m_current_aiming_point == 2); |
| 954 | ((CButton *)GetDlgItem(IDC_BARREL_3_RADIO))->SetCheck(m_current_aiming_point == 3); |
| 955 | ((CButton *)GetDlgItem(IDC_BARREL_4_RADIO))->SetCheck(m_current_aiming_point == 4); |
| 956 | ((CButton *)GetDlgItem(IDC_BARREL_5_RADIO))->SetCheck(m_current_aiming_point == 5); |
| 957 | ((CButton *)GetDlgItem(IDC_BARREL_6_RADIO))->SetCheck(m_current_aiming_point == 6); |
| 958 | ((CButton *)GetDlgItem(IDC_BARREL_7_RADIO))->SetCheck(m_current_aiming_point == 7); |
| 959 | |
| 960 | ((CButton *)GetDlgItem(IDC_WB_NO_ANIM_RADIO))->SetCheck(m_anim_type == 0); |
| 961 | ((CButton *)GetDlgItem(IDC_WB_LOCAL_ANIM_RADIO))->SetCheck(m_anim_type == WBF_ANIM_LOCAL); |
| 962 | ((CButton *)GetDlgItem(IDC_WB_MODEL_ANIM_RADIO))->SetCheck(m_anim_type == WBF_ANIM_FULL); |
| 963 | |
| 964 | UpdateDialog(); |
| 965 | |
| 966 | return TRUE; // return TRUE unless you set the focus to a control |
| 967 | // EXCEPTION: OCX Property Pages should return FALSE |
| 968 | } |
| 969 | |
| 970 | void RobotEditWeaponsDialog::OnKillfocusGbNumMasksEdit() { UpdateDialog(); } |
| 971 | |
| 972 | void RobotEditWeaponsDialog::OnSelendokCurretTurretCombo() { |
| 973 | int cur; |
| 974 | char name[200]; |
| 975 | |
| 976 | if (!UpdateData(true)) |
| 977 | return; |
| 978 | |
| 979 | cur = SendDlgItemMessage(IDC_CURRET_TURRET_COMBO, CB_GETCURSEL, 0, 0); |
| 980 | SendDlgItemMessage(IDC_CURRET_TURRET_COMBO, CB_GETLBTEXT, cur, (LPARAM)(LPCTSTR)name); |
| 981 | |
| 982 | m_current_turret_combo = name; |
| 983 | |
| 984 | UpdateData(false); |
| 985 | |
| 986 | UpdateDialog(); |
| 987 | } |
| 988 | |
| 989 | void RobotEditWeaponsDialog::GetData() { |
| 990 | int i; |
| 991 | |
| 992 | m_obj_static_wb[m_current_wb_index].aiming_gp_index = m_current_aiming_point; |
| 993 | |
| 994 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_ANIM_MASKS; |
| 995 | m_obj_static_wb[m_current_wb_index].flags |= m_anim_type; |
| 996 | |
| 997 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[0] = m_mask_latency_0; |
| 998 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[1] = m_mask_latency_1; |
| 999 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[2] = m_mask_latency_2; |
| 1000 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[3] = m_mask_latency_3; |
| 1001 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[4] = m_mask_latency_4; |
| 1002 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[5] = m_mask_latency_5; |
| 1003 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[6] = m_mask_latency_6; |
| 1004 | m_obj_static_wb[m_current_wb_index].gp_fire_wait[7] = m_mask_latency_7; |
| 1005 | |
| 1006 | m_obj_static_wb[m_current_wb_index].num_masks = m_num_masks; |
| 1007 | |
| 1008 | // Clear the masks |
| 1009 | for (i = 0; i < 8; i++) |
| 1010 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[i] = 0; |
| 1011 | |
| 1012 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp77 << 7; |
| 1013 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp76 << 6; |
| 1014 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp75 << 5; |
| 1015 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp74 << 4; |
| 1016 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp73 << 3; |
| 1017 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp72 << 2; |
| 1018 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp71 << 1; |
| 1019 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[7] |= m_gp70; |
| 1020 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp67 << 7; |
| 1021 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp66 << 6; |
| 1022 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp65 << 5; |
| 1023 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp64 << 4; |
| 1024 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp63 << 3; |
| 1025 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp62 << 2; |
| 1026 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp61 << 1; |
| 1027 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[6] |= m_gp60; |
| 1028 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp57 << 7; |
| 1029 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp56 << 6; |
| 1030 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp55 << 5; |
| 1031 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp54 << 4; |
| 1032 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp53 << 3; |
| 1033 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp52 << 2; |
| 1034 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp51 << 1; |
| 1035 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[5] |= m_gp50; |
| 1036 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp47 << 7; |
| 1037 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp46 << 6; |
| 1038 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp45 << 5; |
| 1039 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp44 << 4; |
| 1040 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp43 << 3; |
| 1041 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp42 << 2; |
| 1042 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp41 << 1; |
| 1043 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[4] |= m_gp40; |
| 1044 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp37 << 7; |
| 1045 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp36 << 6; |
| 1046 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp35 << 5; |
| 1047 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp34 << 4; |
| 1048 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp33 << 3; |
| 1049 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp32 << 2; |
| 1050 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp31 << 1; |
| 1051 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[3] |= m_gp30; |
| 1052 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp27 << 7; |
| 1053 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp26 << 6; |
| 1054 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp25 << 5; |
| 1055 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp24 << 4; |
| 1056 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp23 << 3; |
| 1057 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp22 << 2; |
| 1058 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp21 << 1; |
| 1059 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[2] |= m_gp20; |
| 1060 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp17 << 7; |
| 1061 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp16 << 6; |
| 1062 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp15 << 5; |
| 1063 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp14 << 4; |
| 1064 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp13 << 3; |
| 1065 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp12 << 2; |
| 1066 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp11 << 1; |
| 1067 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[1] |= m_gp10; |
| 1068 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp07 << 7; |
| 1069 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp06 << 6; |
| 1070 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp05 << 5; |
| 1071 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp04 << 4; |
| 1072 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp03 << 3; |
| 1073 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp02 << 2; |
| 1074 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp01 << 1; |
| 1075 | m_obj_static_wb[m_current_wb_index].gp_fire_masks[0] |= m_gp00; |
| 1076 | |
| 1077 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask = 0; |
| 1078 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq7 << 7; |
| 1079 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq6 << 6; |
| 1080 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq5 << 5; |
| 1081 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq4 << 4; |
| 1082 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq3 << 3; |
| 1083 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq2 << 2; |
| 1084 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq1 << 1; |
| 1085 | m_obj_static_wb[m_current_wb_index].gp_quad_fire_mask |= m_gpq0; |
| 1086 | |
| 1087 | m_obj_static_wb[m_current_wb_index].aiming_3d_dot = cos(m_view_cone_angle * PI / (360.0)); |
| 1088 | m_obj_static_wb[m_current_wb_index].aiming_3d_dist = m_max_distance; |
| 1089 | m_obj_static_wb[m_current_wb_index].aiming_XZ_dot = cos(m_xz_plane_angle * PI / (360.0)); |
| 1090 | |
| 1091 | m_obj_static_wb[m_current_wb_index].ammo_usage = m_ammo_usage; |
| 1092 | m_obj_static_wb[m_current_wb_index].energy_usage = m_energy_usage; |
| 1093 | |
| 1094 | m_obj_static_wb[m_current_wb_index].anim_time[0] = m_fire0_cycle_time; |
| 1095 | m_obj_static_wb[m_current_wb_index].anim_time[1] = m_fire1_cycle_time; |
| 1096 | m_obj_static_wb[m_current_wb_index].anim_time[2] = m_fire2_cycle_time; |
| 1097 | m_obj_static_wb[m_current_wb_index].anim_time[3] = m_fire3_cycle_time; |
| 1098 | m_obj_static_wb[m_current_wb_index].anim_time[4] = m_fire4_cycle_time; |
| 1099 | m_obj_static_wb[m_current_wb_index].anim_time[5] = m_fire5_cycle_time; |
| 1100 | m_obj_static_wb[m_current_wb_index].anim_time[6] = m_fire6_cycle_time; |
| 1101 | m_obj_static_wb[m_current_wb_index].anim_time[7] = m_fire7_cycle_time; |
| 1102 | m_obj_static_wb[m_current_wb_index].anim_end_frame[0] = m_fire0_end_tick; |
| 1103 | m_obj_static_wb[m_current_wb_index].anim_end_frame[1] = m_fire1_end_tick; |
| 1104 | m_obj_static_wb[m_current_wb_index].anim_end_frame[2] = m_fire2_end_tick; |
| 1105 | m_obj_static_wb[m_current_wb_index].anim_end_frame[3] = m_fire3_end_tick; |
| 1106 | m_obj_static_wb[m_current_wb_index].anim_end_frame[4] = m_fire4_end_tick; |
| 1107 | m_obj_static_wb[m_current_wb_index].anim_end_frame[5] = m_fire5_end_tick; |
| 1108 | m_obj_static_wb[m_current_wb_index].anim_end_frame[6] = m_fire6_end_tick; |
| 1109 | m_obj_static_wb[m_current_wb_index].anim_end_frame[7] = m_fire7_end_tick; |
| 1110 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[0] = m_fire0_fire_tick; |
| 1111 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[1] = m_fire1_fire_tick; |
| 1112 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[2] = m_fire2_fire_tick; |
| 1113 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[3] = m_fire3_fire_tick; |
| 1114 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[4] = m_fire4_fire_tick; |
| 1115 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[5] = m_fire5_fire_tick; |
| 1116 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[6] = m_fire6_fire_tick; |
| 1117 | m_obj_static_wb[m_current_wb_index].anim_fire_frame[7] = m_fire7_fire_tick; |
| 1118 | m_obj_static_wb[m_current_wb_index].anim_start_frame[0] = m_fire0_start_tick; |
| 1119 | m_obj_static_wb[m_current_wb_index].anim_start_frame[1] = m_fire1_start_tick; |
| 1120 | m_obj_static_wb[m_current_wb_index].anim_start_frame[2] = m_fire2_start_tick; |
| 1121 | m_obj_static_wb[m_current_wb_index].anim_start_frame[3] = m_fire3_start_tick; |
| 1122 | m_obj_static_wb[m_current_wb_index].anim_start_frame[4] = m_fire4_start_tick; |
| 1123 | m_obj_static_wb[m_current_wb_index].anim_start_frame[5] = m_fire5_start_tick; |
| 1124 | m_obj_static_wb[m_current_wb_index].anim_start_frame[6] = m_fire6_start_tick; |
| 1125 | m_obj_static_wb[m_current_wb_index].anim_start_frame[7] = m_fire7_start_tick; |
| 1126 | |
| 1127 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[0] = FindWeaponName(m_weapon_0_text.GetBuffer(0)); |
| 1128 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[1] = FindWeaponName(m_weapon_1_text.GetBuffer(0)); |
| 1129 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[2] = FindWeaponName(m_weapon_2_text.GetBuffer(0)); |
| 1130 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[3] = FindWeaponName(m_weapon_3_text.GetBuffer(0)); |
| 1131 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[4] = FindWeaponName(m_weapon_4_text.GetBuffer(0)); |
| 1132 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[5] = FindWeaponName(m_weapon_5_text.GetBuffer(0)); |
| 1133 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[6] = FindWeaponName(m_weapon_6_text.GetBuffer(0)); |
| 1134 | m_obj_static_wb[m_current_wb_index].gp_weapon_index[7] = FindWeaponName(m_weapon_7_text.GetBuffer(0)); |
| 1135 | |
| 1136 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[0] = FindSoundName(m_fire_sound_0_text.GetBuffer(0)); |
| 1137 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[1] = FindSoundName(m_fire_sound_1_text.GetBuffer(0)); |
| 1138 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[2] = FindSoundName(m_fire_sound_2_text.GetBuffer(0)); |
| 1139 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[3] = FindSoundName(m_fire_sound_3_text.GetBuffer(0)); |
| 1140 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[4] = FindSoundName(m_fire_sound_4_text.GetBuffer(0)); |
| 1141 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[5] = FindSoundName(m_fire_sound_5_text.GetBuffer(0)); |
| 1142 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[6] = FindSoundName(m_fire_sound_6_text.GetBuffer(0)); |
| 1143 | m_obj_static_wb[m_current_wb_index].fm_fire_sound_index[7] = FindSoundName(m_fire_sound_7_text.GetBuffer(0)); |
| 1144 | |
| 1145 | if (m_spray_check) |
| 1146 | m_obj_static_wb[m_current_wb_index].flags |= WBF_SPRAY; |
| 1147 | else |
| 1148 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_SPRAY; |
| 1149 | |
| 1150 | if (m_guided) |
| 1151 | m_obj_static_wb[m_current_wb_index].flags |= WBF_GUIDED; |
| 1152 | else |
| 1153 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_GUIDED; |
| 1154 | |
| 1155 | if (m_user_timeout) |
| 1156 | m_obj_static_wb[m_current_wb_index].flags |= WBF_USER_TIMEOUT; |
| 1157 | else |
| 1158 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_USER_TIMEOUT; |
| 1159 | |
| 1160 | if (m_random_check) |
| 1161 | m_obj_static_wb[m_current_wb_index].flags |= WBF_RANDOM_FIRE_ORDER; |
| 1162 | else |
| 1163 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_RANDOM_FIRE_ORDER; |
| 1164 | |
| 1165 | if (m_force_fvec_check) |
| 1166 | m_obj_static_wb[m_current_wb_index].flags |= WBF_FIRE_FVEC; |
| 1167 | else |
| 1168 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_FIRE_FVEC; |
| 1169 | |
| 1170 | if (m_force_target_check) |
| 1171 | m_obj_static_wb[m_current_wb_index].flags |= WBF_FIRE_TARGET; |
| 1172 | else |
| 1173 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_FIRE_TARGET; |
| 1174 | |
| 1175 | if (m_aim_fvec_check) |
| 1176 | m_obj_static_wb[m_current_wb_index].flags |= WBF_AIM_FVEC; |
| 1177 | else |
| 1178 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_AIM_FVEC; |
| 1179 | |
| 1180 | if (m_onoff_check) |
| 1181 | m_obj_static_wb[m_current_wb_index].flags |= WBF_ON_OFF; |
| 1182 | else |
| 1183 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_ON_OFF; |
| 1184 | |
| 1185 | if (m_custom_view_cone_check) |
| 1186 | m_obj_static_wb[m_current_wb_index].flags |= WBF_USE_CUSTOM_FOV; |
| 1187 | else |
| 1188 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_USE_CUSTOM_FOV; |
| 1189 | |
| 1190 | if (m_custom_max_dist) |
| 1191 | m_obj_static_wb[m_current_wb_index].flags |= WBF_USE_CUSTOM_MAX_DIST; |
| 1192 | else |
| 1193 | m_obj_static_wb[m_current_wb_index].flags &= ~WBF_USE_CUSTOM_MAX_DIST; |
| 1194 | } |
| 1195 | |
| 1196 | void RobotEditWeaponsDialog::OnSelendokCurrentGbCombo() { |
| 1197 | int cur; |
| 1198 | char name[200]; |
| 1199 | int f_save_info; |
| 1200 | |
| 1201 | if (!UpdateData(true)) |
| 1202 | return; |
| 1203 | |
| 1204 | cur = SendDlgItemMessage(IDC_CURRENT_GB_COMBO, CB_GETCURSEL, 0, 0); |
| 1205 | SendDlgItemMessage(IDC_CURRENT_GB_COMBO, CB_GETLBTEXT, cur, (LPARAM)(LPCTSTR)name); |
| 1206 | |
| 1207 | m_current_gb = name; |
| 1208 | |
| 1209 | UpdateData(false); |
| 1210 | |
| 1211 | UpdateDialog(); |
| 1212 | |
| 1213 | f_save_info = OutrageMessageBox( |
| 1214 | MBOX_YESNO, |
| 1215 | "Would you like to save changes to weapon battery %d\nNote: Changes will be lost if you do not save them now.", |
| 1216 | m_current_wb_index + 1); |
| 1217 | if (f_save_info == IDYES) { |
| 1218 | GetData(); |
| 1219 | } |
| 1220 | |
| 1221 | m_current_wb_index = atoi(m_current_gb) - 1; |
| 1222 | ASSERT(m_current_wb_index >= 0 && m_current_wb_index < m_obj_pm->num_wbs); |
| 1223 | |
| 1224 | NewWBSelected(); |
| 1225 | UpdateData(false); |
| 1226 | UpdateDialog(); |
| 1227 | } |