diff --git a/Aquaria/Path.cpp b/Aquaria/Path.cpp index 28ac8ee..2fb8f28 100644 --- a/Aquaria/Path.cpp +++ b/Aquaria/Path.cpp @@ -21,6 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Game.h" #include "Avatar.h" +static const Vector DEFAULT_NODE_COLOR (1, 0.5f, 0.5f); +static const Vector SCRIPTED_NODE_COLOR(0.5f, 0.8f, 0.5f); +static const Vector BUILTIN_NODE_COLOR (1, 0.3f, 1); + + Path::Path() { addType(SCO_PATH); @@ -54,6 +59,7 @@ Path::Path() pauseFreeze = true; activationRange = 800; minimapIcon = 0; + editorColor = DEFAULT_NODE_COLOR; } void Path::clampPosition(Vector *pos, float radius) @@ -273,6 +279,9 @@ void Path::refreshScript() amount = 0; content.clear(); label.clear(); + editorColor = DEFAULT_NODE_COLOR; + pathType = PATH_NONE; + bool builtin = false; destroy(); @@ -412,6 +421,7 @@ void Path::refreshScript() is >> dummy >> vox >> re; if (!re.empty()) replayVox = true; + builtin = true; } else if (label == "warp") { @@ -437,6 +447,7 @@ void Path::refreshScript() spawnEnemyDistance = 0; is >> dummy >> spawnEnemyName >> spawnEnemyDistance >> spawnEnemyNumber; neverSpawned = true; + builtin = true; } else if (label == "pe") @@ -444,11 +455,14 @@ void Path::refreshScript() std::string dummy, particleEffect; SimpleIStringStream is(name); is >> dummy >> particleEffect; - - - setEmitter(particleEffect); + builtin = true; } + + if(script) + editorColor = SCRIPTED_NODE_COLOR; + else if(pathType != PATH_NONE || builtin) + editorColor = BUILTIN_NODE_COLOR; } void Path::setEmitter(const std::string& name) diff --git a/Aquaria/Path.h b/Aquaria/Path.h index 856223a..d468a3a 100644 --- a/Aquaria/Path.h +++ b/Aquaria/Path.h @@ -113,6 +113,7 @@ public: void refreshScript(); MinimapIcon *ensureMinimapIcon(); + Vector editorColor; bool updateFunction; bool activateFunction; bool cursorActivation; diff --git a/Aquaria/PathRender.cpp b/Aquaria/PathRender.cpp index 6cffb1b..a1bedac 100644 --- a/Aquaria/PathRender.cpp +++ b/Aquaria/PathRender.cpp @@ -46,10 +46,8 @@ void PathRender::onRender(const RenderState& rs) const if (selidx == i) glColor4f(1, 1, 1, 0.75f); - else if(p->hasScript()) - glColor4f(0.5f, 0.8f, 0.5f, 0.75f); else - glColor4f(1, 0.5f, 0.5f, 0.75f); + glColor4f(p->editorColor.x, p->editorColor.y, p->editorColor.z, 0.75f); glBegin(GL_LINES); for (size_t n = 0; n < p->nodes.size()-1; n++) @@ -61,8 +59,7 @@ void PathRender::onRender(const RenderState& rs) const } glEnd(); } - - glLineWidth(1); + glLineWidth(1); for (size_t i = 0; i < pathcount; i++) { @@ -104,7 +101,7 @@ void PathRender::onRender(const RenderState& rs) const } } - Vector color = p->hasScript() ? Vector(0.5f, 0.8f, 0.5f) : Vector(1, 0.5f, 0.5f); + Vector color = p->editorColor; float a = 0.75f; if (!p->active) {