ClientEvent browseUrlEvent(const std::string& url, const std::string& window) { json::Object browseURLInfo; browseURLInfo["url"] = url; browseURLInfo["window"] = window; return ClientEvent(client_events::kBrowseUrl, browseURLInfo); }
ClientEvent showErrorMessageEvent(const std::string& title, const std::string& message) { json::Object errorMessage ; errorMessage["title"] = title; errorMessage["message"] = message; return ClientEvent(client_events::kShowErrorMessage, errorMessage); }
void ActiveWindow::KillFocus() { EventDispatch* dispatch = EventDispatch::GetInstance(); if (dispatch) dispatch->KillFocus(this); focus = false; ClientEvent(EID_KILL_FOCUS); }
void ActiveWindow::SetFocus() { EventDispatch* dispatch = EventDispatch::GetInstance(); if (dispatch) dispatch->SetFocus(this); focus = true; ClientEvent(EID_SET_FOCUS); }
ClientEvent showEditorEvent(const std::string& content, bool isRCode, bool lineWrapping) { json::Object data; data["content"] = content; data["is_r_code"] = isRCode; data["line_wrapping"] = lineWrapping; return ClientEvent(client_events::kShowEditor, data); }
void enqueRefreshEventWithDelay(int delay) { // Sometimes on commit, the subsequent request contains outdated // status (i.e. as if the commit had not happened yet). No idea // right now what is causing this. Add a delay for commits to make // sure the correct state is shown. json::Object data; data["delay"] = delay; module_context::enqueClientEvent(ClientEvent(client_events::kVcsRefresh, data)); }
void CUser::NpcEvent(char *pBuf) { if( m_pMain->m_bPointCheckFlag == FALSE) return; int index = 0, send_index = 0, nid = 0, i=0, temp_index = 0; char send_buf[2048]; memset( send_buf, NULL, 2048); CNpc* pNpc = NULL; nid = GetShort( pBuf, index ); pNpc = m_pMain->m_arNpcArray.GetData(nid); if( !pNpc ) return; switch( pNpc->m_tNpcType ) { case NPC_MERCHANT: SetByte( send_buf, WIZ_TRADE_NPC, send_index ); SetDWORD( send_buf, pNpc->m_iSellingGroup, send_index ); Send( send_buf, send_index ); break; case NPC_TINKER: SetByte( send_buf, WIZ_REPAIR_NPC, send_index ); SetDWORD( send_buf, pNpc->m_iSellingGroup, send_index ); Send( send_buf, send_index ); break; case NPC_CAPTAIN: SetByte( send_buf, WIZ_CLASS_CHANGE, send_index ); SetByte( send_buf, CLASS_CHANGE_REQ, send_index ); Send( send_buf, send_index ); break; case NPC_OFFICER: SetShort( send_buf, 0, send_index ); // default 0 page m_pMain->m_KnightsManager.AllKnightsList( this, send_buf ); break; case NPC_WAREHOUSE: SetByte( send_buf, WIZ_WAREHOUSE, send_index ); SetByte( send_buf, WAREHOUSE_REQ, send_index ); Send( send_buf, send_index ); break; case NPC_WARP: break; case NPC_CLERIC: case NPC_COUPON: case NPC_MONK_KARUS: case NPC_MONK_ELMORAD: SetShort( send_buf, nid, send_index ); ClientEvent( send_buf ); break; } }
int ActiveWindow::OnMouseExit(int x, int y) { ClientEvent(EID_MOUSE_EXIT, x, y); return 0; }
int ActiveWindow::OnKeyDown(int vk, int flags) { ClientEvent(EID_KEY_DOWN, vk, flags); return 0; }
int ActiveWindow::OnMouseWheel(int wheel) { ClientEvent(EID_MOUSE_WHEEL, wheel, 0); return 0; }
int ActiveWindow::OnMouseMove(int x, int y) { ClientEvent(EID_MOUSE_MOVE, x, y); return 0; }
int ActiveWindow::OnSelect() { ClientEvent(EID_SELECT); return 0; }
int ActiveWindow::OnClick() { ClientEvent(EID_CLICK); return 0; }
int ActiveWindow::OnDragDrop(int x, int y, ActiveWindow* source) { ClientEvent(EID_DRAG_DROP, x, y); return 0; }
int ActiveWindow::OnDragStart(int x, int y) { ClientEvent(EID_DRAG_START, x, y); return 0; }
int ActiveWindow::OnMouseEnter(int x, int y) { ClientEvent(EID_MOUSE_ENTER, x, y); return 0; }
int ActiveWindow::OnRButtonUp(int x, int y) { ClientEvent(EID_RBUTTON_UP, x, y); return 0; }
int ActiveWindow::OnRButtonDown(int x, int y) { ClientEvent(EID_RBUTTON_DOWN, x, y); return 0; }