source: titan/plugins/tmc/tmc.h @ 15651

Last change on this file since 15651 was 15651, checked in by nit, 11 years ago

[titan] titan first step tmc menü (plugin)

File size: 1.9 KB
Line 
1#ifndef TMC_H
2#define TMC_H
3
4//flag 0: left
5//flag 1: right
6void tmcmenuscroll(int flag, struct skin* tmcmenu1, struct skin* tmcmenu2, struct skin* tmcmenu3, struct skin* tmcmenu4, struct skin* tmcmenu5)
7{
8        char* tmpstr = NULL;
9
10        if(flag == 0)
11        {
12                tmpstr = ostrcat(tmcmenu1->pic, NULL, 0, 0);
13                changepic(tmcmenu1, tmcmenu2->pic);
14                changepic(tmcmenu2, tmcmenu3->pic);
15                changepic(tmcmenu3, tmcmenu4->pic);
16                changepic(tmcmenu4, tmcmenu5->pic);
17                changepic(tmcmenu5, tmpstr);
18                free(tmpstr); tmpstr = NULL;
19                drawscreen(tmcmenu1, 1);
20                drawscreen(tmcmenu2, 1);
21                drawscreen(tmcmenu3, 1);
22                drawscreen(tmcmenu4, 1);
23                drawscreen(tmcmenu5, 0);
24        }
25        else
26        {
27                tmpstr = ostrcat(tmcmenu5->pic, NULL, 0, 0);
28                changepic(tmcmenu5, tmcmenu4->pic);
29                changepic(tmcmenu4, tmcmenu3->pic);
30                changepic(tmcmenu3, tmcmenu2->pic);
31                changepic(tmcmenu2, tmcmenu1->pic);
32                changepic(tmcmenu1, tmpstr);
33                free(tmpstr); tmpstr = NULL;
34                drawscreen(tmcmenu1, 1);
35                drawscreen(tmcmenu2, 1);
36                drawscreen(tmcmenu3, 1);
37                drawscreen(tmcmenu4, 1);
38                drawscreen(tmcmenu5, 0);
39        }
40}
41
42void screentmcmenu()
43{
44        int rcret = 0;
45        struct skin* tmcbg = getscreen("tmcbg");
46        struct skin* tmcmenu1 = getscreen("tmcmenu1");
47        struct skin* tmcmenu2 = getscreen("tmcmenu2");
48        struct skin* tmcmenu3 = getscreen("tmcmenu3");
49        struct skin* tmcmenu4 = getscreen("tmcmenu4");
50        struct skin* tmcmenu5 = getscreen("tmcmenu5");
51
52        drawscreen(tmcbg, 1);
53        drawscreen(tmcmenu1, 1);
54        drawscreen(tmcmenu2, 1);
55        drawscreen(tmcmenu3, 1);
56        drawscreen(tmcmenu4, 1);
57        drawscreen(tmcmenu5, 0);
58
59        while(1)
60        {
61                rcret = waitrc(NULL, 0, 0);
62
63                if(rcret == getrcconfigint("rcexit", NULL)) break;
64
65                if(rcret == getrcconfigint("rcleft", NULL))
66                        tmcmenuscroll(0, tmcmenu1, tmcmenu2, tmcmenu3, tmcmenu4, tmcmenu5);
67                if(rcret == getrcconfigint("rcright", NULL))
68                        tmcmenuscroll(1, tmcmenu1, tmcmenu2, tmcmenu3, tmcmenu4, tmcmenu5);
69        }
70
71        clearscreen(tmcbg);
72}
73
74#endif
Note: See TracBrowser for help on using the repository browser.