gerbilOFdoom Posted December 19, 2011 Share Posted December 19, 2011 Alright, so I'm trying to figure out where the input events are in the source code. If this project were in java, it would have event listeners to perform an action upon a mouse click or key press, but I can't find anything even remotely along those lines. Where is the code for input events and the resulting actions located? Link to comment Share on other sites More sharing options...
quantumstate Posted December 19, 2011 Share Posted December 19, 2011 I think you would probably want to look at binaries/data/mods/public/gui/session/input.js. Some other files in those folders might be relevant as well. You will find that these often call simulation components, http://trac.wildfiregames.com/wiki/SimulationArchitecture gives an overview of the simulation system. The js parts are in /home/jonathan/programming/0ad/binaries/data/mods/public/simulation the components folder contains the simulation components and the helpers folder has some stuff which they use, commands.js is an important file since it handles commands sent to entities. The C++ components are found in source/simulation2.There is a lack of high level documentation for the game unfortunately, hopefully this will help you a bit. Link to comment Share on other sites More sharing options...
gerbilOFdoom Posted December 19, 2011 Author Share Posted December 19, 2011 That's exactly it, Quantumstate! Thanks. I think I'll start logging my exploration of the code, too. Maybe I can add to the documentation... Link to comment Share on other sites More sharing options...
gerbilOFdoom Posted December 20, 2011 Author Share Posted December 20, 2011 For the purpose of figuring out my way around the code, does a command exist that I could use to print a message to the console? For example, if I wanted to print "User has right-clicked" when the user right clicks, what command would I use? Link to comment Share on other sites More sharing options...
quantumstate Posted December 20, 2011 Share Posted December 20, 2011 It is easiest to use warn(). This prints a message onto the normal game screen and into the console. You also get the messages logged in interestinglog.html (found in the log folder which is OS dependent). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now