summaryrefslogtreecommitdiff
path: root/src/T2DLL/WalkerDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/WalkerDlg.cpp')
-rw-r--r--src/T2DLL/WalkerDlg.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/T2DLL/WalkerDlg.cpp b/src/T2DLL/WalkerDlg.cpp
new file mode 100644
index 0000000..f93a376
--- /dev/null
+++ b/src/T2DLL/WalkerDlg.cpp
@@ -0,0 +1,87 @@
+#include "CT2App.h"
+#include "T2CtrlPalette.h"
+#include "T2DlgItem.h"
+#include "T2MainWindow.h"
+#include "T2MWControl.h"
+#include "T2TowerDoc.h"
+#include "T2WorldDef.h"
+#include "WalkerDlg.h"
+
+WalkerDlg::WalkerDlg() {
+ mDeleteOnClose = true;
+}
+
+/*virtual*/ WalkerDlg::~WalkerDlg() {
+}
+
+void WalkerDlg::Setup(T2TowerDoc *inDoc, HINSTANCE inInstance, CWnd *inParentWnd, const POINT &inPt, T2ImageObj *inImageObj) {
+ mDocument = inDoc;
+
+ T2DLGTEMPLATE tmpl;
+ tmpl.resID = 7030;
+ tmpl.pt = inPt;
+ tmpl.moduleHandle = inInstance;
+
+ Realize(inParentWnd, &tmpl, inDoc, inImageObj, inDoc->mWorldDef->GetPalette(), false, inParentWnd, 202, true);
+ ShowWindow(SW_HIDE);
+}
+
+void WalkerDlg::Revert() {
+ if (mFC != 1) {
+ T2DlgItem *item = GetT2DlgItem(107 + mFC);
+ item->SetValue(0);
+
+ mFC = 1;
+
+ item = GetT2DlgItem(107 + mFC);
+ item->SetValue(1);
+ }
+}
+
+void WalkerDlg::Save() {
+ T2CtrlPalette *theCtrlPalette = ((CT2App *) AfxGetApp())->mMainWindow->mCtrlPalette;
+ if (!theCtrlPalette)
+ return;
+
+ T2MWControl *theSlider = theCtrlPalette->mSliderControl;
+ if (!theSlider)
+ return;
+
+ int value = 0;
+ if (mFC != 0)
+ value = 7 - mFC;
+ theSlider->SetData(value);
+
+ if (mFC == 0)
+ mDocument->towerDoc_vf14C(-1);
+ else
+ mDocument->towerDoc_vf14C(mFC);
+}
+
+/*virtual*/ void WalkerDlg::OnT2Create() {
+ mFC = mDocument->towerDoc_vf148();
+ if (mFC == -1)
+ mFC = 0;
+
+ T2DlgItem *item = GetT2DlgItem(107 + mFC);
+ item->SetValue(1);
+}
+
+/*virtual*/ int WalkerDlg::OnT2DialogCommand(UINT cmd, long data) {
+ int result = 1;
+ WORD w = LOWORD(cmd);
+
+ if (w >= 107 && w <= 113) {
+ T2DlgItem *item = GetT2DlgItem(107 + mFC);
+ item->SetValue(0);
+
+ mFC = w - 107;
+
+ item = GetT2DlgItem(w);
+ item->SetValue(1);
+ } else {
+ result = T2Dialog::OnT2DialogCommand(cmd, data);
+ }
+
+ return result;
+}