Closed Ruuttu closed 2 years ago
I don't believe there is any API function that will let you perform a reverse lookup.
GCFScape tool from Nem could be helpful here. But, I agree, such a function should exist to return the full path (relative to garrysmod folder) of a sound file, though I think that is a request to GMod, not wire.
It looks like you can do file.Exists( "sound/vo/heavy_sandwichtaunt01.mp3", "tf" ) to check if a sound exists in Team Fortress 2 for example. You could iterate over the games in engine.GetGames() as a workaround. It would be a lil dirty.
That's a LOT of iteration. Sounds like a function that the user should run manually for those of us that have a lot of mountable sources.
That was my solution back than, building a library for my own sound browser, However if you have tons of stuff mounted it takes ages to build. But once it is build is much faster then the sound browser. (Even had extensive metadata, sorting/categorizing and blamed you for not owning/mounting the right stuff) Unfortunately I don't have any gmod related stuff anymore so you would need to start from scratch.
If you add this to the sidebar there's no need to evaluate the full list of thousands of sound effects. Only one sound whenever the user selects one.
[engine.GetGames] (https://wiki.garrysmod.com/page/engine/GetGames) returns a list of installed games and their folder names... should be easy :)
But, what if it's present in multiple games?
But, what if it's present in multiple games?
Then you create a node "Games", and child nodes being the list of multiple games where it is found in.
Sound's like an idea to me. Maybe I find some time this weekend to prepare a pull request with an update.
I remember a PR for this, but it was determined to be impossible to do now.
It was not impossible. I still think I had a well working solution. The PR it was just not accepted for whatever reason. It was not even tested. Then I got pissed and decided to scrap it. I will not resubmit a solution, I'm sorry. If you need one you can look into the old PR.
Nope, it's not possible. Won't look into it without a proof of concept
There were two PRs for the same issue. I know that @TomyLobo's was closed because File.Exists() got changed and so his PR would no longer work.
@thegrb93, Grocel is a long, longtime contributor to wiremod, all the way back in our SVN days in one way or another. We really should be giving him the courtesy of why it wouldn't work anymore in the context of his PR, even if brief.
@Grocel your PR was submitted during the time when contribution guidelines were far too strict. As a result, it stagnated a lot of PRs because nobody wanted to take the extensive time to review and test. That's probably the chief reason it didn't get merged then; it bogged the process down.
Those guidelines have been relaxed significantly and got the train rolling again. Though I wouldn't discount @thegrb93's concerns. He is a dev, I am not, so I need to be yielding to his and other devs expertise.
@Anticept I know, that's why I was being harder on him. He shouldn't have a problem finding these things out. If it was a noob, I'd have been more courteous
We really should be giving a little courtesy, however brief it may be.
That said, @Grocel , I lack the ability to evaluate this myself. Developing isn't my role in the org. As was said in tomy's PR, File.Exists() behavior was changed. I don't know if your PR accounted for that, and sorry that things got caught up in the "great stagnation" back then.
Ahhh... Garry's fault Best label ever -_-
In the Sound Browser, it is impossible to know what game a specific sound is from. If I'm building something I'll share later, I want to avoid sounds that don't come with Garry's Mod itself. If it's the Heavy shouting something about a sandwich I obviously know that's from Team Fortress 2, but other times it's not that easy to tell.