/** Creates new form RaceMenu1 */ public RaceMenu() { RACENUM = 6; initComponents(); OKButton.setEnabled(false); DescriptionContainer.setViewportView(DescriptionText); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if ((screenSize.getWidth() > getContentPane().getWidth()) && (screenSize.getHeight() > getContentPane().getHeight())) { int intwidth = new Double(((screenSize.getWidth() - getContentPane().getWidth()) / 2)).intValue(); int intheight = new Double(((screenSize.getHeight() - getContentPane().getHeight()) / 2)).intValue(); setLocation(intwidth, intheight); } else { setLocation(0, 0); } menucreate = TLKFactory.getCreateMenu(); menucreate.BlockWindow(true); TLKFAC = menucreate.getTLKFactory(); RESFAC = menucreate.getResourceFactory(); String imagestring = ""; DescriptionText.setText(TLKFAC.getEntry(485)); try { racialmap = RESFAC.getResourceAs2DA("racialtypes"); } catch (IOException err) { JOptionPane.showMessageDialog( null, "Fatal Error - racialtypes.2da not found. Your data files might be corrupt.", "Error", 0); System.exit(0); } for (int i = 0; i < racialmap.length; i++) { String tempispc = racialmap[i][racialtypes.PlayerRace]; if (tempispc != null && tempispc.equalsIgnoreCase("1")) { RaceButton racebutton = new RaceButton(); descstr = racialmap[i][racialtypes.Name]; int descnum = ChkHex.ChkHex(descstr); racebutton.RaceButton.setText(TLKFAC.getEntry(descnum)); racebutton.setSize(240, 52); racebutton.InfoNum.setText(Integer.toString(i)); RaceButtonList.add(racebutton, -1); } } pack(); }
private void RecommendedButtonActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_RecommendedButtonActionPerformed // Add your handling code here: // HUMAN IS DEFAULT RACE (RACE 6) descstr = racialmap[6][racialtypes.Description]; int descnum = ChkHex.ChkHex(descstr); // int descnum = (new Integer((String)racialmap[6].get(new // Integer(racialtypes.Description)))).intValue(); RACENUM = 6; DescriptionText.setText(TLKFAC.getEntry(descnum)); OKButton.setEnabled(true); } // GEN-LAST:event_RecommendedButtonActionPerformed
private void RaceButtonActionPerformed(ActionEvent evt) { int tmp = (new Integer(InfoNum.getText())).intValue(); descstr = racialmap[tmp][racialtypes.Description]; int descnum = ChkHex.ChkHex(descstr); // int descnum = (new Integer((String)racialmap[tmp].get(new // Integer(racialtypes.Description)))).intValue(); DescriptionText.setText(TLKFAC.getEntry(descnum)); DescriptionContainer.scrollRectToVisible(new Rectangle(10, 10)); DescriptionContainer.getViewport().setViewPosition(new Point(0, 0)); // @DUG RACENUM = tmp; OKButton.setEnabled(true); }
private void OKButtonActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_OKButtonActionPerformed // Add your handling code here: CreateMenu menucreate = TLKFactory.getCreateMenu(); menucreate.PortraitButton.setEnabled(true); descstr = racialmap[RACENUM][racialtypes.Name]; int tlkentry = ChkHex.ChkHex(descstr); // int tlkentry = (new Integer((String)racialmap[RACENUM].get(new // Integer(racialtypes.Name)))).intValue(); menucreate.RaceName.setText(TLKFAC.getEntry(tlkentry)); menucreate.MainCharDataAux[1] = racialmap[RACENUM]; menucreate.BlockWindow(false); setVisible(false); dispose(); } // GEN-LAST:event_OKButtonActionPerformed