(12-27-2019 - 02:46 AM)FeetForFree Wrote: I try to made a Open and Close with the current menu and Bottons but it dosent work
I need Helppp
Code:
else if (CONTROLS::IS_CONTROL_PRESSED(0, xBUTTON_A) && CONTROLS::IS_CONTROL_PRESSED(0, xBUTTON_RB))
{
savedSubmenu = submenu;
savedSubmenuLevel = submenuLevel;
savedCurrentOption = currentOption;
// SetupTimer(750);
if (IsTimerReady() && submenu != MAIN_MENU)
{
submenu = CLOSED;
ResetTimer();
}
}
else if (submenu == MAIN_MENU)
{
savedSubmenu = NULL;
savedSubmenuLevel = NULL;
savedCurrentOption = NULL;
}
}
bool
MB_IBPressed = false,
MB_Opns = false,
MB_ABPressed = false,
MB_BBPressed = false,
MB_XBPressed = false,
MB_UPBPressed = false,
MB_DownBPressed = false,
MB_DPRightBPressed = false,
MB_DPLeftBPressed = false,
resetFastScrollUp = true,
resetFastScrollDown = true;
int controlPressedTimeout;
Input *GInputB;
void Unk_Monitor_Buttons_cl()
{
if (submenu == Closed)
{
GInputB->UpdateInput();
if (GInputB->DPadRightDown() && GInputB->XButtonDown() && !MB_IBPressed)
{
MB_Opns = !MB_Opns;
MB_IBPressed = true;
}
else if (!GInputB->DPadRightDown() && !GInputB->XButtonDown())
MB_IBPressed = false;
if (MB_Opns && MB_IBPressed)
{
if (submenuLevel <= 0)
{
submenu = Main_Menu;
submenuLevel = 0;
currentOption = 1;
}
else
{
submenu = lastSubmenu[submenuLevel];
if (lastOption[submenuLevel] != 0)
currentOption = lastOption[submenuLevel];
else
currentOption = 1;
}
playSound("YES");
}
}
else
{
GInputB->UpdateInput();
if (GInputB->DPadRightDown() && GInputB->XButtonDown() && !MB_IBPressed)
{
MB_Opns = !MB_Opns;
MB_IBPressed = true;
}
else if (!GInputB->DPadRightDown() && !GInputB->XButtonDown())
MB_IBPressed = false;
if (!MB_Opns && MB_IBPressed)
{
lastSubmenu[submenuLevel] = submenu;
lastOption[submenuLevel] = currentOption;
submenu = Closed;
}
if (GInputB->BButtonDown() && !MB_BBPressed)
{
submenu = lastSubmenu[submenuLevel - 1];
currentOption = lastOption[submenuLevel - 1];
submenuLevel--;
playSound("Back");
MB_BBPressed = true;
} else if (!GInputB->BButtonDown())
MB_BBPressed = false;
if (GInputB->AButtonDown() && !MB_ABPressed)
{
optionPress = true;
AUDIO::PLAY_SOUND_FRONTEND(-1, "Pin_Good", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS");
MB_ABPressed = true;
} else if (!GInputB->AButtonDown())
MB_ABPressed = false;
if (GInputB->DpadUp())
{
resetFastScrollUp = false;
controlPressedTimeout++;
if (controlPressedTimeout > 5)
{
currentOption = currentOption - 1;
if (currentOption < 1)
currentOption = optionCount;
playSound("NAV_UP_DOWN");
}
}
else resetFastScrollUp = true;
if (GInputB->DpadDown())
{
resetFastScrollDown = false;
controlPressedTimeout++;
if (controlPressedTimeout > 5)
{
currentOption = currentOption + 1;
if (currentOption > optionCount)
currentOption = 1;
playSound("NAV_UP_DOWN");
}
}
else resetFastScrollDown = true;
if (GInputB->DPadRightDown() && !MB_DPRightBPressed)
{
rightPress = true;
MB_DPRightBPressed = true;
}
else if (!GInputB->DPadRightDown())
MB_DPRightBPressed = false;
if (GInputB->DPadLeftDown() && !MB_DPLeftBPressed)
{
leftPress = true;
MB_DPLeftBPressed = true;
}
else if (!GInputB->DPadLeftDown())
MB_DPLeftBPressed = false;
if (GInputB->DPadRightDown())
fastRightPress = true;
if (GInputB->DPadLeftDown())
fastLeftPress = true;
if (GInputB->XButtonDown() && !MB_XBPressed)
{
squarePress = true;
MB_XBPressed = true;
} else if (!GInputB->XButtonDown())
MB_XBPressed = false;
if (resetFastScrollUp && resetFastScrollDown)
controlPressedTimeout = 0;
if (GInputB->DpadUp() && !MB_UPBPressed)
{
currentOption--;
if (currentOption < 1)
currentOption = optionCount;
playSound("NAV_UP_DOWN");
MB_UPBPressed = true;
} else if (!GInputB->DpadUp())
MB_UPBPressed = false;
if (GInputB->DpadDown() && !MB_DownBPressed)
{
currentOption++;
if (currentOption > optionCount)
currentOption = 1;
playSound("NAV_UP_DOWN");
MB_DownBPressed = true;
}
else if (!GInputB->DpadDown())
MB_DownBPressed = false;
}
}