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

Function InputDoorName

editor/WorldObjectsDoorDialog.cpp:636–657  ·  view source on GitHub ↗

Gets a name from the user, making sure it's unique Returns true if got new name, false if cancelled. the data in buf not changed if cancel is pressed

Source from the content-addressed store, hash-verified

634// Returns true if got new name, false if cancelled.
635// the data in buf not changed if cancel is pressed
636bool InputDoorName(char *buf, int len, char *title, char *prompt, CWnd *wnd) {
637 char *tempbuf = (char *)mem_malloc(len);
638
639 strcpy(tempbuf, buf);
640
641try_again:
642
643 if (!InputString(tempbuf, len, title, prompt, wnd)) {
644 mem_free(tempbuf);
645 return 0;
646 }
647
648 if (FindDoorName(tempbuf) != -1) {
649 OutrageMessageBox("The name you specified is already in use. Enter another name.");
650 goto try_again;
651 }
652
653 strcpy(buf, tempbuf);
654 mem_free(tempbuf);
655
656 return 1;
657}
658
659void CWorldObjectsDoorDialog::OnDoorChangeName() {
660 int n = D3EditState.current_door;

Callers 1

OnDoorChangeNameMethod · 0.85

Calls 3

InputStringFunction · 0.85
FindDoorNameFunction · 0.85
OutrageMessageBoxFunction · 0.85

Tested by

no test coverage detected