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

Method OnPathpadAddPath

editor/PathPadDialog.cpp:146–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void CPathPadDialog::OnPathpadAddPath() {
147
148 int curnode;
149 char *namestr;
150 int pathnum;
151 int dup_test;
152
153 pathnum = AllocGamePath();
154 if (pathnum < 0) {
155 return;
156 }
157
158 CEditLineDialog dlg("Enter path name", this);
159 int ret = dlg.DoModal();
160
161 if (ret == IDCANCEL) {
162 FreeGamePath(pathnum);
163 return;
164 }
165
166 namestr = (char *)dlg.GetText();
167 dup_test = FindGamePathName(namestr);
168 if (dup_test != -1) {
169 OutrageMessageBox("PATH NOT CREATED: A path named %s already exists.", namestr);
170 FreeGamePath(pathnum);
171 return;
172 }
173 strcpy(GamePaths[pathnum].name, namestr);
174
175 curnode = InsertNodeIntoPath(pathnum, -1, 0);
176 if (curnode < 0)
177 return;
178
179 D3EditState.current_path = pathnum;
180 D3EditState.current_node = curnode;
181 World_changed = 1;
182 UpdateDialog();
183}
184
185void CPathPadDialog::OnPathpadInsertNode() {
186 int curpath = D3EditState.current_path;

Callers

nothing calls this directly

Calls 7

AllocGamePathFunction · 0.85
FreeGamePathFunction · 0.85
FindGamePathNameFunction · 0.85
OutrageMessageBoxFunction · 0.85
InsertNodeIntoPathFunction · 0.85
DoModalMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected