[DEV] add scene start stop option config
This commit is contained in:
parent
73455cc61b
commit
45fb9f5ffe
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
const char * const ege::widget::Scene::eventPlayTimeChange = "event-scene-play-time-change";
|
const char * const ege::widget::Scene::eventPlayTimeChange = "event-scene-play-time-change";
|
||||||
const char * const ege::widget::Scene::eventKillEnemy = "event-scene-kill-ennemy";
|
const char * const ege::widget::Scene::eventKillEnemy = "event-scene-kill-ennemy";
|
||||||
|
const char * const ege::widget::Scene::configStatus = "status";
|
||||||
|
|
||||||
|
|
||||||
ege::widget::Scene::Scene(bool _setAutoBullet, bool _setAutoCamera) :
|
ege::widget::Scene::Scene(bool _setAutoBullet, bool _setAutoCamera) :
|
||||||
@ -50,6 +50,7 @@ ege::widget::Scene::Scene(bool _setAutoBullet, bool _setAutoCamera) :
|
|||||||
periodicCallEnable();
|
periodicCallEnable();
|
||||||
addEventId(eventPlayTimeChange);
|
addEventId(eventPlayTimeChange);
|
||||||
addEventId(eventKillEnemy);
|
addEventId(eventKillEnemy);
|
||||||
|
registerConfig(configStatus, "list", "start;stop", "Satus of the activity of the Scene");
|
||||||
|
|
||||||
m_debugDrawing = ewol::resource::Colored3DObject::keep();
|
m_debugDrawing = ewol::resource::Colored3DObject::keep();
|
||||||
|
|
||||||
@ -371,4 +372,34 @@ vec3 ege::widget::Scene::convertScreenPositionInMapPosition(const vec2& _posScre
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ege::widget::Scene::onSetConfig(const ewol::object::Config& _conf) {
|
||||||
|
if (true == Widget::onSetConfig(_conf)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_conf.getConfig() == configStatus) {
|
||||||
|
if(compare_no_case(_conf.getData(), "start") == true) {
|
||||||
|
resume();
|
||||||
|
} else if(compare_no_case(_conf.getData(), "stop") == true) {
|
||||||
|
pause();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ege::widget::Scene::onGetConfig(const char* _config, std::string& _result) const {
|
||||||
|
if (true == ewol::Widget::onGetConfig(_config, _result)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (_config == configStatus) {
|
||||||
|
if (m_isRunning == true) {
|
||||||
|
_result = "start";
|
||||||
|
} else {
|
||||||
|
_result = "stop";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,8 +37,11 @@ namespace ege {
|
|||||||
namespace widget {
|
namespace widget {
|
||||||
class Scene : public ewol::Widget {
|
class Scene : public ewol::Widget {
|
||||||
public:
|
public:
|
||||||
|
// extern event
|
||||||
static const char * const eventPlayTimeChange;
|
static const char * const eventPlayTimeChange;
|
||||||
static const char * const eventKillEnemy;
|
static const char * const eventKillEnemy;
|
||||||
|
// configurations:
|
||||||
|
static const char * const configStatus;
|
||||||
protected:
|
protected:
|
||||||
ege::Environement m_env;
|
ege::Environement m_env;
|
||||||
public:
|
public:
|
||||||
@ -133,6 +136,8 @@ namespace ege {
|
|||||||
|
|
||||||
protected: // Derived function
|
protected: // Derived function
|
||||||
virtual void onDraw();
|
virtual void onDraw();
|
||||||
|
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||||
|
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||||
public: // Derived function
|
public: // Derived function
|
||||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||||
virtual void onRegenerateDisplay();
|
virtual void onRegenerateDisplay();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user