29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/rc/AFEditor_resource.h"
41 #ifdef ID_DEBUG_MEMORY
49 #define AFTAB_VIEW 0x01
50 #define AFTAB_PROPERTIES 0x02
51 #define AFTAB_BODIES 0x03
52 #define AFTAB_CONSTRAINTS 0x04
55 {
IDC_COMBO_AF,
"select an articulated figure for editing" },
59 {
IDC_BUTTON_AF_TPOSE,
"set ingame entity using the selected articulated figure back into T-Pose" },
62 { IDCANCEL,
"cancel all changes to all articulated figures" },
99 CDialog::DoDataExchange(pDX);
119 if ( i !=
AFList.GetCurSel() ) {
178 for ( i = 0; i <
c; i++ ) {
190 item.mask = TCIF_PARAM;
193 wndTabs->SetItem( tab, &item );
203 for (
int i = 0;
i <
c;
i++ ) {
205 item.mask = TCIF_PARAM;
207 if ( item.lParam ==
id ) {
235 CDialog::OnInitDialog();
267 EnableToolTips(
TRUE );
277 BEGIN_MESSAGE_MAP(
DialogAF, CDialog)
278 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
279 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
290 ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
304 common->
Printf(
"Cannot run the articulated figure editor in fullscreen mode.\n"
305 "Set r_fullscreen to 0 and vid_restart.\n" );
309 if ( g_AFDialog ==
NULL ) {
314 if ( g_AFDialog->GetSafeHwnd() ==
NULL) {
325 g_AFDialog->ShowWindow( SW_SHOW );
326 g_AFDialog->SetFocus();
330 const char *
name = spawnArgs->GetString(
"articulatedFigure" );
331 if ( name[0] ==
'\0' ) {
332 name = spawnArgs->GetString(
"ragdoll" );
348 MSG *msg = AfxGetCurrentMessage();
350 MSG *msg = &m_msgCur;
353 while( ::PeekMessage(msg,
NULL,
NULL,
NULL, PM_NOREMOVE) ) {
355 if ( !AfxGetApp()->PumpMessage() ) {
379 CDialog::OnActivate( nState, pWndOther, bMinimized );
398 CDialog::OnSetFocus( pOldWnd );
410 return CDialog::OnDestroy();
419 if ( GetSafeHwnd() ) {
421 GetWindowRect( rct );
424 CDialog::OnMove( x, y );
443 item.mask = TCIF_PARAM;
447 switch ( item.lParam ) {
476 if ( index != CB_ERR ) {
478 AFList.GetLBText( index, str );
494 if ( nameDlg.DoModal() != IDOK ) {
499 CFileDialog dlgSave(
FALSE,
"map",
NULL, OFN_OVERWRITEPROMPT,
"AF Files (*.af)|*.af|All Files (*.*)|*.*||", AfxGetMainWnd() );
500 if ( dlgSave.DoModal() != IDOK ) {
523 if ( MessageBox(
"Are you sure you want to delete the articulated figure file ?",
"Delete Articulated Figure", MB_YESNO | MB_ICONQUESTION ) == IDYES ) {
536 if ( index != CB_ERR ) {
538 AFList.GetLBText( index, str );
575 MessageBox(
"Saving the file failed. Make sure the file is not read-only.",
"Delete Articulated Figure", MB_OK );
590 for ( i = 0; i <
c; i++ ) {
592 if ( MessageBox(
"Some articulated figures have been modified.\nCancel all changes ?",
"Cancel", MB_YESNO | MB_ICONQUESTION ) != IDYES ) {
BOOL DefaultOnToolTipNotify(const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, LRESULT *pResult)
virtual void AF_UpdateEntities(const char *fileName)
void GetName(CString &str)
afx_msg void OnBnClickedCancel()
virtual void AF_UndoChanges(void)
CONST PIXELFORMATDESCRIPTOR UINT
afx_msg void OnBnClickedButtonAfDelete()
void SetFileModified(void)
#define IDC_BUTTON_AF_NEW
#define IDC_BUTTON_AF_DELETE
afx_msg void OnBnClickedButtonAfSpawn()
idRenderSystem * renderSystem
afx_msg void OnMove(int x, int y)
idFileSystem * fileSystem
void AFDialogReloadFile(void)
void SetComboBox(CComboBox *combo)
const char * GetName(void) const
virtual idDecl * CreateNewDecl(declType_t type, const char *name, const char *fileName)=0
void AFEditorInit(const idDict *spawnArgs)
afx_msg void OnBnClickedButtonAfSave()
afx_msg void OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
afx_msg void OnBnClickedButtonAfNew()
afx_msg void OnBnClickedButtonAfTpose()
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
void LoadFile(idDeclAF *af)
virtual BOOL OnInitDialog()
virtual bool IsFullScreen(void) const =0
#define IDC_BUTTON_AF_TPOSE
void LoadFile(idDeclAF *af)
virtual void DoDataExchange(CDataExchange *pDX)
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
void LoadFile(idDeclAF *af)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
DialogAFConstraint * constraintDlg
void LoadFile(idDeclAF *af)
DialogAFProperties * propertiesDlg
idDeclManager * declManager
void AFEditorShutdown(void)
virtual int GetNumDecls(declType_t type)=0
DialogAFConstraint * constraintDlg
void AFDialogSetFileModified(void)
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
DialogAFConstraint * constraintDlg
afx_msg void OnTcnSelchangeTabMode(NMHDR *pNMHDR, LRESULT *pResult)
static toolTip_t toolTips[]
virtual bool AF_SpawnEntity(const char *fileName)
afx_msg void OnCbnSelchangeComboAf()
afx_msg void OnBnClickedButtonAfKill()
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
void AddTabItem(int id, const char *name)
void SetTabChildPos(void)
#define IDC_DIALOG_AF_TAB_MODE
#define AFTAB_CONSTRAINTS
virtual const char * OSPathToRelativePath(const char *OSPath)=0
#define IDC_BUTTON_AF_KILL
#define IDC_BUTTON_AF_SAVE
#define IDC_BUTTON_AF_SPAWN
afx_msg void OnSetFocus(CWnd *pOldWnd)