Everything is null. What do you get when you call the create popup function? Null. All the time. I have yet to call that function and not get a nullpointerexception.
Here is the xml and relevant java code:
[java] public void initializePopups(){
//<editor-fold desc=“Win By Destruction” defaultstate=“collapsed”>
if(nifty!=null){
winByDestruction = nifty.createPopup(“popup”);
Menu wbdMenu = winByDestruction.findNiftyControl("#menu", Menu.class);
wbdMenu.setWidth(new SizeValue(“100px”)); // must be set
wbdMenu.addMenuItem(“The world has suffered over 5,000,000$ in losses over your malware.”, “You have won.”);
wbdMenu.setId(“wbdMenu”);
}
//</editor-fold>
}[/java]
<?xml version=“1.0” encoding=“UTF-8”?>
[java]<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>
<!-- +++++++++++++++++++++++++++++++++++++++ -->
<!-- Malware Hub -->
<!-- +++++++++++++++++++++++++++++++++++++++ -->
<screen id=“start” controller=“Game.Screens.MalwareHub”>
<layer id=“Background” childLayout=“center”>
<panel id=“BackgroundPanel” height=“100%” width=“100%” childLayout=“center”>
<image id=“BackgroundImage” filename=“Textures/Backgrounds/PregameBackground.png”></image>
</panel>
</layer>
<layer id="UI" childLayout="center">
<panel id="TopLeftUI" valign="top" align="left" width="12%" height="100%" childLayout="center">
<image id="Government_Stats" filename="Interface/MalwareHub/UI/Government_Stats.png"></image>
</panel>
<panel id="BottomMiddleUI" valign="bottom" align="right" childLayout="horizontal" height="20%" width="88%">
<image id="InfectedStats" filename="Interface/MalwareHub/UI/Infected_Stats.png"></image>
<image id="MoneyStats" filename="Interface/MalwareHub/UI/Money_Stats.png"></image>
<image id="DamageStats" filename="Interface/MalwareHub/UI/Damage_Stats.png"></image>
</panel>
<panel id="TopRightUI" valign="top" align="right" childLayout="center" height="40%" width="30%">
<image id="Malware Button" filename="MalwareHub/Buttons/Malware_Btn.png"></image>
<interact onClick="loadUpgrades()"></interact>
</panel>
</layer>
<layer id="Text" childLayout="horizontal">
<panel id="GovernmentInvestigationPanel" width="12%" align="center" childLayout="center" valign="center">
<text id="GovernmentInvestigationText" text="0%" font="Interface/Fonts/DifficultyMenu/STechMono14px.fnt"></text>
</panel>
<panel id="BigThreeStatsText" width="88%" align="center" childLayout="horizontal" valign="bottom" height="25%">
<text id="InfectedText" text="0 Infected" font="Fonts/DifficultyMenu/STechMono14px.fnt" width="40%" valign="center"></text>
<text id="MoneyText" text="0 $" font="Fonts/DifficultyMenu/STechMono14px.fnt" width="22.5%" valign="center"></text>
<text id="DestructionText" text="0 $" font="Fonts/DifficultyMenu/STechMono14px.fnt" width="40%" valign="center"></text>
</panel>
</layer>
<popup id="popup" childLayout="center" backgroundColor="#000a">
<control id="#menu" name="menu" />
<panel style="nifty-panel-red" childLayout="center" padding="18px,28px,40px,16px" width="30%" height="20%" align="center" valign="center">
</panel>
</popup>
</screen>
</nifty>[/java]