📄 editorplugin.java
字号:
).getWorldMapFromID(0).getTileMapFromID(indexMapsForExitPan).getMapExits( )[indexMapsExitsForExitPan].getScreenPointFromExitLocation() ); addExitStatus = 0; ExitName.setText(""); SetListExitMod(); addListMapsForExitPan(); itSelf.HelpOnMapExit.setText(MAP_EXIT_START_MSG); gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); }//GEN-LAST:event_SaveExitActionPerformed private void AddExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddExitActionPerformed addExitStatus = 1; manageAddExit( 0, 0 ); }//GEN-LAST:event_AddExitActionPerformed private void buttonNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNewActionPerformed // In a ComponentDialog, you can show as many message components and // as many options as you want: JTextField dimX,dimY; // Messages Object[] message = new Object[6]; message[0] = "Insert witdh"; message[1] = dimX = new JTextField(""+60); message[2] = "Insert height"; message[3] = dimY = new JTextField(""+60); JComboBox basicTileSelect = new JComboBox(); ImageLibrary imageLib = EditTile.getDataManager().getImageLibrary();// JLabel tmp; for( int i=0; i < GroupOfGraphics.ROGUE_SET[0].totalImage(); i++) {// tmp = new JLabel( GroupOfGraphics.ROGUE_SET[6].getAsIcon(i, imageLib), JLabel.LEFT ); basicTileSelect.addItem( GroupOfGraphics.ROGUE_SET[0].getAsIcon(i, imageLib) ); } message[4] = basicTileSelect; message[5] = "Select the basic tile to use"; // Options String[] options = { "Create","Cancel" }; int result = JOptionPane.showOptionDialog( this, // the parent that the dialog blocks message, // the dialog message array "New map", // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons options[0] // option that should be made into a default button ); switch(result) { case 0: // yes break; case 1: // no return; default: break; } int gotDimX,gotDimY; try{ gotDimX = new Integer(dimX.getText()).intValue() ; gotDimY = new Integer(dimX.getText()).intValue() ; } catch (Exception e){ return; } gDirector.removeAllDrawables(); TileMap destination = EditTile.getDataManager().getWorldManager().getWorldMapFromID(0).addNewTileMap(); destination.initNewTileMap( EditTile.getDataManager().getWorldManager().getWorldMapFromID(0) ); destination.setAreaName(""); destination.setFullName("New Map"); destination.setShortName(""); destination.setInsertionPoint( new ScreenPoint(10,10) ); destination.setSmallTileMapImage( new ImageIdentifier( "maps-1/town-small-1/shayol-ghul-2" ) ); destination.setMusicName("tar-valon.mid"); destination.selectGraphicSet( EnvironmentManager.GRAPHICS_SET_ROGUE ); TileManagerFlat manager = new TileManagerFlat( destination ); manager.setMap( gotDimX, gotDimY, TileMap.PIXEL_32, (byte)0, (byte)basicTileSelect.getSelectedIndex() ); destination.setManager( (TileMapManager)manager ); EditTile.workingOnThisTileMap = destination; EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); RefreshData(); }//GEN-LAST:event_buttonNewActionPerformed private void buttonRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRefreshActionPerformed gDirector.removeAllDrawables(); EditTile.getDataManager().myMapData.initDisplayEditor( EditTile.getDataManager(), EditTile.workingOnThisTileMap.getLocation() ); }//GEN-LAST:event_buttonRefreshActionPerformed private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed try{ TileMap tileMap = EditTile.getDataManager().getWorldManager().getTileMap( EditTile.workingOnThisTileMap.getLocation() ); EditTile.workingOnThisTileMap.setAreaName( DataAreaName.getText() ); EditTile.workingOnThisTileMap.setFullName( DataFullName.getText() ); EditTile.workingOnThisTileMap.setShortName( DataShortName.getText() ); EditTile.workingOnThisTileMap.setMusicName( DataMusicName.getText( )); // DataInsertionPoint.setText("xxx"); // DataSmallImage.setText("xxx"); // DataBasicSetId.setText( "" + EditTile.workingOnThisTileMap.getManager().getBasicFloorId() ); // DataBasicSetIdNr.setText( "" + EditTile.workingOnThisTileMap.getManager().getBasicFloorNr() ); } catch (Exception e) { System.out.println("not saved as"); return; } EditTile.letsTryToSave( EditTile.workingOnThisTileMap.tileMapID ); }//GEN-LAST:event_buttonSaveActionPerformed private void TileNotFreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TileNotFreeActionPerformed if( !TileNotFree.isSelected() ) selectedIsFree = TileMap.TILE_FREE; else selectedIsFree = TileMap.TILE_NOT_FREE; }//GEN-LAST:event_TileNotFreeActionPerformed private void DataHeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DataHeightActionPerformed // Add your handling code here: }//GEN-LAST:event_DataHeightActionPerformed private void DataSmallImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DataSmallImageActionPerformed // Add your handling code here: }//GEN-LAST:event_DataSmallImageActionPerformed private void DataLengthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DataLengthActionPerformed // Add your handling code here: }//GEN-LAST:event_DataLengthActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel jPanel26; private javax.swing.JTabbedPane jTabbedPane4; private javax.swing.JList DataMapSize; private javax.swing.JTextField StartPointText; private javax.swing.JPanel jPanel27; private javax.swing.JLabel jLabel23; private javax.swing.JLabel HelpOnMapExit; private javax.swing.JLabel jLabel9; private javax.swing.JTextField DataBasicSetId; private javax.swing.JButton DeleteExit; private javax.swing.JPanel LoadTileMap; private javax.swing.JTree BigTree; private javax.swing.JList jListExits; private javax.swing.JButton buttonSave; private javax.swing.JPanel SchedulePan; private javax.swing.JPanel jPanel7; private javax.swing.JPanel jPanel34; private javax.swing.JPanel jPanel28; private javax.swing.JTabbedPane TileMapTabb; private javax.swing.JList ListOfTileMapsForExit; private javax.swing.JPanel SelectedBrushPan; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel21; private javax.swing.JLabel Preview; private javax.swing.JLabel jLabel26; private javax.swing.JTextField DataFullName; private javax.swing.JPanel TileMapsPan; private javax.swing.JPanel jPanel4; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel25; private javax.swing.JSplitPane jSplitPane2; private javax.swing.JPanel jPanel3; private javax.swing.JLabel jLabel2; private javax.swing.JTextField DestinationText; private javax.swing.JLabel jLabel24; private javax.swing.JPanel jPanel24; private javax.swing.JTextField DataShortName; private javax.swing.JPanel jPanel5; private javax.swing.JButton SaveExit; private javax.swing.JTextField DataLength; private javax.swing.JLabel jLabel19; private javax.swing.JPanel jPanel8; private javax.swing.JPanel jPanel22; private javax.swing.JLabel jLabel11; private javax.swing.JButton ExportBackground; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel25; private javax.swing.JPanel jPanel18; private javax.swing.JPanel jPanel17; private javax.swing.JPanel jPanel21; private javax.swing.JTextField DataID; private javax.swing.JLabel jLabel28; private javax.swing.JTextField DataAreaName; private javax.swing.JButton CompleteExit; private javax.swing.JPanel jPanel20; private javax.swing.JLabel jLabel22; private javax.swing.JPanel jPanel15; private javax.swing.JLabel jLabel27; private javax.swing.JPanel jPanel9; private javax.swing.JPanel jPanel23; private javax.swing.JLabel jLabel10; private javax.swing.JList DataGroupOfGraphics; private javax.swing.JPanel jPanel32; private javax.swing.JPanel jPanel16; private javax.swing.JPanel MapExitsPan; private javax.swing.JButton ResumeExit; private javax.swing.JPanel jPanel19; private javax.swing.JTextField ExitName; private javax.swing.JPanel jPanel13; private javax.swing.JTextField DataHeight; private javax.swing.JPanel SaveTileMap; private javax.swing.JTextField DataBasicSetIdNr; private javax.swing.JPanel jPanel10; private javax.swing.JLabel jLabel14; private javax.swing.JButton jButton3; private javax.swing.JList OneGroupList; private javax.swing.JPanel jPanel30; private javax.swing.JPanel jPanel12; private javax.swing.JButton SuspendExit; private javax.swing.JList jList1; private javax.swing.JLabel jLabel16; private javax.swing.JSplitPane jSplitPane3; private javax.swing.JButton AbortExit; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel17; private javax.swing.JTextField DataMusicName; private javax.swing.JPanel jPanel1; private javax.swing.JTextField EndPointText; private javax.swing.JPanel jPanel6; private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel14; private javax.swing.JList HisTileList; private javax.swing.JButton AddExit; private javax.swing.JList jList2; private javax.swing.JPanel GraphicsPan; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel12; private javax.swing.JPanel InfoOnBrushPan; private javax.swing.JButton ImportBackground; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton ImportAll; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel13; private javax.swing.JButton buttonNew; private javax.swing.JPanel TitlePan; private javax.swing.JPanel ImporExportPan; private javax.swing.JList ListOfMapExitsForExit; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel38; private javax.swing.JPanel jPanel11; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTextField DataSmallImage; private javax.swing.JPanel jPanel36; public transient javax.swing.JTabbedPane MainTabb; private javax.swing.JButton buttonRefresh; private javax.swing.JButton ExportAll; private javax.swing.JButton jButton4; private javax.swing.JPanel jPanel29; private javax.swing.JTextField DataInsertionPoint; private javax.swing.JCheckBox TileNotFree; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JLabel jLabel15; // End of variables declaration//GEN-END:variables /*------------------------------------------------------------------------------------*/ /** Called once to initialize the plug-in. * @return if true we display the plug-in, return false if something fails during * this init(), this way the plug-in won't be displayed. */ public boolean init() { WotlasLocation location = new WotlasLocation(); location.WotlasLocationChangeToTileMap(0); EditTile.workingOnThisTileMap = EditTile.getDataManager().getWorldManager().getTileMap( location ); RefreshData(); addListMapsForExitPan(); return true; // this plug-in always works... } /*------------------------------------------------------------------------------------*/ /** Called when we need to reset the content of this plug-in. */ public void reset() { // We remove the previous content init(); } /** Returns the name of the plug-in that will be displayed in the JPlayerPanel. * @return a short name for the plug-in */ public String getPlugInName() { return "Editor"; } /*------------------------------------------------------------------------------------*/ /** Returns the name of the plug-in's author. * @return author name. */ public String getPlugInAuthor() { return "Wotlas Team (Aldiss & Fred & Diego)"; } /*------------------------------------------------------------------------------------*/ /** Returns the tool tip text that will be displayed in the JPlayerPanel. * @return a short tool tip text */ public String getToolTipText() { return "To create/change TileMap"; } /*------------------------------------------------------------------------------------*/ /** Eventual index in the list of JPlayerPanels * @return -1 if the plug-in has to be added at the end of the plug-in list, * otherwise a positive integer for a precise location. */ public int getPlugInIndex() { return -1; } /*------------------------------------------------------------------------------------*/ /** Tells if this plug-in is a system plug-in that represents some base
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -