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

Method ResetNodesForComboBox

editor/PathPadDialog.cpp:806–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806void CPathPadDialog::ResetNodesForComboBox(int handle, char selection_type) {
807 char message[25];
808 SendDlgItemMessage(handle, CB_RESETCONTENT, 0, 0);
809 bool f_add = false;
810
811 int num_next_rooms = 0;
812 int next_rooms[1000];
813
814 if (Viewer_object->roomnum >= 0 && Viewer_object->roomnum <= Highest_room_index &&
815 Rooms[Viewer_object->roomnum].used) {
816 if (selection_type == EBVIEW_ROOM || selection_type == EBVIEW_ROOM_AND_NEXT_ROOMS) {
817 for (int i = 0; i < Rooms[Viewer_object->roomnum].bn_info.num_nodes; i++) {
818 f_add = true;
819
820 sprintf(message, "Room %d, Node %d", Viewer_object->roomnum, i + 1);
821 SendDlgItemMessage(handle, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)message);
822 }
823
824 if (selection_type == EBVIEW_ROOM_AND_NEXT_ROOMS) {
825 int i;
826 int j;
827 int k;
828
829 for (i = 0; i < Rooms[Viewer_object->roomnum].num_portals; i++) {
830 bool f_found = false;
831
832 for (j = 0; j < num_next_rooms; j++) {
833 if (next_rooms[j] == Rooms[Viewer_object->roomnum].portals[i].croom) {
834 f_found = true;
835 break;
836 }
837 }
838
839 if (!f_found && Rooms[Viewer_object->roomnum].portals[i].croom >= 0 &&
840 !(Rooms[Rooms[Viewer_object->roomnum].portals[i].croom].flags & RF_EXTERNAL)) {
841 for (k = 0; k < Rooms[Rooms[Viewer_object->roomnum].portals[i].croom].bn_info.num_nodes; k++) {
842 sprintf(message, "Room %d, Node %d", Rooms[Viewer_object->roomnum].portals[i].croom, k + 1);
843 SendDlgItemMessage(handle, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)message);
844 }
845 }
846 }
847 }
848
849 if (f_add) {
850 sprintf(message, "Room %d, Node %d", Viewer_object->roomnum, 0 + 1);
851 SendDlgItemMessage(handle, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)message);
852 } else {
853 strcpy(message, "No Nodes in room");
854 SendDlgItemMessage(handle, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)message);
855 }
856 }
857 } else if (ROOMNUM_OUTSIDE(Viewer_object->roomnum)) {
858 if (selection_type == EBVIEW_ROOM || selection_type == EBVIEW_ROOM_AND_NEXT_ROOMS) {
859 int room = BOA_INDEX(Viewer_object->roomnum);
860 int tr = room - Highest_room_index - 1;
861 bn_list *bnlist = BNode_GetBNListPtr(Viewer_object->roomnum);
862
863 for (int i = 0; i < bnlist->num_nodes; i++) {

Callers

nothing calls this directly

Calls 1

BNode_GetBNListPtrFunction · 0.85

Tested by

no test coverage detected