| 599 | } |
| 600 | |
| 601 | void FLuaEnv::AddSearcher(lua_CFunction Searcher, int Index) const |
| 602 | { |
| 603 | lua_getglobal(L, "package"); |
| 604 | lua_getfield(L, -1, "searchers"); |
| 605 | lua_remove(L, -2); |
| 606 | if (!lua_istable(L, -1)) |
| 607 | { |
| 608 | UE_LOG(LogUnLua, Warning, TEXT("Invalid package.serachers!")); |
| 609 | return; |
| 610 | } |
| 611 | |
| 612 | const uint32 Len = lua_rawlen(L, -1); |
| 613 | Index = Index < 0 ? (int)(Len + Index + 2) : Index; |
| 614 | for (int e = (int)Len + 1; e > Index; e--) |
| 615 | { |
| 616 | lua_rawgeti(L, -1, e - 1); |
| 617 | lua_rawseti(L, -2, e); |
| 618 | } |
| 619 | |
| 620 | lua_pushlightuserdata(L, (void*)this); |
| 621 | lua_pushcclosure(L, Searcher, 1); |
| 622 | lua_rawseti(L, -2, Index); |
| 623 | lua_pop(L, 1); |
| 624 | } |
| 625 | |
| 626 | void FLuaEnv::OnAsyncLoadingFlushUpdate() |
| 627 | { |
nothing calls this directly
no test coverage detected