mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-16 21:34:01 +02:00
Allow both BrE and AmE spellings of colour with Lua
This commit is contained in:
@@ -330,6 +330,9 @@ int luacon_particle_getproperty(char * key, int * format)
|
|||||||
} else if (strcmp(key, "dcolour")==0){
|
} else if (strcmp(key, "dcolour")==0){
|
||||||
offset = offsetof(particle, dcolour);
|
offset = offsetof(particle, dcolour);
|
||||||
*format = 0;
|
*format = 0;
|
||||||
|
} else if (strcmp(key, "dcolor")==0){
|
||||||
|
offset = offsetof(particle, dcolour);
|
||||||
|
*format = 0;
|
||||||
} else {
|
} else {
|
||||||
offset = -1;
|
offset = -1;
|
||||||
}
|
}
|
||||||
@@ -440,6 +443,10 @@ int luacon_element_getproperty(char * key, int * format)
|
|||||||
offset = offsetof(part_type, pcolors);
|
offset = offsetof(part_type, pcolors);
|
||||||
*format = 0;
|
*format = 0;
|
||||||
}
|
}
|
||||||
|
if (strcmp(key, "colour")==0){
|
||||||
|
offset = offsetof(part_type, pcolors);
|
||||||
|
*format = 0;
|
||||||
|
}
|
||||||
else if (strcmp(key, "advection")==0){
|
else if (strcmp(key, "advection")==0){
|
||||||
offset = offsetof(part_type, advection);
|
offset = offsetof(part_type, advection);
|
||||||
*format = 1;
|
*format = 1;
|
||||||
@@ -1036,6 +1043,7 @@ int luatpt_set_property(lua_State* l)
|
|||||||
h = abs(luaL_optint(l, 6, -1));
|
h = abs(luaL_optint(l, 6, -1));
|
||||||
else
|
else
|
||||||
h = -1;
|
h = -1;
|
||||||
|
//TODO: Use particle_getproperty
|
||||||
if (strcmp(prop,"type")==0){
|
if (strcmp(prop,"type")==0){
|
||||||
offset = offsetof(particle, type);
|
offset = offsetof(particle, type);
|
||||||
format = 3;
|
format = 3;
|
||||||
@@ -1177,6 +1185,7 @@ int luatpt_get_property(lua_State* l)
|
|||||||
return luaL_error(l, "Invalid particle ID '%d'", i);
|
return luaL_error(l, "Invalid particle ID '%d'", i);
|
||||||
if (parts[i].type)
|
if (parts[i].type)
|
||||||
{
|
{
|
||||||
|
//TODO: Use particle_getproperty
|
||||||
if (strcmp(prop,"type")==0){
|
if (strcmp(prop,"type")==0){
|
||||||
lua_pushinteger(l, parts[i].type);
|
lua_pushinteger(l, parts[i].type);
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user