summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2TreasureDialog.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
commitc0c336500955a23e344651e5412c9d9d441ef4ee (patch)
tree790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2TreasureDialog.cpp
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2TreasureDialog.cpp47
1 files changed, 44 insertions, 3 deletions
diff --git a/src/T2DLL/T2TreasureDialog.cpp b/src/T2DLL/T2TreasureDialog.cpp
index 19ddddc..55e27ec 100644
--- a/src/T2DLL/T2TreasureDialog.cpp
+++ b/src/T2DLL/T2TreasureDialog.cpp
@@ -1,4 +1,8 @@
+#include "CTokenizer.h"
+#include "T2PluginSpecifier.h"
+#include "T2TowerDoc.h"
#include "T2TreasureDialog.h"
+#include "T2TreasurePane.h"
T2TreasureDialog::T2TreasureDialog() {
}
@@ -7,22 +11,59 @@ T2TreasureDialog::T2TreasureDialog() {
}
/*virtual*/ void T2TreasureDialog::OnT2Create() {
+ mTreasurePane = (T2TreasurePane *) GetDlgItem(1000);
+ mTextPane = (T2DlgItem *) GetDlgItem(1001);
}
-/*virtual*/ void T2TreasureDialog::CreateDlgItem(CTokenizer&, T2Dialog::T2DialogDef&) {
+/*virtual*/ void T2TreasureDialog::CreateDlgItem(CTokenizer& inTokenizer, T2DialogDef& inDef) {
+ if (!_stricmp(inTokenizer.Current(), "ANIM")) {
+ RECT rect;
+ UINT id = inTokenizer.NextInteger();
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+
+ T2TreasurePane *theTreasurePane = new T2TreasurePane(mTowerDoc, mImageObj, mPalette);
+ theTreasurePane->Create("", inDef.flags, rect, this, id);
+ theTreasurePane->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ theTreasurePane->SetFont(*mFonts[mCurrentFont]);
+ } else {
+ T2Dialog::CreateDlgItem(inTokenizer, inDef);
+ }
}
/*virtual*/ void T2TreasureDialog::OnT2Destroy() {
}
/*virtual*/ void T2TreasureDialog::ShowSelf() {
+ ShowWindow(SW_SHOWNORMAL);
}
/*virtual*/ void T2TreasureDialog::HideSelf() {
+ ShowWindow(SW_HIDE);
}
-/*static*/ void T2TreasureDialog::ShowTreasureDialog(T2TowerDoc*, T2TreasureStatus*) {
+/*static*/ void T2TreasureDialog::ShowTreasureDialog(T2TowerDoc* inTowerDoc, T2TreasureStatus* inStatus) {
+#line 69 // nice
+ _ASSERT(inTowerDoc != NULL);
+
+ CRect rect;
+ AfxGetMainWnd()->GetWindowRect(rect);
+
+ T2DLGTEMPLATE theTemplate;
+ theTemplate.pt = rect.CenterPoint();
+ theTemplate.moduleHandle = inTowerDoc->mWorldPluginSpecifier->mInstance;
+ theTemplate.resID = 11000;
+ T2TreasureDialog *theDialog = new T2TreasureDialog;
+
+ theDialog->Realize(inTowerDoc, &theTemplate, inTowerDoc, NULL, NULL, true, NULL, 0, true);
+ theDialog->SetTreasureInfo(inTowerDoc, inStatus);
}
-void T2TreasureDialog::SetTreasureInfo(T2TowerDoc*, T2TreasureStatus*) {
+void T2TreasureDialog::SetTreasureInfo(T2TowerDoc* inTowerDoc, T2TreasureStatus* inStatus) {
+ mTreasurePane->SetAnimPics(inTowerDoc, inStatus->animID1, inStatus->animID2);
+ strncpy(mText, inStatus->text, 255);
+ mTextPane->SetWindowText(mText);
}