iamgreaser / iceball

Open-source rewrite of the VOXLAP version of Ace of Spades.
http://iceball.build
GNU General Public License v3.0
113 stars 32 forks source link

Customisable crosshairs #162

Closed rakiru closed 9 years ago

rakiru commented 9 years ago

No, I don't mean the image crosshairs that AoS had. I mean something similar to the system in Counter Strike games. Basically, a bunch of cvars (or in this case, config options) defining attributes of it. Something like this would be the current crosshair:

"crosshair": {
    "dot": true,
    "size": 5,
    "thickness": 1.0
    "gap": 2,
    "colour": [255, 0, 0],
    "alpha": 255,
    "outline": false,
    "outline_colour": [0, 0, 0],
    "outline_thickness": 1
}

This could simply be rendered to a texture on load, which can then be used as the current one is.

rakiru commented 9 years ago

Done: 8a648818236abdb67a7b4a7ce0b0c789dc1fa1de

rakiru commented 9 years ago

Until I figure out a good place to document this, here's an example (this should look identical to the old crosshair, although hitmarker is a bit different):

"crosshair": {
    "dot": true,
    "lines": true,
    "size": 4,
    "thickness": 1,
    "gap": 3,
    "colour": [255, 0, 0],
    "outline": false,
    "outline_colour": [0, 0, 0],
    "outline_thickness": 1,
    "style": "classic"
}

Shove that in user.json and you're good to go. If any field is omitted (or the whole crosshair section, those default values will be applied. The defaults may change at any time, so if you're adamant about having this crosshair forever, use those settings. If you just want to, say, make the crosshair white, you can just have:

"crosshair": {
    "colour": [255, 255, 255]
}

Fields:

rakiru commented 9 years ago

A few example:

Crosshair closeup Full screenshot

"crosshair": {
    "dot": true,
    "lines": true,
    "size": 10,
    "thickness": 1,
    "gap": 2,
    "colour": [255, 255, 0],
    "outline": false,
    "outline_colour": [0, 0, 0],
    "outline_thickness": 1,
    "style": "classic"
}

Crosshair closeup Full screenshot

"crosshair": {
    "dot": true,
    "lines": true,
    "size": 5,
    "thickness": 3,
    "gap": 2,
    "colour": [0, 255, 0],
    "outline": true,
    "outline_colour": [0, 127, 127],
    "outline_thickness": 1,
    "style": "classic"
}

Crosshair closeup Full screenshot

"crosshair": {
    "dot": true,
    "lines": false,
    "size": 2,
    "thickness": 3,
    "gap": 2,
    "colour": [255, 0, 255],
    "outline": false,
    "outline_colour": [0, 127, 127],
    "outline_thickness": 1,
    "style": "classic"
}

Crosshair closeup Full screenshot

"crosshair": {
    "dot": false,
    "lines": true,
    "size": 2,
    "thickness": 11,
    "gap": 5,
    "colour": [255, 0, 0],
    "outline": false,
    "outline_colour": [0, 0, 0],
    "outline_thickness": 1,
    "style": "classic"
}

And here's the one I actually use: Crosshair closeup Full screenshot

"crosshair": {
    "dot": true,
    "lines": true,
    "size": 4,
    "thickness": 2,
    "gap": 3,
    "colour": [255, 0, 255],
    "outline": true,
    "outline_colour": [0, 0, 0],
    "outline_thickness": 1,
    "style": "classic"
}
fkaa commented 9 years ago

Speaking of CVars, it would be nice to see the "hardcoded" config options (gl_quality, map_enable_ao et. al) configurable in-game via something like /set gl_quality 0. Worth opening an issue?

ps. you can close issues by adding "closes/fixes #n" in the commit message