Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to search contracts for abyssal modules #2617

Open
NicolasKion opened this issue Jun 8, 2024 · 0 comments
Open

Add button to search contracts for abyssal modules #2617

NicolasKion opened this issue Jun 8, 2024 · 0 comments

Comments

@NicolasKion
Copy link

It would be nice if Pyfa had a button that would open up a search for a specific abyssal module.

It could look similar to this:

Bildschirmfoto 2024-06-08 um 18 01 53

The required change for that should also be pretty straight forward:

# ItemMutator.py

# ...
import webbrowser


class ItemMutatorPanel():
    def __init__(self, parent):
        # ...
         self.searchContractsBtn = wx.Button(self, label="Search contracts")
        self.searchContractsBtn.Bind(wx.EVT_BUTTON, self.OnSearchContracts)
        footerSizer.Add(self.searchContractsBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
        # ...

    def OnSearchContracts(self, event):
        baseUrl = "https://mutamarket.com/modules/"
        typeString = f"type/{self.stuff.item.name.replace(' ', '-')}/"
        attributeString = "attributes/"
        for attribute in self.mutaList.stuff.mutators.values():
            attributeString += f"{attribute.attribute.name}/{attribute.value}/"
        attributeString = attributeString[:-1]
        url = baseUrl + typeString + attributeString
        webbrowser.open(url)

I'm happy to discuss other option too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant