Skip to content

Commit

Permalink
Add Lua access to SongUtil comparator for Song Titles
Browse files Browse the repository at this point in the history
but none of the others because im lazy at the moment and just need this one
  • Loading branch information
poco0317 committed Nov 2, 2020
1 parent 62c3fc9 commit 24cc4c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Etterna/Models/Songs/SongUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,20 @@ IsStepsPlayable(lua_State* L)
return 1;
}

int
SongTitleComparator(lua_State* L)
{
auto* p1 = Luna<Song>::check(L, 1, true);
auto* p2 = Luna<Song>::check(L, 2, true);
const auto b = CompareSongPointersByTitle(p1, p2);
LuaHelpers::Push(L, b);
return 1;
}

const luaL_Reg SongUtilTable[] = { LIST_METHOD(GetPlayableSteps),
LIST_METHOD(IsStepsTypePlayable),
LIST_METHOD(IsStepsPlayable),
LIST_METHOD(SongTitleComparator),
{ nullptr, nullptr } };
}

Expand Down

0 comments on commit 24cc4c5

Please sign in to comment.