private void refreshValues() { IPlayer player = client.getLocalPlayer(); texInit.setText(Integer.toString(player.getConstantInitBonus())); fldConventional.setText(Integer.toString(player.getNbrMFConventional())); fldVibrabomb.setText(Integer.toString(player.getNbrMFVibra())); fldActive.setText(Integer.toString(player.getNbrMFActive())); fldInferno.setText(Integer.toString(player.getNbrMFInferno())); }
@Override public String getToolTipText(MouseEvent e) { java.awt.Point p = e.getPoint(); int rowIndex = rowAtPoint(p); int colIndex = columnAtPoint(p); int realColIndex = convertColumnIndexToModel(colIndex); IPlayer player = playerModel.getPlayerAt(rowIndex); if (player == null) { return null; } int mines = player.getNbrMFConventional() + player.getNbrMFActive() + player.getNbrMFInferno() + player.getNbrMFVibra(); if (realColIndex == PlayerTableModel.COL_PLAYER) { return Messages.getString("ChatLounge.tipPlayer", new Object[] { getValueAt(rowIndex, colIndex), player.getConstantInitBonus(), mines }); } else if (realColIndex == PlayerTableModel.COL_TON) { return ((Double) getValueAt(rowIndex, colIndex)).toString(); } else if (realColIndex == PlayerTableModel.COL_COST) { return Messages.getString("ChatLounge.tipCost", new Object[] { (Integer) getValueAt(rowIndex, colIndex) }); } else if (realColIndex == PlayerTableModel.COL_START) { return (String) getValueAt(rowIndex, colIndex); } else { return Integer.toString((Integer) getValueAt(rowIndex, colIndex)); } } };
/** * Enables relevant buttons and sets up for your turn. */ private void beginMyTurn() { p = clientgui.getClient().getLocalPlayer();// necessary to make it work after resets. setConventionalEnabled(p.getNbrMFConventional()); setCommandEnabled(p.getNbrMFCommand()); setVibrabombEnabled(p.getNbrMFVibra()); setActiveEnabled(p.getNbrMFActive()); setInfernoEnabled(p.getNbrMFInferno()); setRemoveMineEnabled(true); if (!p.hasMinefields()) { butDone.setEnabled(true); } }
p.setNbrMFVibra(p.getNbrMFVibra() + 1); } else if (mf.getType() == Minefield.TYPE_ACTIVE) { p.setNbrMFActive(p.getNbrMFActive() + 1); } else if (mf.getType() == Minefield.TYPE_INFERNO) { p.setNbrMFInferno(p.getNbrMFInferno() + 1); mf = Minefield.createMinefield(coords, p.getId(), Minefield.TYPE_ACTIVE, mfd.getDensity()); p.setNbrMFActive(p.getNbrMFActive() - 1); && (p.getNbrMFVibra() == 0) && (p.getNbrMFActive() == 0) && (p.getNbrMFInferno() == 0)) { butDone.setEnabled(true); setCommandEnabled(p.getNbrMFCommand()); setVibrabombEnabled(p.getNbrMFVibra()); setActiveEnabled(p.getNbrMFActive()); setInfernoEnabled(p.getNbrMFInferno()); deployV = false; if (p.getNbrMFActive() == 0) { deployA = false;