Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char MenuArray[500];
- int MenuArrayPlace = 0;
- char MenuArrayBreak[] = "~n~~s~";
- //reset menu
- void beginMenu() {
- MenuArrayPlace = 0;
- for (int i = 0; i < 500; i++)
- MenuArray[i] = 0;
- }
- //remove from screen
- void closeMiniMenu() {
- *(volatile int*)(0x020672EC + 0x03) = 0x02;
- }
- //show on screen
- void openMiniMenu() {
- *(volatile int*)(0x020672EC + 0x03) = 0x03;
- }
- //add line to menu
- void pushMenu(char *text) {
- int j = 0;
- while (text[j] != 0) {
- if (MenuArrayPlace < 500) {
- MenuArray[MenuArrayPlace] = text[j];
- MenuArrayPlace++;
- }
- j++;
- }
- j = 0;
- while (MenuArrayBreak[j] != 0) {
- if (MenuArrayPlace < 500) {
- MenuArray[MenuArrayPlace] = MenuArrayBreak[j];
- MenuArrayPlace++;
- }
- j++;
- }
- }
- //add title
- void addTitle(char *text) {
- beginMenu();
- char *red = "~r~";
- int j = 0;
- while (red[j] != 0) {
- if (MenuArrayPlace < 500) {
- MenuArray[MenuArrayPlace] = red[j];
- MenuArrayPlace++;
- }
- j++;
- }
- pushMenu(text);
- }
- //add option line
- void addOption(char *text) {
- pushMenu(text);
- }
- //draw the menu on the screen
- void popMenu() {
- for (int i = 0; i < 500; i++)
- *(char*)(0x02066BDC+i) = MenuArray[i];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement