Changes clickcatcher to dynamically scale based on view range (#29370)

Scale()s the icon when range is below 16, if it's above 16, scales the icon to 16 and transforms the rest of the way.

This replaces the other method of creating one click catcher image per tile in the range of the users view, which was pretty memory hungry and inefficient. A single icon operation while the view range changes should still be pretty performant and require less memory bookkeeping.l

This ensures it works when the users view range changes, but does not result in a loss of precision for view ranges up to 16 when moving the mouse (it triggers per pixel which simply get larger when transformed)

fixes #29342
This commit is contained in:
kevinz000
2017-07-24 10:23:37 +12:00
committed by oranges
parent bb37810a4a
commit e568f29bc5
3 changed files with 18 additions and 23 deletions
+1 -2
View File
@@ -48,8 +48,7 @@
preload_rsc = PRELOAD_RSC
var/global/obj/screen/click_catcher/void
var/list/obj/screen/click_catcher/click_catcher_tiles
var/obj/screen/click_catcher/void
// Used by html_interface module.
var/hi_last_pos
+1 -11
View File
@@ -643,12 +643,6 @@ GLOBAL_LIST(external_rsc_urls)
if ("key")
return FALSE
/client/proc/clear_click_catcher()
if(!LAZYLEN(click_catcher_tiles))
return
for(var/I in click_catcher_tiles)
screen -= I
qdel(I)
/client/proc/change_view(new_size)
if (isnull(new_size))
@@ -663,12 +657,8 @@ GLOBAL_LIST(external_rsc_urls)
screen += void
/client/proc/apply_clickcatcher()
clear_click_catcher()
generate_clickcatcher()
click_catcher_tiles = void.UpdateGreed(view,view)
for(var/obj/screen/OS in click_catcher_tiles)
screen += OS
void.UpdateGreed(view,view)
/client/proc/AnnouncePR(announcement)
if(prefs && prefs.chat_toggles & CHAT_PULLR)