
11.07.2015, 22:51
|
|
Участник форума
Регистрация: 13.07.2014
Сообщений: 164
С нами:
6227977
Репутация:
83
|
|
короче не стал доебывать в чате со своими нубскими вопросами, вот один из них.
Благодаря Фипу получилось сделать, чтобы обрабатывались действия с anttweakbar.
Теперь хук не дает закрыть меню/двинуться с места, посмотрел в SFGAME че можно сделать, но не увидел нихера.
(mainloop)
Сообщение от Спойлер
Код:
Код:
void CALLBACK mainloop()
{
static bool init = false;
if (!init)
{
if (GAME == nullptr)
return;
if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
return;
if (!SF->getSAMP()->IsInitialized())
return;
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, present);
SF->getGame()->registerWndProcCallback(SFGame::HIGH_CB_PRIORITY, hookmsg);
init = true;
}
if (SF->getGame()->isKeyPressed(0x7A))
{
TwInit(TW_DIRECT3D9, SF->getRender()->getD3DDevice());
MenuState ^= true;
if (MenuState)
SF->getSAMP()->getMisc()->ToggleCursor(3, true);
else
{
SF->getSAMP()->getMisc()->ToggleCursor(false);
TwTerminate();
}
}
}
(hookmsg и MessageProc)
Сообщение от Спойлер
Код:
Код:
LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (TwEventWin(wnd, msg, wParam, lParam))
return 0;
switch (msg)
{
case WM_CHAR:
if (wParam == VK_ESCAPE)
PostQuitMessage(0);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(wnd, msg, wParam, lParam);
}
}
bool __stdcall hookmsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return MessageProc(hwnd, uMsg, wParam, lParam);
}
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|