Thread: Adding a loader for logics multi gameframe client

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Adding a loader for logics multi gameframe client 
    Banned

    Join Date
    May 2011
    Posts
    1,785
    Thanks given
    854
    Thanks received
    853
    Rep Power
    0
    This is what you will be adding:



    Picture changes depending on the revision you select. You can change the pictures yourself in the code if you dont like them.

    First add this class called "Loader".

    Code:
    import java.awt.Dimension;
    import java.awt.EventQueue;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.URL;
    
    import javax.imageio.ImageIO;
    import javax.swing.ButtonGroup;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    import javax.swing.UIManager;
    import javax.swing.border.EmptyBorder;
    
    /**
     * 
     * @author Haider - Poesy700
     *
     */
    
    public class Loader extends JFrame {
    
    	private static final long serialVersionUID = 1L;
    	private JPanel contentPane;
    	private JLabel label;
    	protected static Loader frame;
    
    	/**
    	 * Launch the application.
    	 */
    	public static void main(String[] args) {
    		EventQueue.invokeLater(new Runnable() {
    			public void run() {
    				try {
    					try {
    						UIManager.setLookAndFeel(UIManager
    								.getSystemLookAndFeelClassName());
    					} catch (Exception e) {
    						e.printStackTrace();
    					}
    					frame = new Loader();
    					frame.setVisible(true);
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}
    		});
    	}
    
    	/**
    	 * Create the frame.
    	 */
    	public Loader() {
    		setTitle("Loader");
    		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setBounds(100, 100, 480, 472);
    		setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
    		
    		contentPane = new JPanel();
    		
    		//317, 459, 464, 474, 498, 508, 525, 562
    
    		final String pic317 = "http://i.imgur.com/oZLwx2d.png";
    		final String pic459 = "http://i.imgur.com/o8QqwEY.png";
    		final String pic464 = "http://i.imgur.com/AFKy2UC.png";
    		final String pic474 = "http://i.imgur.com/vVQDxsc.png";
    		final String pic498 = "http://i.imgur.com/E2JsZwW.png";
    		final String pic508 = "http://i.imgur.com/UBqk5BX.png";
    		final String pic525 = "http://i.imgur.com/WpHaByA.png";
    		final String pic562 = "http://i.imgur.com/K7GpwHy.png";	
    		
    		try {
    			String link = pic317;
    			URL url = new URL(link);
    			Image image = ImageIO.read(url).getScaledInstance(450, 300,
    					Image.SCALE_SMOOTH);
    			System.out.println("Load image into frame...");
    			label = new JLabel(new ImageIcon(image));
    			label.setBounds(-17, -53, 799, 500);
    			label.setSize(new Dimension(500, 500));
    			contentPane.add(label);
    			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		
    
    		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    		setContentPane(contentPane);
    		contentPane.setLayout(null);
    
    		
    		final JRadioButton revision317 = new JRadioButton("317");
    		revision317.setBounds(61, 7, 43, 23);
    		contentPane.add(revision317);
    
    		final JRadioButton revision459 = new JRadioButton("459");
    		revision459.setBounds(106, 7, 43, 23);
    		contentPane.add(revision459);
    		
    		final JRadioButton revision464 = new JRadioButton("464");
    		revision464.setBounds(151, 7, 43, 23);
    		contentPane.add(revision464);
    		
    		final JRadioButton revision474 = new JRadioButton("474");
    		revision474.setBounds(196, 7, 43, 23);
    		contentPane.add(revision474);
    		
    		final JRadioButton revision498 = new JRadioButton("498");
    		revision498.setBounds(241, 7, 43, 23);
    		contentPane.add(revision498);
    		
    		final JRadioButton revision508 = new JRadioButton("508");
    		revision508.setBounds(286, 7, 43, 23);
    		contentPane.add(revision508);
    		
    		final JRadioButton revision525 = new JRadioButton("525");
    		revision525.setBounds(331, 7, 43, 23);
    		contentPane.add(revision525);
    		
    		final JRadioButton revision562 = new JRadioButton("562");
    		revision562.setBounds(376, 7, 43, 23);
    		contentPane.add(revision562);
    
    		JButton btnStart = new JButton("Start");
    		btnStart.setBounds(195, 380, 89, 23);
    		contentPane.add(btnStart);
    
    
    		ButtonGroup buttonGroup = new ButtonGroup();
    		buttonGroup.add(revision317);
    		buttonGroup.add(revision459);
    		buttonGroup.add(revision464);
    		buttonGroup.add(revision474);
    		buttonGroup.add(revision498);
    		buttonGroup.add(revision508);
    		buttonGroup.add(revision525);
    		buttonGroup.add(revision562);
    		
    		revision317.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic317);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision459.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic459);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision464.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic464);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision474.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic474);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision498.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic498);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision508.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic508);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision525.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic525);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    		
    		revision562.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				try {
    				URL url = new URL(pic562);
    				Image image = ImageIO.read(url).getScaledInstance(450, 300,
    						Image.SCALE_SMOOTH);
    				label.setIcon(new ImageIcon(image));
    				repaint();
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}});
    
    		btnStart.addActionListener(new ActionListener() {
    
    			@Override
    			public void actionPerformed(ActionEvent ae) {
    				if (revision317.isSelected()) {
    					Client.main(new String[] {"317"});
    	            	frame.dispose();
    				}
    				if (revision459.isSelected()) {
    					Client.main(new String[] {"459"});
    	            	frame.dispose();
    				}
    				if (revision464.isSelected()) {
    					Client.main(new String[] {"464"});
    	            	frame.dispose();
    				}
    				if (revision474.isSelected()) {
    					Client.main(new String[] {"474"});
    	            	frame.dispose();
    				}
    				if (revision498.isSelected()) {
    					Client.main(new String[] {"498"});
    	            	frame.dispose();
    				}
    				if (revision508.isSelected()) {
    					Client.main(new String[] {"508"});
    	            	frame.dispose();
    				}
    				if (revision525.isSelected()) {
    					Client.main(new String[] {"525"});
    	            	frame.dispose();
    				}
    				if (revision562.isSelected()) {
    					Client.main(new String[] {"562"});
    	            	frame.dispose();
    				}
    			}
    		});
    
    	}
    }
    Now go to your Client class and look for "void main".

    You should see something like this;

    Code:
    	public static void main(String args[]) {
    		try {
    			nodeID = 10;
    			portOff = 0;
    			setHighMem();
    			isMembers = true;
    			Signlink.storeid = 32;
    			Signlink.startpriv(InetAddress.getLocalHost());
    			clientSize = 0;
    			instance = new Client();
    			instance.createClientFrame(clientWidth, clientHeight);
    		} catch (Exception exception) { }
    	}
    replace it with this:

    Code:
    	public static void main(String args[]) {
    		try {
    			Configuration.clientRevision = Integer.parseInt(args[0]);
    			nodeID = 10;
    			portOff = 0;
    			setHighMem();
    			isMembers = true;
    			Signlink.storeid = 32;
    			Signlink.startpriv(InetAddress.getLocalHost());
    			clientSize = 0;
    			instance = new Client();
    			instance.createClientFrame(clientWidth, clientHeight);
    		} catch (Exception exception) { }
    	}
    Now to run the client you will have to run the Loader class as main class.

    Enjoy
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member Thinkdifferent's Avatar
    Join Date
    Dec 2012
    Posts
    311
    Thanks given
    95
    Thanks received
    27
    Rep Power
    63
    why would you make a loader just for choosing a gameframe?
    this is ugly, it should be done the way battlescape has done it.
    and why you were replying shit about logics multi gameframe client when he was trying to sell it on his selling thread and now you're making this snippet?
    retired
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member Mr Jason's Avatar
    Join Date
    Dec 2013
    Posts
    384
    Thanks given
    37
    Thanks received
    113
    Rep Power
    0
    Wait, wasn't this logic's released client?



    'Our greatest glory is not in never failing, but in rising up every time we fail', ~Ralph Waldo Emerson.
    Reply With Quote  
     

  6. #4  
    Donator

    Join Date
    Oct 2013
    Posts
    350
    Thanks given
    207
    Thanks received
    59
    Rep Power
    38
    Nice man
    Reply With Quote  
     

  7. #5  
    Banned

    Join Date
    May 2011
    Posts
    1,785
    Thanks given
    854
    Thanks received
    853
    Rep Power
    0
    Quote Originally Posted by Wesam14 View Post
    why would you make a loader just for choosing a gameframe?
    this is ugly, it should be done the way battlescape has done it.
    and why you were replying shit about logics multi gameframe client when he was trying to sell it on his selling thread and now you're making this snippet?
    "why would you make a loader just for choosing a gameframe?"
    So the players can choose their gameframe ?? Players dont have acces to the source code lol
    ''this is ugly, it should be done the way battlescape has done it."
    If you dont like it okay but wtf? There is no way it SHOULD be done i do it in any way i like and i think it looks nice.
    "and why you were replying shit about logics multi gameframe client when he was trying to sell it on his selling thread and now you're making this snippet?"
    Ah sorry i totally forgot i am not allowed to make snippets for something i gave criticism on sorry for breaking the unwritten rune-server code of conduct


    Quote Originally Posted by JasonRTM View Post
    Wait, wasn't this logic's released client?
    What? this works for logics released client yes if thats what you are saying?
    Reply With Quote  
     

  8. Thankful user:


  9. #6  
    Super Donator

    Janizary's Avatar
    Join Date
    Jul 2009
    Age
    19
    Posts
    2,132
    Thanks given
    109
    Thanks received
    137
    Rep Power
    1031
    Quote Originally Posted by JasonRTM View Post
    Wait, wasn't this logic's released client?
    yes. read the thread.

    [Only registered and activated users can see links. ]
    Quote Originally Posted by Pirlo View Post
    I don't think the cold war existed during/before WWI
    Reply With Quote  
     

  10. #7  
    Registered Member

    Join Date
    May 2012
    Posts
    434
    Thanks given
    103
    Thanks received
    52
    Rep Power
    125
    ****ing repd++, Poesy thank you very much. Turned out simpler then i would it would have been. Good job
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  11. #8  
    Donator


    Join Date
    Jun 2011
    Posts
    2,555
    Thanks given
    539
    Thanks received
    402
    Rep Power
    658
    Looks pretty neat compared to the one you originally posted on his thread. Nice job .
    All the best,
    Nirvana

    Reply With Quote  
     

  12. #9  
    Registered Member Dum-Dums's Avatar
    Join Date
    Jul 2014
    Posts
    69
    Thanks given
    8
    Thanks received
    7
    Rep Power
    18
    Useful.
    Reply With Quote  
     

  13. #10  
    Registered Member

    Join Date
    Aug 2012
    Posts
    3,161
    Thanks given
    2,843
    Thanks received
    855
    Rep Power
    2235
    Nice job
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 0
    Last Post: 05-02-2014, 10:20 PM
  2. Multi world client for sale!
    By _jj_ in forum Selling
    Replies: 2
    Last Post: 04-04-2014, 04:08 AM
  3. Adding overlay flo for a "Newer" client
    By KaiserCo in forum Snippets
    Replies: 14
    Last Post: 07-16-2012, 10:02 PM
  4. Replies: 7
    Last Post: 12-29-2009, 09:19 AM
  5. Replies: 0
    Last Post: 07-04-2009, 03:32 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •