2018-10-10 17:44:01 +03:00
|
|
|
#ifndef INCLUDE_MENU_H
|
|
|
|
#define INCLUDE_MENU_H
|
2016-01-07 18:26:59 +03:00
|
|
|
|
2018-10-10 17:44:01 +03:00
|
|
|
:dword menu_process_id;
|
|
|
|
|
2020-04-13 14:51:56 +03:00
|
|
|
#define MENU_ALIGN_TOP_LEFT 0
|
|
|
|
#define MENU_ALIGN_TOP_RIGHT 1
|
|
|
|
#define MENU_ALIGN_BOT_LEFT 2
|
|
|
|
#define MENU_ALIGN_BOT_RIGHT 3
|
2020-04-12 00:17:55 +03:00
|
|
|
|
|
|
|
:dword shared_mem = NULL;
|
|
|
|
:char shared_name[] = "LMENU";
|
2020-04-13 17:47:37 +03:00
|
|
|
:void open_lmenu(dword _x, _y, _position, _selected, _text1)
|
2020-04-12 00:17:55 +03:00
|
|
|
{
|
|
|
|
if (!shared_mem) {
|
2020-04-13 14:51:56 +03:00
|
|
|
shared_mem = memopen(#shared_name, 16, SHM_CREATE + SHM_WRITE);
|
|
|
|
if (EDX) shared_mem = memopen(#shared_name, 16, SHM_WRITE);
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
2020-04-13 14:51:56 +03:00
|
|
|
ESDWORD[shared_mem ] = _selected;
|
2020-04-12 00:17:55 +03:00
|
|
|
ESDWORD[shared_mem + 4] = _x;
|
|
|
|
ESDWORD[shared_mem + 8] = _y;
|
|
|
|
ESDWORD[shared_mem + 12] = _position;
|
2020-04-13 17:47:37 +03:00
|
|
|
menu_process_id = RunProgram("/sys/develop/menu", _text1);
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
:dword get_menu_click()
|
|
|
|
{
|
2020-04-13 14:51:56 +03:00
|
|
|
if (menu_process_id) && (GetProcessSlot(menu_process_id)) {
|
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
menu_process_id = NULL;
|
2020-04-13 16:16:55 +03:00
|
|
|
EAX = ESDWORD[shared_mem];
|
|
|
|
ESDWORD[shared_mem] = 0;
|
|
|
|
return EAX;
|
2020-04-13 14:51:56 +03:00
|
|
|
}
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
|
|
|
|
2018-10-10 17:44:01 +03:00
|
|
|
#endif
|