Rev 7906 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7906 | Rev 8365 | ||
---|---|---|---|
1 | #define MIN_PB_BLOCK_W 19 |
1 | #define MIN_PB_BLOCK_W 19 |
2 | #define LOAD_CPU 0x2460C8 |
2 | #define LOAD_CPU 0x2460C8 |
3 | #define PROGRESS_ACTIVE 0x489FE4 |
3 | #define PROGRESS_ACTIVE 0x62B7E4 |
4 | #define PROGRESS_BG 0xFFFfff |
4 | #define PROGRESS_BG 0xFFFfff |
5 | #define PROGRESS_BG_TEXT 0x696969 |
5 | #define PROGRESS_BG_TEXT 0x696969 |
6 | 6 | ||
7 | :struct sensor { |
7 | :struct sensor { |
8 | int x,y,w,h; |
8 | int x,y,w,h; |
9 | void set_size(); |
9 | void set_size(); |
10 | void draw_wrapper(); |
10 | void draw_wrapper(); |
11 | void draw_progress(); |
11 | void draw_progress(); |
12 | }; |
12 | }; |
13 | 13 | ||
14 | :void sensor::set_size(dword _x, _y, _w, _h) |
14 | :void sensor::set_size(dword _x, _y, _w, _h) |
15 | { |
15 | { |
16 | x=_x+2; |
16 | x=_x+2; |
17 | y=_y; |
17 | y=_y; |
18 | w=_w; |
18 | w=_w; |
19 | h=_h; |
19 | h=_h; |
20 | draw_wrapper(); |
20 | draw_wrapper(); |
21 | } |
21 | } |
22 | 22 | ||
23 | :void sensor::draw_wrapper() |
23 | :void sensor::draw_wrapper() |
24 | { |
24 | { |
25 | DrawRectangle(x-1, y-1, w+1, h+1, sc.work_graph); |
25 | DrawRectangle(x-1, y-1, w+1, h+1, sc.work_graph); |
26 | DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work, sc.work_light); |
26 | DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work, sc.work_light); |
27 | } |
27 | } |
28 | 28 | ||
29 | :void sensor::draw_progress(dword progress_w) |
29 | :void sensor::draw_progress(dword progress_w) |
30 | { |
30 | { |
31 | char textp[16]; |
31 | char textp[16]; |
32 | DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200)); |
32 | DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200)); |
33 | DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE); |
33 | DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE); |
34 | DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, sc.work_graph, 200)); |
34 | DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, sc.work_graph, 200)); |
35 | DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); |
35 | DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); |
36 | 36 | ||
37 | strcpy(#textp, itoa(w-progress_w*100/w)); |
37 | strcpy(#textp, itoa(w-progress_w*100/w)); |
38 | chrcat(#textp, '%'); |
38 | chrcat(#textp, '%'); |
39 | WriteText(-strlen(#textp)*8 + w / 2 + x, h/2-7+y, 0x90, 0x000000, #textp); |
39 | WriteText(-strlen(#textp)*8 + w / 2 + x, h/2-7+y, 0x90, 0x000000, #textp); |
40 | } |
40 | } |