Ceres Posted February 12, 2023 Report Share Posted February 12, 2023 Hello! Is it possible to get a link/path to the code that is responsible for an item (menu, unit) clicked on, e.g. in the console? Thus, one could find the right place in the code quicker if interested in e.g. a menu structure. Quote Link to comment Share on other sites More sharing options...
Mentula Posted February 14, 2023 Report Share Posted February 14, 2023 Unfortunately no, as far as I know. It would be great to have an "Inspect" functionality, like the one present on most browsers. Maybe it is worth to considered it as a long-term addition to the game. This would make the game more attractive to modders and facilitate the development of mods/features/patches. @Stan` what do you think? 1 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 14, 2023 Report Share Posted February 14, 2023 On 12/02/2023 at 11:38 AM, Ceres said: Hello! Is it possible to get a link/path to the code that is responsible for an item (menu, unit) clicked on, e.g. in the console? Thus, one could find the right place in the code quicker if interested in e.g. a menu structure. No but you can use the somewhat updated doc on https://docs.wildfiregames.com/javascript/gui/ 19 minutes ago, Mentula said: It would be great to have an "Inspect" functionality, like the one present on most browsers. Maybe it is worth to considered it as a long-term addition to the game. This would make the game more attractive to modders and facilitate the development of mods/features/patches. @Stan` what do you think? It would be nice indeed, but that's very low priority, if it's even possible. 1 Quote Link to comment Share on other sites More sharing options...
Ceres Posted February 16, 2023 Author Report Share Posted February 16, 2023 @Stan` Is there a debugging function showing in the console the (local) player's interaction with the user interface? If yes, then maybe that information would already help non-experts to find the right area for the code. I could try and check but don't know how to properly enable a debugging mode. Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 16, 2023 Report Share Posted February 16, 2023 I'm not sure one can hook themselves to every click in the interface. But it's probably possible. Quote Link to comment Share on other sites More sharing options...
nani Posted June 5, 2023 Report Share Posted June 5, 2023 Ctrl + C + L Quote Link to comment Share on other sites More sharing options...
causative Posted June 5, 2023 Report Share Posted June 5, 2023 What I might do is look at some text in the GUI that appears over the item, then run a recursive grep for that text in the source tree that I have checked out from svn. I find the following bash function useful. function codegrep () { find ${2:-.} -regex '.*\.cpp\|.*\.h\|.*\.hpp\|.*\.js' -exec grep "${1}" '{}' + } You can also look in xml files for menus and stuff (just add |.*\.xml to the regex), though that will take a lot longer. And if you know the ancestor directory, such as source/ for cpp or binaries/data/mods/public for javascript and xml, that will also speed it up a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.