Package de.taliis.editor

Examples of de.taliis.editor.openedFile


  }

// action listener
  public void actionPerformed(ActionEvent e) {
    adt obj;
    openedFile os = fm.getActiveFile();

    if(os.obj instanceof adt) {
      obj = (adt)os.obj; 
    }
    else return;
 
    // kill all waters
    if(e.getSource()==miKillWater) {
      if(obj.getVersion()==adt.ADT_VERSION_NORMAL
         || obj.getVersion()==adt.ADT_VERSION_EXPANSION_TBC) {
       
        for(int c=0; c<256; c++) {
          obj.mcnk[c].mclq = new MCLQ();
          obj.mcnk[c].setFlags(obj.mcnk[c].getFlags() & 0x3);
        }
      } 
      else {
        System.err.println("ADT Version is not suported jet.");
      }
    }
    // kill all shadows
    else if(e.getSource()==miKillShadows) {
      if(obj.getVersion()==adt.ADT_VERSION_NORMAL
         || obj.getVersion()==adt.ADT_VERSION_EXPANSION_TBC) {
         
        for(int c=0; c<256; c++) {
          obj.mcnk[c].mcsh= new MCSH();
        }
      } 
      else {
        System.err.println("ADT Version is not suported jet.");
      }
    }
   
   
    else if(e.getSource()==miInjectAlpha) {
      Vector<openedFile> choices = fm.getFileList();
      openedFile result = (openedFile) JOptionPane.showInputDialog(
        miInjectAlpha.getComponent(),
                "Chose a Source File:\n",
                "Inject",
                JOptionPane.PLAIN_MESSAGE,
                null,
                choices.toArray(),
                null);
     
      if(result==null) return;
      if(result.obj instanceof adt) {
        adt injObj = (adt) result.obj;
        obj.mtex=injObj.mtex;
        for(int c=0; c<256; c++) {
          obj.mcnk[c].setNLayers(injObj.mcnk[c].getNLayers());
          obj.mcnk[c].mcal=injObj.mcnk[c].mcal;
          obj.mcnk[c].mcly=injObj.mcnk[c].mcly;
        }   
      }
    }
   
   
    else if(e.getSource()==miInjectDoodads) {
      Vector<openedFile> choices = fm.getFileList();
      openedFile result = (openedFile) JOptionPane.showInputDialog(
        miInject.getComponent(),
                "Chose a Source File:\n",
                "Inject",
                JOptionPane.PLAIN_MESSAGE,
                null,
                choices.toArray(),
                null);
     
      if(result==null) return;
      float xpos,ypos,oldy,oldx;
      //get new position
      ypos=533.33f*Integer.parseInt(os.f.getAbsolutePath().substring(os.f.getAbsolutePath().length()-6, os.f.getAbsolutePath().length()-4));
      xpos=533.33f*Integer.parseInt(os.f.getAbsolutePath().substring(os.f.getAbsolutePath().length()-9, os.f.getAbsolutePath().length()-7));
      //get old position
      oldy=533.33f*Integer.parseInt(result.f.getAbsolutePath().substring(result.f.getAbsolutePath().length()-6, result.f.getAbsolutePath().length()-4));
      oldx=533.33f*Integer.parseInt(result.f.getAbsolutePath().substring(result.f.getAbsolutePath().length()-9, result.f.getAbsolutePath().length()-7));     
     
     
      if(result.obj instanceof adt) {
        adt injObj = (adt) result.obj;

        injObj.mddf.render();
        injObj.modf.render();
        injObj.mwmo.render();
        injObj.mmdx.render();
        injObj.mmid.render();
        injObj.mwid.render();
        try {
          MDDF mddf=new MDDF(injObj.mddf.buff);
          MODF modf=new MODF(injObj.modf.buff);
          MWMO mwmo=new MWMO(injObj.mwmo.buff);
          MMDX mmdx=new MMDX(injObj.mmdx.buff);
          MMID mmid=new MMID(injObj.mmid.buff);
          MWID mwid=new MWID(injObj.mwid.buff);
          {
          obj.mddf=mddf;
          obj.modf=modf;
          obj.mwmo=mwmo;
          obj.mmdx=mmdx;
          obj.mmid=mmid;
          obj.mwid=mwid;
          }
           
            for(int i=0;i<obj.mddf.entrys.length;i++)
            {
              float newval;
              newval=(obj.mddf.entrys[i].translate(obj.mddf.entrys[i].getY())-(xpos-oldx));
              obj.mddf.entrys[i].setY(obj.mddf.entrys[i].translate(newval));
              newval=(obj.mddf.entrys[i].translate(obj.mddf.entrys[i].getX())-(ypos-oldy));
              obj.mddf.entrys[i].setX(obj.mddf.entrys[i].translate(newval));
            }
           
            for(int i=0;i<obj.modf.entrys.length;i++)
            {
              float newval;
              newval=(obj.modf.entrys[i].translate(obj.modf.entrys[i].getY())-(xpos-oldx));
              obj.modf.entrys[i].setY(obj.modf.entrys[i].translate(newval));
              newval=(obj.modf.entrys[i].translate(obj.modf.entrys[i].getX())-(ypos-oldy));
              obj.modf.entrys[i].setX(obj.modf.entrys[i].translate(newval));
            }
           
         
        } catch (ChunkNotFoundException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
       
        for(int c=0; c<256; c++) {
          obj.mcnk[c].setNDoodad(injObj.mcnk[c].getNDoodad());
          injObj.mcnk[c].mcrf.render();
          try{
            MCRF mcrf=new MCRF(injObj.mcnk[c].mcrf.buff);
            obj.mcnk[c].mcrf=mcrf;
          }
           catch (ChunkNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
          }
        }
      }
    }
   
    // inject heightmap
    else if(e.getSource()==miInject) {
      Vector<openedFile> choices = fm.getFileList();
      openedFile result = (openedFile) JOptionPane.showInputDialog(
        miInject.getComponent(),
                "Chose a Source File:\n",
                "Inject",
                JOptionPane.PLAIN_MESSAGE,
                null,
View Full Code Here


  @Override
  public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    wdl obj;
    openedFile os = fm.getActiveFile();

    if(os.obj instanceof wdl) {
      obj = (wdl)os.obj; 
    }
    else return;
   
    if(e.getSource()==miInjectHeight) {
      Vector<openedFile> choices = fm.getFileList();
      openedFile result = (openedFile) JOptionPane.showInputDialog(
        miInjectHeight.getComponent(),
                "Chose a Source File:\n",
                "Inject",
                JOptionPane.PLAIN_MESSAGE,
                null,
View Full Code Here

      if(mix.endsWith("same")) {
        src = data.dbcFile;
      }
      else {
        //request (load) DBC file
        openedFile of = null;
       
        // ask the file loader
        for(openedFile af : fm.getFileList()) {
          if(af.f.getName().endsWith(mix)) {
            of = af;
View Full Code Here

    // TODO Auto-generated method stub
   
  }
 
  public JPanel createView() {
    openedFile of = fm.getActiveFile();
    if(of==null) return null;
   
    if(of.obj instanceof blp) {
      blp img = (blp)of.obj;
      Icon icon = new ImageIcon(img.getImg());
View Full Code Here

    // TODO Auto-generated method stub
  }

  public JPanel createView() {
    // get file
    openedFile of = fm.getActiveFile();

    if (of == null || !(of.obj instanceof adt))
      return null;
    adt obj = (adt) of.obj;
    // create buffered image
View Full Code Here

  }


  private void Import() {
    // get file
    openedFile of = fm.getActiveFile();

    if (of == null || !(of.obj instanceof adt))
      return;

    // get data
View Full Code Here

  /**
   * Exports our layers as RGB image. Same directory as the ADT file have itself.
   */
  private void Export() {
    // get file
    openedFile of = fm.getActiveFile();
   
    if(of==null || !(of.obj instanceof adt)) return;
   
    // get data
    adt obj = (adt)of.obj;
View Full Code Here

// action listener
  public void actionPerformed(ActionEvent e) {
   
    // check adt file
    if(e.getSource()==miCheck) {
      openedFile os = fm.getActiveFile();
      if(os.obj instanceof adt) {
        adt f = (adt)os.obj;
       
        adtChecker check = new adtChecker(f);
        check.check();
View Full Code Here

  @Override
  public JPanel createView() {
   
    // TODO Auto-generated method stub
    JPanel main = new JPanel();
    openedFile of = fm.getActiveFile();
    wowfile f = (wowfile)fm.getActiveFile().obj;
    if(of.obj instanceof m2) {
      main.setLayout(new BorderLayout());
    }
    if(f instanceof m2){
View Full Code Here

  public void unload() { }


  public JPanel createView() {
    JPanel main = new JPanel();
    openedFile of = fm.getActiveFile();
   
    if(of.obj instanceof wdt) {
      main.setLayout(new BorderLayout());
      table = new JTable(new wdtTableModel( (wdt)of.obj ));
   
View Full Code Here

TOP

Related Classes of de.taliis.editor.openedFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.