Skip to content

Commit

Permalink
0.7.7.7
Browse files Browse the repository at this point in the history
- Fixed mods by weapon type
  • Loading branch information
GottFaust committed Jul 16, 2015
1 parent 2db18b4 commit 74c94e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
10 changes: 6 additions & 4 deletions src/mods/WeaponModPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void setSelectedMod(Mod mod){
* @param selectedMods
* @param mods
*/
public void updateDropDowns(Vector<String> selectedMods, Vector<Mod> mods){
public void updateDropDowns(Vector<String> selectedMods, Vector<Mod> mods, String weaponType){
modBox.removeActionListener(this);
try{
modBox.removeAllItems();
Expand All @@ -182,9 +182,11 @@ public void updateDropDowns(Vector<String> selectedMods, Vector<Mod> mods){
}catch(Exception ex){
selectedName = "--";
}
for(int i=0; i<mods.size(); i++){
if(!selectedMods.contains(mods.get(i).name) || mods.get(i).name.equals(selectedName)){
modBox.addItem(mods.get(i).name);
for(Mod mod : mods){
if(!selectedMods.contains(mod.name) || mod.name.equals(selectedName)){
if(mod.type.equals(weaponType)){
modBox.addItem(mod.name);
}
}
}
modBox.setSelectedItem(selectedName);
Expand Down
16 changes: 8 additions & 8 deletions src/weapons/WeaponPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1011,14 +1011,14 @@ public void updateDropDownContents(){
selectedMods.add(modSeven);
selectedMods.add(modEight);

modOnePanel.updateDropDowns(selectedMods, modInit.mods);
modTwoPanel.updateDropDowns(selectedMods, modInit.mods);
modThreePanel.updateDropDowns(selectedMods, modInit.mods);
modFourPanel.updateDropDowns(selectedMods, modInit.mods);
modFivePanel.updateDropDowns(selectedMods, modInit.mods);
modSixPanel.updateDropDowns(selectedMods, modInit.mods);
modSevenPanel.updateDropDowns(selectedMods, modInit.mods);
modEightPanel.updateDropDowns(selectedMods, modInit.mods);
modOnePanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modTwoPanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modThreePanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modFourPanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modFivePanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modSixPanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modSevenPanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
modEightPanel.updateDropDowns(selectedMods, modInit.mods, weaponType);
}

/**
Expand Down

0 comments on commit 74c94e9

Please sign in to comment.