-
Notifications
You must be signed in to change notification settings - Fork 15
/
LawnApp.h
336 lines (320 loc) · 13.8 KB
/
LawnApp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
#ifndef __LAWNAPP_H__
#define __LAWNAPP_H__
#include "ConstEnums.h"
#include "SexyAppFramework/SexyApp.h"
#include "Sexy.TodLib/TodFoley.h"
class Board;
class GameSelector;
class ChallengeDefinition;
class SeedChooserScreen;
class AwardScreen;
class CreditScreen;
class TodFoley;
class PoolEffect;
class ZenGarden;
class PottedPlant;
class EffectSystem;
class TodParticleSystem;
class Reanimation;
class ReanimatorCache;
class ProfileMgr;
class PlayerInfo;
class Music;
class TitleScreen;
class PopDRMComm;
class ChallengeScreen;
class StoreScreen;
class AlmanacDialog;
class TypingCheck;
namespace Sexy
{
class Dialog;
class Graphics;
class ButtonWidget;
};
enum FoleyType;
using namespace Sexy;
typedef std::list<ButtonWidget*> ButtonList;
typedef std::list<Image*> ImageList;
class LevelStats
{
public:
int mUnusedLawnMowers;
public:
LevelStats() { Reset(); }
inline void Reset() { mUnusedLawnMowers = 0; }
};
class LawnApp : public SexyApp
{
public:
Board* mBoard; //+0x768
TitleScreen* mTitleScreen; //+0x76C
GameSelector* mGameSelector; //+0x770
SeedChooserScreen* mSeedChooserScreen; //+0x774
AwardScreen* mAwardScreen; //+0x778
CreditScreen* mCreditScreen; //+0x77C
ChallengeScreen* mChallengeScreen; //+0x780
TodFoley* mSoundSystem; //+0x784
ButtonList mControlButtonList; //+0x788
ImageList mCreatedImageList; //+0x794
std::string mReferId; //+0x7A0
std::string mRegisterLink; //+0x7BC
std::string mMod; //+0x7D8
bool mRegisterResourcesLoaded; //+0x7F4
bool mTodCheatKeys; //+0x7F5
GameMode mGameMode; //+0x7F8
GameScenes mGameScene; //+0x7FC
bool mLoadingZombiesThreadCompleted; //+0x800
bool mFirstTimeGameSelector; //+0x801
int mGamesPlayed; //+0x804
int mMaxExecutions; //+0x808
int mMaxPlays; //+0x80C
int mMaxTime; //+0x810
bool mEasyPlantingCheat; //+0x814
PoolEffect* mPoolEffect; //+0x818
ZenGarden* mZenGarden; //+0x81C
EffectSystem* mEffectSystem; //+0x820
ReanimatorCache* mReanimatorCache; //+0x824
ProfileMgr* mProfileMgr; //+0x828
PlayerInfo* mPlayerInfo; //+0x82C
LevelStats* mLastLevelStats; //+0x830
bool mCloseRequest; //+0x834
int mAppCounter; //+0x838
Music* mMusic; //+0x83C
ReanimationID mCrazyDaveReanimID; //+0x840
CrazyDaveState mCrazyDaveState; //+0x844
int mCrazyDaveBlinkCounter; //+0x848
ReanimationID mCrazyDaveBlinkReanimID; //+0x84C
int mCrazyDaveMessageIndex; //+0x850
SexyString mCrazyDaveMessageText; //+0x854
int mAppRandSeed; //+0x870
HICON mBigArrowCursor; //+0x874
PopDRMComm* mDRM; //+0x878
intptr_t mSessionID; //+0x87C
int mPlayTimeActiveSession; //+0x880
int mPlayTimeInactiveSession; //+0x884
BoardResult mBoardResult; //+0x888
bool mSawYeti; //+0x88C
TypingCheck* mKonamiCheck; //+0x890
TypingCheck* mMustacheCheck; //+0x894
TypingCheck* mMoustacheCheck; //+0x898
TypingCheck* mSuperMowerCheck; //+0x89C
TypingCheck* mSuperMowerCheck2; //+0x8A0
TypingCheck* mFutureCheck; //+0x8A4
TypingCheck* mPinataCheck; //+0x8A8
TypingCheck* mDanceCheck; //+0x8AC
TypingCheck* mDaisyCheck; //+0x8B0
TypingCheck* mSukhbirCheck; //+0x8B4
bool mMustacheMode; //+0x8B8
bool mSuperMowerMode; //+0x8B9
bool mFutureMode; //+0x8BA
bool mPinataMode; //+0x8BB
bool mDanceMode; //+0x8BC
bool mDaisyMode; //+0x8BD
bool mSukhbirMode; //+0x8BE
TrialType mTrialType; //+0x8C0
bool mDebugTrialLocked; //+0x8C4
bool mMuteSoundsForCutscene; //+0x8C5
public:
LawnApp();
virtual ~LawnApp();
bool KillNewOptionsDialog();
virtual void GotFocus();
virtual void LostFocus();
virtual void InitHook();
virtual void WriteToRegistry();
virtual void ReadFromRegistry();
virtual void LoadingThreadProc();
virtual void LoadingCompleted();
virtual void LoadingThreadCompleted();
virtual void URLOpenFailed(const std::string& theURL);
virtual void URLOpenSucceeded(const std::string& theURL);
virtual bool OpenURL(const std::string& theURL, bool shutdownOnOpen);
virtual bool DebugKeyDown(int theKey);
virtual void HandleCmdLineParam(const std::string& theParamName, const std::string& theParamValue);
void ConfirmQuit();
void ConfirmCheckForUpdates() { ; }
void CheckForUpdates() { ; }
void DoUserDialog();
void FinishUserDialog(bool isYes);
void DoCreateUserDialog();
void DoCheatDialog();
void FinishCheatDialog(bool isYes);
void FinishCreateUserDialog(bool isYes);
void DoConfirmDeleteUserDialog(const SexyString& theName);
void FinishConfirmDeleteUserDialog(bool isYes);
void DoRenameUserDialog(const SexyString& theName);
void FinishRenameUserDialog(bool isYes);
void FinishNameError(int theId);
void FinishRestartConfirmDialog();
void DoConfirmSellDialog(const SexyString& theMessage);
void DoConfirmPurchaseDialog(const SexyString& theMessage);
void FinishTimesUpDialog();
void KillBoard();
void MakeNewBoard();
void StartPlaying();
bool TryLoadGame();
void NewGame();
void PreNewGame(GameMode theGameMode, bool theLookForSavedGame);
void ShowGameSelector();
void KillGameSelector();
void ShowAwardScreen(AwardType theAwardType, bool theShowAchievements); // @Patoke: add argument
void KillAwardScreen();
void ShowSeedChooserScreen();
void KillSeedChooserScreen();
void DoHighScoreDialog();
void DoBackToMain();
void DoConfirmBackToMain();
void DoNewOptions(bool theFromGameSelector);
void DoRegister();
void DoRegisterError();
bool CanDoRegisterDialog();
/*inline*/ bool WriteCurrentUserConfig();
void DoNeedRegisterDialog();
void DoContinueDialog();
void DoPauseDialog();
void FinishModelessDialogs();
virtual Dialog* DoDialog(int theDialogId, bool isModal, const SexyString& theDialogHeader, const SexyString& theDialogLines, const SexyString& theDialogFooter, int theButtonMode);
virtual Dialog* DoDialogDelay(int theDialogId, bool isModal, const SexyString& theDialogHeader, const SexyString& theDialogLines, const SexyString& theDialogFooter, int theButtonMode);
virtual void Shutdown();
virtual void Init();
virtual void Start();
virtual Dialog* NewDialog(int theDialogId, bool isModal, const SexyString& theDialogHeader, const SexyString& theDialogLines, const SexyString& theDialogFooter, int theButtonMode);
virtual bool KillDialog(int theDialogId);
virtual void ModalOpen();
virtual void ModalClose();
virtual void PreDisplayHook();
virtual bool ChangeDirHook(const char* theIntendedPath);
virtual bool NeedRegister();
virtual void UpdateRegisterInfo();
virtual void ButtonPress(int theId);
virtual void ButtonDepress(int theId);
virtual void ButtonDownTick(int theId);
virtual void ButtonMouseEnter(int theId);
virtual void ButtonMouseLeave(int theId);
virtual void ButtonMouseMove(int theId, int theX, int theY);
virtual void UpdateFrames();
virtual bool UpdateApp();
/*inline*/ bool IsAdventureMode();
/*inline*/ bool IsSurvivalMode();
bool IsContinuousChallenge();
/*inline*/ bool IsArtChallenge();
bool NeedPauseGame();
virtual void ShowResourceError(bool doExit = false);
void ToggleSlowMo();
void ToggleFastMo();
void PlayFoley(FoleyType theFoleyType);
void PlayFoleyPitch(FoleyType theFoleyType, float thePitch);
void PlaySample(int theSoundNum);
void FastLoad(GameMode theGameMode);
static SexyString GetStageString(int theLevel);
/*inline*/ void KillChallengeScreen();
void ShowChallengeScreen(ChallengePage thePage);
ChallengeDefinition& GetCurrentChallengeDef();
void CheckForGameEnd();
virtual void CloseRequestAsync();
/*inline*/ bool IsChallengeWithoutSeedBank();
AlmanacDialog* DoAlmanacDialog(SeedType theSeedType = SeedType::SEED_NONE, ZombieType theZombieType = ZombieType::ZOMBIE_INVALID);
bool KillAlmanacDialog();
int GetSeedsAvailable();
Reanimation* AddReanimation(float theX, float theY, int theRenderOrder, ReanimationType theReanimationType);
TodParticleSystem* AddTodParticle(float theX, float theY, int theRenderOrder, ParticleEffect theEffect);
/*inline*/ ParticleSystemID ParticleGetID(TodParticleSystem* theParticle);
/*inline*/ TodParticleSystem* ParticleGet(ParticleSystemID theParticleID);
/*inline*/ TodParticleSystem* ParticleTryToGet(ParticleSystemID theParticleID);
/*inline*/ ReanimationID ReanimationGetID(Reanimation* theReanimation);
/*inline*/ Reanimation* ReanimationGet(ReanimationID theReanimationID);
/*inline*/ Reanimation* ReanimationTryToGet(ReanimationID theReanimationID);
void RemoveReanimation(ReanimationID theReanimationID);
void RemoveParticle(ParticleSystemID theParticleID);
StoreScreen* ShowStoreScreen();
void KillStoreScreen();
bool HasSeedType(SeedType theSeedType);
/*inline*/ bool SeedTypeAvailable(SeedType theSeedType);
/*inline*/ void EndLevel();
inline bool IsIceDemo() { return false; }
/*inline*/ bool IsShovelLevel();
/*inline*/ bool IsWallnutBowlingLevel();
/*inline*/ bool IsMiniBossLevel();
/*inline*/ bool IsSlotMachineLevel();
/*inline*/ bool IsLittleTroubleLevel();
/*inline*/ bool IsStormyNightLevel();
/*inline*/ bool IsFinalBossLevel();
/*inline*/ bool IsBungeeBlitzLevel();
static /*inline*/ SeedType GetAwardSeedForLevel(int theLevel);
SexyString GetCrazyDaveText(int theMessageIndex);
/*inline*/ bool CanShowAlmanac();
/*inline*/ bool IsNight();
/*inline*/ bool CanShowStore();
/*inline*/ bool HasBeatenChallenge(GameMode theGameMode);
PottedPlant* GetPottedPlantByIndex(int thePottedPlantIndex);
static /*inline*/ bool IsSurvivalNormal(GameMode theGameMode);
static /*inline*/ bool IsSurvivalHard(GameMode theGameMode);
static /*inline*/ bool IsSurvivalEndless(GameMode theGameMode);
/*inline*/ bool HasFinishedAdventure();
/*inline*/ bool IsFirstTimeAdventureMode();
/*inline*/ bool CanSpawnYetis();
void CrazyDaveEnter();
void UpdateCrazyDave();
void CrazyDaveTalkIndex(int theMessageIndex);
void CrazyDaveTalkMessage(const SexyString& theMessage);
void CrazyDaveLeave();
void DrawCrazyDave(Graphics* g);
void CrazyDaveDie();
void CrazyDaveStopTalking();
void PreloadForUser();
int GetNumPreloadingTasks();
int LawnMessageBox(int theDialogId, const SexyChar* theHeaderName, const SexyChar* theLinesName, const SexyChar* theButton1Name, const SexyChar* theButton2Name, int theButtonMode);
virtual void EnforceCursor();
void ShowCreditScreen();
void KillCreditScreen();
static SexyString Pluralize(int theCount, const SexyChar* theSingular, const SexyChar* thePlural);
int GetNumTrophies(ChallengePage thePage);
/*inline*/ bool EarnedGoldTrophy();
inline bool IsRegistered() { return false; }
inline bool IsExpired() { return false; }
inline bool IsDRMConnected() { return false; }
/*inline*/ bool IsScaryPotterLevel();
static /*inline*/ bool IsEndlessScaryPotter(GameMode theGameMode);
/*inline*/ bool IsSquirrelLevel();
/*inline*/ bool IsIZombieLevel();
/*inline*/ bool CanShowZenGarden();
static SexyString GetMoneyString(int theAmount);
bool AdvanceCrazyDaveText();
/*inline*/ bool IsWhackAZombieLevel();
void UpdatePlayTimeStats();
void BetaAddFile(std::list<std::string>& theUploadFileList, std::string theFileName, std::string theShortName);
bool CanPauseNow();
/*inline*/ bool IsPuzzleMode();
/*inline*/ bool IsChallengeMode();
static /*inline*/ bool IsEndlessIZombie(GameMode theGameMode);
void CrazyDaveDoneHanding();
inline SexyString GetCurrentLevelName() { return _S("Unknown"); }
/*inline*/ int TrophiesNeedForGoldSunflower();
/*inline*/ int GetCurrentChallengeIndex();
void LoadGroup(const char* theGroupName, int theGroupAveMsToLoad);
// void TraceLoadGroup(const char* theGroupName, int theGroupTime, int theTotalGroupWeigth, int theTaskWeight);
void CrazyDaveStopSound();
/*inline*/ bool IsTrialStageLocked();
/*inline*/ void FinishZenGardenToturial();
bool UpdatePlayerProfileForFinishingLevel();
bool SaveFileExists();
/*inline*/ bool CanDoPinataMode();
/*inline*/ bool CanDoDanceMode();
/*inline*/ bool CanDoDaisyMode();
virtual void SwitchScreenMode(bool wantWindowed, bool is3d, bool force = false);
static /*inline*/ void CenterDialog(Dialog* theDialog, int theWidth, int theHeight);
};
SexyString LawnGetCurrentLevelName();
bool LawnGetCloseRequest();
bool LawnHasUsedCheatKeys();
void BetaSubmitFunc();
extern bool (*gAppCloseRequest)(); //[0x69E6A0]
extern bool (*gAppHasUsedCheatKeys)(); //[0x69E6A4]
extern SexyString (*gGetCurrentLevelName)();
extern bool gIsPartnerBuild;
extern bool gFastMo; //0x6A9EAB
extern bool gSlowMo; //0x6A9EAA
extern LawnApp* gLawnApp; //0x6A9EC0
extern int gSlowMoCounter; //0x6A9EC4
#endif // __LAWNAPP_H__