Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LauncherPanel()
- {
- setLayout(null);
- TransparentButton site = new TransparentButton();
- TransparentButton forum = new TransparentButton();
- TransparentButton discord = new TransparentButton();
- JButton ram = new JButton();
- if (!this.accountSaver.getEncryptedAccounts().isEmpty())
- {
- Account a = ((EncryptedAccount)this.accountSaver.getEncryptedAccounts().get(0)).getAccount();
- this.pass.setText(a.getPassword());
- this.username.setText(a.getEmail());
- this.infos.setText("Bonjour " + a.getUsername() + " !");
- }
- if (!new File(Launcher.PW_DIR.getAbsoluteFile() + File.separator + "Launcher" + File.separator + ".notdelete").exists()) {
- new File(Launcher.PW_DIR.getAbsoluteFile() + File.separator + "Launcher" + File.separator + ".notdelete").mkdir();
- }
- if (this.saver.get("ram") == null) {
- this.saver.set("ram", String.valueOf(4294967296L));
- }
- if (Long.parseLong(this.saver.get("ram")) < 1073741824L) {
- this.saver.set("ram", String.valueOf(4294967296L));
- }
- try
- {
- Long.parseLong(this.saver.get("ram"));
- }
- catch (NumberFormatException e)
- {
- createOption("RAM incorrecte, rectification... Fait", "Erreur", 2);
- this.saver.set("ram", String.valueOf(4294967296L));
- }
- this.username.setBounds(302, 228, 247, 17);
- this.username.setBorder(null);
- this.username.setOpaque(false);
- this.username.setFont(getFont().deriveFont(15.0F));
- this.pass.setBounds(302, 264, 247, 17);
- this.pass.setBorder(null);
- this.pass.setOpaque(false);
- this.pass.setFont(this.username.getFont());
- site.setBounds(648, 188, 160, 36);
- forum.setBounds(648, 239, 160, 34);
- discord.setBounds(648, 290, 160, 36);
- this.play.setBounds(347, 287, 160, 32);
- this.infos.setBounds(259, 312, 365, 45);
- this.infos.setFont(this.infos.getFont().deriveFont(15.0F));
- this.infos.setForeground(Color.BLACK);
- this.infos.setHorizontalAlignment(0);
- this.infos.setVerticalAlignment(0);
- this.progress.setBorder(null);
- this.progress.setBounds(22, 354, 801, 14);
- this.saveAccount.setBounds(530, 290, 100, 20);
- this.saveAccount.setFont(this.username.getFont().deriveFont(11.0F));
- this.saveAccount.setOpaque(false);
- this.saveAccount.setSelected(Boolean.valueOf(this.saver.get("save")).booleanValue());
- this.saveAccount.setToolTipText("Attention ! Le mot de passe sera hache, mais pas de bonne qualite ! Reflechissez avant de le faire !");
- this.accountsChoice.setBounds(513, 200, 105, 17);
- for (EncryptedAccount e : this.accountSaver.getEncryptedAccounts()) {
- this.accountsChoice.addItem(e);
- }
- this.accountsChoice.addItemListener(new ItemListener()
- {
- public void itemStateChanged(ItemEvent e)
- {
- if (e.getStateChange() == 1)
- {
- Account a = ((EncryptedAccount)e.getItem()).getAccount();
- LauncherPanel.this.pass.setText(a.getPassword());
- LauncherPanel.this.username.setText(a.getEmail());
- LauncherPanel.this.infos.setText("Bonjour " + a.getUsername() + " !");
- }
- }
- });
- ram.setIcon(new ImageIcon(Swinger.getResource("ram.jpg")));
- ram.setBounds(0, 0, 51, 51);
- add(this.username);
- add(this.pass);
- add(site);
- add(forum);
- add(discord);
- add(this.play);
- add(this.infos);
- add(this.progress);
- add(this.saveAccount);
- add(this.accountsChoice);
- add(ram);
- site.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- LauncherPanel.this.openURL("http://portal-world-roguelike.livehost.fr/");
- }
- });
- forum.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- LauncherPanel.this.openURL("http://portal-world-mmorpg.livehost.fr/forum/index.php");
- }
- });
- discord.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- LauncherPanel.this.openURL("https://discord.gg/k7z2YHq");
- }
- });
- this.play.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- LauncherPanel.this.onPlay(LauncherPanel.this.username.getText(), String.valueOf(LauncherPanel.this.pass.getPassword()));
- }
- });
- ram.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- String res = (String)JOptionPane.showInputDialog(LauncherPanel.this, "Maximum de RAM pouvant �tre utilis�e :", "RAM", 3, null, RamSelector.RAM_ARRAY, RamSelector.RAM_ARRAY[3]);
- if (res != null)
- {
- res = res.replaceAll("Go", "");
- LauncherPanel.this.saver.set("ram", String.valueOf(Long.parseLong(res) * 1073741824L));
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement