Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. *
  2. * Decompiled with CFR 0_123.
  3. */
  4. package DesertMiner;
  5.  
  6. import java.awt.Component;
  7. import java.awt.Container;
  8. import java.awt.Font;
  9. import java.awt.LayoutManager;
  10. import java.awt.event.ActionEvent;
  11. import java.awt.event.ActionListener;
  12. import javax.swing.JButton;
  13. import javax.swing.JComboBox;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16. import javax.swing.JPanel;
  17. import javax.swing.border.Border;
  18. import javax.swing.border.EmptyBorder;
  19.  
  20. public class Gui {
  21. final int COPPER_ROCK = 7453;
  22. final int TIN_ROCK = 7485;
  23. final int IRON_ROCK = 7488;
  24. final int COAL_ROCK = 7489;
  25. final int GOLD_ROCK = 7468;
  26. final int MITHRIL_ROCK = 7459;
  27. final int ADDY_ROCK = 7460;
  28. private JFrame gui;
  29. private String selectedPickaxe = "Bronze";
  30. private String selectedOre = "Copper";
  31. private boolean started = false;
  32.  
  33. public boolean getStarted() {
  34. return this.started;
  35. }
  36.  
  37. public String getPick() {
  38. return this.selectedPickaxe;
  39. }
  40.  
  41. public String getOre() {
  42. return this.selectedOre;
  43. }
  44.  
  45. public int getPickId() {
  46. if (this.getPick().equalsIgnoreCase("Bronze")) {
  47. return 1;
  48. }
  49. if (this.getPick().equalsIgnoreCase("Iron")) {
  50. return 1;
  51. }
  52. if (this.getPick().equalsIgnoreCase("Steel")) {
  53. return 1;
  54. }
  55. if (this.getPick().equalsIgnoreCase("Black")) {
  56. return 1;
  57. }
  58. if (this.getPick().equalsIgnoreCase("Mithril")) {
  59. return 1;
  60. }
  61. if (this.getPick().equalsIgnoreCase("Addy")) {
  62. return 1;
  63. }
  64. if (this.getPick().equalsIgnoreCase("Dragon")) {
  65. return 1;
  66. }
  67. return 0;
  68. }
  69.  
  70. public int getOreId() {
  71. if (this.getOre().equalsIgnoreCase("Copper")) {
  72. return 7453;
  73. }
  74. if (this.getOre().equalsIgnoreCase("Tin")) {
  75. return 7485;
  76. }
  77. if (this.getOre().equalsIgnoreCase("Iron")) {
  78. return 7488;
  79. }
  80. if (this.getOre().equalsIgnoreCase("Coal")) {
  81. return 7489;
  82. }
  83. if (this.getOre().equalsIgnoreCase("Gold")) {
  84. return 7468;
  85. }
  86. if (this.getOre().equalsIgnoreCase("Mithril")) {
  87. return 7459;
  88. }
  89. if (this.getOre().equalsIgnoreCase("Addy")) {
  90. return 7460;
  91. }
  92. return 0;
  93. }
  94.  
  95. public void createGui() {
  96. this.gui = new JFrame("Desert Miner Version: 1.0");
  97. this.gui.setResizable(false);
  98. this.gui.setDefaultCloseOperation(3);
  99. this.gui.setBounds(100, 100, 302, 239);
  100. JPanel contentPane = new JPanel();
  101. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  102. this.gui.setContentPane(contentPane);
  103. contentPane.setLayout(null);
  104. JLabel lblNewLabel = new JLabel("Please select a pickaxe:");
  105. lblNewLabel.setFont(new Font("Tahoma", 0, 14));
  106. lblNewLabel.setBounds(10, 11, 155, 44);
  107. contentPane.add(lblNewLabel);
  108. JLabel lblNewLabel_1 = new JLabel("Please select an ore:");
  109. lblNewLabel_1.setFont(new Font("Tahoma", 0, 14));
  110. lblNewLabel_1.setBounds(10, 77, 155, 31);
  111. contentPane.add(lblNewLabel_1);
  112. JButton startButton = new JButton("Start");
  113. startButton.addActionListener(e -> {
  114. this.started = true;
  115. this.gui.setVisible(false);
  116. }
  117. );
  118. startButton.setFont(new Font("Tahoma", 0, 14));
  119. startButton.setBounds(79, 158, 120, 31);
  120. contentPane.add(startButton);
  121. JComboBox<String> pickaxeSelector = new JComboBox<String>(new String[]{"Bronze", "Iron", "Steel", "Black", "Mithril", "Addy", "Rune", "Dragon"});
  122. pickaxeSelector.addActionListener(e -> {
  123. String string = this.selectedPickaxe = pickaxeSelector.getSelectedItem().toString();
  124. }
  125. );
  126. pickaxeSelector.setBounds(175, 25, 101, 20);
  127. contentPane.add(pickaxeSelector);
  128. JComboBox<String> oreSelector = new JComboBox<String>(new String[]{"Copper", "Tin", "Iron", "Coal", "Gold", "Mithril", "Addy"});
  129. oreSelector.addActionListener(e -> {
  130. String string = this.selectedOre = oreSelector.getSelectedItem().toString();
  131. }
  132. );
  133. oreSelector.setBounds(175, 84, 101, 20);
  134. contentPane.add(oreSelector);
  135. this.gui.setVisible(true);
  136. }
  137.  
  138. public void destroyGui() {
  139. this.gui.setVisible(false);
  140. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement