feat: format the onHandleRequestAction event code
This commit is contained in:
+25
-18
@@ -47,7 +47,7 @@ public:
|
|||||||
if (!result) cancelFunction; \
|
if (!result) cancelFunction; \
|
||||||
}) \
|
}) \
|
||||||
); \
|
); \
|
||||||
return true;
|
return true
|
||||||
|
|
||||||
void Export_Event_API() {
|
void Export_Event_API() {
|
||||||
RemoteCall::exportAs("GMLIB_Event_API", "getNextScriptEventId", []() -> std::string {
|
RemoteCall::exportAs("GMLIB_Event_API", "getNextScriptEventId", []() -> std::string {
|
||||||
@@ -197,24 +197,31 @@ void Export_Event_API() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
case doHash("onHandleRequestAction"): {
|
case doHash("onHandleRequestAction"): {
|
||||||
REGISTER_EVENT_LISTEN(Event::PlayerEvent::HandleRequestActionBeforeEvent,
|
// clang-format off
|
||||||
(Player * player,
|
REGISTER_EVENT_LISTEN(
|
||||||
std::string const& actionType,
|
Event::PlayerEvent::HandleRequestActionBeforeEvent,
|
||||||
int count,
|
(
|
||||||
std::string const& sourceContainerNetId,
|
Player * player,
|
||||||
int sourceSlot,
|
std::string const& actionType,
|
||||||
std::string const& destinationContainerNetId,
|
int count,
|
||||||
int destinationSlot),
|
std::string const& sourceContainerNetId,
|
||||||
((Player*)&ev.self(),
|
int sourceSlot,
|
||||||
magic_enum::enum_name(requestAction->mActionType).data(),
|
std::string const& destinationContainerNetId,
|
||||||
(int)requestAction->mAmount,
|
int destinationSlot
|
||||||
magic_enum::enum_name(requestAction->mSrc.mOpenContainerNetId).data(),
|
),
|
||||||
(int)requestAction->mSrc.mSlot,
|
(
|
||||||
magic_enum::enum_name(requestAction->mDst.mOpenContainerNetId).data(),
|
(Player*)&ev.self(),
|
||||||
(int)requestAction->mDst.mSlot),
|
magic_enum::enum_name(requestAction.mActionType).data(),
|
||||||
ev.cancel(),
|
(int)requestAction.mAmount,
|
||||||
auto requestAction = (ItemStackRequestActionTransferBase*)&ev.getRequestAction();
|
magic_enum::enum_name(requestAction.mSrc.mOpenContainerNetId).data(),
|
||||||
|
(int)requestAction.mSrc.mSlot,
|
||||||
|
magic_enum::enum_name(requestAction.mDst.mOpenContainerNetId).data(),
|
||||||
|
(int)requestAction.mDst.mSlot
|
||||||
|
),
|
||||||
|
ev.cancel(),
|
||||||
|
auto& requestAction = (ItemStackRequestActionTransferBase&)ev.getRequestAction();
|
||||||
);
|
);
|
||||||
|
// clang-format on
|
||||||
}
|
}
|
||||||
case doHash("onSendContainerClosePacket"): {
|
case doHash("onSendContainerClosePacket"): {
|
||||||
REGISTER_EVENT_LISTEN(
|
REGISTER_EVENT_LISTEN(
|
||||||
|
|||||||
Reference in New Issue
Block a user