@@ -27,6 +27,8 @@ LitObject::LitObject(const ReaderMapping& reader) :
27
27
m_light_offset(-6 .f, -17 .f),
28
28
m_sprite_name(" images/objects/lightflower/lightflower1.sprite" ),
29
29
m_light_sprite_name(" images/objects/lightflower/light/glow_light.sprite" ),
30
+ m_sprite_action(" default" ),
31
+ m_light_sprite_action(" default" ),
30
32
m_sprite(),
31
33
m_light_sprite(),
32
34
m_layer(0 ),
@@ -42,6 +44,9 @@ LitObject::LitObject(const ReaderMapping& reader) :
42
44
reader.get (" light-sprite" , m_light_sprite_name);
43
45
reader.get (" layer" , m_layer, 0 );
44
46
47
+ reader.get (" action" , m_sprite_action);
48
+ reader.get (" light-action" , m_light_sprite_action);
49
+
45
50
std::vector<float > vColor;
46
51
if (!reader.get (" color" , vColor)) vColor = { 1 .f , 1 .f , 1 .f };
47
52
@@ -52,6 +57,9 @@ LitObject::LitObject(const ReaderMapping& reader) :
52
57
m_light_sprite = SpriteManager::current ()->create (m_light_sprite_name);
53
58
m_light_sprite->set_blend (Blend::ADD);
54
59
60
+ m_sprite->set_action (m_sprite_action);
61
+ m_light_sprite->set_action (m_light_sprite_action);
62
+
55
63
m_col.m_bbox .set_size (static_cast <float >(m_sprite->get_width ()),
56
64
static_cast <float >(m_sprite->get_height ()));
57
65
}
@@ -73,10 +81,13 @@ LitObject::get_settings()
73
81
{
74
82
ObjectSettings result = MovingObject::get_settings ();
75
83
76
- result.add_sprite (_ (" Sprite" ), &m_sprite_name, " sprite" , std::string (" images/objects/torch/torch1 .sprite" ));
77
- result.add_sprite (_ (" Light sprite" ), &m_light_sprite_name, " light-sprite" , std::string (" images/objects/torch/torch1 .sprite" ));
84
+ result.add_sprite (_ (" Sprite" ), &m_sprite_name, " sprite" , std::string (" images/objects/lightflower/lightflower1 .sprite" ));
85
+ result.add_sprite (_ (" Light sprite" ), &m_light_sprite_name, " light-sprite" , std::string (" images/objects/lightflower/light/glow_light .sprite" ));
78
86
result.add_int (_ (" Layer" ), &m_layer, " layer" , 0 );
79
87
88
+ result.add_text (_ (" Sprite starting action" ), &m_sprite_action, " action" , std::string (" default" ));
89
+ result.add_text (_ (" Light sprite starting action" ), &m_light_sprite_action, " light-action" , std::string (" default" ));
90
+
80
91
result.add_float (_ (" Light sprite offset X" ), &m_light_offset.x , " light-offset-x" );
81
92
result.add_float (_ (" Light sprite offset Y" ), &m_light_offset.y , " light-offset-y" );
82
93
@@ -90,6 +101,9 @@ LitObject::after_editor_set()
90
101
m_light_sprite = SpriteManager::current ()->create (m_light_sprite_name);
91
102
m_light_sprite->set_blend (Blend::ADD);
92
103
104
+ m_sprite->set_action (m_sprite_action);
105
+ m_light_sprite->set_action (m_light_sprite_action);
106
+
93
107
m_col.m_bbox .set_size (static_cast <float >(m_sprite->get_width ()),
94
108
static_cast <float >(m_sprite->get_height ()));
95
109
}
0 commit comments