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

Method FormatParameterValueText

editor/DallasMainDlg.cpp:2343–2567  ·  view source on GitHub ↗

Formats the text for a Parameter Value according to the given node data

Source from the content-addressed store, hash-verified

2341
2342// Formats the text for a Parameter Value according to the given node data
2343void CDallasMainDlg::FormatParameterValueText(CString &text, tTreeNodeData *data) {
2344 object *objp;
2345 char *temp_str;
2346 char temp_name[_MAX_PATH + 1];
2347
2348 // Make sure given data is valid
2349 if (data == NULL) {
2350 text = "";
2351 return;
2352 }
2353
2354 // Make sure given data node is a parameter node
2355 if (data->type != PARAMETER_NODE) {
2356 text = "<Not a Parameter>";
2357 return;
2358 }
2359
2360 // Format the text according to the parameter type and value data
2361 switch (data->ID) {
2362 case DOOR_PARAMETER_TYPE:
2363 if (data->subID == USE_ME_HANDLE) {
2364 text.Format("OWNER");
2365 break;
2366 }
2367 if (data->int_val == OBJECT_HANDLE_NONE) {
2368 text.Format("%s", NONE_STRING);
2369 break;
2370 }
2371 objp = ObjGet(data->int_val);
2372 if (objp == NULL || objp->type == OBJ_NONE || objp->name == NULL)
2373 text.Format("*DOOR_ERROR*");
2374 else
2375 text.Format("%s", objp->name);
2376 break;
2377 case OBJECT_PARAMETER_TYPE:
2378 if (data->subID == USE_IT_HANDLE) {
2379 text.Format("IT");
2380 break;
2381 }
2382 if (data->subID == USE_ME_HANDLE) {
2383 text.Format("OWNER");
2384 break;
2385 }
2386 if (data->int_val == OBJECT_HANDLE_NONE) {
2387 text.Format("%s", NONE_STRING);
2388 break;
2389 }
2390 objp = ObjGet(data->int_val);
2391 if (objp == NULL || objp->type == OBJ_NONE || objp->name == NULL)
2392 text.Format("*OBJECT_ERROR*");
2393 else
2394 text.Format("%s", objp->name);
2395 break;
2396 case ROOM_PARAMETER_TYPE:
2397 if (data->int_val == NOT_SPECIFIED_TYPE) {
2398 text.Format("%s", NOT_SPECIFIED_STRING);
2399 break;
2400 }

Callers

nothing calls this directly

Calls 4

ObjGetFunction · 0.85
MatcenValidFunction · 0.85
GoalGetNameMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected