From 000e52515706c0c08cefe90fe0033e613a70b8ea Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:11:54 -0700 Subject: [PATCH 1/4] ok --- code/game/atoms.dm | 18 ------------------ code/modules/client/client_procs.dm | 19 +++++++++++++++++-- html/statbrowser.html | 2 +- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 9607dc4dce..7fbfe48f4e 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1143,21 +1143,3 @@ */ /atom/proc/setClosed() return - -///Passes Stat Browser Panel clicks to the game and calls client click on an atom -/atom/Topic(href, list/href_list) - . = ..() - if(!usr?.client) - return - var/client/usr_client = usr.client - var/list/paramslist = list() - if(href_list["statpanel_item_shiftclick"]) - paramslist["shift"] = "1" - if(href_list["statpanel_item_ctrlclick"]) - paramslist["ctrl"] = "1" - if(href_list["statpanel_item_altclick"]) - paramslist["alt"] = "1" - if(href_list["statpanel_item_click"]) - // first of all make sure we valid - var/mouseparams = list2params(paramslist) - usr_client.Click(src, loc, null, mouseparams) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 267ee3a5e1..4d706c4907 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -101,6 +101,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( keyUp(keycode) return + if(href_list["statpanel_item_target"]) + handle_statpanel_click(href_list) + return + // Tgui Topic middleware if(tgui_Topic(href_list)) return @@ -141,6 +145,17 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( ..() //redirect to hsrc.Topic() +/client/proc/handle_statpanel_click(list/href_list) + var/atom/target = locate(href_list["statpanel_item_target"]) + var/list/paramslist = list() + if(href_list["statpanel_item_shiftclick"]) + paramslist["shift"] = "1" + if(href_list["statpanel_item_ctrlclick"]) + paramslist["ctrl"] = "1" + if(href_list["statpanel_item_altclick"]) + paramslist["alt"] = "1" + Click(target, target.loc, null, paramslist, FALSE, "statpanel") + /client/proc/is_content_unlocked() if(!prefs.unlock_content) to_chat(src, "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Only 10 bucks for 3 months! Click Here to find out more.") @@ -798,7 +813,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( message_admins("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.") ip_intel = res.intel -/client/Click(atom/object, atom/location, control, params, ignore_spam = FALSE) +/client/Click(atom/object, atom/location, control, params, ignore_spam = FALSE, extra_info) if(last_click > world.time - world.tick_lag) return last_click = world.time @@ -851,7 +866,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( return if(prefs.log_clicks) - log_click(object, location, control, params, src) + log_click(object, location, control, params, src, extra_info? "clicked ([extra_info])" : null) if (prefs.hotkeys) // If hotkey mode is enabled, then clicking the map will automatically diff --git a/html/statbrowser.html b/html/statbrowser.html index 346a198746..e7d49ceebc 100644 --- a/html/statbrowser.html +++ b/html/statbrowser.html @@ -875,7 +875,7 @@ function draw_listedturf() { // rather than every onmousedown getting the "part" of the last entry. return function(e) { e.preventDefault(); - clickcatcher = "?src=" + part[1] + ";statpanel_item_click=1"; + clickcatcher = "?src=_statpanel_;statpanel_item_target=" + part[1] + ";statpanel_item_click=1"; if(e.shiftKey){ clickcatcher += ";statpanel_item_shiftclick=1"; } From 221a98d27b229f1a24079fdc6a92bc22583c9acc Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:25:00 -0700 Subject: [PATCH 2/4] how'd this ever work --- code/modules/client/client_procs.dm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 4d706c4907..c4cbb43bdf 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -147,14 +147,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( /client/proc/handle_statpanel_click(list/href_list) var/atom/target = locate(href_list["statpanel_item_target"]) - var/list/paramslist = list() - if(href_list["statpanel_item_shiftclick"]) - paramslist["shift"] = "1" - if(href_list["statpanel_item_ctrlclick"]) - paramslist["ctrl"] = "1" - if(href_list["statpanel_item_altclick"]) - paramslist["alt"] = "1" - Click(target, target.loc, null, paramslist, FALSE, "statpanel") + Click(target, target.loc, null, "shift=[href_list["statpanel_item_shiftclick"]?1:0]&ctrl=[href_list["statpanel_item_ctrlclick"]?1:0]&alt=[href_list["statpanel_item_altclick"]?1:0]", FALSE, "statpanel") /client/proc/is_content_unlocked() if(!prefs.unlock_content) From 9b83ae564a88836db0053fa388b805db34c2617e Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:31:55 -0700 Subject: [PATCH 3/4] e --- code/modules/client/client_procs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index c4cbb43bdf..c854358373 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -147,7 +147,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( /client/proc/handle_statpanel_click(list/href_list) var/atom/target = locate(href_list["statpanel_item_target"]) - Click(target, target.loc, null, "shift=[href_list["statpanel_item_shiftclick"]?1:0]&ctrl=[href_list["statpanel_item_ctrlclick"]?1:0]&alt=[href_list["statpanel_item_altclick"]?1:0]", FALSE, "statpanel") + Click(target, target.loc, null, "[href_list["statpanel_item_shiftclick"]?["shift=1;"]:null][href_list["statpanel_item_ctrlclick"]?["ctrl=1;"]:null]&alt=[href_list["statpanel_item_altclick"]?["alt=1;"]:null]", FALSE, "statpanel") /client/proc/is_content_unlocked() if(!prefs.unlock_content) From 13f9bbef01c53b2f2c6b2ebb62f038fd34d1a7b0 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 21 Dec 2020 21:36:12 -0700 Subject: [PATCH 4/4] paramlist --- code/modules/client/client_procs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index c854358373..53ae0f5574 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -147,7 +147,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( /client/proc/handle_statpanel_click(list/href_list) var/atom/target = locate(href_list["statpanel_item_target"]) - Click(target, target.loc, null, "[href_list["statpanel_item_shiftclick"]?["shift=1;"]:null][href_list["statpanel_item_ctrlclick"]?["ctrl=1;"]:null]&alt=[href_list["statpanel_item_altclick"]?["alt=1;"]:null]", FALSE, "statpanel") + Click(target, target.loc, null, "[href_list["statpanel_item_shiftclick"]?"shift=1;":null][href_list["statpanel_item_ctrlclick"]?"ctrl=1;":null]&alt=[href_list["statpanel_item_altclick"]?"alt=1;":null]", FALSE, "statpanel") /client/proc/is_content_unlocked() if(!prefs.unlock_content)