MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateDialog

Method UpdateDialog

editor/DoorwayDialog.cpp:268–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266char last_name[OBJ_NAME_LEN + 1];
267
268void CDoorwayDialog::UpdateDialog() {
269 if (!m_Active)
270 return;
271
272 if (Num_doors <= 0)
273 return;
274 if (Doors[D3EditState.current_door].used == 0)
275 D3EditState.current_door = GetNextDoor(D3EditState.current_door);
276
277 int door_handle = D3EditState.current_door;
278
279 CEdit *ebox = (CEdit *)GetDlgItem(IDC_DOORWAYSELEDIT);
280 ebox->SetWindowText(Doors[door_handle].name);
281 DrawDoorwayDoorPic();
282
283 ((CButton *)GetDlgItem(IDC_DOORWAY_ATTACHDOOR))->EnableWindow(Placed_door != -1);
284
285 ebox = (CEdit *)GetDlgItem(IDC_DOORWAY_ID);
286
287 if (Cur_object_index == -1 || Objects[Cur_object_index].type != OBJ_DOOR) {
288 ebox->SetWindowText("No doorway selected");
289 Current_door_room = -1;
290 EnableCurrentItems(0);
291 } else {
292 char str[250];
293 object *objp = &Objects[Cur_object_index];
294
295 EnableCurrentItems(1);
296
297 Current_door_room = objp->roomnum;
298
299 ASSERT(Rooms[Current_door_room].flags & RF_DOOR);
300
301 strcpy(last_name, Objects[Cur_object_index].name ? Objects[Cur_object_index].name : "<no name>");
302 sprintf(str, "Door: %s ", last_name);
303 ebox->SetWindowText(str);
304
305 doorway *dw = Rooms[Current_door_room].doorway_data;
306
307 sprintf(str, "%.2f", dw->position);
308 ebox = (CEdit *)GetDlgItem(IDC_DOORWAY_POS_EDIT);
309 ebox->SetWindowText(str);
310
311 // Update key check boxes
312 CButton *bbox = (CButton *)GetDlgItem(IDC_DOORWAY_LOCKED);
313 bbox->SetCheck(dw->flags & DF_LOCKED);
314
315 bbox = (CButton *)GetDlgItem(IDC_DOORWAY_AUTO);
316 bbox->SetCheck(dw->flags & DF_AUTO);
317
318 bbox = (CButton *)GetDlgItem(IDC_DOORWAY_GB_IGNORE_LOCKED);
319 bbox->SetCheck(dw->flags & DF_GB_IGNORE_LOCKED);
320
321 bbox = (CButton *)GetDlgItem(IDC_KEY1_CHECK);
322 bbox->SetCheck(dw->keys_needed & KEY_FLAG(1));
323
324 bbox = (CButton *)GetDlgItem(IDC_KEY2_CHECK);
325 bbox->SetCheck(dw->keys_needed & KEY_FLAG(2));

Callers

nothing calls this directly

Calls 2

GetNextDoorFunction · 0.85
SetCheckMethod · 0.80

Tested by

no test coverage detected