From 77d5f9cb43d84add69916b095e35cad1e28e2bbf Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Tue, 17 Aug 2021 21:29:25 -0400 Subject: [PATCH] [SEMI-MODULAR] Adds an override to allow the use of icon2html RARELY when we need it, fixing in the same swoop the in-game GAGS coloring screen (#7615) * Adds an override to allow the use of icon2html in rare cases * That should've been properly documented as SKYRAT EDIT, whoops --- code/__HELPERS/icons.dm | 9 ++++++--- code/modules/admin/greyscale_modify_menu.dm | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index ddaf37ffb6d..bc26e80cc63 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1053,9 +1053,12 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 dummySave = null fdel("tmp/dummySave.sav") //if you get the idea to try and make this more optimized, make sure to still call unlock on the savefile after every write to unlock it. -/proc/icon2html(thing, target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null) +/proc/icon2html(thing, target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null, override_skyrat = FALSE) /// SKYRAT EDIT - icon2html override instead of fully disabling it - Original: /proc/icon2html(thing, target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null) + // SKYRAT EDIT START - icon2html override instead of fully disabling it + if(!override_skyrat) return "" //SKYRAT EDIT DISABLE - ICON2HTML -/* + // SKYRAT EDIT END + if (!thing) return if(SSlag_switch.measures[DISABLE_USR_ICON2HTML] && usr && !HAS_TRAIT(usr, TRAIT_BYPASS_MEASURES)) @@ -1123,7 +1126,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 if(sourceonly) return SSassets.transport.get_asset_url(key) return "" -*/ + /proc/icon2base64html(thing) if (!thing) diff --git a/code/modules/admin/greyscale_modify_menu.dm b/code/modules/admin/greyscale_modify_menu.dm index 5f33ceec206..c59a9e0a769 100644 --- a/code/modules/admin/greyscale_modify_menu.dm +++ b/code/modules/admin/greyscale_modify_menu.dm @@ -240,16 +240,26 @@ This is highly likely to cause a lag spike for a few seconds."}, var/list/step_data = data["steps"][step] var/image/layer = image(step) var/image/result = step_data["result"] + // SKYRAT EDIT BEGIN - Bringing back the GAGS coloring menu - ORIGINAL: + /* steps += list( list( - "layer"=icon2html(layer, user, dir=sprite_dir, sourceonly=TRUE), - "result"=icon2html(result, user, dir=sprite_dir, sourceonly=TRUE), + "layer"=icon2html(layer, user, dir=sprite_dir, sourceonly=TRUE, override_skyrat = TRUE), + "result"=icon2html(result, user, dir=sprite_dir, sourceonly=TRUE, override_skyrat = TRUE), + "config_name"=step_data["config_name"] + ) + )*/ + steps += list( + list( + "layer"=icon2html(layer, user, dir=sprite_dir, sourceonly=TRUE, override_skyrat = TRUE), + "result"=icon2html(result, user, dir=sprite_dir, sourceonly=TRUE, override_skyrat = TRUE), "config_name"=step_data["config_name"] ) ) + // SKYRAT EDIT END sprite_data["time_spent"] = TICK_DELTA_TO_MS(time_spent) - sprite_data["finished"] = icon2html(finished, user, dir=sprite_dir, sourceonly=TRUE) + sprite_data["finished"] = icon2html(finished, user, dir=sprite_dir, sourceonly=TRUE, override_skyrat = TRUE) refreshing = FALSE /datum/greyscale_modify_menu/proc/Unlock()