2022-01-08 18:31:08 +01:00
|
|
|
//<= imgsrc, imgsize, color_old_1, color_new_1, color_old_2, color_new_2
|
2021-12-26 19:21:03 +01:00
|
|
|
inline fastcall replace_2cols(EDI, EDX, ESI, ECX, EBX, EAX)
|
|
|
|
{
|
|
|
|
EDX += EDI; //imgsrc + imgsize;
|
|
|
|
WHILE (EDI < EDX) {
|
|
|
|
IF (DSDWORD[EDI]==ESI) DSDWORD[EDI] = ECX;
|
|
|
|
ELSE IF (DSDWORD[EDI]==EBX) DSDWORD[EDI] = EAX;
|
|
|
|
EDI += 4;
|
|
|
|
}
|
|
|
|
}
|
2020-04-04 01:17:28 +02:00
|
|
|
|
2021-06-28 00:16:37 +02:00
|
|
|
:unsigned int DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n, bool pressed)
|
2020-04-04 01:17:28 +02:00
|
|
|
{
|
|
|
|
#define TSZE 25
|
2021-12-26 19:21:03 +01:00
|
|
|
static dword lightest, i16_mem, old_work_light;
|
|
|
|
dword i16_size;
|
2022-01-09 07:36:16 +01:00
|
|
|
if (!lightest) || (old_work_light != sc.light) {
|
|
|
|
old_work_light = sc.light;
|
|
|
|
lightest = MixColors(sc.light, 0xFFFfff, skin_is_dark()*155 + 20);
|
2021-12-26 19:21:03 +01:00
|
|
|
if (ESI = memopen("ICONS18", NULL, SHM_READ)) {
|
|
|
|
i16_size = EDX;
|
|
|
|
i16_mem = malloc(i16_size);
|
|
|
|
memmov(i16_mem, ESI, i16_size);
|
2022-01-09 07:36:16 +01:00
|
|
|
replace_2cols(i16_mem, i16_size, 0xffFFFfff, sc.light, 0xffCACBD6, sc.dark);
|
2021-12-26 19:21:03 +01:00
|
|
|
}
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|
2022-01-09 07:36:16 +01:00
|
|
|
DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, sc.light);
|
2020-04-04 01:17:28 +02:00
|
|
|
DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
|
|
|
|
if (_icon_n==-1) {
|
2022-01-09 07:36:16 +01:00
|
|
|
DrawBar(_x+6, _y+5, 16, 16, sc.light);
|
|
|
|
DrawBar(_x+6, _y+7, 15, 3, sc.line);
|
2021-12-26 19:21:03 +01:00
|
|
|
$add ecx,5*65536
|
|
|
|
$int 64
|
|
|
|
$add ecx,5*65536
|
|
|
|
$int 64
|
2020-04-04 01:17:28 +02:00
|
|
|
} else {
|
2021-12-26 19:21:03 +01:00
|
|
|
if (i16_mem) PutPaletteImage(18*18*4*_icon_n + i16_mem,
|
|
|
|
18, 18, TSZE/2-9+2+_x, TSZE/2-9+1+_y+pressed, 32, 0);
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|
2020-05-11 09:32:44 +02:00
|
|
|
|
|
|
|
if (!pressed) {
|
2022-01-09 07:36:16 +01:00
|
|
|
DrawOvalBorder(_x, _y, TSZE, TSZE, lightest, sc.line, sc.light, sc.work);
|
2020-05-11 09:32:44 +02:00
|
|
|
} else {
|
2022-01-09 07:36:16 +01:00
|
|
|
DrawOvalBorder(_x, _y, TSZE, TSZE, sc.line, sc.light, sc.dark, sc.work);
|
2020-05-11 09:32:44 +02:00
|
|
|
PutShadow(_x+1, _y+1, TSZE, TSZE, true, 2);
|
|
|
|
}
|
|
|
|
|
2020-05-05 03:16:36 +02:00
|
|
|
return _x;
|
2020-04-04 01:17:28 +02:00
|
|
|
}
|