Skip to content

Commit

Permalink
properly handle right-click delete
Browse files Browse the repository at this point in the history
  • Loading branch information
MjnMixael committed Oct 19, 2023
1 parent 87c8828 commit 44e875c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fred2/missioncutscenesdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CMissionCutscenesDlg::CMissionCutscenesDlg(CWnd* pParent /*=NULL*/)
m_name = _T("");
m_desc = _T("");
//}}AFX_DATA_INIT
m_cutscenes_tree.m_mode = MODE_GOALS; // We don't need to perform actions here, so use the same method as Goals
m_cutscenes_tree.m_mode = MODE_CUTSCENES; // We don't need to perform actions here, so use the same method as Goals
m_cutscenes_tree.link_modified(&modified);
modified = 0;
select_sexp_node = -1;
Expand Down Expand Up @@ -226,7 +226,7 @@ void CMissionCutscenesDlg::update_cur_cutscene()
// handler for context menu (i.e. a right mouse button click).
void CMissionCutscenesDlg::OnRclickCutscenesTree(NMHDR* pNMHDR, LRESULT* pResult)
{
m_cutscenes_tree.right_clicked(MODE_GOALS); // We don't need to perform actions here, so use the same method as Goals
m_cutscenes_tree.right_clicked(MODE_CUTSCENES); // We don't need to perform actions here, so use the same method as Goals
*pResult = 0;
}

Expand Down
4 changes: 4 additions & 0 deletions fred2/sexp_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,10 @@ void sexp_tree::NodeDelete()
Assert(Goal_editor_dlg);
theNode = Goal_editor_dlg->handler(ROOT_DELETED, item_index);

}else if (m_mode == MODE_CUTSCENES) {
Assert(Cutscene_editor_dlg);
theNode = Cutscene_editor_dlg->handler(ROOT_DELETED, item_index);

} else if (m_mode == MODE_EVENTS) {
Assert(Event_editor_dlg);
theNode = Event_editor_dlg->handler(ROOT_DELETED, item_index);
Expand Down
1 change: 1 addition & 0 deletions fred2/sexp_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#define MODE_GOALS (1 | ST_LABELED_ROOT | ST_ROOT_DELETABLE)
#define MODE_EVENTS (2 | ST_LABELED_ROOT | ST_ROOT_DELETABLE | ST_ROOT_EDITABLE)
#define MODE_CAMPAIGN (3 | ST_LABELED_ROOT | ST_ROOT_DELETABLE)
#define MODE_CUTSCENES (4 | ST_LABELED_ROOT | ST_ROOT_DELETABLE)

// various tree operations notification codes (to be handled by derived class)
#define ROOT_DELETED 1
Expand Down

0 comments on commit 44e875c

Please sign in to comment.