(ActionEvent ae)
| 59 | } |
| 60 | |
| 61 | public void actionPerformed(ActionEvent ae) |
| 62 | { |
| 63 | if ((!(ae.getSource() instanceof JCheckBox)) || (Main.dataChanging)) { |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | try |
| 68 | { |
| 69 | int value = Integer.parseInt(ae.getActionCommand()); |
| 70 | int tab = value / 100; |
| 71 | int row = value % 100 / 10; |
| 72 | int col = value % 10; |
| 73 | JCheckBox field = this.fields[tab][row][col]; |
| 74 | String abilityLabel = databaseLabels[tab][row][col]; |
| 75 | |
| 76 | DBList list = (DBList)Main.database.getTopLevelStruct().getValue(); |
| 77 | list = (DBList)list.getElement("Mod_PlayerList").getValue(); |
| 78 | DBList playerList = (DBList)list.getElement(0).getValue(); |
| 79 | list = (DBList)playerList.getElement("CharAbilities").getValue(); |
| 80 | |
| 81 | if (field.isSelected()) { |
| 82 | boolean addSign = true; |
| 83 | |
| 84 | if (row == 0) { |
| 85 | if (col > this.signLevels[tab][0] + 1) { |
| 86 | JOptionPane.showMessageDialog(this, "Lower sign level must be obtained first", "Missing level", 0); |
| 87 | |
| 88 | addSign = false; |
| 89 | } |
| 90 | } else if (row == 1) { |
| 91 | if (col > this.signLevels[tab][1] + 1) { |
| 92 | JOptionPane.showMessageDialog(this, "Lower sign level powerup must be obtained first", "Missing powerup", 0); |
| 93 | |
| 94 | addSign = false; |
| 95 | } |
| 96 | } |
| 97 | else if (col > this.signLevels[tab][0]) { |
| 98 | JOptionPane.showMessageDialog(this, "The sign level must be obtained first", "Missing level", 0); |
| 99 | |
| 100 | addSign = false; |
| 101 | } |
| 102 | |
| 103 | if (addSign) { |
| 104 | DBList fieldList = new DBList(2); |
| 105 | fieldList.addElement(new DBElement(10, 0, "RnAbName", abilityLabel)); |
| 106 | fieldList.addElement(new DBElement(0, 0, "RnAbStk", new Integer(0))); |
| 107 | list.addElement(new DBElement(14, 48879, "", fieldList)); |
| 108 | |
| 109 | if ((row < 2) && (col > this.signLevels[tab][row])) { |
| 110 | boolean updatedSpell = false; |
| 111 | int low = associatedSpells[tab] * 10; |
| 112 | int high = associatedSpells[tab] * 10 + 9; |
| 113 | list = null; |
| 114 | DBElement element = playerList.getElement("KnownList0"); |
| 115 | if (element != null) { |
| 116 | list = (DBList)element.getValue(); |
| 117 | int count = list.getElementCount(); |
| 118 | for (int i = 0; i < count; i++) { |
nothing calls this directly
no test coverage detected