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

Method OnObjpadNextobj

editor/ObjectDialog.cpp:804–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804void CObjectDialog::OnObjpadNextobj() {
805 int next;
806
807 // If on the terrain, advance to the next object
808 if (Editor_view_mode == VM_TERRAIN && OBJECT_OUTSIDE(&Objects[Cur_object_index])) {
809 next = -1;
810 int done = 0;
811 for (int i = Cur_object_index + 1; i <= Highest_object_index && !done; i++) {
812 object *obj = &Objects[i];
813
814 if (obj->type != OBJ_NONE && OBJECT_OUTSIDE(obj) && obj->type != OBJ_ROOM) {
815 next = i;
816 done = 1;
817 }
818 }
819
820 if (!done) {
821 // Start counting from zero
822 for (int i = 0; i <= Cur_object_index && !done; i++) {
823 object *obj = &Objects[i];
824
825 if (obj->type != OBJ_NONE && OBJECT_OUTSIDE(obj) && obj->type != OBJ_ROOM) {
826 next = i;
827 done = 1;
828 }
829 }
830
831 if (next == -1) {
832 EditorStatus("There are no other objects on the terrain");
833 return;
834 }
835 }
836
837 SelectObject(next);
838 return;
839 }
840
841 if (Objects[Cur_object_index].roomnum != ROOMNUM(Curroomp)) {
842 next = Curroomp->objects;
843 if (next == -1) {
844 EditorStatus("There are no objects in the current room");
845 return;
846 }
847 } else {
848 next = Objects[Cur_object_index].next;
849 if (next == -1) {
850 next = Curroomp->objects;
851 if (next == Cur_object_index) {
852 EditorStatus("There are no other objects in this room");
853 return;
854 }
855 }
856 }
857
858 SelectObject(next);
859}
860
861void CObjectDialog::OnSetfocusComboObjID() { InitObjIDComboBox((CComboBox *)GetDlgItem(IDC_COMBO_OBJID)); }

Callers

nothing calls this directly

Calls 2

EditorStatusFunction · 0.85
SelectObjectFunction · 0.85

Tested by

no test coverage detected