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

Function GetCurrentIndex

editor/ObjectDialog.cpp:374–404  ·  view source on GitHub ↗

Returns the current index of the given type

Source from the content-addressed store, hash-verified

372
373// Returns the current index of the given type
374int GetCurrentIndex() {
375 int type = D3EditState.current_obj_type;
376 int current;
377
378 switch (type) {
379 case OBJ_ROBOT:
380 current = D3EditState.current_robot;
381 break;
382 case OBJ_POWERUP:
383 current = D3EditState.current_powerup;
384 break;
385 case OBJ_CLUTTER:
386 current = D3EditState.current_clutter;
387 break;
388 case OBJ_BUILDING:
389 current = D3EditState.current_building;
390 break;
391 case OBJ_PLAYER:
392 return current_player;
393 break;
394 default:
395 Int3();
396 }
397
398 if (Object_info[current].type != type) { // current is of wrong type
399 current = GetObjectID(type); //...so get a new current
400 SetCurrentIndex(current);
401 }
402
403 return current;
404}
405
406/////////////////////////////////////////////////////////////////////////////
407// CObjectDialog message handlers

Callers 6

InitObjIDComboBoxMethod · 0.85
OnInitDialogMethod · 0.85
OnPaintMethod · 0.85
DrawPictureMethod · 0.85
OnObjectPlaceObjectMethod · 0.85

Calls 2

SetCurrentIndexFunction · 0.85
GetObjectIDFunction · 0.50

Tested by

no test coverage detected