/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
code/modules/context_click/context_click.dm
38 строк
1 KB
ShiftyRail
Expunges hasvar() (#26846)
26 июн 2020, 10:55
Не верифицирован
26 июн 2020, 10:55
eeb24fd
Код
Авторство
О чём код?
/*///////////////////// CONTEXT CLICKING: The datum is a contextual click handler for on-item behaviour It allows you to assign IDs and click locations to various parts of an item IDs can then be used to cause certain behaviour using the action() proc *////////////////////// /datum/context_click var/obj/holder /datum/context_click/New(to_hold) ..() holder = to_hold /datum/context_click/Destroy() holder = null return ..() //Gives the id clicked in this particular handler /datum/context_click/proc/return_clicked_id(var/x_pos, var/y_pos) return //Helper for using params /datum/context_click/proc/return_clicked_id_by_params(params) if(!params) return var/list/params_list = params2list(params) var/x_pos_clicked = clamp(text2num(params_list["icon-x"]), 1, WORLD_ICON_SIZE) var/y_pos_clicked = clamp(text2num(params_list["icon-y"]), 1, WORLD_ICON_SIZE) return return_clicked_id(x_pos_clicked, y_pos_clicked) ////ACTIONS//// //This is what you call when you want to hook into the handler //Combine params with return_clicked_id_by_params /datum/context_click/proc/action(obj/item/used_item, mob/user, params) return