Prop tool - only check GoL rulestings / names for ctype
They are meaningless when applied to any other property, even .type
This commit is contained in:
parent
e26ec36fe9
commit
14be92c013
@ -108,7 +108,15 @@ void PropertyWindow::SetProperty()
|
|||||||
//#C0FFEE
|
//#C0FFEE
|
||||||
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
||||||
}
|
}
|
||||||
else if (value.length() > 1 && value.BeginsWith("B") && value.Contains("/"))
|
else
|
||||||
|
{
|
||||||
|
// Try to parse as particle name
|
||||||
|
v = sim->GetParticleType(value.ToUtf8());
|
||||||
|
|
||||||
|
// Try to parse special GoL rules
|
||||||
|
if (v == -1 && properties[property->GetOption().second].Name == "ctype")
|
||||||
|
{
|
||||||
|
if (value.length() > 1 && value.BeginsWith("B") && value.Contains("/"))
|
||||||
{
|
{
|
||||||
v = ParseGOLString(value);
|
v = ParseGOLString(value);
|
||||||
if (v == -1)
|
if (v == -1)
|
||||||
@ -133,6 +141,10 @@ void PropertyWindow::SetProperty()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse as plain number
|
||||||
if (v == -1)
|
if (v == -1)
|
||||||
{
|
{
|
||||||
v = value.ToNumber<int>();
|
v = value.ToNumber<int>();
|
||||||
|
@ -5,7 +5,7 @@ std::vector<StructProperty> const &Particle::GetProperties()
|
|||||||
{
|
{
|
||||||
static std::vector<StructProperty> properties = {
|
static std::vector<StructProperty> properties = {
|
||||||
{ "type" , StructProperty::ParticleType, (intptr_t)(offsetof(Particle, type )) },
|
{ "type" , StructProperty::ParticleType, (intptr_t)(offsetof(Particle, type )) },
|
||||||
{ "life" , StructProperty::ParticleType, (intptr_t)(offsetof(Particle, life )) },
|
{ "life" , StructProperty::Integer , (intptr_t)(offsetof(Particle, life )) },
|
||||||
{ "ctype" , StructProperty::ParticleType, (intptr_t)(offsetof(Particle, ctype )) },
|
{ "ctype" , StructProperty::ParticleType, (intptr_t)(offsetof(Particle, ctype )) },
|
||||||
{ "x" , StructProperty::Float , (intptr_t)(offsetof(Particle, x )) },
|
{ "x" , StructProperty::Float , (intptr_t)(offsetof(Particle, x )) },
|
||||||
{ "y" , StructProperty::Float , (intptr_t)(offsetof(Particle, y )) },
|
{ "y" , StructProperty::Float , (intptr_t)(offsetof(Particle, y )) },
|
||||||
|
Reference in New Issue
Block a user