Skip to content

Commit 15946c6

Browse files
committed
feat: add event for finished pp scan
1 parent 2bce36b commit 15946c6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/Event.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace Event {
5454
RENDERER_START,
5555
RENDERER_FINISH,
5656
STUCK,
57+
PP_SCAN_FINISH,
5758
};
5859

5960
template <EventType E>

src/Features/ConfigPlus.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ MK_SAR_ON(speedrun_finish, "when a speedrun finishes", true)
870870
MK_SAR_ON(renderer_start, "when renderer starts", true)
871871
MK_SAR_ON(renderer_finish, "when renderer finishes", true)
872872
MK_SAR_ON(stuck, "when the player gets stuck (singleplayer) (requires cheats)", true)
873+
MK_SAR_ON(pp_scan_finish, "when pp scan is finished", false)
873874

874875
ON_EVENT_P(SESSION_START, 1000000) {
875876
RUN_EXECS(load);
@@ -930,6 +931,9 @@ ON_EVENT(STUCK) {
930931
RUN_EXECS(stuck);
931932
}
932933
}
934+
ON_EVENT(PP_SCAN_FINISH) {
935+
RUN_EXECS(pp_scan_finish);
936+
}
933937

934938
struct Seq {
935939
std::queue<std::string> commands;

src/Features/PlacementScanner.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ static void endScan(bool success) {
325325
}
326326
delete[] g_scan.image;
327327
g_setup.state = SetupState::NONE;
328+
Event::Trigger<Event::PP_SCAN_FINISH>({});
328329
}
329330

330331
static bool testRay(uintptr_t portalgun, Vector origin, Vector dir, bool checkMatchArea) {

0 commit comments

Comments
 (0)