mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-28 02:50:34 +00:00
crosshair option
This commit is contained in:
parent
bc76bc472c
commit
5ad1be2962
20
config.cpp
20
config.cpp
@ -387,6 +387,9 @@ EX void initConfig() {
|
||||
addsaver(vid.quickmouse, "quick mouse", !ISPANDORA);
|
||||
|
||||
// colors
|
||||
|
||||
addsaver(crosshair_size, "size:crosshair");
|
||||
addsaver(crosshair_color, "color:crosshair");
|
||||
|
||||
addsaver(backcolor, "color:background");
|
||||
addsaver(forecolor, "color:foreground");
|
||||
@ -1244,6 +1247,19 @@ EX void configureInterface() {
|
||||
dialog::add_action([] {
|
||||
vid.graphglyph = (1+vid.graphglyph)%3;
|
||||
});
|
||||
|
||||
dialog::addSelItem(XLAT("draw crosshair"), crosshair_size > 0 ? fts(crosshair_size) : ONOFF(false), 'x');
|
||||
dialog::add_action([] () {
|
||||
dialog::editNumber(crosshair_size, 0, 100, 1, 10, XLAT("crosshair size"), XLAT(
|
||||
"Display a targetting reticle in the center of the screen. Might be useful when exploring 3D modes, "
|
||||
"as it precisely shows the direction we are going. However, the option is available in all modes."
|
||||
));
|
||||
dialog::bound_low(0);
|
||||
dialog::extra_options = [] {
|
||||
dialog::addColorItem(XLAT("crosshair color"), crosshair_color, 'X');
|
||||
dialog::add_action([] { dialog::openColorDialog(crosshair_color); });
|
||||
};
|
||||
});
|
||||
|
||||
dialog::addBreak(50);
|
||||
dialog::addBack();
|
||||
@ -2175,6 +2191,10 @@ EX int read_color_args() {
|
||||
else if(argis("-period")) {
|
||||
PHASEFROM(2); shift(); periodcolor = arghex();
|
||||
}
|
||||
else if(argis("-crosshair")) {
|
||||
PHASEFROM(2); shift(); crosshair_color = arghex();
|
||||
shift_arg_formula(crosshair_size);
|
||||
}
|
||||
else if(argis("-borders")) {
|
||||
PHASEFROM(2); shift(); bordcolor = arghex();
|
||||
}
|
||||
|
15
hud.cpp
15
hud.cpp
@ -471,6 +471,9 @@ EX void draw_radar(bool cornermode) {
|
||||
}
|
||||
}
|
||||
|
||||
EX color_t crosshair_color = 0xFFFFFFC0;
|
||||
EX ld crosshair_size = 0;
|
||||
|
||||
EX void drawStats() {
|
||||
if(nohud || vid.stereo_mode == sLR) return;
|
||||
if(callhandlers(false, hooks_prestats)) return;
|
||||
@ -494,9 +497,21 @@ EX void drawStats() {
|
||||
dynamicval<ld> vs(vid.scale, 1);
|
||||
dynamicval<ld> vc(vid.camera_angle, 0);
|
||||
if(prod) vid.alpha = 30, vid.scale = 30;
|
||||
|
||||
auto& cd = current_display;
|
||||
auto xc = cd->xcenter;
|
||||
auto yc = cd->ycenter;
|
||||
|
||||
calcparam();
|
||||
|
||||
if(crosshair_color && crosshair_size > 0) {
|
||||
initquickqueue();
|
||||
vid.linewidth = 1;
|
||||
queueline(tC0(atscreenpos(xc - crosshair_size, yc, 1)), tC0(atscreenpos(xc + crosshair_size, yc, 1)), crosshair_color).prio = PPR::SUPERLINE;
|
||||
queueline(tC0(atscreenpos(xc, yc - crosshair_size, 1)), tC0(atscreenpos(xc, yc + crosshair_size, 1)), crosshair_color).prio = PPR::SUPERLINE;
|
||||
quickqueue();
|
||||
}
|
||||
|
||||
if(vid.radarsize > 0 && h)
|
||||
#if CAP_RACING
|
||||
if(!racing::on)
|
||||
|
Loading…
Reference in New Issue
Block a user