| 206 | #define NULL_NAME "<none>" |
| 207 | |
| 208 | void CWorldObjectsGenericDialog::UpdateDialog() { |
| 209 | CEdit *ebox; |
| 210 | CButton *bbox; |
| 211 | int first, n; |
| 212 | char txt[100]; |
| 213 | int i; |
| 214 | |
| 215 | if (m_current == -1) { |
| 216 | // ebox=(CEdit *) GetDlgItem (IDC_GENERIC_NAME_EDIT); |
| 217 | // ebox->SetWindowText ("NONE"); |
| 218 | EnableDisableAll(0); |
| 219 | |
| 220 | // Show paste button if you have the network, and there's an object in the copy buffer |
| 221 | ((CButton *)GetDlgItem(IDC_GENERIC_PASTE))->EnableWindow(Network_up && (Copy_object.type != OBJ_NONE)); |
| 222 | |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | EnableDisableAll(1); |
| 227 | |
| 228 | ebox = (CEdit *)GetDlgItem(IDC_GENERIC_MODEL_NAME_EDIT); |
| 229 | |
| 230 | PageInPolymodel(Object_info[m_current].render_handle); |
| 231 | |
| 232 | if (m_lod == 0) |
| 233 | ebox->SetWindowText(Poly_models[Object_info[m_current].render_handle].name); |
| 234 | else if (m_lod == 1) { |
| 235 | if (Object_info[m_current].med_render_handle == -1) |
| 236 | ebox->SetWindowText("No model defined"); |
| 237 | else |
| 238 | ebox->SetWindowText(Poly_models[Object_info[m_current].med_render_handle].name); |
| 239 | } else { |
| 240 | if (Object_info[m_current].lo_render_handle == -1) |
| 241 | ebox->SetWindowText("No model defined"); |
| 242 | else |
| 243 | ebox->SetWindowText(Poly_models[Object_info[m_current].lo_render_handle].name); |
| 244 | } |
| 245 | |
| 246 | // Do LOD distance edit box |
| 247 | ebox = (CEdit *)GetDlgItem(IDC_LOD_DISTANCE_EDIT); |
| 248 | |
| 249 | if (m_lod == 0) |
| 250 | ebox->SetWindowText("0"); |
| 251 | else if (m_lod == 1) { |
| 252 | sprintf(txt, "%f", Object_info[m_current].med_lod_distance); |
| 253 | ebox->SetWindowText(txt); |
| 254 | } else { |
| 255 | sprintf(txt, "%f", Object_info[m_current].lo_lod_distance); |
| 256 | ebox->SetWindowText(txt); |
| 257 | } |
| 258 | |
| 259 | int poly_handle; |
| 260 | if (m_lod == 0) |
| 261 | poly_handle = Object_info[m_current].render_handle; |
| 262 | else if (m_lod == 1) |
| 263 | poly_handle = Object_info[m_current].med_render_handle; |
| 264 | else |
| 265 | poly_handle = Object_info[m_current].lo_render_handle; |
nothing calls this directly
no test coverage detected