 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Mar 09, 2009 11:31 pm Post subject: |
|
|
Can someone help with this. For some reason the callback OnOffMenuFadeOut never gets called. It used to work fine with the previous beta version.
Is my usage of VLF correct (i.e. correct cancellation of dialogs, callback usage etc?)
| Code: | void OnOffFadeOut(void * ptr)
{
//asm("break\n");
vlfGuiRemoveText(relayname);
vlfGuiCancelCentralMenu();
vlfGuiCancelBottomDialog();
MainMenu(g_relaySel);
}
int BackToMainMenuFromOnOffMenu(int enter)
{
if (enter)
{
if (bConnected)
{
unsigned char msg;
switch (vlfGuiCentralMenuSelection())
{
case 0:
msg = 'A' + (unsigned char)g_relaySel;
sceNetInetSend(g_sock, &msg, 1, 0);
break;
case 1:
msg = 'a' + (unsigned char)g_relaySel;
sceNetInetSend(g_sock, &msg, 1, 0);
break;
}
vlfGuiSetRectangleFade(0, 56, 350, 272 - 56, VLF_FADE_MODE_OUT, VLF_FADE_SPEED_SUPER_FAST, 0, OnOffFadeOut, NULL, 0);
return VLF_EV_RET_REMOVE_HANDLERS;
}
vlfGuiMessageDialog("No connection to Home Automation Server.", VLF_MD_TYPE_ERROR);
return VLF_EV_RET_NOTHING;
}
vlfGuiSetRectangleFade(0, 56, 350, 272 - 56, VLF_FADE_MODE_OUT, VLF_FADE_SPEED_SUPER_FAST, 0, OnOffFadeOut, NULL, 0);
return VLF_EV_RET_REMOVE_HANDLERS;
}
void OnOffMenu(int sel)
{
char *items[] =
{
"On",
"Off"
};
relayname = vlfGuiAddText(240, 90, names[g_relaySel]);
vlfGuiSetTextAlignment(relayname, VLF_ALIGNMENT_CENTER);
vlfGuiCentralMenu(2, items, sel, NULL, 0, 0);
vlfGuiBottomDialog(VLF_DI_ENTER, VLF_DI_CANCEL, 0, 1, VLF_DEFAULT, BackToMainMenuFromOnOffMenu);
vlfGuiSetRectangleFade(0, 56, 350, 272 - 56, VLF_FADE_MODE_IN, VLF_FADE_SPEED_SUPER_FAST, 0, NULL, NULL, 0);
}
void MainMenuFadeOut(void * ptr)
{
vlfGuiCancelCentralMenu();
vlfGuiCancelBottomDialog();
OnOffMenu(g_relayStatus[g_relaySel]?0:1);
}
int MainMenuSelect(int sel)
{
g_relaySel = sel;
vlfGuiSetRectangleFade(0, 56, 480, 272 - 56, VLF_FADE_MODE_OUT, VLF_FADE_SPEED_SUPER_FAST, 0, MainMenuFadeOut, NULL, 0);
return VLF_EV_RET_REMOVE_HANDLERS;
}
void MainMenu(int sel)
{
char *items[] =
{
&names[0][0],
&names[1][0],
&names[2][0],
&names[3][0],
&names[4][0],
&names[5][0],
&names[6][0],
&names[7][0]
};
vlfGuiCentralMenu(8, items, sel, MainMenuSelect, 0, 5);
vlfGuiBottomDialog(VLF_DI_ENTER, VLF_DI_CANCEL, 0, 1, VLF_DEFAULT, NULL);
vlfGuiSetRectangleFade(0, 56, 480, 272 - 56, VLF_FADE_MODE_IN, VLF_FADE_SPEED_SUPER_FAST, 0, NULL, NULL, 0);
} |
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Mar 10, 2009 12:17 am Post subject: |
|
|
| Well, I found that the problem was that I had some text items hidden and lying around. I kept these so I could reuse them later by making them visible, which worked in the beta. But v1.0 doesn't seem to like hidden objects that aren't used. It causes all kinds of strange problems. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|