#pragma once #include "common.h" #include "T2DLL/T2MsgWindowCallback.h" #include "T2DLL/T2Settlement.h" #include "T2DLL/T2Sprite.h" #include "T2DLL/T2ToolCallback.h" #include "T2TowerMainView.h" enum { kControlWindow, kMessageWindow, kToolWindow }; // The type of entity found when performing a hit test enum { kHitNull, kHitBkgndInfo, kHitTenant, kHitMover, kHitPeople, kHitOutObj, kHitSpriteObj }; union HitTestResult { T2DrawableObject *obj; T2SpriteObj *spriteObj; unsigned int bkgndInfo; }; enum { // Leave the cursor as-is kCursorNoChange = -1, // Destruct (193, 184) kCursorDestruct = 0, // Finger (187, 188) kCursorFinger = 1, // Info (193, 183) kCursorInfo = 2, // Zoom (195, 195) kCursorZoom = 3, // Hand (189, 190) kCursorHand = 4, // Mic (185, 185) kCursorMic = 5, // Search range (192, 192) kCursorSearchRange = 6, // No symbol (210, 210) kCursorNo = 7, // Use IDC_ARROW kCursorDefault = 0x100 }; class T2HUnknown; typedef void (*TowerDocDestroyCallback)(void *); enum { kDm0 = 0, kDm1, kDm2, kDm3 }; struct DragMask { int x0; int x4; RECT rect; }; class T2TowerDoc : public CDocument, public T2MsgWindowCallback, public T2ToolCallback { protected: T2TowerDoc(); DECLARE_DYNCREATE(T2TowerDoc) public: virtual ~T2TowerDoc(); //{{AFX_VIRTUAL(T2TowerDoc) public: virtual BOOL OnNewDocument(); virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); virtual void Serialize(CArchive &ar); //}}AFX_VIRTUAL // is this one properly placed??? virtual BOOL IsDustOn() const { return mIsDustOn; } virtual void LoadsWorldPlugin(); // new file? // C0 virtual void towerDoc_vfC0(int); virtual void towerDoc_vfC4(); virtual void towerDoc_vfC8(); virtual void towerDoc_vfCC(T2PluginSpecifier *inWorldPluginSpec, BOOL inIsExistingFile); void xUnkNameSelectWorld(T2PluginSpecifier *inWorldPluginSpec); void x41CFEB(); // D0 virtual void towerDoc_vfD0(); void LoadOptionPlugins(); virtual void towerDoc_vfD4(BOOL inResetMainWindow); virtual void towerDoc_vfD8(const RECT &inRect1, const RECT &inRect2); virtual void DrawRequestAll(const RECT &inRect); // E0 virtual void DrawMoverAll(const RECT &inRect); virtual void DrawInView(const RECT &inRect1, const RECT &inRect2); virtual void DrawOutView(const RECT &inRect1, const RECT &inRect2); virtual void DrawBuilding(const RECT &inRect1, const RECT &inRect2); // F0 virtual void towerDoc_vfF0(const RECT &inRect1, const RECT &inRect2); virtual void DrawBkgnd(const RECT &inRect); virtual void towerDoc_vfF8(const RECT &inRect); virtual void towerDoc_vfFC(const RECT &inRect); // 100 virtual void towerDoc_vf100(const RECT &inRect); virtual void DrawTenantOutViewAll(const RECT &inRect); virtual int GetZoomLevel() const; void SetZoomLevel(int inZoom) { mZoomLevel = inZoom; } virtual T2BitImage *GetImage() const; // 110 virtual T2TowerMainView *GetMainView() const; virtual void SelectPlugins(BOOL inIsGradeUp); virtual void InitSound(T2SoundPlayer *inSoundPlayer); void LoadSoundForPlugin(T2TemplatePlugin *inPlugin); virtual void UpdatePalette(int startIndex, int count, PALETTEENTRY *entries); // updates palette // 120 virtual T2DateTime *GetNow() const; virtual T2RouteNavigator *GetRouteNavi() const; virtual T2TemplatePluginList *GetSilhouetteTemplates(); virtual T2FloorInfo *GetFloorInfo() const { return mFloorInfo; } // 130 virtual T2Pool *GetPool() const { return mPool; } virtual T2SoundPlayer *GetSoundPlayer() const { return mSoundPlayer; } virtual int GetLevel() const { return mGameLevel; } virtual T2TowerMessage *GetTowerMessage() { return mTowerMessage; } // 140 virtual int GetViewMode() const { return mViewMode; } virtual void SetViewMode(int inViewMode); virtual int GetWalkRate() const { return mWalkRate; } virtual void SetWalkRate(int inWalkRate); // 150 virtual T2TrafficInfo *GetTrafficInfo() const { return mTrafficInfo; } virtual BOOL IsToiletFlagOn() const; virtual BOOL IsColdFlagOn() const; int CheckGameLevel(); void UpdateAllTenant(); virtual BOOL IsRectInView(const RECT &inRect); // 160 virtual T2PaletteAnime *GetPaletteAnime() const { return mPaletteAnime; } virtual void SetInfoBarText(const char *inText); virtual void towerDoc_vf168(const RECT &inRect) { mTowerMainView->CenterOnRectAndZoom(inRect); } virtual BOOL GetElevTransparent() const { return mElevTransparent; } // 170 virtual T2WorldDef *GetWorldDef() const { return mWorldDef; } virtual T2RegistedTenantDB *GetRegistedTenantDB() const { return mRegistedTenantDB; } virtual T2TemplatePluginList *GetTenantTemplates() const { return mTenantTemplates; } virtual T2TemplatePluginList *GetMoverTemplates() const { return mMoverTemplates; } // 180 virtual T2TemplatePluginList *GetOuterObjTemplates() const { return mOuterObjTemplates; } CPluginInfoArray *MakePluginInfoArray(); void _MakePluginInfoArray(CPluginInfoArray *inResultArray, CFilePluginList *inPluginArray); virtual void towerDoc_vf184(int inFlags); virtual void FinalEventOccur(); virtual T2Tenant *GetSearchRangeFrom() const { return mSearchRangeFrom; } // 190 virtual void SetSearchRangeFrom(T2Tenant *inTenant); virtual void towerDoc_vf194(); virtual void towerDoc_vf198(unsigned short inWindowType); virtual void SetCursorType(int inCursor, BOOL inIsPressed); // 1A0 virtual void towerDoc_vf1A0(BOOL inPause); virtual BOOL towerDoc_vf1A4() const { return _1F8 != 0; } virtual void *towerDoc_vf1A8() const { return mDestroyCallbackData; } virtual void towerDoc_vf1AC(void *inData) { mDestroyCallbackData = inData; } // 1B0 virtual void towerDoc_vf1B0(TowerDocDestroyCallback inFunc) { mDestroyCallback = inFunc; } virtual void BreakoutEmergency(); virtual void AddFavoritePeople(T2People *inPeople); virtual void AddFavoriteTenant(T2Tenant *inTenant); // 1C0 virtual void RemoveFavoritePeople(const char *inName, BOOL inFlag); virtual void RemoveFavoritePeople(T2People *inPeople, BOOL inFlag); virtual void RemoveFavoriteTenant(const char *inName, BOOL inFlag); virtual void RemoveFavoriteTenant(T2Tenant *inTenant, BOOL inFlag); // 1D0 virtual void towerDoc_vf1D0(int unk1, int unk2) {} virtual void towerDoc_vf1D4(); virtual void towerDoc_vf1D8(); virtual void CreatePool(); // 1E0 virtual void LoadPool(T2Archive &inArchive); virtual void DoDestruct(const CPoint &inPt); virtual BOOL DestructTenant(POINT inPt1, POINT inPt2, T2Tenant *inTenant, BOOL inSkipSounds); BOOL OutsideAreaCheck(T2Tenant *inTenant, BOOL inShowError); void CalcCraneUpdateRect(RECT &ioRect); virtual BOOL DestructMover(POINT inPt1, POINT inPt2, T2Mover *inMover); // 1F0 virtual BOOL DestructOutObj(POINT inPt1, POINT inPt2, T2OutObj *inOutObj); virtual BOOL DoClickByTenantTool(CRect inRect, T2TenantDef *inDef, unsigned int inValiation); virtual void DoDragByTenantTool(CRect inRect); virtual void DoReleaseByTenantTool(CRect inRect); // 200 virtual BOOL DoClickByMoverTool(CRect inRect, T2MoverDef *inDef, unsigned int inValiation, BOOL inIsFromMouseMove); virtual void DoDragByMoverTool(CRect inRect); virtual void DoReleaseByMoverTool(CRect inRect); virtual void DoClickByOutObjTool(CRect inRect, T2OuterObjDef *inDef, unsigned int inValiation); // 210 virtual void DoDragByOutObjTool(CRect inRect); virtual void DoReleaseByOutObjTool(CRect inRect); virtual BOOL DoClickByFingerTool(CPoint inPt); virtual void DoDragByFingerTool(CPoint inPt); // 220 virtual void DoReleaseByFingerTool(CPoint inPt); virtual void DoGetInfo(CPoint inPt); virtual void towerDoc_vf228(CPoint inPt); virtual void DoInterview(CPoint inPt); // 230 virtual void DoSearchRangeTool(CPoint inPt); virtual void DoRenumberTenant(); virtual void DoFind(T2Name *inName); BOOL x4295F1(T2People *inPeople, RECT &outRect); virtual BOOL towerDoc_vf23C(CPoint inPt); // 240 virtual void CalcDragMask(CRect inRect); virtual int CalcDragMaskPoint(CRect &ioRect, int &ioFunds, DragMask *inArray, int inMode, BOOL inShowError); // CalcDragMaskPoint virtual BOOL towerDoc_vf248(CRect inRect); virtual T2Tenant *AssignNewTenant(T2TenantDef *inTenantDef, RECT &inRect, unsigned int inValiation); // 250 virtual void CheckBuildQueue(); virtual BOOL CheckTenantArea(const RECT &inRect, T2TenantDef *inTenantDef, BOOL inShowErr, BOOL inUnkFlag); virtual BOOL towerDoc_vf258(const RECT &inRect, T2MoverDef *inMoverDef); virtual BOOL towerDoc_vf25C(const RECT &inRect, T2MoverDef *inMoverDef); // 260 virtual void towerDoc_vf260(const RECT &inRect, T2OuterObjDef *inOuterObjDef); virtual void TenantAdded(T2Tenant *inTenant); virtual void TenantRemoved(T2Tenant *inTenant); virtual int GetCurrentFunds() const { return mSettlement->GetCurrentFunds(); } // 270 virtual void DoPay(int inCost, short inFundGroup); virtual void DoPayTool(int inCost, short inFundGroup, T2ToolDef *inToolDef, const char *inMessage, int inLimitLength, int inLimitType); virtual void DoPayTool(int inCost, short inFundGroup, T2ToolDef *toolDef); virtual int GetNextTenantNumber(int inV); // 280 virtual void towerDoc_vf280(); // empty: RecreateFavoriteMenus? virtual void towerDoc_vf284() { UpdateAllTenant(); } virtual BOOL towerDoc_vf288(RECT &ioRect, int &ioCost); virtual void FillFloor(const RECT &inRect); // 290 virtual void towerDoc_vf290(BOOL inPause); virtual void towerDoc_vf294() { towerDoc_vf290(false); } virtual void towerDoc_vf298(); virtual int HitTest(POINT inPt, HitTestResult &outObj, BOOL inSkipPeople, BOOL inSkipOuterObj); int HitTestLayer(T2BitImage *inImage, POINT inPt, HitTestResult &outObj, int inLayer); // 2A0 virtual T2ToolWindow *towerDoc_vf2A0(); virtual int GetDrawSpeed() const { return mDrawSpeed; } virtual int SetDrawSpeed(int inVal) { int oldVal = mDrawSpeed; mDrawSpeed = inVal; return oldVal; } virtual BOOL SetElevTransparent(BOOL inTransparent); // 2B0 virtual BOOL towerDoc_vf2B0(BOOL inValue); // SetVolatile maybe? virtual int towerDoc_vf2B4() const { return _1FC; } virtual void CallbackZoomIn(POINT inPt); virtual void CallbackZoomOut(); virtual void CallbackInView(); virtual void CallbackOutView(); virtual void CallbackPriceView(); virtual void CallbackMaintView(); virtual void CallbackTransView(); virtual void CallbackEvalView(); virtual void CallbackPause(BOOL inPause); virtual void CallbackCalendar(); virtual void CallbackFunds(); virtual void CallbackPopulation(); virtual BOOL towerDoc_vf2BC(const char *inPath); // 2C0 virtual BOOL towerDoc_vf2C0(const char *inPath); virtual void toolCallback_vf00(int unkParam1, T2ToolIconItem *inItem); void x429A9A(BOOL inPause); void x429B01(BOOL inPause); // this might be SetVolatile actually void SetFireBurning(BOOL flag) { m208 = flag; } int Get228() { return m228; } BOOL Get22C() const { return _22C; } T2PluginLoader *mT2PluginLoader; T2WorldPlugin *mWorldPlugin; T2PluginSpecifier *mWorldPluginSpecifier; T2PluginSpecifier *mToolPaletteSpecifier; DWORD mWorldPluginID; DWORD mToolPaletteID; T2WorldDef *mWorldDef; int _78; int _7C; int mZoomLevel; // the current funds when the player clicked to begin building a tenant int mFundsOnClick; BOOL mPause; int mGameLevel; int _90; int _94; int _98; int m9C; DWORD mA0; // VIPs that have been satisfied int mViewMode; int _A8; int _AC; BOOL _B0; int mLastRequestedCursor; int mCurrentCursorIndex; int mBC; DWORD mC0; T2DateTime *mNow; T2TowerMessage *mTowerMessage; CString mCC; T2FloorInfo *mFloorInfo; BkgndInfo *mBkgndInfo; T2TrafficInfo *mTrafficInfo; T2Sprite mSprite; T2SoundPlayer *mSoundPlayer; CFilePluginList *mTenantPlugins; CFilePluginList *mMoverPlugins; CFilePluginList *mOuterObjPlugins; T2MoviePluginList *mMoviePluginList; CFilePluginList *mHallEventPlugins; CFilePluginList *mAdvertisePlugins; T2TemplatePluginList *mTenantTemplates; T2TemplatePluginList *mMoverTemplates; T2TemplatePluginList *mMatterTemplates; T2TemplatePluginList *mPeopleTemplates; T2TemplatePluginList *mSilhouetteTemplates; T2TemplatePluginList *mOuterObjTemplates; T2TemplatePluginDB *mTemplatePluginDB; T2OptionPluginList *mOptionPluginList; T2OuterObjList *mOuterObjList; T2Settlement *mSettlement; T2NameList *mNameDB; T2PeopleArrayList *mPeopleArrayList; T2Pool *mPool; T2RegistedTenantDB *mRegistedTenantDB; T2TenantDef *mFloorDef; T2RouteNavigator *mRouteNavigator; T2Tenant *mSearchRangeFrom; int mCraneCount; POINT *mCranePosArray; T2HUnknown *_170; int _174; T2PaletteAnime *mPaletteAnime; BOOL mPaletteUpdated; BOOL mDebugStepRunEnabled; BOOL mDisplayIPS; POINT m188; BOOL mErrorFlag; BOOL mNewDocFlag; BOOL mIsStuffLoadedFlag; T2TowerMainView *mTowerMainView; T2TenantDef *m1A0; T2Tenant *_1A4; int _1A8; int _1AC; unsigned int mValiation; DragMask *mDragMask; CObjectQueue *mObjectQueue; POINT _1BC; T2Equip *m1C4; // does the system support palettes? BOOL mIsPaletteMode; int m1CC; BOOL mElevTransparent; BOOL mIsDustOn; unsigned int mToiletDenomi; unsigned int mColdDenomi; int mWalkRate; BOOL _1E4; void *mDestroyCallbackData; TowerDocDestroyCallback mDestroyCallback; int m1F0; int _1F4; int _1F8; int _1FC; int _200; int m204; int m208; time_t m20C; int m210; int m214; DWORD m218; DWORD m21C; unsigned int mDrawSpeed; int _224; int m228; BOOL _22C; protected: void InvalClock(); void InvalCalender(); void InvalFunds(); void InvalPopulation(); void SetupGradeAnimation(); void x42670C(); void x426717(); void CycleOutlinePalette(); //{{AFX_MSG(T2TowerDoc) afx_msg void OnSystemInformation(); afx_msg void OnUpdateDebugStepRun(CCmdUI *pCmdUI); afx_msg void OnDebugStepRun(); afx_msg void OnUpdateDebugIdleSpeedMeasuring(CCmdUI *pCmdUI); afx_msg void OnDebugIdleSpeedMeasuring(); afx_msg void OnUpdateDebugAllLoadMeasuring(CCmdUI *pCmdUI); afx_msg void OnDebugAllLoadMeasuring(); afx_msg void OnUpdateDebugPool(CCmdUI *pCmdUI); afx_msg void OnDebugPool(); afx_msg void OnUpdateDebugDisplayIPS(CCmdUI *pCmdUI); afx_msg void OnDebugDisplayIPS(); afx_msg void OnUpdateDebugPeople(CCmdUI *pCmdUI); afx_msg void OnDebugPeople(); afx_msg void OnDebugGradeUp(); afx_msg void OnDebugGradeDown(); afx_msg void OnPause(); afx_msg void OnUpdatePause(CCmdUI *pCmdUI); afx_msg void OnSetting(); afx_msg void OnUpdateSetting(CCmdUI *pCmdUI); afx_msg void OnHideElevatorRoom(); afx_msg void OnUpdateHideElevatorRoom(CCmdUI *pCmdUI); afx_msg void OnFavorite(); afx_msg void OnUpdateFavorite(CCmdUI *pCmdUI); afx_msg void OnHideControlWindow(); afx_msg void OnUpdateHideControlWindow(CCmdUI *pCmdUI); afx_msg void OnHideMessageWindow(); afx_msg void OnUpdateHideMessageWindow(CCmdUI *pCmdUI); afx_msg void OnHideToolWindow(); afx_msg void OnUpdateHideToolWindow(CCmdUI *pCmdUI); //}}AFX_MSG DECLARE_MESSAGE_MAP() };