diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 2b887226fa8..cbf0d6372e8 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -115,6 +115,8 @@ #define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state" ///from base of [/atom/update_overlays]: (list/new_overlays) #define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays" +///from base of [/atom/update_greyscale]: (list/colors) +#define COMSIG_ATOM_UPDATE_GREYSCALE "atom_update_greyscale" ///from base of [/atom/update_icon]: (signalOut, did_anything) #define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon" ///from base of atom/Entered(): (atom/movable/entering, /atom/oldLoc) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index a9f5860838a..edc657c6db0 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -72,6 +72,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define UPDATE_ICON_STATE (1<<2) /// Update the atom's overlays #define UPDATE_OVERLAYS (1<<3) +/// Update the atom's greyscaling +#define UPDATE_GREYSCALE (1<<4) /// Update the atom's icon #define UPDATE_ICON (UPDATE_ICON_STATE|UPDATE_OVERLAYS) diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 66db0f9e7a5..55c4846dd2d 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -110,6 +110,7 @@ #define INIT_ORDER_INPUT 85 #define INIT_ORDER_SOUNDS 83 #define INIT_ORDER_INSTRUMENTS 82 +#define INIT_ORDER_GREYSCALE 81 #define INIT_ORDER_VIS 80 #define INIT_ORDER_ACHIEVEMENTS 77 #define INIT_ORDER_RESEARCH 75 diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index c5f491fc729..1f65488110d 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -79,6 +79,7 @@ // /atom #define VV_HK_MODIFY_TRANSFORM "atom_transform" +#define VV_HK_MODIFY_GREYSCALE "modify_greyscale" #define VV_HK_ADD_REAGENT "addreagent" #define VV_HK_TRIGGER_EMP "empulse" #define VV_HK_TRIGGER_EXPLOSION "explode" diff --git a/code/controllers/subsystem/greyscale.dm b/code/controllers/subsystem/greyscale.dm new file mode 100644 index 00000000000..f7070e04136 --- /dev/null +++ b/code/controllers/subsystem/greyscale.dm @@ -0,0 +1,34 @@ +SUBSYSTEM_DEF(greyscale) + name = "Greyscale" + flags = SS_NO_FIRE + init_order = INIT_ORDER_GREYSCALE + + var/list/datum/greyscale_config/configurations = list() + var/list/datum/greyscale_layer/layer_types = list() + +/datum/controller/subsystem/greyscale/Initialize(start_timeofday) + for(var/datum/greyscale_layer/fake_type as anything in subtypesof(/datum/greyscale_layer)) + layer_types[initial(fake_type.layer_type)] = fake_type + + for(var/greyscale_type in subtypesof(/datum/greyscale_config)) + var/datum/greyscale_config/config = new greyscale_type() + configurations["[greyscale_type]"] = config + + return ..() + +/datum/controller/subsystem/greyscale/proc/RefreshConfigsFromFile() + for(var/i in configurations) + configurations[i].Refresh(TRUE) + +/datum/controller/subsystem/greyscale/proc/GetColoredIconByType(type, list/colors) + type = "[type]" + if(istext(colors)) // It's the color string format for map edits/type values etc + colors = ParseColorString(colors) + return configurations[type].Generate(colors) + +/datum/controller/subsystem/greyscale/proc/ParseColorString(colors) + var/list/split_colors = splittext(colors, "#") + var/list/output = list() + for(var/i in 2 to length(split_colors)) + output += "#[split_colors[i]]" + return output diff --git a/code/datums/greyscale/README.md b/code/datums/greyscale/README.md new file mode 100644 index 00000000000..2e39af452a2 --- /dev/null +++ b/code/datums/greyscale/README.md @@ -0,0 +1,91 @@ +# Greyscale Autogenerated Sprites (GAS) + +If you're wanting to add easy recolors for your sprite then this is the system for you. Features include: + +- Multiple color layers so your sprite can be generated from more than one color. +- Mixed greyscale and colored sprite layers; You can choose to only greyscale a part of the sprite or have premade filters applied to layers. +- Blend modes; Instead of just putting layers of sprites on top of eachother you can use the more advanced blend modes. +- Reusable configurations; You can reference greyscale sprites from within the configuration of another, allowing you to have a bunch of styles with minimal additional configuration. + +## Broad overview + +There are three main parts to GAS that you'll need to be aware of when adding a new greyscale sprite: + +- The json configuration + +All configuration files can be found in [code/datums/greyscale/json_configs](./json_configs) and is where you control how your icons are combined together along with the colors specified from in code. + +- The dmi file + +It contains the sprites that will be used as the basis for the rest of the generation process. You can only have one dmi file specified per configuration but if you want to split up your sprites you can reference other configurations instead. + +- The configuration type + +This is simply some pointers in the code linking together your dmi and the json configuration. + +## Json Configuration File + +The json is made up of some metadata and a list of layers used while creating the sprite. Inner lists are processed as their own chunk before being applied elsewhere, this is useful when you start using more advanced blend modes. Most of the time though you're just going to want a list of icons overlaid on top of eachother. + +```json +{ + "layers": [ + { + "type": "reference", + "reference_type": "/datum/greyscale_config/some_other_config", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + [ + { + "type": "icon_state", + "icon_state": "highlights", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "reference", + "reference_type": "/datum/greyscale_config/sparkle_effect", + "blend_mode": "add" + } + ] + ] +} +``` + +In this example, we start off by creating a sprite specified by a different configuration. The "type" key is required to specify the kind of layer you defining. Once that is done, the next two layers are grouped together, so they will be generated into one sprite before being applied to any sprites outside their group. You can think of it as an order of operations. + +The first of the two in the inner group is an "icon_state", this means that the icon will be retrieved from the associated dmi file using the "icon_state" key. + +The last layer is another reference type. Note that you don't need to give colors to every layer if the layer does not need any colors applied to it. + +"blend_mode" and "color_ids" are special, all layer types have them. The blend mode is what controls how that layer's finished product gets merged together with the rest of the sprite. The color ids control what colors are passed in to the layer. + +## Dmi File + +There are no special requirements from the dmi file to work with this system. You just need to specify the icon file in code and the icon_state in the json configuration. + +## Dm Code + +While the amount of dm code required to make a greyscale sprite was minimized as much as possible, some small amount is required anyway if you want anything to use it. + +As an example: +```c +/datum/greyscale_config/canister + icon_file = 'icons/obj/atmospherics/canisters/default.dmi' + json_config = 'code/datums/greyscale/json_configs/canister_default.json' +``` +And that's all you need to make it usable by other code: + +```c +/obj/machinery/portable_atmospherics/canister + ... + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#ee4242" +``` + +More configurations can be found in [code/datums/greyscale/greyscale_configs.dm](./greyscale_configs.dm) + +## Debugging + +If you're making a new greyscale sprite you sometimes want to be able to see how layers got generated or maybe you're just tweaking some colors. Rather than rebooting the server with every change there is a greyscale modification menu that can be found in the vv dropdown menu for the greyscale object. Here you can change colors and preview the results. diff --git a/code/datums/greyscale/_greyscale_config.dm b/code/datums/greyscale/_greyscale_config.dm new file mode 100644 index 00000000000..bfd012343a5 --- /dev/null +++ b/code/datums/greyscale/_greyscale_config.dm @@ -0,0 +1,136 @@ +/datum/greyscale_config + /// Reference to the json config file + var/json_config + + /// Reference to the dmi file for this config + var/icon_file + + /////////////////////////////////////////////////////////////////////////////////////////// + // Do not set any further vars, the json file specified above is what generates the object + + /// String path to the json file, used for reloading + var/string_json_config + + /// String path to the icon file, used for reloading + var/string_icon_file + + /// Layer objects that the sprite is made up of + var/list/layers + + /// How many colors are expected to be given when building the sprite + var/expected_colors = 0 + + /// Generated icons keyed by their color arguments + var/list/icon_cache + +// There's more sanity checking here than normal because this is designed for spriters to work with +// Sensible error messages that tell you exactly what's wrong is the best way to make this easy to use +/datum/greyscale_config/New() + if(!json_config) + CRASH("Greyscale config object [DebugName()] is missing a json configuration, make sure `json_config` has been assigned a value.") + string_json_config = "[json_config]" + if(!icon_file) + CRASH("Greyscale config object [DebugName()] is missing an icon file, make sure `icon_file` has been assigned a value.") + string_icon_file = "[icon_file]" + + Refresh() + +/datum/greyscale_config/proc/Refresh(loadFromDisk=FALSE) + if(loadFromDisk) + json_config = file(string_json_config) + icon_file = file(string_icon_file) + + var/list/raw = json_decode(file2text(json_config)) + layers = ReadLayersFromJson(raw["layers"]) + if(!length(layers)) + CRASH("The json configuration [DebugName()] is missing any layers.") + + icon_cache = list() + + ReadMetadata() + +/// Gets the name used for debug purposes +/datum/greyscale_config/proc/DebugName() + return "([icon_file]|[json_config])" + +/// Takes the json layers configuration and puts it into a more processed format +/datum/greyscale_config/proc/ReadLayersFromJson(list/data) + var/list/output = ReadLayerGroup(data) + return output[1] + +/datum/greyscale_config/proc/ReadLayerGroup(list/data) + if(!islist(data[1])) + var/layer_type = SSgreyscale.layer_types[data["type"]] + if(!layer_type) + CRASH("An unknown layer type was specified in greyscale configuration json: [data["layer_type"]]") + return new layer_type(icon_file, data) + var/list/output = list() + for(var/list/group as anything in data) + output += ReadLayerGroup(group) + if(length(output)) // Adding lists to lists unwraps the top level so here we are + output = list(output) + return output + +/// Reads layer configurations to take out some useful overall information +/datum/greyscale_config/proc/ReadMetadata() + var/list/datum/greyscale_layer/all_layers = list() + var/list/to_process = list(layers) + while(length(to_process)) + var/current = to_process[length(to_process)] + to_process.len-- + if(islist(current)) + to_process += current + else + all_layers += current + + var/list/color_groups = list() + for(var/datum/greyscale_layer/layer as anything in all_layers) + for(var/id in layer.color_ids) + color_groups["[id]"] = TRUE + + expected_colors = length(color_groups) + +/// Actually create the icon and color it in, handles caching +/datum/greyscale_config/proc/Generate(list/colors) + if(length(colors) != expected_colors) + CRASH("[DebugName()] expected [expected_colors] color arguments but only received [length(colors)]") + var/key = colors.Join("&") + var/icon/new_icon = icon_cache[key] + if(new_icon) + return new_icon + new_icon = icon_cache[key] = GenerateLayerGroup(colors, layers) + return new_icon + +/// Internal recursive proc to handle nested layer groups +/datum/greyscale_config/proc/GenerateLayerGroup(list/colors, list/group, list/render_steps) + var/icon/new_icon + for(var/datum/greyscale_layer/layer as anything in group) + var/icon/layer_icon + if(islist(layer)) + layer_icon = GenerateLayerGroup(colors, layer, render_steps) + layer = layer[1] // When there are multiple layers in a group like this we use the first one's blend mode + else + layer_icon = layer.Generate(colors, render_steps) + + if(!new_icon) + new_icon = layer_icon + else + new_icon.Blend(layer_icon, layer.blend_mode) + + // These are so we can see the result of every step of the process in the preview ui + if(render_steps) + var/icon/new_icon_copy = new(new_icon) + var/icon/layer_icon_copy = new(layer_icon) + render_steps[layer_icon_copy] = icon(new_icon_copy) + return new_icon + +/datum/greyscale_config/proc/GenerateDebug(list/colors) + if(length(colors) != expected_colors) + CRASH("[DebugName()] expected [expected_colors] color arguments but only received [length(colors)]") + + var/list/output = list() + var/list/debug_steps = list() + output["steps"] = debug_steps + + output["icon"] = GenerateLayerGroup(colors, layers, debug_steps) + return output diff --git a/code/datums/greyscale/greyscale_configs.dm b/code/datums/greyscale/greyscale_configs.dm new file mode 100644 index 00000000000..14f9e4ad5d0 --- /dev/null +++ b/code/datums/greyscale/greyscale_configs.dm @@ -0,0 +1,22 @@ +/datum/greyscale_config/canister + icon_file = 'icons/obj/atmospherics/canisters.dmi' + json_config = 'code/datums/greyscale/json_configs/canister_default.json' + +/datum/greyscale_config/canister/base + json_config = 'code/datums/greyscale/json_configs/canister_base.json' + +/datum/greyscale_config/canister/post_effects + json_config = 'code/datums/greyscale/json_configs/canister_post_effects.json' + +/datum/greyscale_config/canister/stripe + json_config = 'code/datums/greyscale/json_configs/canister_stripe.json' + +/datum/greyscale_config/canister/double_stripe + json_config = 'code/datums/greyscale/json_configs/canister_double_stripe.json' + +/datum/greyscale_config/canister/hazard + json_config = 'code/datums/greyscale/json_configs/canister_hazard.json' + +/datum/greyscale_config/prototype_canister + icon_file = 'icons/obj/atmospherics/prototype_canister.dmi' + json_config = 'code/datums/greyscale/json_configs/canister_proto.json' diff --git a/code/datums/greyscale/json_configs/canister_base.json b/code/datums/greyscale/json_configs/canister_base.json new file mode 100644 index 00000000000..c9318e8a26c --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_base.json @@ -0,0 +1,20 @@ +{ + "layers": [ + { + "type": "icon_state", + "icon_state": "base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "add_shader", + "blend_mode": "add" + }, + { + "type": "icon_state", + "icon_state": "multi_shader", + "blend_mode": "multiply" + } + ] +} diff --git a/code/datums/greyscale/json_configs/canister_default.json b/code/datums/greyscale/json_configs/canister_default.json new file mode 100644 index 00000000000..a37d83fc322 --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_default.json @@ -0,0 +1,16 @@ +{ + "layers": [ + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/post_effects", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/canister_double_stripe.json b/code/datums/greyscale/json_configs/canister_double_stripe.json new file mode 100644 index 00000000000..f1dd6410041 --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_double_stripe.json @@ -0,0 +1,29 @@ +{ + "layers": [ + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + [ + { + "type": "icon_state", + "icon_state": "double_stripe", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "icon_state", + "icon_state": "double_stripe_shader", + "blend_mode": "subtract" + } + ], + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/post_effects", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/canister_hazard.json b/code/datums/greyscale/json_configs/canister_hazard.json new file mode 100644 index 00000000000..d900035650f --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_hazard.json @@ -0,0 +1,22 @@ +{ + "layers": [ + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "hazard_stripes", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/post_effects", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/canister_post_effects.json b/code/datums/greyscale/json_configs/canister_post_effects.json new file mode 100644 index 00000000000..ee2b550638c --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_post_effects.json @@ -0,0 +1,15 @@ +{ + "layers": [ + { + "type": "icon_state", + "icon_state": "outline", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "lights", + "blend_mode": "overlay" + } + ] +} diff --git a/code/datums/greyscale/json_configs/canister_proto.json b/code/datums/greyscale/json_configs/canister_proto.json new file mode 100644 index 00000000000..f77e9a5ada9 --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_proto.json @@ -0,0 +1,39 @@ +{ + "layers": [ + { + "type": "icon_state", + "icon_state": "can_base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "can_shader", + "blend_mode": "multiply" + }, + { + "type": "icon_state", + "icon_state": "stand", + "blend_mode": "overlay" + }, + { + "type": "icon_state", + "icon_state": "decals", + "blend_mode": "overlay" + }, + [ + { + "type": "icon_state", + "icon_state": "light_base", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "icon_state", + "icon_state": "light", + "blend_mode": "overlay", + "color_ids": [ 3 ] + } + ] + ] +} diff --git a/code/datums/greyscale/json_configs/canister_stripe.json b/code/datums/greyscale/json_configs/canister_stripe.json new file mode 100644 index 00000000000..91444eb566d --- /dev/null +++ b/code/datums/greyscale/json_configs/canister_stripe.json @@ -0,0 +1,22 @@ +{ + "layers": [ + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/base", + "blend_mode": "overlay", + "color_ids": [ 1 ] + }, + { + "type": "icon_state", + "icon_state": "stripe", + "blend_mode": "overlay", + "color_ids": [ 2 ] + }, + { + "type": "reference", + "reference_type": "/datum/greyscale_config/canister/post_effects", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/datums/greyscale/layer.dm b/code/datums/greyscale/layer.dm new file mode 100644 index 00000000000..b7cc1bc1976 --- /dev/null +++ b/code/datums/greyscale/layer.dm @@ -0,0 +1,74 @@ +/datum/greyscale_layer + var/layer_type + var/list/color_ids + var/blend_mode + + var/static/list/blend_modes = list( + "add" = ICON_ADD, + "subtract" = ICON_SUBTRACT, + "multiply" = ICON_MULTIPLY, + "or" = ICON_OR, + "overlay" = ICON_OVERLAY, + "underlay" = ICON_UNDERLAY, + ) + +/datum/greyscale_layer/New(icon_file, list/json_data) + color_ids = json_data["color_ids"] + blend_mode = blend_modes[lowertext(json_data["blend_mode"])] + if(isnull(blend_mode)) + CRASH("Greyscale config for [icon_file] is missing a blend mode on a layer.") + +/// Used to actualy create the layer using the given colors +/// Do not override, use InternalGenerate instead +/datum/greyscale_layer/proc/Generate(list/colors, list/render_steps) + var/list/processed_colors = list() + for(var/i in color_ids) + processed_colors += colors[i] + return InternalGenerate(processed_colors, render_steps) + +/datum/greyscale_layer/proc/InternalGenerate(list/colors) + +//////////////////////////////////////////////////////// +// Subtypes + +/// The most basic greyscale layer; a layer which is created from a single icon_state in the given icon file +/datum/greyscale_layer/icon_state + layer_type = "icon_state" + var/icon/icon + var/color_id + +/datum/greyscale_layer/icon_state/New(icon_file, list/json_data) + . = ..() + var/icon_state = json_data["icon_state"] + if(!(icon_state in icon_states(icon_file))) + CRASH("Configured icon state \[[icon_state]\] was not found in [icon_file]. Double check your json configuration.") + icon = new(icon_file, json_data["icon_state"]) + + if(length(color_ids) > 1) + CRASH("Icon state layers can not have more than one color id") + +/datum/greyscale_layer/icon_state/InternalGenerate(list/colors, list/render_steps) + . = ..() + var/icon/new_icon = icon(icon) + if(length(colors)) + new_icon.Blend(colors[1], ICON_MULTIPLY) + return new_icon + +/// A layer created by using another greyscale icon's configuration +/datum/greyscale_layer/reference + layer_type = "reference" + var/datum/greyscale_config/reference_config + +/datum/greyscale_layer/reference/New(icon_file, list/json_data) + . = ..() + reference_config = SSgreyscale.configurations[json_data["reference_type"]] + if(!reference_config) + CRASH("An unknown greyscale configuration was given to a reference layer: [json_data["reference_type"]]") + +/datum/greyscale_layer/reference/InternalGenerate(list/colors, list/render_steps) + if(render_steps) + // We're debugging + var/list/debug_data = reference_config.GenerateDebug(colors) + render_steps += debug_data["steps"] + return debug_data["icon"] + return reference_config.Generate(colors) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 56456e1e2f3..13e2f159580 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -128,6 +128,11 @@ ///Used for changing icon states for different base sprites. var/base_icon_state + ///The config type to use for greyscaled sprites. Both this and greyscale_colors must be assigned to work. + var/greyscale_config + ///A string of hex format colors to be used by greyscale sprites, ex: "#0054aa#badcff" + var/greyscale_colors + ///Icon-smoothing behavior. var/smoothing_flags = NONE ///What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags. @@ -695,6 +700,13 @@ update_icon_state() . |= UPDATE_ICON_STATE + if(updates & UPDATE_GREYSCALE) + var/list/colors = update_greyscale() + // Updating the greyscale config in update_greyscale() is fine or we would check this earlier + if(greyscale_config) + icon = SSgreyscale.GetColoredIconByType(greyscale_config, colors) + . |= UPDATE_GREYSCALE + if(updates & UPDATE_OVERLAYS) if(LAZYLEN(managed_vis_overlays)) SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) @@ -715,6 +727,14 @@ SHOULD_CALL_PARENT(TRUE) return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE) +/atom/proc/update_greyscale() + SHOULD_CALL_PARENT(TRUE) + . = list() + var/list/raw_rgb = splittext(greyscale_colors, "#") + for(var/i in 2 to length(raw_rgb)) + . += "#[raw_rgb[i]]" + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_GREYSCALE, .) + /// Updates the overlays of the atom /atom/proc/update_overlays() SHOULD_CALL_PARENT(TRUE) @@ -1171,6 +1191,8 @@ VV_DROPDOWN_OPTION(VV_HK_RADIATE, "Radiate") VV_DROPDOWN_OPTION(VV_HK_EDIT_FILTERS, "Edit Filters") VV_DROPDOWN_OPTION(VV_HK_ADD_AI, "Add AI controller") + if(greyscale_colors) + VV_DROPDOWN_OPTION(VV_HK_MODIFY_GREYSCALE, "Modify greyscale colors") /atom/vv_do_topic(list/href_list) . = ..() diff --git a/code/modules/admin/greyscale_modify_menu.dm b/code/modules/admin/greyscale_modify_menu.dm new file mode 100644 index 00000000000..b8d5c212175 --- /dev/null +++ b/code/modules/admin/greyscale_modify_menu.dm @@ -0,0 +1,92 @@ +/datum/greyscale_modify_menu + var/atom/target + var/client/user + + var/list/split_colors + + var/list/sprite_data + +/datum/greyscale_modify_menu/New(atom/target, client/user) + src.target = target + src.user = user + + ReadColorsFromString(target.greyscale_colors) + + refresh_preview() + + RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/ui_close) + +/datum/greyscale_modify_menu/Destroy() + target = null + user = null + return ..() + +/datum/greyscale_modify_menu/ui_state(mob/user) + return GLOB.admin_state + +/datum/greyscale_modify_menu/ui_close() + qdel(src) + +/datum/greyscale_modify_menu/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "GreyscaleModifyMenu") + ui.open() + +/datum/greyscale_modify_menu/ui_data(mob/user) + var/list/data = list() + var/list/color_data = list() + data["colors"] = color_data + for(var/i in 1 to length(split_colors)) + color_data += list(list( + "index" = i, + "value" = split_colors[i] + )) + + data["sprites"] = sprite_data + return data + +/datum/greyscale_modify_menu/ui_act(action, params) + . = ..() + if(.) + return + switch(action) + if("recolor") + var/index = text2num(params["color_index"]) + split_colors[index] = lowertext(params["new_color"]) + refresh_preview() + if("recolor_from_string") + ReadColorsFromString(lowertext(params["color_string"])) + refresh_preview() + if("pick_color") + var/group = params["color_index"] + var/new_color = input( + usr, + "Choose color for greyscale color group [group]:", + "Greyscale Modification Menu", + split_colors[group] + ) as color|null + if(new_color) + split_colors[group] = new_color + refresh_preview() + if("apply") + target.greyscale_colors = split_colors.Join() + target.update_appearance() + if("refresh_file") + SSgreyscale.RefreshConfigsFromFile() + refresh_preview() + +/datum/greyscale_modify_menu/proc/ReadColorsFromString(colorString) + var/list/raw_colors = splittext(colorString, "#") + split_colors = list() + for(var/i in 2 to length(raw_colors)) + split_colors += "#[raw_colors[i]]" + +/datum/greyscale_modify_menu/proc/refresh_preview() + var/list/data = SSgreyscale.configurations["[target.greyscale_config]"].GenerateDebug(split_colors) + + sprite_data = list() + var/list/steps = list() + sprite_data["steps"] = steps + for(var/step in data["steps"]) + steps += list(list("layer"=icon2html(data["steps"][step], user, sourceonly=TRUE), "result"=icon2html(step, user, sourceonly=TRUE))) diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index a6becc966cf..0d323e8cf07 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -21,6 +21,7 @@ var/mob/living/L = target if(istype(L)) vv_update_display(target, "real_name", L.real_name || "No real name") + if(href_list[VV_HK_BASIC_CHANGE]) modify_variables(target, target_var, 0) if(href_list[VV_HK_BASIC_MASSEDIT]) @@ -77,6 +78,11 @@ target._AddElement(lst) log_admin("[key_name(usr)] has added [result] [datumname] to [key_name(target)].") message_admins("[key_name_admin(usr)] has added [result] [datumname] to [key_name_admin(target)].") + if(href_list[VV_HK_MODIFY_GREYSCALE]) + if(!check_rights(NONE)) + return + var/datum/greyscale_modify_menu/menu = new(target, usr) + menu.ui_interact(usr) if(href_list[VV_HK_CALLPROC]) usr.client.callproc_datum(target) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 318d6cb74cf..9d703587844 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -38,9 +38,11 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) /obj/machinery/portable_atmospherics/canister name = "canister" desc = "A canister for the storage of gas." - icon_state = "yellow" + icon = 'icons/obj/atmospherics/canisters.dmi' + icon_state = "#mapme" + greyscale_config = /datum/greyscale_config/canister/hazard + greyscale_colors = "#ffff00#000000" density = TRUE - base_icon_state = "yellow" //Used to make dealing with breaking the canister less hellish. volume = 1000 armor = list(MELEE = 50, BULLET = 50, LASER = 50, ENERGY = 100, BOMB = 10, BIO = 100, RAD = 100, FIRE = 80, ACID = 50) max_integrity = 250 @@ -48,6 +50,8 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) pressure_resistance = 7 * ONE_ATMOSPHERE req_access = list() + var/icon/canister_overlay_file = 'icons/obj/atmospherics/canisters.dmi' + ///Is the valve open? var/valve_open = FALSE ///Used to log opening and closing of the valve, available on VV @@ -116,168 +120,173 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) if(mode) . += "This canister is Tier [mode]. A sticker on its side says MAX SAFE PRESSURE: [siunit_pressure(initial(pressure_limit), 0)]." -/obj/machinery/portable_atmospherics/canister/nitrogen - name = "Nitrogen canister" - desc = "Nitrogen gas. Reportedly useful for something." - icon_state = "red" - base_icon_state = "red" - gas_type = /datum/gas/nitrogen - -/obj/machinery/portable_atmospherics/canister/oxygen - name = "Oxygen canister" - desc = "Oxygen. Necessary for human life." - icon_state = "blue" - base_icon_state = "blue" - gas_type = /datum/gas/oxygen - -/obj/machinery/portable_atmospherics/canister/carbon_dioxide - name = "Carbon dioxide canister" - desc = "Carbon dioxide. What the fuck is carbon dioxide?" - icon_state = "black" - base_icon_state = "black" - gas_type = /datum/gas/carbon_dioxide - -/obj/machinery/portable_atmospherics/canister/toxins - name = "Plasma canister" - desc = "Plasma gas. The reason YOU are here. Highly toxic." - icon_state = "orange" - base_icon_state = "orange" - gas_type = /datum/gas/plasma - -/obj/machinery/portable_atmospherics/canister/bz - name = "\improper BZ canister" - desc = "BZ, a powerful hallucinogenic nerve agent." - icon_state = "purple" - base_icon_state = "purple" - gas_type = /datum/gas/bz - -/obj/machinery/portable_atmospherics/canister/nitrous_oxide - name = "Nitrous oxide canister" - desc = "Nitrous oxide gas. Known to cause drowsiness." - icon_state = "redws" - base_icon_state = "redws" - gas_type = /datum/gas/nitrous_oxide +// Please keep the canister types sorted +// Basic canister per gas below here /obj/machinery/portable_atmospherics/canister/air name = "Air canister" desc = "Pre-mixed air." - icon_state = "grey" - base_icon_state = "grey" - -/obj/machinery/portable_atmospherics/canister/tritium - name = "Tritium canister" - desc = "Tritium. Inhalation might cause irradiation." - icon_state = "green" - base_icon_state = "green" - gas_type = /datum/gas/tritium - -/obj/machinery/portable_atmospherics/canister/nob - name = "Hyper-noblium canister" - desc = "Hyper-Noblium. More noble than all other gases." - icon_state = "nob" - base_icon_state = "nob" - gas_type = /datum/gas/hypernoblium - -/obj/machinery/portable_atmospherics/canister/nitryl - name = "Nitryl canister" - desc = "Nitryl gas. Feels great 'til the acid eats your lungs." - icon_state = "brown" - base_icon_state = "brown" - gas_type = /datum/gas/nitryl - -/obj/machinery/portable_atmospherics/canister/stimulum - name = "Stimulum canister" - desc = "Stimulum. High energy gas, high energy people." - icon_state = "darkpurple" - base_icon_state = "darkpurple" - gas_type = /datum/gas/stimulum - -/obj/machinery/portable_atmospherics/canister/pluoxium - name = "Pluoxium canister" - desc = "Pluoxium. Like oxygen, but more bang for your buck." - icon_state = "darkblue" - base_icon_state = "darkblue" - gas_type = /datum/gas/pluoxium - -/obj/machinery/portable_atmospherics/canister/water_vapor - name = "Water vapor canister" - desc = "Water Vapor. We get it, you vape." - icon_state = "water_vapor" - base_icon_state = "water_vapor" - gas_type = /datum/gas/water_vapor - filled = 1 - -/obj/machinery/portable_atmospherics/canister/miasma - name = "Miasma canister" - desc = "Miasma. Makes you wish your nose was blocked." - icon_state = "miasma" - base_icon_state = "miasma" - gas_type = /datum/gas/miasma - filled = 1 - -/obj/machinery/portable_atmospherics/canister/freon - name = "Freon canister" - desc = "Freon. Can absorb heat" - icon_state = "freon" - base_icon_state = "freon" - gas_type = /datum/gas/freon - filled = 1 - -/obj/machinery/portable_atmospherics/canister/hydrogen - name = "Hydrogen canister" - desc = "Hydrogen, highly flammable" - icon_state = "h2" - base_icon_state = "h2" - gas_type = /datum/gas/hydrogen - filled = 1 - -/obj/machinery/portable_atmospherics/canister/healium - name = "Healium canister" - desc = "Healium, causes deep sleep" - icon_state = "healium" - base_icon_state = "healium" - gas_type = /datum/gas/healium - filled = 1 - -/obj/machinery/portable_atmospherics/canister/proto_nitrate - name = "Proto Nitrate canister" - desc = "Proto Nitrate, reacts differently with various gases" - icon_state = "proto_nitrate" - base_icon_state = "proto_nitrate" - gas_type = /datum/gas/proto_nitrate - filled = 1 - -/obj/machinery/portable_atmospherics/canister/zauker - name = "Zauker canister" - desc = "Zauker, highly toxic" - icon_state = "zauker" - base_icon_state = "zauker" - gas_type = /datum/gas/zauker - filled = 1 - -/obj/machinery/portable_atmospherics/canister/halon - name = "Halon canister" - desc = "Halon, removes oxygen from high temperature fires and cools down the area" - icon_state = "halon" - base_icon_state = "halon" - gas_type = /datum/gas/halon - filled = 1 - -/obj/machinery/portable_atmospherics/canister/helium - name = "Helium canister" - desc = "Helium, inert gas" - icon_state = "halon" - base_icon_state = "halon" - gas_type = /datum/gas/helium - filled = 1 + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#c6c0b5" /obj/machinery/portable_atmospherics/canister/antinoblium name = "Antinoblium canister" desc = "Antinoblium, we still don't know what it does, but it sells for a lot" - icon_state = "halon" - base_icon_state = "halon" gas_type = /datum/gas/antinoblium filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#9b5d7f#368bff" + +/obj/machinery/portable_atmospherics/canister/bz + name = "\improper BZ canister" + desc = "BZ, a powerful hallucinogenic nerve agent." + gas_type = /datum/gas/bz + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#9b5d7f#d0d2a0" + +/obj/machinery/portable_atmospherics/canister/carbon_dioxide + name = "Carbon dioxide canister" + desc = "Carbon dioxide. What the fuck is carbon dioxide?" + gas_type = /datum/gas/carbon_dioxide + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#4e4c48" + +/obj/machinery/portable_atmospherics/canister/freon + name = "Freon canister" + desc = "Freon. Can absorb heat" + gas_type = /datum/gas/freon + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#6696ee#fefb30" + +/obj/machinery/portable_atmospherics/canister/halon + name = "Halon canister" + desc = "Halon, removes oxygen from high temperature fires and cools down the area" + gas_type = /datum/gas/halon + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#9b5d7f#368bff" + +/obj/machinery/portable_atmospherics/canister/healium + name = "Healium canister" + desc = "Healium, causes deep sleep" + gas_type = /datum/gas/healium + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#009823#ff0e00" + +/obj/machinery/portable_atmospherics/canister/helium + name = "Helium canister" + desc = "Helium, inert gas" + gas_type = /datum/gas/helium + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#9b5d7f#368bff" + +/obj/machinery/portable_atmospherics/canister/hydrogen + name = "Hydrogen canister" + desc = "Hydrogen, highly flammable" + gas_type = /datum/gas/hydrogen + filled = 1 + greyscale_config = /datum/greyscale_config/canister/stripe + greyscale_colors = "#bdc2c0#ffffff" + +/obj/machinery/portable_atmospherics/canister/miasma + name = "Miasma canister" + desc = "Miasma. Makes you wish your nose was blocked." + gas_type = /datum/gas/miasma + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#009823#f7d5d3" + +/obj/machinery/portable_atmospherics/canister/nitrogen + name = "Nitrogen canister" + desc = "Nitrogen gas. Reportedly useful for something." + gas_type = /datum/gas/nitrogen + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#d41010" + +/obj/machinery/portable_atmospherics/canister/nitrous_oxide + name = "Nitrous oxide canister" + desc = "Nitrous oxide gas. Known to cause drowsiness." + gas_type = /datum/gas/nitrous_oxide + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#c63e3b#f7d5d3" + +/obj/machinery/portable_atmospherics/canister/nitryl + name = "Nitryl canister" + desc = "Nitryl gas. Feels great 'til the acid eats your lungs." + gas_type = /datum/gas/nitryl + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#7b4732" + +/obj/machinery/portable_atmospherics/canister/nob + name = "Hyper-noblium canister" + desc = "Hyper-Noblium. More noble than all other gases." + gas_type = /datum/gas/hypernoblium + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#6399fc#b2b2b2" + +/obj/machinery/portable_atmospherics/canister/oxygen + name = "Oxygen canister" + desc = "Oxygen. Necessary for human life." + gas_type = /datum/gas/oxygen + greyscale_config = /datum/greyscale_config/canister/stripe + greyscale_colors = "#2786e5#e8fefe" + +/obj/machinery/portable_atmospherics/canister/pluoxium + name = "Pluoxium canister" + desc = "Pluoxium. Like oxygen, but more bang for your buck." + gas_type = /datum/gas/pluoxium + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#2786e5" + +/obj/machinery/portable_atmospherics/canister/proto_nitrate + name = "Proto Nitrate canister" + desc = "Proto Nitrate, reacts differently with various gases" + gas_type = /datum/gas/proto_nitrate + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#008200#33cc33" + +/obj/machinery/portable_atmospherics/canister/stimulum + name = "Stimulum canister" + desc = "Stimulum. High energy gas, high energy people." + gas_type = /datum/gas/stimulum + greyscale_config = /datum/greyscale_config/canister + greyscale_colors = "#9b5d7f" + +/obj/machinery/portable_atmospherics/canister/toxins + name = "Plasma canister" + desc = "Plasma gas. The reason YOU are here. Highly toxic." + gas_type = /datum/gas/plasma + greyscale_config = /datum/greyscale_config/canister/hazard + greyscale_colors = "#f62800#000000" + +/obj/machinery/portable_atmospherics/canister/tritium + name = "Tritium canister" + desc = "Tritium. Inhalation might cause irradiation." + gas_type = /datum/gas/tritium + greyscale_config = /datum/greyscale_config/canister/hazard + greyscale_colors = "#3fcd40#000000" + +/obj/machinery/portable_atmospherics/canister/water_vapor + name = "Water vapor canister" + desc = "Water Vapor. We get it, you vape." + gas_type = /datum/gas/water_vapor + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#4c4e4d#f7d5d3" + +/obj/machinery/portable_atmospherics/canister/zauker + name = "Zauker canister" + desc = "Zauker, highly toxic" + gas_type = /datum/gas/zauker + filled = 1 + greyscale_config = /datum/greyscale_config/canister/double_stripe + greyscale_colors = "#009a00#006600" + +// Special canisters below here /obj/machinery/portable_atmospherics/canister/fusion_test name = "fusion test canister" @@ -312,13 +321,14 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) /obj/machinery/portable_atmospherics/canister/proto name = "prototype canister" + greyscale_config = /datum/greyscale_config/prototype_canister + greyscale_colors = "#ffffff#a50021#ffffff" + mode = NONE /obj/machinery/portable_atmospherics/canister/proto/default name = "prototype canister" desc = "The best way to fix an atmospheric emergency... or the best way to introduce one." - icon_state = "proto" - base_icon_state = "proto" volume = 5000 max_integrity = 300 temperature_resistance = 2000 + T0C @@ -383,23 +393,24 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) . = ..() var/isBroken = machine_stat & BROKEN ///Function is used to actually set the overlays - . += "tier [mode]-[isBroken]" + if(mode) + . += icon(canister_overlay_file, "tier[mode]") if(isBroken) - return + . += icon(canister_overlay_file, "broken") if(holding) - . += "can-open" + . += icon(canister_overlay_file, "can-open") if(connected_port) - . += "can-connector" + . += icon(canister_overlay_file, "can-connector") switch(air_contents.return_pressure()) if((40 * ONE_ATMOSPHERE) to INFINITY) - . += "can-3" + . += icon(canister_overlay_file, "can-3") if((10 * ONE_ATMOSPHERE) to (40 * ONE_ATMOSPHERE)) - . += "can-2" + . += icon(canister_overlay_file, "can-2") if((5 * ONE_ATMOSPHERE) to (10 * ONE_ATMOSPHERE)) - . += "can-1" + . += icon(canister_overlay_file, "can-1") if((10) to (5 * ONE_ATMOSPHERE)) - . += "can-0" + . += icon(canister_overlay_file, "can-0") /obj/machinery/portable_atmospherics/canister/should_atmos_process(datum/gas_mixture/air, exposed_temperature) @@ -480,15 +491,18 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) holding.forceMove(T) holding = null + animate(src, 0.5 SECONDS, transform=turn(transform, rand(-179, 180)), easing=BOUNCE_EASING) + /obj/machinery/portable_atmospherics/canister/replace_tank(mob/living/user, close_valve) . = ..() - if(.) - if(close_valve) - valve_open = FALSE - update_appearance() - investigate_log("Valve was closed by [key_name(user)].", INVESTIGATE_ATMOS) - else if(valve_open && holding) - investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS) + if(!.) + return + if(close_valve) + valve_open = FALSE + update_appearance() + investigate_log("Valve was closed by [key_name(user)].", INVESTIGATE_ATMOS) + else if(valve_open && holding) + investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS) /obj/machinery/portable_atmospherics/canister/process_atmos() . = ..() diff --git a/icons/obj/atmos.dmi b/icons/obj/atmos.dmi index c7d60886fcd..ec462c41729 100644 Binary files a/icons/obj/atmos.dmi and b/icons/obj/atmos.dmi differ diff --git a/icons/obj/atmospherics/canisters.dmi b/icons/obj/atmospherics/canisters.dmi new file mode 100644 index 00000000000..385914d1979 Binary files /dev/null and b/icons/obj/atmospherics/canisters.dmi differ diff --git a/icons/obj/atmospherics/prototype_canister.dmi b/icons/obj/atmospherics/prototype_canister.dmi new file mode 100644 index 00000000000..fb73aa2ed6d Binary files /dev/null and b/icons/obj/atmospherics/prototype_canister.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 0d28f663264..bddc032943e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -339,6 +339,7 @@ #include "code\controllers\subsystem\explosions.dm" #include "code\controllers\subsystem\fire_burning.dm" #include "code\controllers\subsystem\garbage.dm" +#include "code\controllers\subsystem\greyscale.dm" #include "code\controllers\subsystem\icon_smooth.dm" #include "code\controllers\subsystem\id_access.dm" #include "code\controllers\subsystem\idlenpcpool.dm" @@ -719,6 +720,9 @@ #include "code\datums\elements\food\food_trash.dm" #include "code\datums\elements\food\processable.dm" #include "code\datums\elements\food\venue_price.dm" +#include "code\datums\greyscale\_greyscale_config.dm" +#include "code\datums\greyscale\greyscale_configs.dm" +#include "code\datums\greyscale\layer.dm" #include "code\datums\helper_datums\events.dm" #include "code\datums\helper_datums\getrev.dm" #include "code\datums\helper_datums\icon_snapshot.dm" @@ -1516,6 +1520,7 @@ #include "code\modules\admin\create_object.dm" #include "code\modules\admin\create_turf.dm" #include "code\modules\admin\fun_balloon.dm" +#include "code\modules\admin\greyscale_modify_menu.dm" #include "code\modules\admin\holder2.dm" #include "code\modules\admin\ipintel.dm" #include "code\modules\admin\IsBanned.dm" diff --git a/tgui/packages/tgui/interfaces/GreyscaleModifyMenu.tsx b/tgui/packages/tgui/interfaces/GreyscaleModifyMenu.tsx new file mode 100644 index 00000000000..64130f08be1 --- /dev/null +++ b/tgui/packages/tgui/interfaces/GreyscaleModifyMenu.tsx @@ -0,0 +1,118 @@ +import { useBackend } from '../backend'; +import { Box, Button, ColorBox, Flex, Icon, Input, LabeledList, Section, Stack, Table } from '../components'; +import { Window } from '../layouts'; + +type ColorEntry = { + index: Number; + value: string; +} + +type SpriteData = { + finished: SpriteEntry + steps: Array +} + +type SpriteEntry = { + layer: string + result: string +} + +type GreyscaleMenuData = { + colors: Array; + sprites: SpriteData; +} + +const ColorDisplay = (props, context) => { + const { act, data } = useBackend(context); + const colors = (data.colors || []); + return ( +
+ + + item.value).join('')} + onChange={(_, value) => act("recolor_from_string", { color_string: value })} + /> + + {colors.map(item => ( + + + {" "} +
+ ); +}; + +const PreviewDisplay = (props, context) => { + const { data } = useBackend(context); + return ( +
+ + + Step Layer + Step Result + + {data.sprites.steps.map(item => ( + + + + + ))} +
+
+ ); +}; + +const SingleSprite = (props) => { + const { + source, + } = props; + return ( + + ); +}; + +export const GreyscaleModifyMenu = (props, context) => { + const { act, data } = useBackend(context); + return ( + + + +