[Source]Window wont show on use item
Hi guys,
I've been making a system
and when i press the item, the window wont show up.
i've coded the UI and i wanted to test if it does work..
PHP Code:
if( pItemProp->dwID == II_STONE_TELEPORT)
{
CWndTeleportStone* pTeleportStone = (CWndTeleportStone*)g_WndMng.GetWndBase( APP_SELECT_CHANNEL );
if( !pTeleportStone )
{
pTeleportStone = new CWndTeleportStone;
pTeleportStone->Initialize(&g_WndMng);
}
return;
}
Any help?
Re: [Source]Window wont show on use item
What are you trying to do? Make a way to switch channels without logging out first?
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
ShadowDragon42
What are you trying to do? Make a way to switch channels without logging out first?
o.O
no, that item will be used to init a window where you can select where to teleport...
Re: [Source]Window wont show on use item
You could check out the teleporter used in Blessed Infinitum and see how they've done it. Look for the CWndTeleporter class, good luck ;)
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
Max98
o.O
no, that item will be used to init a window where you can select where to teleport...
try to take a look at the place of destiny source, thay got the teleport scrol working 100%.... atleast if you can find the filles cos links are all dead :'(
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
Maples
You could check out the teleporter used in
Blessed Infinitum and see how they've done it. Look for the
CWndTeleporter class, good luck ;)
they didn't use an item to make it x)
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
Max98
they didn't use an item to make it x)
That shouldn't hold you back, should it? Find the place where they catch the Z key and create the teleport window. After that, see how they create the window and voila, you've got an example of how it's done.
Could this be of any help?
Re: [Source]Window wont show on use item
Code:
if( pItemProp->dwID == II_STONE_TELEPORT)
{
SAFE_DELETE(g_WndMng.m_pWndTeleportStone);
g_WndMng.m_pWndTeleportStone = new CWndTeleportStone;
g_WndMng.m_pWndTeleportStone->Initialize(&g_WndMng);
return;
}
Note your implementation would've caused a memory leak.
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
Max98
o.O
no, that item will be used to init a window where you can select where to teleport...
I asked that cause you were searching to see if the window for Channel Select existed lol and it wouldn't unless you opened one.
Re: [Source]Window wont show on use item
Quote:
Originally Posted by
mootie
Code:
if( pItemProp->dwID == II_STONE_TELEPORT)
{
SAFE_DELETE(g_WndMng.m_pWndTeleportStone);
g_WndMng.m_pWndTeleportStone = new CWndTeleportStone;
g_WndMng.m_pWndTeleportStone->Initialize(&g_WndMng);
return;
}
Note your implementation would've caused a memory leak.
Shouldn't it be like that?:
Code:
if( pItemProp->dwID == II_STONE_TELEPORT)
{
if(g_WndMng.m_pWndTeleportStone);
SAFE_DELETE(g_WndMng.m_pWndTeleportStone);
g_WndMng.m_pWndTeleportStone = new CWndTeleportStone;
g_WndMng.m_pWndTeleportStone->Initialize(&g_WndMng);
return;
}
Re: [Source]Window wont show on use item
Jomex, the 'if statement' you added is automatically done by the SAFE_DELETE function (which is why it has SAFE in the name).