I seem to have the basic structure for it worked out. I just need to add the graphical elements/positions to the .rc file to actually test it out with and then I'll have a .patch to post (assuming that it works)
Edit: Okay, so I have what I think is a rudimentary adjustment to make it all happen. I'll put the code/patch up first for critical review, then based on feedback I'll link some test builds based on that.
Index: debriefingeditordlg.cpp
===================================================================
--- debriefingeditordlg.cpp (revision 7857)
+++ debriefingeditordlg.cpp (working copy)
@@ -14,7 +14,10 @@
#include "DebriefingEditorDlg.h"
#include "FREDDoc.h"
#include "mission/missionbriefcommon.h"
+#include "mission/missionparse.h"
+#include "globalincs/linklist.h"
#include "parse/sexp.h"
+#include "gamesnd/eventmusic.h"
#include "cfile/cfile.h"
#include "sound/audiostr.h"
#include "localization/localize.h"
@@ -35,6 +38,9 @@
m_voice = _T("");
m_stage_title = _T("");
m_rec_text = _T("");
+ m_debriefPass_music = -1;
+ m_debriefAvg_music = -1;
+ m_debriefFail_music = -1;
m_current_debriefing = -1;
//}}AFX_DATA_INIT
@@ -54,6 +60,9 @@
DDX_Text(pDX, IDC_VOICE, m_voice);
DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
DDX_Text(pDX, IDC_REC_TEXT, m_rec_text);
+ DDX_CBIndex(pDX, IDC_SUCCESSFUL_MISSION_TRACK, m_debriefPass_music);
+ DDX_CBIndex(pDX, IDC_DEBRIEFING_TRACK, m_debriefAvg_music);
+ DDX_CBIndex(pDX, IDC_FAILED_MISSION_TRACK, m_debriefFail_music);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_text, MAX_BRIEF_LEN - 1);
@@ -115,12 +124,32 @@
CDialog::OnInitDialog();
m_play_bm.LoadBitmap(IDB_PLAY);
((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
+ CComboBox *box;
+ box = (CComboBox *) GetDlgItem(IDC_ICON_IMAGE);
m_current_debriefing = 0;
UpdateData(FALSE);
+ m_debriefPass_music = Mission_music[SCORE_DEBRIEF_SUCCESS] + 1;
+ m_debriefAvg_music = Mission_music[SCORE_DEBRIEF_AVERAGE] + 1;
+ m_debriefFail_music = Mission_music[SCORE_DEBRIEF_FAIL] + 1;
Debriefing = &Debriefings[m_current_debriefing];
+ box = (CComboBox *) GetDlgItem(IDC_SUCCESSFUL_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_DEBRIEFING_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
+ box = (CComboBox *) GetDlgItem(IDC_FAILED_MISSION_TRACK);
+ box->AddString("None");
+ for (i=0; i<Num_music_files; i++)
+ box->AddString(Spooled_music[i].name);
+
m_tree.link_modified(&modified); // provide way to indicate trees are modified in dialog
n = m_tree.select_sexp_node = select_sexp_node;
select_sexp_node = -1;
@@ -152,6 +181,9 @@
int enable, save_debriefing;
debrief_stage *ptr;
+ Mission_music[SCORE_DEBRIEF_SUCCESS] = m_debriefPass_music - 1;
+ Mission_music[SCORE_DEBRIEF_AVERAGE] = m_debriefAvg_music - 1;
+ Mission_music[SCORE_DEBRIEF_FAIL] = m_debriefFail_music - 1;
save_debriefing = m_current_debriefing;
if (update)
Index: debriefingeditordlg.h
===================================================================
--- debriefingeditordlg.h (revision 7857)
+++ debriefingeditordlg.h (working copy)
@@ -8,6 +8,7 @@
*/
+#include "mission/missionbriefcommon.h"
/////////////////////////////////////////////////////////////////////////////
// debriefing_editor_dlg dialog
@@ -29,6 +30,9 @@
CString m_voice;
CString m_stage_title;
CString m_rec_text;
+ int m_debriefPass_music;
+ int m_debriefAvg_music;
+ int m_debriefFail_music;
int m_current_debriefing;
//}}AFX_DATA
Index: fred.rc
===================================================================
--- fred.rc (revision 7857)
+++ fred.rc (working copy)
@@ -1646,7 +1646,7 @@
CONTROL "order 10",IDC_CHECK10,"Button",BS_3STATE | WS_TABSTOP,7,183,105,10
END
-IDD_DEBRIEFING_EDITOR DIALOGEX 0, 0, 322, 172
+IDD_DEBRIEFING_EDITOR DIALOGEX 0, 0, 322, 225
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Debriefing Editor"
MENU IDR_PLAYER_EDIT_MENU
@@ -1668,6 +1668,13 @@
LTEXT "Stage 1 of 9",IDC_STAGE_TITLE,7,10,53,8
LTEXT "Usage Formula",IDC_STATIC,7,43,48,8
LTEXT "Recommendation Text",IDC_STATIC,135,96,72,8
+ GROUPBOX "Debriefing Music",IDC_STATIC,7,175,260,45
+ LTEXT "Success Music",IDC_STATIC,15,187,53,8
+ COMBOBOX IDC_SUCCESSFUL_MISSION_TRACK,12,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Average Music",IDC_STATIC,100,187,53,8
+ COMBOBOX IDC_DEBRIEFING_TRACK,97,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Failure Music",IDC_STATIC,185,187,53,8
+ COMBOBOX IDC_FAILED_MISSION_TRACK,182,195,80,180,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_ADJUST_GRID DIALOG 0, 0, 153, 94
[attachment deleted by ninja]