@ -82,12 +86,8 @@ public class UI implements ActionListener {
}
},false)
};
Clickerbot=newClicker();
privateFilefile=newFile(".profile");
Clickerbot=newClicker();
publicUI(){
Main.get().ui=this;
@ -153,7 +153,7 @@ public class UI implements ActionListener {
frame.setVisible(true);
//set tooltips
start.setToolTipText("Starts the Bot.");
start.setToolTipText("Starts the Bot. (When gray, try to set the positions for the red buttons!)");
skip.setToolTipText("Skips the current Action.(Waiting or beeing in a match, only usefull, when the bot miss clicked somewhere)");
pause.setToolTipText("Pauses the \"output\" of the Bot, but the internal states are still updated.");
exit.setToolTipText("Stops the Bot and closes the Window.");
@ -173,6 +173,8 @@ public class UI implements ActionListener {
posselctors[6].button.setToolTipText("Set the Position, where a Card should be placed. Leave it empty to use the same position as the \"Battle\" position.");
posselctors[7].button.setToolTipText("Set the position of the Close button, of the menue that po up, when you tap the arena. This one also saves the color of the position to auto detect it.");
@ -207,6 +209,7 @@ public class UI implements ActionListener {
elseif(srcb.equals(exit)){
bot.stop();
frame.setVisible(false);
frame.dispose();
System.exit(0);
}elseif(srcb.equals(pause)){
if(bot.isPaused()){//the bot is going to be unpaused
@ -223,9 +226,18 @@ public class UI implements ActionListener {
}elseif(srcinstanceofJMenuItem){
JMenuItemsrcI=(JMenuItem)src;
if(srcI.equals(load)){
load(true);
intreturnval=filechooser.showOpenDialog(frame);
if(returnval==JFileChooser.APPROVE_OPTION){
Filef=filechooser.getSelectedFile();
load(f,true);
}else
info("cancled.");
}elseif(srcI.equals(save)){
save();
intreturnval=filechooser.showOpenDialog(frame);
if(returnval==JFileChooser.APPROVE_OPTION){
save(filechooser.getSelectedFile());
}else
info("cancled.");
}elseif(srcI.equals(new_)){
new_();
}
@ -244,10 +256,10 @@ public class UI implements ActionListener {
}
}
privatevoidload(booleaninfo){
if(file.exists()){
privatevoidload(Filef,booleaninfo){
if(f.exists()){
try{
Scanners=newScanner(file);
Scanners=newScanner(f);
while(s.hasNextLine()){
Stringsplit[]=s.nextLine().split(" ");
if(!split[1].equals("null")){
@ -289,11 +301,11 @@ public class UI implements ActionListener {
info("no profile found.");
}
privatevoidsave(){
privatevoidsave(Filef){
try{
if(!file.exists())
file.createNewFile();
else {
if(!f.getName().endsWith(".profile"))
f=newFile(f.getAbsoluteFile()+".profile");
if(f.exists()){
/*ok==0
cancel=2*/
intchoose=JOptionPane.showConfirmDialog(null,"You are going to override the old profile!","Override",JOptionPane.OK_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE);
@ -302,9 +314,10 @@ public class UI implements ActionListener {