mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-10 18:52:59 +00:00
grid color is now configurable (stdgridcolor)
This commit is contained in:
@@ -255,6 +255,7 @@ void initConfig() {
|
|||||||
addsaver(ringcolor, "color:ring");
|
addsaver(ringcolor, "color:ring");
|
||||||
addsaver(modelcolor, "color:model");
|
addsaver(modelcolor, "color:model");
|
||||||
addsaver(periodcolor, "color:period");
|
addsaver(periodcolor, "color:period");
|
||||||
|
addsaver(stdgridcolor, "color:stdgrid");
|
||||||
addsaver(dialog::dialogcolor, "color:dialog");
|
addsaver(dialog::dialogcolor, "color:dialog");
|
||||||
for(auto& p: colortables)
|
for(auto& p: colortables)
|
||||||
savecolortable(p.second, s0+"canvas"+p.first);
|
savecolortable(p.second, s0+"canvas"+p.first);
|
||||||
@@ -1673,6 +1674,9 @@ void show_color_dialog() {
|
|||||||
dialog::addColorItem(XLAT("projection background"), modelcolor, 'c');
|
dialog::addColorItem(XLAT("projection background"), modelcolor, 'c');
|
||||||
dialog::add_action([] () { dialog::openColorDialog(modelcolor); dialog::dialogflags |= sm::SIDE; });
|
dialog::add_action([] () { dialog::openColorDialog(modelcolor); dialog::dialogflags |= sm::SIDE; });
|
||||||
|
|
||||||
|
dialog::addColorItem(XLAT("standard grid color"), stdgridcolor, 'g');
|
||||||
|
dialog::add_action([] () { vid.grid = true; dialog::openColorDialog(stdgridcolor); dialog::dialogflags |= sm::SIDE; });
|
||||||
|
|
||||||
dialog::addSelItem(XLAT("brightness behind the sphere"), fts3(backbrightness), 'i');
|
dialog::addSelItem(XLAT("brightness behind the sphere"), fts3(backbrightness), 'i');
|
||||||
dialog::add_action([] () { dialog::editNumber(backbrightness, 0, 1, .01, 0.25, XLAT("brightness behind the sphere"), "brightness behind the sphere"); dialog::bound_low(0); });
|
dialog::add_action([] () { dialog::editNumber(backbrightness, 0, 1, .01, 0.25, XLAT("brightness behind the sphere"), "brightness behind the sphere"); dialog::bound_low(0); });
|
||||||
|
|
||||||
@@ -1853,6 +1857,9 @@ int read_color_args() {
|
|||||||
else if(argis("-ring")) {
|
else if(argis("-ring")) {
|
||||||
PHASEFROM(2); shift(); ringcolor = arghex();
|
PHASEFROM(2); shift(); ringcolor = arghex();
|
||||||
}
|
}
|
||||||
|
else if(argis("-stdgrid")) {
|
||||||
|
PHASEFROM(2); shift(); stdgridcolor = arghex();
|
||||||
|
}
|
||||||
else if(argis("-period")) {
|
else if(argis("-period")) {
|
||||||
PHASEFROM(2); shift(); periodcolor = arghex();
|
PHASEFROM(2); shift(); periodcolor = arghex();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3523,6 +3523,8 @@ bool openorsafe(cell *c) {
|
|||||||
|
|
||||||
#define Dark(x) darkena(x,0,0xFF)
|
#define Dark(x) darkena(x,0,0xFF)
|
||||||
|
|
||||||
|
color_t stdgridcolor = 0x202020FF;
|
||||||
|
|
||||||
int gridcolor(cell *c1, cell *c2) {
|
int gridcolor(cell *c1, cell *c2) {
|
||||||
if(cmode & sm::DRAW) return Dark(forecolor);
|
if(cmode & sm::DRAW) return Dark(forecolor);
|
||||||
if(!c2)
|
if(!c2)
|
||||||
@@ -3542,6 +3544,7 @@ int gridcolor(cell *c1, cell *c2) {
|
|||||||
return Dark(0x2020A0);
|
return Dark(0x2020A0);
|
||||||
if(c1->land == laMinefield && c2->land == laMinefield && (openorsafe(c1) != openorsafe(c2)))
|
if(c1->land == laMinefield && c2->land == laMinefield && (openorsafe(c1) != openorsafe(c2)))
|
||||||
return Dark(0xA0A0A0);
|
return Dark(0xA0A0A0);
|
||||||
|
if(!darken) return stdgridcolor;
|
||||||
return Dark(0x202020);
|
return Dark(0x202020);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
hyper.h
2
hyper.h
@@ -2497,7 +2497,7 @@ string generateHelpForItem(eItem it);
|
|||||||
bool graphglyph();
|
bool graphglyph();
|
||||||
extern bool hiliteclick;
|
extern bool hiliteclick;
|
||||||
extern int antialiaslines;
|
extern int antialiaslines;
|
||||||
extern color_t ringcolor, periodcolor, modelcolor;
|
extern color_t ringcolor, periodcolor, modelcolor, stdgridcolor;
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user