gets the node type * * @name gui.get_type * @param node [type:node] node from which to get the type * @return type [type:constant] type * * - `gui.TYPE_BOX` * - `gui.TYPE_TEXT` * - `gui.TYPE_PIE` * - `gui.TYPE_PARTICLEFX` * - `gui.TYPE_CUSTOM` * * @return subtype [type:number|nil] id of the custom type */
| 574 | * @return subtype [type:number|nil] id of the custom type |
| 575 | */ |
| 576 | static int LuaGetType(lua_State* L) |
| 577 | { |
| 578 | int top = lua_gettop(L); |
| 579 | (void) top; |
| 580 | |
| 581 | dmGui::HScene scene = dmGui::GuiScriptInstance_Check(L); |
| 582 | |
| 583 | HNode hnode; |
| 584 | LuaCheckNodeInternal(L, 1, &hnode); |
| 585 | |
| 586 | dmGui::NodeType type = dmGui::GetNodeType(scene, hnode); |
| 587 | lua_pushnumber(L, type); |
| 588 | |
| 589 | if (type == NODE_TYPE_CUSTOM) |
| 590 | { |
| 591 | uint32_t subtype = dmGui::GetNodeCustomType(scene, hnode); |
| 592 | lua_pushnumber(L, (lua_Number) subtype); |
| 593 | } |
| 594 | else |
| 595 | { |
| 596 | lua_pushnil(L); |
| 597 | } |
| 598 | |
| 599 | assert(top + 2 == lua_gettop(L)); |
| 600 | |
| 601 | return 2; |
| 602 | } |
| 603 | |
| 604 | /*# sets the id of the specified node |
| 605 | * |
nothing calls this directly
no test coverage detected