Skip to content

Commit

Permalink
fix OnRmlEventDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Jul 9, 2023
1 parent 578dd13 commit 307235d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions client/src/runtime/CSharpResourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "natives.h"
#include "exceptions/LoadException.h"
#include "../../c-api/utils/entity.h"
#include "../../c-api/mvalue.h"

using namespace std;

Expand Down Expand Up @@ -125,14 +126,11 @@ void CSharpResourceImpl::OnEvent(const alt::CEvent* ev)
case alt::CEvent::Type::RMLUI_EVENT:
{
auto rmlUiEvent = dynamic_cast<const alt::CRmlEvent*>(ev);
auto args = rmlUiEvent->GetArgs();
auto name = rmlUiEvent->GetName();
auto size = args->GetSize();

OnRmlEventDelegate(rmlUiEvent->GetElement(),
name.c_str(),
rmlUiEvent->GetArgs().get(),
size);
AllocMValue(std::move(rmlUiEvent->GetArgs())));
break;
}
case alt::CEvent::Type::WEB_SOCKET_CLIENT_EVENT:
Expand Down
2 changes: 1 addition & 1 deletion client/src/runtime/eventDelegates.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ typedef void (* ServerEventDelegate_t)(const char* name, alt::MValueConst** args
typedef void (* WebViewEventDelegate_t)(alt::IWebView*, const char* name, alt::MValueConst** args, uint64_t size);
typedef void (* ConsoleCommandDelegate_t)(const char* name, const char* args[], uint64_t size);
typedef void (* WebSocketEventDelegate_t)(alt::IWebSocketClient*, const char* name, alt::MValueConst** args, uint64_t size);
typedef void (* RmlEventDelegate_t)(alt::IRmlElement*, const char* name, alt::IMValueDict* args, uint64_t size);
typedef void (* RmlEventDelegate_t)(alt::IRmlElement*, const char* name, alt::MValueConst* args);

typedef void (* PlayerSpawnDelegate_t)();
typedef void (* PlayerDisconnectDelegate_t)();
Expand Down

0 comments on commit 307235d

Please sign in to comment.