mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-20 06:03:01 +00:00
color dialog has the new sliders
This commit is contained in:
parent
3ae7d8b2d7
commit
5763120dae
18
dialogs.cpp
18
dialogs.cpp
@ -775,17 +775,23 @@ EX namespace dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item it;
|
||||||
|
it.type = diSlider;
|
||||||
|
it.scale = 100;
|
||||||
|
|
||||||
for(int i=0; i<4; i++) {
|
for(int i=0; i<4; i++) {
|
||||||
int y = vid.yres / 2 + (2-i) * vid.fsize * 2;
|
int y = vid.yres / 2 + (2-i) * vid.fsize * 2;
|
||||||
if(i == 3 && !colorAlpha) continue;
|
if(i == 3 && !colorAlpha) continue;
|
||||||
|
int in = 3 - i - (colorAlpha?0:1);
|
||||||
|
|
||||||
|
color_t colors[4] = {0xFF0000, 0x00FF00, 0x0000FF, 0xFFFFFF};
|
||||||
|
it.color = colors[in];
|
||||||
|
it.param = part(color, i) / 255.;
|
||||||
|
draw_slider(dcenter - dwidth / 4, dcenter + dwidth / 4, y, it);
|
||||||
|
|
||||||
color_t col = ((i==colorp) && !mousing) ? 0xFFD500 : dialogcolor;
|
color_t col = ((i==colorp) && !mousing) ? 0xFFD500 : dialogcolor;
|
||||||
|
string rgt; rgt += "RGBA" [in];
|
||||||
displayColorButton(dcenter - dwidth/4, y, "(", 0, 16, 0, col);
|
displayColorButton(dcenter + dwidth/4 + vid.fsize, y, rgt, 0, 0, 0, col);
|
||||||
string rgt = ") "; rgt += "ABGR" [i+(colorAlpha?0:1)];
|
|
||||||
displayColorButton(dcenter + dwidth/4, y, rgt, 0, 0, 0, col);
|
|
||||||
displayColorButton(dcenter - dwidth/4 + dwidth * part(color, i) / 510, y, "#", 0, 8, 0, col);
|
|
||||||
|
|
||||||
if(mousey >= y - vid.fsize && mousey < y + vid.fsize)
|
if(mousey >= y - vid.fsize && mousey < y + vid.fsize)
|
||||||
getcstat = 'A' + i, inslider = true, slider_x = mousex;
|
getcstat = 'A' + i, inslider = true, slider_x = mousex;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user