I need a button on one page that switches to another tab. This would be in addition to the original tab button. With great difficulty, I have it in such a state that it switches to the right tab, but it makes everything on that tab unclickable and unusable. All I can do is click on a different tab. Clicking on the tab that I wish to go to works perfectly, and everything works on it. The program is acting as if it is switching and showing the tab, but without activating it. It is also preferable to have it send a controlEvent that would act as if it was a tab button, but if there is a workaround that works too!
public void controlEvent(ControlEvent theEvent) {
if (theEvent.isTab() || theEvent.isFrom("moveToTele"))
{
println("test");
if(theEvent.isTab())
{
activeTab = theEvent.getTab().getId();
}
else if(theEvent.isFrom("moveToTele"))
{
activeTab = 2;
cp5.getTab("teleop").bringToFront("teleop");
// Teleop is the tab name that is trying to be moved to
}
if (activeTab == 1) {
cp5.getGroup("techFoul").moveTo("sandstorm");
cp5.getGroup("foul").moveTo("sandstorm");
cp5.getController("disabled").moveTo("sandstorm");
cp5.getController("yellowCard").moveTo("sandstorm");
cp5.getController("redCard").moveTo("sandstorm");
cp5.getController("flippedOver").moveTo("sandstorm");
}
else if (activeTab == 2) {
cp5.getGroup("techFoul").moveTo("teleop");
cp5.getGroup("foul").moveTo("teleop");
cp5.getController("disabled").moveTo("teleop");
cp5.getController("yellowCard").moveTo("teleop");
cp5.getController("redCard").moveTo("teleop");
cp5.getController("flippedOver").moveTo("teleop");
}
}
}
void moveToTele() {
cp5.getTab("sandstorm").setActive(false);
cp5.getTab("teleop").setActive(true);
}
void moveToPost() {
cp5.getTab("teleop").setActive(false);
cp5.getTab("postGame").setActive(true);
cp5.getTab("postGame").activateEvent(true);
println(activeTab);
}
If there is any other code you need, let me know! Thank you!