JoshuaJB / 0ad

Git mirror of the 0 A.D. source code (http://trac.wildfiregames.com/browser)
http://play0ad.com
Other
3 stars 0 forks source link

Adds basic CInput password masking #18

Closed historicbruno closed 11 years ago

historicbruno commented 11 years ago

Doesn't do anything fancy, it checks if "masking_enabled" property is true, if so, it will only render the "masking_char" which defaults to an asterisk (*). May be issues with selecting text using different fonts, because I didn't touch any of that code, but it works with the current style as far as I can tell.

historicbruno commented 11 years ago

Also, a script can set "masking_enabled" false, and the caption will reappear, so we could have that typical UI option.

JoshuaJB commented 11 years ago

Looks pretty good, only thing is that "masking_enabled" is a little verbose. Maybe naming it "mask" and "mask_char" would be a little more concise?

historicbruno commented 11 years ago

That's fine, and it matches some other properties like "scrollbar" and "multiline". Generally I like to be verbose with property and variable names, but in this case we can go with the convention.

historicbruno commented 11 years ago

Oops, I found the bug I was expecting, if you type "wwwwwwwwwww" it will mess up the alignment. I'll see if I can fix that :)

historicbruno commented 11 years ago

Should be fixed now, and I changed the property names as discussed