Skip to content

Commit

Permalink
add lua binding to judge tap offsets
Browse files Browse the repository at this point in the history
the others arent as necessary as this one. this one can let you have custom gameplay judgments easier.
  • Loading branch information
poco0317 committed Dec 19, 2022
1 parent 82529f3 commit a7e8c62
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Etterna/Singletons/ReplayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,19 @@ class LunaReplayManager : public Luna<ReplayManager>
COMMON_RETURN_SELF;
}

static int RunOffsetJudgingFunction(T* p, lua_State* L) {

// this offset should be [-1,1] rather than [-1000,1000]
auto offset = FArg(1);
// the scalar is the judge window multiplier. j4 means 1.0.
auto scalar = FArg(2);

LuaHelpers::Push<TapNoteScore>(
L, p->CustomOffsetJudgingFunction(offset, scalar));

return 1;
}

LunaReplayManager()
{
ADD_METHOD(GetReplay);
Expand All @@ -880,6 +893,8 @@ class LunaReplayManager : public Luna<ReplayManager>
ADD_METHOD(SetHoldNoteScoreScoringFunction);
ADD_METHOD(SetTapScoringFunction);
ADD_METHOD(SetOffsetJudgingFunction);

ADD_METHOD(RunOffsetJudgingFunction);
}
};
LUA_REGISTER_CLASS(ReplayManager)

0 comments on commit a7e8c62

Please sign in to comment.