Thread: sendUnlockIComponentOptionSlots

Results 1 to 6 of 6
  1. #1 sendUnlockIComponentOptionSlots 
    Registered Member
    Join Date
    Mar 2015
    Posts
    21
    Thanks given
    3
    Thanks received
    6
    Rep Power
    11
    I've gone through Google and searching through numerous pages on this forum but have not quite found what I'm looking for.

    I understand basically how sendUnlockIComponentOptionSlots works, in that it allows a character to click on certain components within an interface.

    My question is, how am I able to find what these component are, and what do each of the integers and other option mean within it?

    A small explanation or a point in the right direction would be very much appreciated.
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Basically some interface components (which could be called child inters) have sub-components called slots. A good example is your inventory. All your 28 inventories spaces are handled with one component but with different slots. What sendUnlockIComponentOptionSlots does is it changes the right-click option on the said interface component to something else (remove, deposit, etc...).

    You need to use it as follow:

    Code:
    sendUnlockIComponentOptionSlots(int interfaceId, int componentId, int fromSlot, int toSlot, int... optionsSlots);
    ---------------

    Code:
    int interfaceId
    Id of the interface you are sending it to. Pretty standart.

    ---------------

    Code:
    int componentId
    The id of the component in the interface writen above. If you don't have the id, you can make a method similar to this in ButtonHandler:

    Code:
    if (interfaceId == number)//replace number by the interfaceId
        player.getPackets().sendGameMessage("ComponentID: "+componentId);
    ---------------

    Code:
    int fromSlot
    Usually 0. It's basically the first slot of the component that it handles it. For example, inventory would be 0 for the first top left item.

    ---------------

    Code:
    int toSlot
    The last slot of the interface. This one is a little bit tricky. You know how the inventory has 28 slots? Well you write the number of slots-1 so 27 because slot 0 counts. so 0..1..2..3.. up to 27 would make 28 slots.

    ---------------

    Code:
    int... optionSlots
    This one might look harder but it's pretty easy. Basically it's an enumeration of the numbers on the first row. For inventory it would be 0, 1, 2, 3 since there's 4 inventory slots in the first row of the interface.

    ---------------

    Tell me if you have any questions.
    Project thread
    Reply With Quote  
     

  3. Thankful user:

    Community VeteranSub

  4. #3  
    Registered Member
    Join Date
    Mar 2015
    Posts
    21
    Thanks given
    3
    Thanks received
    6
    Rep Power
    11
    Thank you for the detailed reply. Thank you for helping me understand each of the other areas. However, I'd like to expand on a few issues I'm receiving. Is there anyway to output all the different component IDs of an interface I'm on?

    In the duelling interface, I'd like to see what the bottom box component ID is. When I use the button handler to output the component IDs, it works for most of the other slots but I cannot click on this area.

    The component ID for the top slot is 47, I only know this due to looking around in the source.

    If it's possible to mark the component IDs of any interface I'm on, it would be beneficial for future development.
    Reply With Quote  
     

  5. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Just do trial and error. There's better ways to do it but it'd take too long to explain so it's the easiest. Check around 40-50.

    And I'm pretty sure duel arena has already been released so you could look for that to make your job easier.
    Project thread
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Mar 2015
    Posts
    21
    Thanks given
    3
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by clem585 View Post
    Just do trial and error. There's better ways to do it but it'd take too long to explain so it's the easiest. Check around 40-50.

    And I'm pretty sure duel arena has already been released so you could look for that to make your job easier.
    It is already released but what I've found is incredibly glitchy. As for finding the component IDs, would the best bet simply be trial and error for every interface?
    Reply With Quote  
     

  7. #6  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by testuser1 View Post
    It is already released but what I've found is incredibly glitchy. As for finding the component IDs, would the best bet simply be trial and error for every interface?
    For you, yes. You could make a method that loops throught the components and turn them off one by one until you see the item box disapear but idk if you know how.
    Project thread
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •