diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
commit | c0c336500955a23e344651e5412c9d9d441ef4ee (patch) | |
tree | 790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2ToolDef.cpp | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2ToolDef.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/T2DLL/T2ToolDef.cpp b/src/T2DLL/T2ToolDef.cpp index c57672f..21b0a63 100644 --- a/src/T2DLL/T2ToolDef.cpp +++ b/src/T2DLL/T2ToolDef.cpp @@ -3,24 +3,25 @@ #include "CResourcePlugin.h" #include "T2AdvertisePlugin.h" #include "T2BitImage.h" +#include "T2DateTime.h" #include "T2HaveOutViewObject.h" #include "T2ImageObj.h" #include "T2ToolDef.h" #include "T2ToolPlugin.h" +#include "T2WorldDef.h" #include "UT2Coordinate.h" T2ToolDef::T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2ToolPlugin* plugin) : T2TemplatePlugin(type, specifier, resFile, plugin) { mToolIcon = new T2BitImage(mModuleHandle, 100, 1); - // TODO: this needs to come from T2WorldDef - mImageObj->AddObject(mModuleHandle, 100, mToolIcon); + worldDef->m1D0->AddObject(mModuleHandle, 100, mToolIcon); mEC = new T2BitImage(mModuleHandle, 1000, 1); mImageObj->AddObject(mModuleHandle, 1000, mEC); - m114 = NULL; - m118 = 0; + mToolQuietUntil = NULL; + mCategoryQuietUntil = NULL; mSettlement = 0; mCurBuildCount = 0; @@ -79,8 +80,8 @@ T2ToolDef::T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile delete mToolIcon; if (mEC) delete mEC; - if (m114) - delete m114; // what type is this? + if (mToolQuietUntil) + delete mToolQuietUntil; // what type is this? if (mSubPluginList) delete mSubPluginList; } @@ -102,7 +103,7 @@ T2ToolDef::T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile SetRect(&outRect, inPt.x, inPt.y, inPt.x + mWidth, inPt.y + mHeight); outPt.x = outRect.left; outPt.y = outRect.top; - UT2Coordinate::UnitToQD(outRect, factor, 0); + UT2Coordinate::UnitToQD(outRect, factor); return CursorType_0; } @@ -120,7 +121,7 @@ void T2ToolDef::GetName(CString& outStr, int id) { /*virtual*/ int T2ToolDef::CalcMentenanceCostProc(const T2HaveOutViewObject* obj) const { int cost = 0; T2ToolDef *objToolDef = obj->GetToolDef(); - if (objToolDef->IsSetAttribute(0x100)) + if (objToolDef->IsSetAttribute(kToolAttrNormalMenteCost)) cost = GetOutMoney(obj->GetValiation()); return cost; } |