Log in

View Full Version : [TEC] command bar


minsc_tdp
08-15-07, 02:56 PM
How can I detect if a mod has altered the command bar buttons in some way (or orders bar or menu bar, whatever its called)?

Could I check Data\Menu\cfg\OrdersBar.cfg and if it's not stock that will confirm it? This is for sh4speech to warn if the buttons have been moved around

Digital_Trucker
08-15-07, 06:15 PM
That would be the place to look, for sure. If you really wanted to go whole hog with it, you could even map which buttons are in which location and use some kind of indexing technique to point at the tabs and buttons without any manual intervention.

I.E Keep a start x,y value (both for tabs and for buttons) and the x differential for each so that you can determine the x,y value for any button by adding the starting x value to the product of the button number with the differential value. Then build an array of which commands are located at which button. Then when a command is requested, instead of going to a hard coded x,y value, you do a table lookup for the command that returns the button number, calculate the x value and do your mouse command.

Using this method, you could even keep the beginning and differential values stored by screen resolution and use the graphics settings file in the game folder to set them when you start your program up.