This repository has been archived by the owner on Nov 28, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUIController.java
122 lines (94 loc) · 3.14 KB
/
GUIController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package scripts.spxaioplanker;
import java.net.URL;
import java.util.ResourceBundle;
import com.allatori.annotations.DoNotRename;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import org.tribot.api.Timing;
import scripts.generalapi.PostRequest;
import scripts.spxaioplanker.data.Vars;
import scripts.spxaioplanker.data.enums.PlankType;
import scripts.tribotapi.Client;
import scripts.tribotapi.gui.AbstractGUIController;
import scripts.tribotapi.util.Utility;
/**
* Created by Sphiinx on 7/28/2016.
*/
@DoNotRename
public class GUIController extends AbstractGUIController {
@FXML
@DoNotRename
private ResourceBundle resources;
@FXML
@DoNotRename
private URL location;
@FXML
@DoNotRename
private Button start;
@FXML
@DoNotRename
private ComboBox<PlankType> plank_type;
@FXML
@DoNotRename
private Spinner<Integer> coins_to_take;
@FXML
@DoNotRename
private TextArea bug_clientdebug;
@FXML
@DoNotRename
private TextArea bug_stacktrace;
@FXML
@DoNotRename
private TextArea bug_description;
@FXML
@DoNotRename
private TextArea bug_botdebug;
@FXML
@DoNotRename
private Button send_report;
@FXML
@DoNotRename
private Label report_sent;
@FXML
@DoNotRename
private Label report_spam;
@FXML
@DoNotRename
private Hyperlink join_discord;
@FXML
@DoNotRename
private Hyperlink add_skype;
@FXML
@DoNotRename
private Hyperlink private_message;
@FXML
@DoNotRename
private Hyperlink website_link;
@FXML
@DoNotRename
void initialize() {
plank_type.getItems().setAll(PlankType.values());
plank_type.getSelectionModel().select(0);
join_discord.setOnAction((event) -> Utility.openURL("https://discordapp.com/invite/0yCbdv5qTOWmxUD5"));
add_skype.setOnAction((event -> Utility.openURL("http://hatscripts.com/addskype/?sphiin.x")));
private_message.setOnAction((event -> Utility.openURL("https://tribot.org/forums/profile/176138-sphiinx/")));
website_link.setOnAction((event -> Utility.openURL("http://spxscripts.com/")));
send_report.setOnAction((event) -> {
if (PostRequest.LAST_SENT_TIME <= 0 || Timing.timeFromMark(PostRequest.LAST_SENT_TIME) > 60000) {
if (!PostRequest.sendReportData(Client.getManifest(Main.class).name(), Client.getManifest(Main.class).version(), bug_description.getText(), bug_stacktrace.getText(), bug_clientdebug.getText(), bug_botdebug.getText()))
report_sent.setText("UH OH! There seems to have been an error with your report!");
report_sent.setOpacity(1);
report_spam.setOpacity(0);
PostRequest.LAST_SENT_TIME = Timing.currentTimeMillis();
} else {
report_sent.setOpacity(0);
report_spam.setOpacity(1);
}
});
start.setOnAction((event) -> {
Vars.get().coins_to_take = coins_to_take.getValue();
Vars.get().plank_type = plank_type.getSelectionModel().getSelectedItem();
getGUI().close();
});
}
}