Skip to content

Commit

Permalink
0.8.0
Browse files Browse the repository at this point in the history
- Added a "Max Mods" button
- Fixed Paracyst burst rate
  • Loading branch information
GottFaust committed Jul 21, 2015
1 parent 82078b8 commit 28c2584
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/etc/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class Constants {

/** Frame Title **/
public static final String APP_TITLE = "Warframe Weapon DPS Calculator";
public static final String APP_VERSION = "v0.7.9";
public static final String APP_VERSION = "v0.8.0";

/** ToolTips **/
public static final String NAME_TOOL_TIP = "The weapon's name.";
Expand Down Expand Up @@ -407,7 +407,7 @@ public class Constants {
"Rifle,Charge,Physical,Opticor,1.25,5,14,,50,425,25,1,5,540,2,15,2,15,1",
"Rifle,Continuous,Physical,Panthera (Secondary Attack),1.5,3,6.7,650,0,0,225,1.7,60,540,2,0,0,10,1",
"Rifle,Semi-Auto,Physical,Panthera,1.5,3,6.7,650,20,10,70,1.7,60,540,2,0,0,10,1",
"Rifle,Burst,Toxin,Paracyst,,4,8.3,25,8.3,38.5,8.2,3.9,60,540,2,5,2,15,1",
"Rifle,Burst,Toxin,Paracyst,,4,,25,8.3,38.5,8.2,8.3,60,540,2,5,2,15,1",
"Rifle,Charge,Physical,Paris (Charged),1,3,6.7,300,9,144,27,1,1,72,0.7,30,2,10,1",
"Rifle,Charge,Physical,Paris Prime (Charged),1,3,6.7,300,5,160,35,1,1,72,0.7,45,2,20,1",
"Rifle,Semi-Auto,Physical,Paris Prime,0.5,3,6.7,300,2.5,80,17.5,1,1,72,0.7,45,2,20,1",
Expand Down
9 changes: 9 additions & 0 deletions src/mods/WeaponModPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,20 @@ public String getModRank(){
return (String)modLevel.getSelectedItem();
}

/**
* Maxes the selected mod out
*/
public void maxMod(){

modLevel.setSelectedIndex(modLevel.getItemCount()-1);
}

/**
* Sets the selected mod
* @param mod
*/
public void setSelectedMod(Mod mod){

selectedMod = mod;
}

Expand Down
47 changes: 46 additions & 1 deletion src/weapons/WeaponPanel.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package weapons;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
Expand All @@ -12,12 +14,15 @@
import java.util.Vector;

import javax.swing.AbstractButton;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;

import etc.Constants;
import etc.UIBuilder;
Expand Down Expand Up @@ -57,11 +62,14 @@ public class WeaponPanel extends JPanel implements ActionListener {
/** JLabels **/
protected JLabel weaponLabel = new JLabel("Weapon - ");
protected JLabel refireCancelLabel = new JLabel("Refire Cancel - ");
protected JLabel totalModCostLabel = new JLabel("Total mod point cost associated with this build:");
protected JLabel totalModCostLabel = new JLabel("Total mod cost:");

/** JTextFields **/
protected JTextField totalModCostField = new JTextField(10);

/** JButtons **/
protected JButton maxModsButton = new JButton("Max Mods");

/** Data **/
protected Vector<String> selectedMods = new Vector<String>();
protected Vector<Mod> activeMods = new Vector<Mod>();
Expand Down Expand Up @@ -125,6 +133,8 @@ public void buildUI(){

UIBuilder.textFieldInit(totalModCostField);

UIBuilder.buttonInit(maxModsButton);

UIBuilder.createTitledLineBorder(attributesPanel, "ATTRIBUTES");
UIBuilder.createTitledLineBorder(modsPanel, "MODS");

Expand Down Expand Up @@ -193,6 +203,8 @@ public void buildUI(){

totalModCostPanel.add(totalModCostLabel);
totalModCostPanel.add(totalModCostField);
totalModCostPanel.add(Box.createRigidArea(new Dimension(5,0)));
totalModCostPanel.add(maxModsButton);

modsPanel.add(modsTopPanel);
modsPanel.add(modsBottomPanel);
Expand All @@ -206,6 +218,7 @@ public void buildUI(){
wap.weaponModeBox.addActionListener(this);
wap.damageTypeBox.addActionListener(this);
weaponBox.addActionListener(this);
maxModsButton.addActionListener(this);

updateDropDownContents();

Expand Down Expand Up @@ -766,6 +779,25 @@ public Mod getModByName(String name){
return localMod;
}

/**
* Maxes all selected mods
*/
public void maxMods(){

modOnePanel.maxMod();
modTwoPanel.maxMod();
modThreePanel.maxMod();
modFourPanel.maxMod();
modFivePanel.maxMod();
modSixPanel.maxMod();
modSevenPanel.maxMod();
modEightPanel.maxMod();
}

/**
* Updates the mod panels
* @param panel
*/
public void updateModPanel(WeaponModPanel panel){
Mod selectedMod = null;
if(panel.equals(modOnePanel)){
Expand Down Expand Up @@ -805,6 +837,9 @@ public void updateModPanel(WeaponModPanel panel){
calculateModCosts();
}

/**
* Updates the weapon box
*/
public void updateWeaponBox(){
updatingDropDowns = true;
weaponBox.removeAllItems();
Expand All @@ -817,6 +852,10 @@ public void updateWeaponBox(){
updatingDropDowns = false;
}

/**
* Updates the fields with the selected weapon's stats
* @param selected weapon
*/
public void updateFields(String selected){
Weapon selectedWeapon = null;
if(selected.equals(Constants.CUSTOM_WEAPON)){
Expand Down Expand Up @@ -862,9 +901,15 @@ public void actionPerformed(ActionEvent e) {
if(!updatingDropDowns){
updateFields((String)weaponBox.getSelectedItem());
}
}else if(e.getSource().equals(maxModsButton)){
maxMods();
}
}

/**
* Returns whether this weapon is refire canceled or not
* @return canceled?
*/
public boolean isRefireCanceled() {
return refireCancel.isSelected();
}
Expand Down

0 comments on commit 28c2584

Please sign in to comment.