-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.h
171 lines (138 loc) · 5.5 KB
/
Main.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
// Main.h
// Definitions and classes for the object workings
// Only include once
#ifndef MAIN_H
#define MAIN_H
#define MINIMUM_VERSION 1
// IDE FLAGS
// Can be a combination of:
//OF_NOSIZE - Extension cannot be resized at edittime
//OF_NODRAW - Extension does not display anything
//OF_ALLOWANGLES - Can be rotated at edittime
//OF_PRIVATEVARIABLES - Uses private variables
//OF_MOVEMENTPLUGIN - Is a movement plugin
//OF_MOVEMENTS - Allow movement plugins to be added
//OF_EFFECTS - Allow display effects
//OF_NOCOMMONDEBUG - Don't show 'Common' field (X/Y/W/H/Angle/Opacity) in debugger
//OF_NODEBUG - Don't show at all in debugger
//OF_UNDEFINEDEXPRESSIONS - Allow ReturnUndefinedExpression to be called
#define IDE_FLAGS OF_NOSIZE | OF_NODRAW
#include "Common\ExpReturn.hpp"
#define OBJECTRECT CRect(editObject->objectX, editObject->objectY, editObject->objectX + editObject->objectWidth, editObject->objectY + editObject->objectHeight)
//////////// RUNTIME OBJECT ////////////
// Add any member functions or data you want to this class.
// Your extension inherits CRunObject. See the definition
// for the default member values you have access to.
class ExtObject : public CRunObject
{
public:
// Constructor (called when Construct creates the object)
ExtObject(initialObject* editObject, VRuntime* pVRuntime);
// Destructor (called when Construct destroys the object)
~ExtObject();
IRenderer* const renderer;
//////////////////////////
// OnFrame: called once per frame just before Draw() (after the events list)
// OnFrame2: called once per frame just after Draw() (before the events list)
BOOL OnFrame();
BOOL OnFrame2();
// Draw: called when Construct wants you to render your object.
void Draw();
// WindowProc is called if your extension creates a window and calls RegisterWindow().
LRESULT WindowProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
BOOL PreTranslateMessage(MSG* msg);
// Return default expression editor value and undefined expressions when enabled.
long ReturnDefaultValue(LPVAL params, ExpReturn& ret);
long ReturnUndefinedExpression(CString& expName, LPVAL params, ExpReturn& ret);
// Called just after the constructor when your object has been prepared.
void OnCreate();
// Called when a frame changes and your object is global
void OnFrameChange(int oldFrame, int newFrame);
// Called when your object should save/load itself at runtime
void Serialize(bin& ar);
// Data functions
long GetData(int id, void* param);
long CallFunction(int id, void* param);
// Debugging
void DebuggerUpdateDisplay(ExpStore*& pPrivateVars);
void OnDebuggerValueChanged(const char* name, const char* value);
////////////////////////////////////////////////////
// ACTIONS, CONDITIONS AND EXPRESSIONS DEFINITIONS
#include "Common\CommonAceDecl.hpp"
// Conditions
long cIsTrophyAchieved( LPVAL params );
long cIsValidUser( LPVAL params );
long cIsGuestScore( LPVAL params );
long cIsGameStorageItemSet( LPVAL params );
long cIsUserStorageItemSet( LPVAL params );
// Actions
long aSetGameID( LPVAL params );
long aSetGamePrivateKey( LPVAL params );
long aSetUsername( LPVAL params );
long aSetUserToken( LPVAL params );
long aAddAchievedTrophy( LPVAL params );
long aSetGameStorageItem( LPVAL params );
long aSetUserStorageItem( LPVAL params );
long aRemoveGameStorageItem( LPVAL params );
long aRemoveUserStorageItem( LPVAL params );
long aLoadScores( LPVAL params );
long aAddScore( LPVAL params );
// Expressions
long eGetGameID( LPVAL params, ExpReturn &ret );
long eGetGamePrivateKey( LPVAL params, ExpReturn &ret );
long eGetUsername( LPVAL params, ExpReturn &ret );
long eGetUserToken( LPVAL params, ExpReturn &ret );
long eGetErrorMessage( LPVAL params, ExpReturn &ret );
long eGetTrophyTitle( LPVAL params, ExpReturn &ret );
long eGetTrophyDescription( LPVAL params, ExpReturn &ret );
long eGetTrophyDifficulty( LPVAL params, ExpReturn &ret );
long eGetTrophyAchievedDate( LPVAL params, ExpReturn &ret );
long eGetGameStorageData( LPVAL params, ExpReturn &ret );
long eGetUserStorageData( LPVAL params, ExpReturn &ret );
long eGetScoresCount( LPVAL params, ExpReturn &ret );
long eGetScoreString( LPVAL params, ExpReturn &ret );
long eGetScoreSort( LPVAL params, ExpReturn &ret );
long eGetScoreExtraData( LPVAL params, ExpReturn &ret );
long eGetScoreUser( LPVAL params, ExpReturn &ret );
long eGetScoreUserID( LPVAL params, ExpReturn &ret );
long eGetScoreStoredDate( LPVAL params, ExpReturn &ret );
////////////////////////////////////////////////////
// Data members
GameJoltAPI api;
int m_LoadScoresCount;
vector<Score> m_Scores;
// Use when private variables (OF_PRIVATEVARIABLES) are enabled.
//vector<ExpStore> privateVars;
};
//////////// EDITTIME INFO ////////////
class EditExt
{
public:
///////////////////////////
// Class data
EditExt(class VEditTime* pVEditTime, class editInfo* pEInfo);
~EditExt();
void Draw();
int GetMenuIcons(int ACEMenu);
void Initialize();
void OnPut();
void OnRemoved();
int OnShowACEMenu(TABLE ACEType);
BOOL OnSizeObject();
void Serialize(bin& ar);
void OnPropertiesUpdate();
void GetAnimationHandle(int& handle);
class VEditTime* pEditTime; // Pointer to Virtual Edittime
class editInfo* pInfo; // Pointer to object edittime info
int iTexture; // DX texture
///////////////////////////
// Your edittime extension data goes here
int m_GameID;
CString m_GamePrivateKey;
int m_LoadScoresCount;
};
// Internal stuff include
#include "Common\Internal.hpp"
#include "Common\Properties.h"
// Only include once
#endif