Skip to content

Commit 9d3ea02

Browse files
committed
Preliminary Resizing
Patched negative damage creatures Isolated Closing windows
1 parent 10c1ee1 commit 9d3ea02

File tree

9 files changed

+245
-98
lines changed

9 files changed

+245
-98
lines changed

src/drzed/Data/Encounter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public void updateEntity2(String ownerName, String ownerID, String petName, Stri
184184
}
185185
//Pet Ability Taken
186186
if (petsOfOwners.containsKey(targetID)) {
187+
magnitude = magnitude < 0 ? magnitude * -1 : magnitude;
187188
petsOfOwners.get(targetID).updateAbility(targetName, tnid, 0, 0, magnitude);
188189
globalDamageToPlayers += magnitude;
189190
if (flag.contains("Kill")) {
@@ -210,12 +211,12 @@ public void updateEntity2(String ownerName, String ownerID, String petName, Stri
210211
return;
211212
}
212213
//In Theory this should never call
213-
logToDebugFile("ENTITIES THAT SHOULDN'T BE DAMAGING EACH-OTHER");
214+
/*logToDebugFile("ENTITIES THAT SHOULDN'T BE DAMAGING EACH-OTHER");
214215
logToDebugFile("=========================================");
215216
logToDebugFile("Damage Source Entity " + otherEnt.name + " ID = " + otherEnt.fullID);
216217
logToDebugFile("Damage Target Entity " + targetName + " ID = " + targetID);
217218
logToDebugFile("Amount : " + magnitude);
218-
logToDebugFile("=========================================");
219+
logToDebugFile("=========================================");*/
219220
//At least I hope?
220221
//UPDATE: It has triggered when an enemy damages another enemy, WTF Cryptic
221222
}

src/drzed/Data/Entity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public void updateAbility(String abilityName, String abilityID, double damage, d
7878
}
7979

8080
public void updateAbility(String abilityName, String abilityID, double damage, double base, double dtaken) {
81+
if (abilityName.equalsIgnoreCase(name)) {
82+
return;
83+
}
8184
Ability ab = null;
8285
abilityID = AbilityTypes.fixAbils(abilityName, abilityID);
8386

src/drzed/GUI/CondensedController.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import javafx.stage.FileChooser;
1919

2020
import java.io.File;
21-
import java.io.IOException;
2221
import java.text.DecimalFormat;
2322

2423
@SuppressWarnings("all")
@@ -85,22 +84,20 @@ public void loadEncounter(ActionEvent actionEvent) {
8584
chooser.getExtensionFilters().add(extFilter);
8685
chooser.setSelectedExtensionFilter(extFilter);
8786
chooser.setInitialDirectory(new File("./data/"));
88-
String enc = chooser.showOpenDialog(Main.stage).getName();
87+
String enc = chooser.showOpenDialog(Main.mainStage).getName();
8988
if (!enc.isEmpty()) {
9089
Main.importEnc(enc);
9190
Platform.runLater(() -> resetData());
9291
Platform.runLater(() -> updateAllData());
9392
}
9493
}
9594

96-
public void quit(ActionEvent actionEvent) {
97-
Platform.exit();
98-
System.exit(0);
99-
}
100-
10195
public void close(ActionEvent actionEvent) {
102-
Platform.exit();
103-
System.exit(0);
96+
Main.streamStage.close();
97+
if ((Main.miniStage == null || !Main.miniStage.isShowing()) && (Main.mainStage == null || !Main.mainStage.isShowing())) {
98+
Platform.exit();
99+
System.exit(0);
100+
}
104101
}
105102

106103
double xOffset, yOffset;

src/drzed/GUI/ML_Condensed.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<TableColumn id="pct" fx:id="abilityShareCol" maxWidth="68.0" minWidth="35.0" prefWidth="40.0" sortType="DESCENDING" text="\%" />
2424
</columns>
2525
</TableView>
26-
<Button mnemonicParsing="false" onAction="#quit" text="Quit" AnchorPane.leftAnchor="350.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
26+
<Button mnemonicParsing="false" onAction="#close" text="Quit" AnchorPane.leftAnchor="350.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
2727
</children>
2828
</AnchorPane>

src/drzed/GUI/ML_ParserGUI.fxml

Lines changed: 79 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,92 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import javafx.geometry.Insets?>
34
<?import javafx.scene.chart.PieChart?>
4-
<?import javafx.scene.control.Button?>
55
<?import javafx.scene.control.Menu?>
66
<?import javafx.scene.control.MenuBar?>
77
<?import javafx.scene.control.MenuItem?>
88
<?import javafx.scene.control.TableColumn?>
99
<?import javafx.scene.control.TableView?>
1010
<?import javafx.scene.layout.AnchorPane?>
11+
<?import javafx.scene.layout.ColumnConstraints?>
12+
<?import javafx.scene.layout.GridPane?>
13+
<?import javafx.scene.layout.RowConstraints?>
1114

12-
<AnchorPane maxHeight="720.0" maxWidth="1280.0" minHeight="720.0" minWidth="1280.0" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="720.0" prefWidth="1280.0" stylesheets="@dark.css" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="drzed.GUI.MainController">
15+
<AnchorPane maxHeight="720.0" maxWidth="1280.0" minHeight="720.0" minWidth="1280.0" prefHeight="720.0" prefWidth="1280.0" stylesheets="@dark.css" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="drzed.GUI.MainController">
1316
<children>
14-
<MenuBar layoutY="2.0" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="25.0" prefWidth="1079.0" stylesheets="@dark.css" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
15-
<menus>
16-
<Menu fx:id="menuD" mnemonicParsing="false" text="File">
17-
<items>
18-
<MenuItem mnemonicParsing="false" onAction="#openMini" text="Open Mini" />
19-
<MenuItem mnemonicParsing="false" onAction="#onFile" text="File.." />
20-
<MenuItem mnemonicParsing="false" onAction="#loadEncounter" text="Open Past Encounter" />
21-
<MenuItem mnemonicParsing="false" onAction="#closeEncounter" text="Close Encounter" />
22-
<MenuItem mnemonicParsing="false" onAction="#openStrMode" text="Open Streamer GUI" />
23-
</items>
24-
</Menu>
25-
</menus>
26-
</MenuBar>
27-
<PieChart fx:id="pieChart" labelLineLength="0.0" labelsVisible="false" layoutX="989.0" layoutY="406.0" legendSide="LEFT" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="411.0" prefWidth="624.0" title="Top 10 Abilities" AnchorPane.bottomAnchor="-4.0" AnchorPane.rightAnchor="-4.0" />
28-
<Button mnemonicParsing="false" onAction="#quit" text="Quit" AnchorPane.leftAnchor="1228.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
29-
<TableView fx:id="table" layoutY="27.0" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="287.0" prefWidth="1280.0" stylesheets="@dark.css" AnchorPane.bottomAnchor="406.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="27.0">
30-
<columns>
31-
<TableColumn fx:id="nameCol" prefWidth="140.0" text="Name" />
32-
<TableColumn fx:id="damageCol" prefWidth="130.0" sortType="DESCENDING" text="Damage" />
33-
<TableColumn fx:id="dpsCol" prefWidth="120.0" sortType="DESCENDING" text="DPS" />
34-
<TableColumn fx:id="healCol" prefWidth="130.0" sortType="DESCENDING" text="Heal" />
35-
<TableColumn fx:id="hpscol" prefWidth="120.0" sortType="DESCENDING" text="HPS" />
36-
<TableColumn fx:id="shieldCol" prefWidth="120.0" sortType="DESCENDING" text="Shield" />
37-
<TableColumn fx:id="takenCol" prefWidth="120.0" sortType="DESCENDING" text="Taken" />
38-
<TableColumn fx:id="durationCol" prefWidth="70.0" sortType="DESCENDING" text="Duration" />
39-
<TableColumn fx:id="hitsCol" prefWidth="70.0" sortType="DESCENDING" text="Hits" />
40-
<TableColumn fx:id="killCol" prefWidth="45.0" sortType="DESCENDING" text="Kills" />
41-
<TableColumn fx:id="deathCol" prefWidth="45.0" sortType="DESCENDING" text="Deaths" />
42-
<TableColumn fx:id="effCol" prefWidth="55.0" sortType="DESCENDING" text="Eff %" />
43-
</columns>
44-
</TableView>
45-
<TableView fx:id="statsTbl" layoutY="316.0" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="405.0" prefWidth="662.0" stylesheets="@dark.css" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="618.0" AnchorPane.topAnchor="316.0">
46-
<columns>
47-
<TableColumn fx:id="abilityCol" maxWidth="170.0" minWidth="80.0" prefWidth="130.0" text="Ability" />
48-
<TableColumn fx:id="damageCol2" maxWidth="160.0" minWidth="80.0" prefWidth="120.0" sortType="DESCENDING" text="Damage" />
49-
<TableColumn fx:id="dpsCol2" maxWidth="100.0" minWidth="60.0" prefWidth="70.0" sortType="DESCENDING" text="DPH" />
50-
<TableColumn fx:id="hitsCol2" maxWidth="80.0" minWidth="40.0" prefWidth="50.0" sortType="DESCENDING" text="Hits" />
51-
<TableColumn fx:id="abilityShareCol" maxWidth="60.0" minWidth="40.0" prefWidth="50.0" sortType="DESCENDING" text="\%" />
52-
<TableColumn fx:id="typeCol" maxWidth="90.0" minWidth="50.0" prefWidth="60.0" sortType="DESCENDING" text="Type" />
53-
<TableColumn fx:id="abTaken" maxWidth="120.0" minWidth="60.0" sortType="DESCENDING" text="Taken" />
54-
<TableColumn fx:id="healCol1" maxWidth="120.0" minWidth="60.0" sortType="DESCENDING" text="Heal" />
55-
</columns>
56-
</TableView>
17+
<GridPane layoutX="1.0" layoutY="-104.0" prefHeight="720.0" prefWidth="1280.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
18+
<columnConstraints>
19+
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1200.0" minWidth="320.0" prefWidth="657.0" />
20+
<ColumnConstraints hgrow="SOMETIMES" maxWidth="623.0" minWidth="10.0" prefWidth="600.0" />
21+
</columnConstraints>
22+
<rowConstraints>
23+
<RowConstraints maxHeight="25.0" minHeight="25.0" prefHeight="25.0" vgrow="SOMETIMES" />
24+
<RowConstraints maxHeight="480.0" minHeight="200.0" prefHeight="240.0" vgrow="SOMETIMES" />
25+
<RowConstraints maxHeight="600.0" minHeight="320.0" prefHeight="400.0" vgrow="SOMETIMES" />
26+
</rowConstraints>
27+
<children>
28+
<PieChart fx:id="pieChart" labelLineLength="0.0" labelsVisible="false" legendSide="LEFT" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="411.0" prefWidth="624.0" title="Top 10 Abilities" GridPane.columnIndex="1" GridPane.rowIndex="2">
29+
<padding>
30+
<Insets bottom="4.0" left="2.0" right="4.0" top="2.0" />
31+
</padding>
32+
<GridPane.margin>
33+
<Insets bottom="4.0" right="4.0" />
34+
</GridPane.margin>
35+
</PieChart>
36+
<MenuBar onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="25.0" prefWidth="1079.0" stylesheets="@dark.css" GridPane.columnSpan="2">
37+
<menus>
38+
<Menu fx:id="menuD" mnemonicParsing="false" text="File">
39+
<items>
40+
<MenuItem mnemonicParsing="false" onAction="#openMini" text="Open Mini" />
41+
<MenuItem mnemonicParsing="false" onAction="#openStrMode" text="Open Streamer GUI" />
42+
<MenuItem mnemonicParsing="false" onAction="#loadEncounter" text="Open Past Encounter" />
43+
<MenuItem mnemonicParsing="false" onAction="#closeEncounter" text="Close Encounter" />
44+
<MenuItem mnemonicParsing="false" onAction="#close" text="Quit" />
45+
</items>
46+
</Menu>
47+
</menus>
48+
</MenuBar>
49+
<TableView fx:id="table" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="287.0" prefWidth="1280.0" stylesheets="@dark.css" GridPane.columnSpan="2" GridPane.rowIndex="1">
50+
<columns>
51+
<TableColumn fx:id="nameCol" prefWidth="140.0" text="Name" />
52+
<TableColumn fx:id="damageCol" prefWidth="130.0" sortType="DESCENDING" text="Damage" />
53+
<TableColumn fx:id="dpsCol" prefWidth="120.0" sortType="DESCENDING" text="DPS" />
54+
<TableColumn fx:id="healCol" prefWidth="130.0" sortType="DESCENDING" text="Heal" />
55+
<TableColumn fx:id="hpscol" prefWidth="120.0" sortType="DESCENDING" text="HPS" />
56+
<TableColumn fx:id="shieldCol" prefWidth="120.0" sortType="DESCENDING" text="Shield" />
57+
<TableColumn fx:id="takenCol" prefWidth="120.0" sortType="DESCENDING" text="Taken" />
58+
<TableColumn fx:id="durationCol" prefWidth="70.0" sortType="DESCENDING" text="Duration" />
59+
<TableColumn fx:id="hitsCol" prefWidth="70.0" sortType="DESCENDING" text="Hits" />
60+
<TableColumn fx:id="killCol" prefWidth="45.0" sortType="DESCENDING" text="Kills" />
61+
<TableColumn fx:id="deathCol" prefWidth="45.0" sortType="DESCENDING" text="Deaths" />
62+
<TableColumn fx:id="effCol" prefWidth="55.0" sortType="DESCENDING" text="Eff %" />
63+
</columns>
64+
<padding>
65+
<Insets bottom="4.0" left="4.0" right="4.0" top="1.0" />
66+
</padding>
67+
<GridPane.margin>
68+
<Insets left="4.0" right="4.0" />
69+
</GridPane.margin>
70+
</TableView>
71+
<TableView fx:id="statsTbl" onMouseClicked="#onClick" onMouseDragged="#onDrag" onMousePressed="#onPress" prefHeight="405.0" prefWidth="662.0" stylesheets="@dark.css" GridPane.rowIndex="2">
72+
<columns>
73+
<TableColumn fx:id="abilityCol" maxWidth="170.0" minWidth="80.0" prefWidth="130.0" text="Ability" />
74+
<TableColumn fx:id="damageCol2" maxWidth="160.0" minWidth="80.0" prefWidth="120.0" sortType="DESCENDING" text="Damage" />
75+
<TableColumn fx:id="dpsCol2" maxWidth="100.0" minWidth="60.0" prefWidth="70.0" sortType="DESCENDING" text="DPH" />
76+
<TableColumn fx:id="hitsCol2" maxWidth="80.0" minWidth="40.0" prefWidth="50.0" sortType="DESCENDING" text="Hits" />
77+
<TableColumn fx:id="abilityShareCol" maxWidth="60.0" minWidth="40.0" prefWidth="50.0" sortType="DESCENDING" text="\%" />
78+
<TableColumn fx:id="typeCol" maxWidth="90.0" minWidth="50.0" prefWidth="60.0" sortType="DESCENDING" text="Type" />
79+
<TableColumn fx:id="abTaken" maxWidth="120.0" minWidth="60.0" sortType="DESCENDING" text="Taken" />
80+
<TableColumn fx:id="healCol1" maxWidth="120.0" minWidth="60.0" sortType="DESCENDING" text="Heal" />
81+
</columns>
82+
<padding>
83+
<Insets bottom="4.0" left="4.0" right="4.0" top="2.0" />
84+
</padding>
85+
<GridPane.margin>
86+
<Insets bottom="4.0" left="4.0" />
87+
</GridPane.margin>
88+
</TableView>
89+
</children>
90+
</GridPane>
5791
</children>
5892
</AnchorPane>

src/drzed/GUI/MainController.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@
2727

2828
import java.io.File;
2929
import java.io.IOException;
30-
import java.io.UnsupportedEncodingException;
31-
import java.net.URLDecoder;
32-
import java.nio.charset.Charset;
3330
import java.text.DecimalFormat;
34-
import java.text.MessageFormat;
35-
import java.util.Locale;
3631

3732
import static drzed.Data.Encounter.formatTime;
3833

@@ -147,7 +142,7 @@ public void loadEncounter(ActionEvent actionEvent) {
147142
chooser.getExtensionFilters().add(extFilter);
148143
chooser.setSelectedExtensionFilter(extFilter);
149144
chooser.setInitialDirectory(new File("./data/"));
150-
String enc = chooser.showOpenDialog(Main.stage).getName();
145+
String enc = chooser.showOpenDialog(Main.mainStage).getName();
151146
if (!enc.isEmpty()) {
152147
reviewMode = true;
153148
Main.importEnc(enc);
@@ -165,31 +160,29 @@ public void onFile(ActionEvent actionEvent) {
165160
FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("COMBATLOG files (Combatlog*.log)", "Combatlog*.log");
166161
chooser.getExtensionFilters().add(extFilter);
167162
chooser.setSelectedExtensionFilter(extFilter);
168-
Main.Directory = chooser.showOpenDialog(Main.stage).getParentFile();
163+
Main.Directory = chooser.showOpenDialog(Main.mainStage).getParentFile();
169164
System.out.println(Main.Directory.getAbsolutePath().replaceAll("\\\\", "/"));
170165
Configs.combatLogFolder = Main.Directory.getAbsolutePath().replaceAll("\\\\", "/");
171166
Main.resaveConfig();
172167
}
173168

174-
public void quit(ActionEvent actionEvent) {
175-
Platform.exit();
176-
System.exit(0);
177-
}
178-
179169
public void close(ActionEvent actionEvent) {
180-
Platform.exit();
181-
System.exit(0);
170+
Main.mainStage.close();
171+
if ((Main.miniStage == null || !Main.miniStage.isShowing()) && (Main.streamStage == null || !Main.streamStage.isShowing())) {
172+
Platform.exit();
173+
System.exit(0);
174+
}
182175
}
183176

184177
double xOffset, yOffset;
185178
public void onDrag(MouseEvent mouseEvent) {
186-
Main.stage.setX(mouseEvent.getScreenX() + xOffset);
187-
Main.stage.setY(mouseEvent.getScreenY() + yOffset);
179+
Main.mainStage.setX(mouseEvent.getScreenX() + xOffset);
180+
Main.mainStage.setY(mouseEvent.getScreenY() + yOffset);
188181
}
189182

190183
public void onPress(MouseEvent mouseEvent) {
191-
xOffset = Main.stage.getX() - mouseEvent.getScreenX();
192-
yOffset = Main.stage.getY() - mouseEvent.getScreenY();
184+
xOffset = Main.mainStage.getX() - mouseEvent.getScreenX();
185+
yOffset = Main.mainStage.getY() - mouseEvent.getScreenY();
193186
}
194187

195188
public void openMini(ActionEvent actionEvent) {
@@ -214,7 +207,7 @@ public void openStrMode(ActionEvent actionEvent) {
214207
Stage secondStage = new Stage();
215208
secondStage.setTitle("Magic Legends Condensed DPS Tracker");
216209
secondStage.setScene(new Scene(root, 390, 320));
217-
secondStage.initStyle(StageStyle.TRANSPARENT);
210+
secondStage.initStyle(StageStyle.UNDECORATED);
218211
// secondStage.setAlwaysOnTop(true);
219212
secondStage.setX(0);
220213
secondStage.setY(0);

src/drzed/GUI/MiniController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ public void mPress(MouseEvent mouseEvent) {
117117
}
118118

119119
public void close(MouseEvent mouseEvent) {
120-
Platform.exit();
121-
System.exit(0);
120+
Main.miniStage.close();
121+
if ((Main.mainStage == null || !Main.mainStage.isShowing()) && (Main.streamStage == null || !Main.streamStage.isShowing())) {
122+
Platform.exit();
123+
System.exit(0);
124+
}
122125
}
123126
}

0 commit comments

Comments
 (0)