Evamist / Bank-Highlighter

Bank Highlighter, inspired by RuneLite's "Inventory Tags," lets you color-code items in your bank or inventory (while the bank is open) for easier visibility. This feature is particularly useful for organizing skill/combat gear sets and quickly finding the items you need.
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Share Config With Inventory Tag #1

Open Anfoone opened 6 days ago

Anfoone commented 6 days ago

Hey!

Was looking for a plugin like this forever now. I would constantly complain to my friends that I wish this existed and I Just found it out of the whim.

I was wondering if possible since some of the code is refurbished from Inventory Tag; if there would be possibility to add a toggle to that it can share tags that you made from Inventory Tags?

I.e. Copy the data I created already from Inventory Tags so I don't need to retag everything

Nick2bad4u commented 6 days ago

@Anfoone @Evamist I actually found a way to do this:

  1. Navigate to your .runelite\profile\URPROFILE.properties file (replace URPROFILE with the correct profile name).
  2. Open the file in Notepad++ and search for all lines containing "inventorytags.tag".
  3. Select these lines from the search results and copy them to a new window.
  4. Use the replace function to change "inventorytags.tag" to "bankhighlighter.tag".
  5. Copy the newly renamed lines back into the bottom of your original URPROFILE.properties file.
  6. Close RuneLite and save the changes.
  7. Relaunch RuneLite, and all your items will be tagged. - Saved me from manually retagging 357 items I had tagged already lol.

Screenshot:

image

Should be kind of easy for dev to do this automatically in the plugin - especially since the two settings locations already share a common location in the .properties file.

Anfoone commented 5 days ago

Oh that's amazing! I spent time yesterday looking for a properties or a config file to do exactly this but had no luck. Thanks for sharing this!

Evamist commented 5 days ago

Ah love this! Will have a look when I can! Glad you enjoying it - uploaded because I wanted it lol.

Nick2bad4u commented 5 days ago

Ah love this! Will have a look when I can! Glad you enjoying it - uploaded because I wanted it lol.

I also updated your plugin readme with better formatting and a screenshot.

I opened a pull request for it.

TV-cmd commented 3 days ago

@Anfoone @Evamist I actually found a way to do this:

1. Navigate to your .runelite\profile\URPROFILE.properties file (replace URPROFILE with the correct profile name).

2. Open the file in Notepad++ and search for all lines containing "inventorytags.tag".

3. Select these lines from the search results and copy them to a new window.

4. Use the replace function to change "inventorytags.tag" to "bankhighlighter.tag".

5. Copy the newly renamed lines back into the bottom of your original URPROFILE.properties file.

6. Close RuneLite and save the changes.

7. Relaunch RuneLite, and all your items will be tagged. - Saved me from manually retagging 357 items I had tagged already lol.

Screenshot:

image

Should be kind of easy for dev to do this automatically in the plugin - especially since the two settings locations already share a common location in the .properties file.

Hey man could you please make it so that you just 1-click import 'em ez? Thanks.

Nick2bad4u commented 1 day ago

@Anfoone @Evamist I actually found a way to do this: Block (14 lines)```

  1. Navigate to your .runelite\profile\URPROFILE.properties file (replace URPROFILE with the correct profile name).

  2. Open the file in Notepad++ and search for all lines containing "inventorytags.tag".

  3. Select these lines from the search results and copy them to a new window.

  4. Use the replace function to change "inventorytags.tag" to "bankhighlighter.tag".

  5. Copy the newly renamed lines back into the bottom of your original URPROFILE.properties file.

  6. Close RuneLite and save the changes.

  7. Relaunch RuneLite, and all your items will be tagged. - Saved me from manually retagging 357 items I had tagged already lol.

Screenshot: image Should be kind of easy for dev to do this automatically in the plugin - especially since the two settings locations already share a common location in the .properties file.

Hey man could you please make it so that you just 1-click import 'em ez? Thanks.

I dont have the time but the plugin dev sounds like hes looking at it.

Nick2bad4u commented 14 hours ago

I wrote this script for you to do this in the plugin @Evamist

    // Get RuneLite config directory
    File runeLiteConfigDir = new File(System.getProperty("user.home") + "/.runelite/profiles");

    if (runeLiteConfigDir.exists() && runeLiteConfigDir.isDirectory()) {
        // Loop through profiles in the RuneLite config directory
        File[] profiles = runeLiteConfigDir.listFiles((dir, name) -> name.endsWith(".properties"));
        if (profiles != null && profiles.length > 0) {
            // Assuming the first profile file is the active one (could add more logic here to determine the active profile)
            File activeProfile = profiles[0];  // Replace with actual active profile logic if needed

            if (activeProfile.exists()) {
                Properties properties = new Properties();
                Properties updatedProperties = new Properties();
                try (FileInputStream in = new FileInputStream(activeProfile)) {
                    properties.load(in);
                    for (String key : properties.stringPropertyNames()) {
                        if (key.startsWith("inventorytags.tag")) {
                            String tagValue = properties.getProperty(key);
                            String newKey = key.replace("inventorytags.tag", "bankhighlighter.tag");
                            updatedProperties.setProperty(newKey, tagValue);
                        }
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }

                // Write back the new bankhighlighter tags to the file
                try (FileOutputStream out = new FileOutputStream(activeProfile, true)) {
                    updatedProperties.store(out, null);  // Append to the file
                } catch (IOException e) {
                    e.printStackTrace();
                }

                // Call to refresh the bank highlighter tags
                loadBankTags();  // Assuming this function exists in the plugin
            }
        }
    }
}

I also wrote a small panel to add a button for importing -

JButton importButton = new JButton("Import Inventory Tags");
importButton.addActionListener(e -> {
    importInventoryTagsToBank();  // Call the method in the plugin class
});
panel.add(importButton);

its up to you how u want to to implement these