Day 38: 12 March 2013
23:24: I’ve done a couple of smallish things today. I added in the weapon type to a weapon’s properties and made it so you could hover over the items in the module/ship part library. That’s pretty convenient. I also tweaked the color of the little progress bars, but most people won’t notice that.
The next step for me is the ship details. I suppose that means creating a text box control that will allow you to type in a ship’s name and hull number. I vaguely remember implementing a text box at one point forever ago, but it’s a little intimidating right now, thinking about it. I mean, you kind of overlook how complicated it can be.
First, you need to have a system that can handle focus. That is, you need to be able to direct your keyboard events to a certain specific control.
Then you need to have those key presses, plus the arrow keys, do what they’re supposed to do.
Then there’s a bunch of rendering aspects, like drawing the cursor, and drawing only part of the text if it gets too long, and goes beyond the edge of the text box. I think I might put a limit on the length for now, just so I don’t have to deal with this particular piece. Besides, super long ship names will cause problems all over the GUI anyway.
And to top it off, you’ve got to be able to handle placing the cursor at the location that the person clicks, and maybe even being able to select part of it and delete it.
Well… I think I’ll have to take a few shortcuts. I don’t really want to spend the next week working on a textbox. I have a ton of other things to do, so it looks like it will be just a skeleton of a textbox. Perhaps I should put a limit on the amount of time I spend on it.