2018-10-20 13:00:31 +02:00
|
|
|
|
|
|
|
#define MIN_PB_BLOCK_W 19
|
|
|
|
#define LOAD_CPU 0x2460C8
|
2020-12-11 14:33:32 +01:00
|
|
|
#define PROGRESS_ACTIVE 0x62B7E4
|
2018-10-20 13:00:31 +02:00
|
|
|
#define PROGRESS_BG 0xFFFfff
|
|
|
|
#define PROGRESS_BG_TEXT 0x696969
|
|
|
|
|
|
|
|
:struct sensor {
|
|
|
|
int x,y,w,h;
|
|
|
|
void set_size();
|
|
|
|
void draw_wrapper();
|
|
|
|
void draw_progress();
|
|
|
|
};
|
|
|
|
|
|
|
|
:void sensor::set_size(dword _x, _y, _w, _h)
|
|
|
|
{
|
|
|
|
x=_x+2;
|
|
|
|
y=_y;
|
|
|
|
w=_w;
|
|
|
|
h=_h;
|
|
|
|
draw_wrapper();
|
|
|
|
}
|
|
|
|
|
|
|
|
:void sensor::draw_wrapper()
|
|
|
|
{
|
2020-04-18 01:52:24 +02:00
|
|
|
DrawRectangle(x-1, y-1, w+1, h+1, sc.work_graph);
|
2020-05-10 03:44:40 +02:00
|
|
|
DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work, sc.work_light);
|
2018-10-20 13:00:31 +02:00
|
|
|
}
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
:void sensor::draw_progress(dword progress_w)
|
2018-10-20 13:00:31 +02:00
|
|
|
{
|
2020-05-10 03:44:40 +02:00
|
|
|
char textp[16];
|
2018-10-20 13:00:31 +02:00
|
|
|
DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200));
|
|
|
|
DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE);
|
2020-04-18 01:52:24 +02:00
|
|
|
DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, sc.work_graph, 200));
|
2018-10-20 13:00:31 +02:00
|
|
|
DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG);
|
2020-05-10 03:44:40 +02:00
|
|
|
|
|
|
|
strcpy(#textp, itoa(w-progress_w*100/w));
|
|
|
|
chrcat(#textp, '%');
|
|
|
|
WriteText(-strlen(#textp)*8 + w / 2 + x, h/2-7+y, 0x90, 0x000000, #textp);
|
2018-10-20 13:00:31 +02:00
|
|
|
}
|