import java.util.*; import java.net.*; import java.awt.event.*; import java.awt.*; // // BUY MORE LEVELS // public class menu5 implements Menu , ActionListener{ public Image image; public Image menu5; private boolean visible=true; boolean allready=false; public Global global; public String arg1=new String(""); public String arg2=new String(""); public String method=new String(""); public String retval=new String(""); public String list[]=new String[1010]; // NOT OK Screen ImageButton Abort; Button back; public boolean isVisible(){return visible;} Color backgroundcolor=new Color(0,60,0); Color menucolor=new Color(0,60,0); Color emailforeground=Color.black; Color passwordforeground=Color.black; Color chattextforegroundcolor=new Color(0,255,0); Color chattextbackgroundcolor=new Color(0,60,0); Color chatforegroundcolor=new Color(0,200,0); Color chatbackgroundcolor=new Color(0,60,0); Color infoforegroundcolor=new Color(0,200,0); Color infobackgroundcolor=new Color(0,0,0); Color fieldlistforegroundcolor=new Color(0,200,0); public void init(Global glbl){ global=glbl; System.out.println("menu5 -> init"); menu5=global.loadImage(global.Server, "images/menu5"+global.Extention, global.show); makemenu5(); } public void show(Graphics g){ //g.drawString("Hoi", 100,100); System.out.println("Menu5 -> show"); if(visible){ if(menu5!=null){ global.show.graphics.fillRect(0,0,1024,768); global.show.graphics.drawImage(menu5,0,0, global.show); showmenu5(g); } } } public void makemenu5(){ try{ Abort=new ImageButton(menu5,null, "BUY LEVELS", global.show, "BUY LEVELS"); Abort.setBackground(Color.white); Abort.addActionListener(this); // Abort.setBounds(100,150,500,32); Abort.setBounds(global.show.WSIZE,global.show.WSIZE,(global.WIDTH-2)*global.show.WSIZE,(global.HEIGHT-2)*global.show.WSIZE); Abort.setName("Abort"); global.show.add(Abort); allready=false; back=new Button( "Return to Game"); back.setBounds(global.show.WSIZE, (global.HEIGHT-1)*global.show.WSIZE , (global.WIDTH-2)*global.show.WSIZE, 42); back.addActionListener(this); back.setName("Return"); global.show.add(back); }catch(Exception ee){ System.out.println("Select menu2 error: "+ee.toString()); } } public void showmenu5(Graphics g){ global.State=0; if(allready)return; global.showprogressionbar=false; allready=true; setVisible(true); global.show.graphics.fillRect(0,0,1024,768); global.show.graphics.drawImage(menu5,0,0, global.show); if(global.show.menu[1]!=null) global.show.menu[1].setVisible(false); try{ global.show.graphics.setColor(new Color(0,60,0)); g.drawImage(global.show.offscreen, global.show.STARTX, global.show.STARTY, global.show); }catch(Exception eggg){ System.out.println("drawing menu5(teamplay) exc: "+eggg.toString()); } } public void actionPerformed(ActionEvent ae){ System.out.println("Performed action (menu5): "+ae); if(ae.toString().toUpperCase().indexOf("BUY") > -1){ try{ global.show.applet.getAppletContext().showDocument(new URL(global.Server+"buygame.php?usernr="+global.usernr),"_self"); }catch(Exception ega){} } if(ae.toString().indexOf("Select") > -1){ } if(ae.toString().indexOf("lijst") > -1){ } if(ae.toString().indexOf("Return") > -1){ Abort.setVisible(false); back.setVisible(false); global.State=global.NOTHING; } } public void Select(){ setVisible(false); } public void setVisible(boolean state){ Abort.setVisible(state); back.setVisible(state); } }