| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#if !defined(AFX_SCRIPTSELECT_H__84E5B8C1_29FC_11D1_86CC_004033312F7C__INCLUDED_) |
| 20 |
#define AFX_SCRIPTSELECT_H__84E5B8C1_29FC_11D1_86CC_004033312F7C__INCLUDED_ |
| 21 |
|
| 22 |
#if _MSC_VER >= 1000 |
| 23 |
#pragma once |
| 24 |
#endif |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#include "objscript.h" |
| 29 |
#include "objcscript.h" |
| 30 |
#include "d3x.h" |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#include "object.h" |
| 36 |
#include "trigger.h" |
| 37 |
|
| 38 |
class CScriptSelect : public CDialog { |
| 39 |
|
| 40 |
public: |
| 41 |
CScriptSelect(uint16_t scr_type = 0xffff, int custom = CUSTOM_SCRIPT_MASK, |
| 42 |
CWnd *pParent = NULL); |
| 43 |
|
| 44 |
int m_CurScriptSel; |
| 45 |
|
| 46 |
|
| 47 |
int m_NumParms; |
| 48 |
tScriptParm m_Parm[MAX_SCRPARAMS]; |
| 49 |
int m_CustomType; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
enum { IDD = IDD_SCRIPTSELECT }; |
| 54 |
CString m_ScriptName; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
protected: |
| 61 |
virtual void DoDataExchange(CDataExchange *pDX); |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
protected: |
| 66 |
|
| 67 |
|
| 68 |
afx_msg void OnDblclkScriptselListbox(); |
| 69 |
virtual void OnOK(); |
| 70 |
virtual BOOL OnInitDialog(); |
| 71 |
afx_msg void OnDestroy(); |
| 72 |
afx_msg void OnParameters(); |
| 73 |
afx_msg void OnSelchangeScriptselListbox(); |
| 74 |
afx_msg void OnScriptselAdd(); |
| 75 |
afx_msg void OnEditScript(); |
| 76 |
afx_msg void OnScrtype(); |
| 77 |
|
| 78 |
DECLARE_MESSAGE_MAP() |
| 79 |
|
| 80 |
private: |
| 81 |
void UpdateScriptListbox(); |
| 82 |
void EditScript(const char *filename, const char *scrname); |
| 83 |
|
| 84 |
private: |
| 85 |
tD3XProgram *m_ScriptCode; |
| 86 |
uint16_t m_ScriptType; |
| 87 |
}; |
| 88 |
|
| 89 |
inline void SETUP_SCRIPTSELECT_OBJECT(CScriptSelect &sel, object *obj) { |
| 90 |
#if 0 |
| 91 |
sel.m_ScriptName = obj->script.name; |
| 92 |
sel.m_NumParms = obj->script.num_parms; |
| 93 |
obj->script.copy_parms(sel.m_Parm); |
| 94 |
#endif |
| 95 |
} |
| 96 |
|
| 97 |
inline void RETURN_SCRIPTSELECT_OBJECT(object *obj, CScriptSelect &sel) { |
| 98 |
#if 0 |
| 99 |
obj->script.set_parms(sel.m_NumParms, sel.m_Parm); |
| 100 |
if (sel.m_ScriptName == "null") |
| 101 |
obj->script.set_name(NULL); |
| 102 |
else |
| 103 |
obj->script.set_name(sel.m_ScriptName); |
| 104 |
obj->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; |
| 105 |
|
| 106 |
mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, obj->script.is_custom)); |
| 107 |
#endif |
| 108 |
} |
| 109 |
|
| 110 |
inline void SETUP_SCRIPTSELECT_TRIGGER(CScriptSelect &sel, trigger *trig) { |
| 111 |
#if 0 |
| 112 |
sel.m_ScriptName = trig->script.name; |
| 113 |
sel.m_NumParms = trig->script.num_parms; |
| 114 |
trig->script.copy_parms(sel.m_Parm); |
| 115 |
#endif |
| 116 |
} |
| 117 |
|
| 118 |
inline void RETURN_SCRIPTSELECT_TRIGGER(trigger *trig, CScriptSelect &sel) { |
| 119 |
#if 0 |
| 120 |
trig->script.set_parms(sel.m_NumParms, sel.m_Parm); |
| 121 |
if (sel.m_ScriptName == "null") |
| 122 |
trig->script.set_name(NULL); |
| 123 |
else |
| 124 |
trig->script.set_name(sel.m_ScriptName); |
| 125 |
trig->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; |
| 126 |
|
| 127 |
mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, trig->script.is_custom)); |
| 128 |
#endif |
| 129 |
} |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
#endif |