mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-28 17:30:56 +00:00
more node colors to indicate type of node:
green: with Lua script attached purple: built-in effect, no Lua script attached salmon: default (no effect, no script)
This commit is contained in:
parent
2373fd7170
commit
32168bae9f
3 changed files with 21 additions and 9 deletions
|
@ -21,6 +21,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Avatar.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()
|
Path::Path()
|
||||||
{
|
{
|
||||||
addType(SCO_PATH);
|
addType(SCO_PATH);
|
||||||
|
@ -54,6 +59,7 @@ Path::Path()
|
||||||
pauseFreeze = true;
|
pauseFreeze = true;
|
||||||
activationRange = 800;
|
activationRange = 800;
|
||||||
minimapIcon = 0;
|
minimapIcon = 0;
|
||||||
|
editorColor = DEFAULT_NODE_COLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Path::clampPosition(Vector *pos, float radius)
|
void Path::clampPosition(Vector *pos, float radius)
|
||||||
|
@ -273,6 +279,9 @@ void Path::refreshScript()
|
||||||
amount = 0;
|
amount = 0;
|
||||||
content.clear();
|
content.clear();
|
||||||
label.clear();
|
label.clear();
|
||||||
|
editorColor = DEFAULT_NODE_COLOR;
|
||||||
|
pathType = PATH_NONE;
|
||||||
|
bool builtin = false;
|
||||||
|
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
|
@ -412,6 +421,7 @@ void Path::refreshScript()
|
||||||
is >> dummy >> vox >> re;
|
is >> dummy >> vox >> re;
|
||||||
if (!re.empty())
|
if (!re.empty())
|
||||||
replayVox = true;
|
replayVox = true;
|
||||||
|
builtin = true;
|
||||||
}
|
}
|
||||||
else if (label == "warp")
|
else if (label == "warp")
|
||||||
{
|
{
|
||||||
|
@ -437,6 +447,7 @@ void Path::refreshScript()
|
||||||
spawnEnemyDistance = 0;
|
spawnEnemyDistance = 0;
|
||||||
is >> dummy >> spawnEnemyName >> spawnEnemyDistance >> spawnEnemyNumber;
|
is >> dummy >> spawnEnemyName >> spawnEnemyDistance >> spawnEnemyNumber;
|
||||||
neverSpawned = true;
|
neverSpawned = true;
|
||||||
|
builtin = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (label == "pe")
|
else if (label == "pe")
|
||||||
|
@ -444,11 +455,14 @@ void Path::refreshScript()
|
||||||
std::string dummy, particleEffect;
|
std::string dummy, particleEffect;
|
||||||
SimpleIStringStream is(name);
|
SimpleIStringStream is(name);
|
||||||
is >> dummy >> particleEffect;
|
is >> dummy >> particleEffect;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setEmitter(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)
|
void Path::setEmitter(const std::string& name)
|
||||||
|
|
|
@ -113,6 +113,7 @@ public:
|
||||||
void refreshScript();
|
void refreshScript();
|
||||||
MinimapIcon *ensureMinimapIcon();
|
MinimapIcon *ensureMinimapIcon();
|
||||||
|
|
||||||
|
Vector editorColor;
|
||||||
bool updateFunction;
|
bool updateFunction;
|
||||||
bool activateFunction;
|
bool activateFunction;
|
||||||
bool cursorActivation;
|
bool cursorActivation;
|
||||||
|
|
|
@ -46,10 +46,8 @@ void PathRender::onRender(const RenderState& rs) const
|
||||||
|
|
||||||
if (selidx == i)
|
if (selidx == i)
|
||||||
glColor4f(1, 1, 1, 0.75f);
|
glColor4f(1, 1, 1, 0.75f);
|
||||||
else if(p->hasScript())
|
|
||||||
glColor4f(0.5f, 0.8f, 0.5f, 0.75f);
|
|
||||||
else
|
else
|
||||||
glColor4f(1, 0.5f, 0.5f, 0.75f);
|
glColor4f(p->editorColor.x, p->editorColor.y, p->editorColor.z, 0.75f);
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
for (size_t n = 0; n < p->nodes.size()-1; n++)
|
for (size_t n = 0; n < p->nodes.size()-1; n++)
|
||||||
|
@ -61,8 +59,7 @@ void PathRender::onRender(const RenderState& rs) const
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
glLineWidth(1);
|
||||||
glLineWidth(1);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < pathcount; i++)
|
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;
|
float a = 0.75f;
|
||||||
if (!p->active)
|
if (!p->active)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue