wildweasel wrote:Yeah, I don't know if I'd be able to work with that; mouse-controlled is nice but probably very hard to work with as far as code goes.
At current, the GUI I've made is 100% stable, and it's actually fairly easy to work with. All it takes it a little debug-running, some paper and a pencil (or pen), and patience.wildweasel wrote:Well, perhaps a CS Source type of buy menu could work too, mouse-controlled may be the way to go here...the only thing would be how easy it would be to add new menu items to the list. I don't want it to be too difficult.
FYI, I did release the source to all of the code in the thread link, so if you wanted to peek at it or something, by all means. Another thing, you don't need direct permission to use any of the code I've made, just add me somewhere in your credits is all.

Anyway, I guess I'll go a little into depth as to how the GUI works. It makes use of GetPlayerInput() (As I'm sure plenty of modders have speculated). All it does from there is track the player's mouse movements, and uses the sensitivity to change the coordinates of a HudMessage (Which would be the cursor. While it is constantly being displayed, it takes in a variable that is changed by mouse movement). There is also another Input Check that determines when the player clicks the mouse. When the player does so, it runs a few checks on the coordinates of the HudMessage to determine whether the player is actually highlighting a button or not, and what action to take.
This is the part that takes patience: You have to make a Debug message that will display the said coordinates of that HudMessage, and you will have to record them so you can put them into your check system. I did make a custom function that can do the check (In LoCS II, it's called 'CheckButton(MinX, MinY, MaxX, MaxY)'). You simply position the cursor at the upper-left most point of the clickable "button", jot down the coords, move it to the bottom-right most position, right those down, and then slap them in the script. You can even use #define's if you'd like. Also, the good news is this system is also 100% multiplayer compatible, with just a few carefully-done arrays (which I did have in the source).
The only step you would have to do beforehand is setting up the GUI menus (what they look like, etc. For example, in LoCS II, the skill trees are just some (poorly) drawn images I made in Photoshop, designed to fit on the screen). After that, get it to show up in game, and then do the coordinate checking. You can also use it to toggle graphics (like in CS:S, you have a preview of a weapon show up when you highlight it in the menu. In LoCS II, I used it to show Skill information).
If you need any more help with any of this, just give a holler. Hope some of this was helpful.
