Thread: [Opensource] Interface editor 530+

Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25
  1. #21  
    Registered Member
    Join Date
    Nov 2017
    Posts
    129
    Thanks given
    16
    Thanks received
    9
    Discord
    View profile
    Rep Power
    25
    Trying to modify a current RS interface. For some reason one of the images inside the interface is black inside the editor so I can't delete it.
    Reply With Quote  
     

  2. #22  
    ⚔️ Battle614 - Superiority ⚔️

    Yuuji's Avatar
    Join Date
    Feb 2012
    Posts
    666
    Thanks given
    181
    Thanks received
    135
    Discord
    View profile
    Rep Power
    187
    Quote Originally Posted by Nova Genesis View Post
    Trying to modify a current RS interface. For some reason one of the images inside the interface is black inside the editor so I can't delete it.
    Dump your sprites using the editor. That should fix your issue.

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #23  
    Donator
    Taht one guy's Avatar
    Join Date
    Aug 2011
    Posts
    51
    Thanks given
    1
    Thanks received
    6
    Discord
    View profile
    Rep Power
    51
    For some reason this program cannot pack interfaces from files.

    I have created some code which will allow you to export / import

    Add to InterfaceGUI.java:

    Spoiler for InterfaceGUI:

    public void exportInterface(int interfaceId) throws FileNotFoundException, IOException {
    File file = new File("data/export/" + interfaceId + "/");
    file.mkdir();
    int components = Cache.STORE.getIndexes()[3].getValidFilesCount(interfaceId);
    for(int i = 0; i < components; i++) {
    byte[] data2 = Cache.STORE.getIndexes()[3].getFile(interfaceId, i);
    FileOutputStream fos = new FileOutputStream(new File("data/export/" + interfaceId + "/"+i+".dat"));
    fos.write(data2);
    fos.close();
    }
    JOptionPane.showMessageDialog(scrollPane_2, interfaceId + " dumped to data/export/" + interfaceId + "/");
    }

    public static InterfaceGui frame;

    public static InterfaceGui getFrame() {
    return frame;
    }


    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
    ComponentDefinition.packInterface(chooser.getSelec tedFile());
    } else {
    System.out.println("No Selection ");
    }


    Add to ComponentDefinition.java:

    Spoiler for ComponentDefinition:

    public static ComponentDefinition[] packInterface(File file) {
    int interfaceId = Integer.parseInt(file.getName());
    if (interfaceId >= icomponentsdefs.length)
    return null;
    System.out.println("Components: "+new File("data/export/" + interfaceId + "/").list().length);
    icomponentsdefs[interfaceId] = new ComponentDefinition[new File("data/export/" + interfaceId + "/").list().length];
    for (int i = 0; i < icomponentsdefs[interfaceId].length; i++) {
    byte[] data = getFile(interfaceId, i);
    if (data == null) {
    logger.log(Level.SEVERE, "Component "+i+ " from interface "+interfaceId+" is null, on initial load.");
    } else {
    ComponentDefinition defs = icomponentsdefs[interfaceId][i] = new ComponentDefinition();
    defs.ihash = i + (interfaceId << 16);
    defs.decode(new InputStream(data), i, interfaceId);
    Cache.STORE.getIndexes()[3].putFile(interfaceId, i, defs.encode());
    InterfaceGui.getFrame().drawTree(interfaceId);
    }
    }
    JOptionPane.showMessageDialog(null, interfaceId + " has been packed");
    return icomponentsdefs[interfaceId];
    }

    public static byte[] getFile(int interfaceId, int i) {
    File file = new File("data/export/" + interfaceId + "/"+i+".dat");
    byte[] bytesArray = new byte[(int) file.length()];
    FileInputStream fis;
    try {
    fis = new FileInputStream(file);
    fis.read(bytesArray);
    fis.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    return bytesArray;
    }
    Reply With Quote  
     

  4. #24  
    van 't stad

    Shnek's Avatar
    Join Date
    Oct 2013
    Posts
    1,054
    Thanks given
    333
    Thanks received
    282
    Rep Power
    95
    Quote Originally Posted by Taht one guy View Post
    For some reason this program cannot pack interfaces from files.

    I have created some code which will allow you to export / import

    Add to InterfaceGUI.java:

    Spoiler for InterfaceGUI:

    public void exportInterface(int interfaceId) throws FileNotFoundException, IOException {
    File file = new File("data/export/" + interfaceId + "/");
    file.mkdir();
    int components = Cache.STORE.getIndexes()[3].getValidFilesCount(interfaceId);
    for(int i = 0; i < components; i++) {
    byte[] data2 = Cache.STORE.getIndexes()[3].getFile(interfaceId, i);
    FileOutputStream fos = new FileOutputStream(new File("data/export/" + interfaceId + "/"+i+".dat"));
    fos.write(data2);
    fos.close();
    }
    JOptionPane.showMessageDialog(scrollPane_2, interfaceId + " dumped to data/export/" + interfaceId + "/");
    }

    public static InterfaceGui frame;

    public static InterfaceGui getFrame() {
    return frame;
    }


    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
    ComponentDefinition.packInterface(chooser.getSelec tedFile());
    } else {
    System.out.println("No Selection ");
    }


    Add to ComponentDefinition.java:

    Spoiler for ComponentDefinition:

    public static ComponentDefinition[] packInterface(File file) {
    int interfaceId = Integer.parseInt(file.getName());
    if (interfaceId >= icomponentsdefs.length)
    return null;
    System.out.println("Components: "+new File("data/export/" + interfaceId + "/").list().length);
    icomponentsdefs[interfaceId] = new ComponentDefinition[new File("data/export/" + interfaceId + "/").list().length];
    for (int i = 0; i < icomponentsdefs[interfaceId].length; i++) {
    byte[] data = getFile(interfaceId, i);
    if (data == null) {
    logger.log(Level.SEVERE, "Component "+i+ " from interface "+interfaceId+" is null, on initial load.");
    } else {
    ComponentDefinition defs = icomponentsdefs[interfaceId][i] = new ComponentDefinition();
    defs.ihash = i + (interfaceId << 16);
    defs.decode(new InputStream(data), i, interfaceId);
    Cache.STORE.getIndexes()[3].putFile(interfaceId, i, defs.encode());
    InterfaceGui.getFrame().drawTree(interfaceId);
    }
    }
    JOptionPane.showMessageDialog(null, interfaceId + " has been packed");
    return icomponentsdefs[interfaceId];
    }

    public static byte[] getFile(int interfaceId, int i) {
    File file = new File("data/export/" + interfaceId + "/"+i+".dat");
    byte[] bytesArray = new byte[(int) file.length()];
    FileInputStream fis;
    try {
    fis = new FileInputStream(file);
    fis.read(bytesArray);
    fis.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    return bytesArray;
    }
    If you create a pull request I'll approve it!


    Do not use the vps from ovh, blocking vps without reason and no customer support
    Reply With Quote  
     

  5. #25  
    Donator
    Taht one guy's Avatar
    Join Date
    Aug 2011
    Posts
    51
    Thanks given
    1
    Thanks received
    6
    Discord
    View profile
    Rep Power
    51
    Quote Originally Posted by Shnek View Post
    If you create a pull request I'll approve it!
    Ok I've added a few pull requests, hopefully they work
    Reply With Quote  
     

  6. Thankful user:


Page 3 of 3 FirstFirst 123

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [530] Interface Editor for Paragon Client
    By Penance OG in forum Requests
    Replies: 2
    Last Post: 02-22-2019, 04:29 PM
  2. Interface Editor
    By Meanz in forum Projects
    Replies: 23
    Last Post: 11-27-2008, 12:44 AM
  3. my current project(interface editor)
    By .fabian in forum RS2 Client
    Replies: 12
    Last Post: 08-10-2008, 02:16 PM
  4. Replies: 12
    Last Post: 05-09-2008, 11:24 PM
  5. Custom Interface's and Interface Editor
    By Meanz in forum RS2 Client
    Replies: 77
    Last Post: 04-28-2008, 12:15 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •