Skip to content

Commit 7fbb913

Browse files
committed
Undo states and saving for sprite editor
1 parent 9f4ad13 commit 7fbb913

File tree

2 files changed

+250
-2
lines changed

2 files changed

+250
-2
lines changed

IDE/Contents/Include/PolycodeSpriteEditor.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,25 @@ class PolycodeSpriteEditorActionData : public PolycodeEditorActionData {
3333
public:
3434
PolycodeSpriteEditorActionData() {
3535
reverse = true;
36+
sprite = NULL;
37+
state = NULL;
3638
}
3739

3840
~PolycodeSpriteEditorActionData() {
41+
3942
}
4043

4144
Sprite *sprite;
4245
SpriteState *state;
4346
String name;
47+
48+
Number stateFPS;
49+
Number stateScale;
50+
Vector2 stateBBox;
51+
Vector2 stateOffset;
52+
53+
std::vector<unsigned int> frameIDs;
54+
std::vector<SpriteFrame> spriteFrames;
4455
bool reverse;
4556
};
4657

@@ -87,6 +98,11 @@ class SpriteSheetEditor : public UIElement {
8798

8899
void Resize(Number width, Number height);
89100

101+
PolycodeEditor *editor;
102+
103+
SpriteSet *sprite;
104+
UIRect *previewImage;
105+
90106
protected:
91107

92108
UIRect *headerBg;
@@ -108,8 +124,6 @@ class SpriteSheetEditor : public UIElement {
108124
Vector2 panMouseBase;
109125
bool panning;
110126

111-
SpriteSet *sprite;
112-
UIRect *previewImage;
113127

114128
std::vector<Vector2> defaultAnchors;
115129

@@ -196,6 +210,8 @@ class SpriteStateEditBar : public UIElement {
196210
void setSceneSprite(SceneSprite *sprite);
197211
void setSpriteState(SpriteState *state);
198212

213+
PolycodeEditor *editor;
214+
199215
protected:
200216

201217
Vector2 clickBaseCoord;
@@ -255,12 +271,16 @@ class SpriteStateEditorDetails : public UIElement {
255271
SpriteState *getSpriteState();
256272

257273
void setSceneSprite(SceneSprite *spritePreview);
274+
275+
PolycodeSpriteEditorActionData *makeStateData();
258276

259277
void refreshState();
260278

261279
UIButton *getAppendFramesButton();
262280
SpriteStateEditBar *getEditBar();
263281

282+
PolycodeEditor *editor;
283+
264284
protected:
265285

266286
UIRect *headerBg;

0 commit comments

Comments
 (0)