PDA

Просмотр полной версии : Anttweakbar


Uztor
14.12.2014, 20:26
Hello, I can't click on a Item...

I use Anttweakbar + SAMPFUNCS API.

Код:






bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (MenuActive == 1)
{
TwWindowSize(405, 235);
char menuParameters[512], buf[2048];
int i;
int BackBufferWidth, BackBufferHeight;
int iMainMenuPosX = BackBufferWidth / 2 - 400 / 2;
int iMainMenuPosY = BackBufferHeight - 275;
iMainMenuPosX = (BackBufferWidth / 2) - (405 / 2) - 150;
iMainMenuPosY = (BackBufferHeight / 2) - (235 / 2) - 150;
TwBar *twBar_Main;
twBar_Main = TwNewBar("test");
TwAddButton(twBar_Main, "GTA", NULL, NULL, NULL);
TwDraw();
}
}




Код:






void CALLBACK mainloop(void)
{
static bool init = false;
if (!init)
{
...
} else {
TwInit(TW_DIRECT3D9, SF->getRender()->getD3DDevice());
if (SF->getGame()->isKeyPressed(0x7A)) { //F11
if (MenuActive == 0) {
MenuActive = 1;
SF->getSAMP()->getMisc()->ToggleCursor(true);
}
else if (MenuActive == 1) {
MenuActive = 0;
SF->getSAMP()->getMisc()->ToggleCursor(false);
TwTerminate();
}
}
}
}




http://puu.sh/dupsw/678d92877d.jpg

FYP
14.12.2014, 21:17
you need to and TwEventWin to win msg callback. like that:

Код:






LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Send event message to AntTweakBar
if( TwEventWin(wnd, msg, wParam, lParam) )
return 0; // Event has been handled by AntTweakBar
}

Uztor
15.12.2014, 03:34
you need to and TwEventWin to win msg callback. like that:

Код:






LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Send event message to AntTweakBar
if( TwEventWin(wnd, msg, wParam, lParam) )
return 0; // Event has been handled by AntTweakBar
}





Hello, the function "TwEventWin" does not exist in the 1.16 Version.

povargek
15.12.2014, 17:22
Hello, the function "TwEventWin" does not exist in the 1.16 Version.



Use a AntTweakBar from s0beit 0.3c.

I'm use this code:

Код:






static LRESULT __stdcall OnWindowMsg(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam)
{
if (TwEventWin(wnd, umsg, wparam, lparam))
return 0;

return CallWindowProc(!orig_wndproc!, wnd, umsg, wparam, lparam);
}

CWndHook::CWndHook(HWND wnd)
{
orig_wndproc = (WNDPROC)(UINT_PTR)SetWindowLong(wnd, GWL_WNDPROC, (LONG)(UINT_PTR)OnWindowMsg);
orig_wnd = wnd;
}

CWndHook::~CWndHook()
{
SetWindowLong(orig_wnd, GWL_WNDPROC, (LONG)(UINT_PTR)orig_wndproc);
orig_wnd = NULL;
}

Uztor
18.12.2014, 01:55
Use a AntTweakBar from s0beit 0.3c.


Can you send me the link please?

Dark_Knight
18.12.2014, 02:56
Can you send me the link please?


http://anttweakbar.sourceforge.net/doc/ (https://www.blast.hk/redirect/aHR0cDovL2FudHR3ZWFrYmFyLnNvdXJjZWZvcmdlLm5ldC9kb2 Mv)

Uztor
18.12.2014, 09:54
http://anttweakbar.sourceforge.net/doc/ (https://www.blast.hk/redirect/aHR0cDovL2FudHR3ZWFrYmFyLnNvdXJjZWZvcmdlLm5ldC9kb2 Mv)


I mean S0beit 0.3c source with anttweakbar. :)

Dark_Knight
18.12.2014, 14:07
I mean S0beit 0.3c source with anttweakbar. :)


And?

Uztor
18.12.2014, 17:25
And?


what end? I need the sobeit 0.3c source with anttweakbar... please.

/edit: found