Skip to content

Commit 7c5371a

Browse files
authored
Merge pull request #3624 from Goober5000/fred2_cancel_confirm
confirm cancel in Event Editor
2 parents 99972a1 + af8422c commit 7c5371a

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

fred2/eventeditor.cpp

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -857,28 +857,14 @@ void event_editor::OnCancel()
857857
{
858858
}
859859

860-
// this is called the clicking the ID_CANCEL button
860+
// this is called when you click the ID_CANCEL button
861861
void event_editor::OnButtonCancel()
862862
{
863863
audiostream_close_file(m_wave_id, 0);
864864
m_wave_id = -1;
865865

866-
event_annotation_prune();
867-
868-
theApp.record_window_data(&Events_wnd_data, this);
869-
delete Event_editor_dlg;
870-
Event_editor_dlg = NULL;
871-
}
872-
873-
void event_editor::OnClose()
874-
{
875-
int z;
876-
877-
audiostream_close_file(m_wave_id, 0);
878-
m_wave_id = -1;
879-
880866
if (query_modified()) {
881-
z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
867+
int z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
882868
if (z == IDCANCEL){
883869
return;
884870
}
@@ -890,12 +876,17 @@ void event_editor::OnClose()
890876
}
891877

892878
event_annotation_prune();
893-
879+
894880
theApp.record_window_data(&Events_wnd_data, this);
895881
delete Event_editor_dlg;
896882
Event_editor_dlg = NULL;
897883
}
898884

885+
void event_editor::OnClose()
886+
{
887+
OnButtonCancel();
888+
}
889+
899890
void event_editor::insert_handler(int old, int node)
900891
{
901892
int i;

0 commit comments

Comments
 (0)