| 5428 | */ |
| 5429 | |
| 5430 | lua_State* InitializeScript(dmScript::HContext script_context) |
| 5431 | { |
| 5432 | lua_State* L = dmScript::GetLuaState(script_context); |
| 5433 | |
| 5434 | int top = lua_gettop(L); |
| 5435 | (void)top; |
| 5436 | |
| 5437 | GUI_SCRIPT_TYPE_HASH = dmScript::RegisterUserType(L, GUI_SCRIPT, GuiScript_methods, GuiScript_meta); |
| 5438 | |
| 5439 | GUI_SCRIPT_INSTANCE_TYPE_HASH = dmScript::RegisterUserType(L, GUI_SCRIPT_INSTANCE, GuiScriptInstance_methods, GuiScriptInstance_meta); |
| 5440 | |
| 5441 | NODE_PROXY_TYPE_HASH = dmScript::RegisterUserType(L, NODE_PROXY_TYPE_NAME, NodeProxy_methods, NodeProxy_meta); |
| 5442 | |
| 5443 | luaL_register(L, LIB_NAME, Gui_methods); |
| 5444 | |
| 5445 | #define SETPROP(name, prop) \ |
| 5446 | lua_pushliteral(L, #name);\ |
| 5447 | lua_setfield(L, -2, "PROP_"#prop);\ |
| 5448 | |
| 5449 | SETPROP(position, POSITION) |
| 5450 | SETPROP(rotation, ROTATION) |
| 5451 | SETPROP(euler, EULER) |
| 5452 | SETPROP(scale, SCALE) |
| 5453 | SETPROP(color, COLOR) |
| 5454 | SETPROP(outline, OUTLINE) |
| 5455 | SETPROP(shadow, SHADOW) |
| 5456 | SETPROP(size, SIZE) |
| 5457 | SETPROP(fill_angle, FILL_ANGLE) |
| 5458 | SETPROP(inner_radius, INNER_RADIUS) |
| 5459 | SETPROP(leading, LEADING) |
| 5460 | SETPROP(tracking, TRACKING) |
| 5461 | SETPROP(slice9, SLICE9) |
| 5462 | |
| 5463 | #undef SETPROP |
| 5464 | |
| 5465 | #define SETTYPE(name) \ |
| 5466 | lua_pushnumber(L, (lua_Number) NODE_TYPE_##name); \ |
| 5467 | lua_setfield(L, -2, "TYPE_"#name);\ |
| 5468 | |
| 5469 | SETTYPE(BOX) |
| 5470 | SETTYPE(TEXT) |
| 5471 | SETTYPE(PIE) |
| 5472 | SETTYPE(PARTICLEFX) |
| 5473 | SETTYPE(CUSTOM) |
| 5474 | |
| 5475 | #undef SETTYPE |
| 5476 | |
| 5477 | // For backwards compatibility |
| 5478 | #define SETEASINGOLD(name, easing) \ |
| 5479 | lua_pushnumber(L, (lua_Number) easing); \ |
| 5480 | lua_setfield(L, -2, "EASING_"#name);\ |
| 5481 | |
| 5482 | SETEASINGOLD(NONE, dmEasing::TYPE_LINEAR) |
| 5483 | SETEASINGOLD(IN, dmEasing::TYPE_INCUBIC) |
| 5484 | SETEASINGOLD(OUT, dmEasing::TYPE_OUTCUBIC) |
| 5485 | SETEASINGOLD(INOUT, dmEasing::TYPE_INOUTCUBIC) |
| 5486 | |
| 5487 | #undef SETEASINGOLD |
nothing calls this directly
no test coverage detected