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

Method OnMatMoveViewerButton

editor/matcenkeypad.cpp:936–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

934}
935
936void matcenkeypad::OnMatMoveViewerButton() {
937 char a_type = Matcen[m_matcen_id]->GetAttachType();
938 int attach = Matcen[m_matcen_id]->GetAttach();
939 vector c_pnt;
940
941 MakeBOA();
942
943 if (a_type == MT_OBJECT && ObjGet(attach) && Matcen[m_matcen_id]->GetCreatePnt(&c_pnt)) {
944 ObjSetPos(Viewer_object, &c_pnt, Objects[attach].roomnum, NULL, false);
945 } else if (a_type == MT_ROOM && attach >= 0 && attach <= Highest_room_index && Rooms[attach].used &&
946 Matcen[m_matcen_id]->GetCreatePnt(&c_pnt)) {
947 int roomnum;
948
949 if (Rooms[attach].flags & RF_EXTERNAL) {
950 roomnum = GetTerrainRoomFromPos(&c_pnt);
951 } else {
952 roomnum = attach;
953 }
954
955 ObjSetPos(Viewer_object, &c_pnt, roomnum, NULL, false);
956 Viewer_moved = 1;
957 } else {
958 OutrageMessageBox(MBOX_OK,
959 "Cannot move viewer: This Matcen is either unassigned or linked to an invalid room/object.");
960 }
961
962 UpdateDialog();
963}
964
965void matcenkeypad::OnMatPasteObjrefButton() {
966

Callers

nothing calls this directly

Calls 8

MakeBOAFunction · 0.85
ObjGetFunction · 0.85
ObjSetPosFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
OutrageMessageBoxFunction · 0.85
GetAttachTypeMethod · 0.80
GetAttachMethod · 0.80
GetCreatePntMethod · 0.80

Tested by

no test coverage detected