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

Method OnFileLeaveEditor

editor/MainFrm.cpp:1938–1992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1936 m_ViewActivated = TRUE;
1937}
1938
1939void CMainFrame::OnFileLeaveEditor() {
1940 // Returns true if there are out of data files
1941 int count = AreScriptsOutofDate();
1942 if (count > 0) {
1943 if (OutrageMessageBox(MBOX_YESNO, "There were %d scripts that couldn't be compiled, continue?", count) != IDYES)
1944 return;
1945 }
1946
1947 bool keypad_was_visible = D3EditState.keypad_visible;
1948 DWORD cbar_was_visible = (m_wndToolBar.GetStyle() & WS_VISIBLE);
1949 DWORD status_was_visible = (m_wndStatusBar.GetStyle() & WS_VISIBLE);
1950
1951 // Shutdown view system
1952 m_ViewActivated = FALSE;
1953 ((CEditorView *)GetActiveView())->DeactivateView();
1954 if (m_FloatingKeypadDialog)
1955 m_FloatingKeypadDialog->Deactivate();
1956 CKeypadDialog::Deactivate();
1957 delete Desktop_surf;
1958
1959 // hide keypad if it's visible
1960 if (keypad_was_visible)
1961 OnViewKeypadToggle();
1962 if (cbar_was_visible)
1963 ShowControlBar(&m_wndToolBar, FALSE, FALSE);
1964 if (status_was_visible)
1965 ShowControlBar(&m_wndStatusBar, FALSE, FALSE);
1966
1967 SetFunctionMode(MENU_MODE);
1968
1969 // if we have selected the windowed toggle, assert this.
1970 if (D3EditState.game_render_mode == GM_WINDOWED)
1971 PROGRAM(windowed) = 1;
1972 else
1973 PROGRAM(windowed) = 0;
1974
1975 RunGameFromEditor();
1976 PROGRAM(windowed) = 1;
1977
1978 // hide keypad if it's visible
1979 if (status_was_visible)
1980 ShowControlBar(&m_wndStatusBar, TRUE, FALSE);
1981 if (cbar_was_visible)
1982 ShowControlBar(&m_wndToolBar, TRUE, FALSE);
1983 if (keypad_was_visible)
1984 OnViewKeypadToggle();
1985
1986 // Restore view system
1987 Desktop_surf = new grSurface(0, 0, 0, SURFTYPE_VIDEOSCREEN, 0);
1988 if (m_FloatingKeypadDialog)
1989 m_FloatingKeypadDialog->Activate();
1990 CKeypadDialog::Activate();
1991 ((CEditorView *)GetActiveView())->ActivateView();
1992 m_ViewActivated = TRUE;
1993}
1994
1995void CMainFrame::OnFilePreferences() {

Callers

nothing calls this directly

Calls 8

AreScriptsOutofDateFunction · 0.85
OutrageMessageBoxFunction · 0.85
SetFunctionModeFunction · 0.85
RunGameFromEditorFunction · 0.85
DeactivateViewMethod · 0.80
ActivateViewMethod · 0.80
DeactivateMethod · 0.45
ActivateMethod · 0.45

Tested by

no test coverage detected