Color Rotation Gear Tweak (#11571)

This commit is contained in:
Geeves
2021-04-10 18:32:07 +02:00
committed by GitHub
parent c23d3b8480
commit d22cbec9c4
3 changed files with 21 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
#define GEAR_NO_SELECTION 0
#define GEAR_HAS_COLOR_SELECTION 1
#define GEAR_HAS_NAME_SELECTION 2
#define GEAR_HAS_DESC_SELECTION 4
#define GEAR_HAS_DESC_SELECTION 4
#define GEAR_HAS_COLOR_ROTATION_SELECTION 8

View File

@@ -46,6 +46,23 @@ Color adjustment
return
I.color = sanitize_hexcolor(metadata, I.color)
/*
Color Rotation adjustment
*/
var/datum/gear_tweak/color_rotation/gear_tweak_color_rotation = new()
/datum/gear_tweak/color_rotation/get_contents(var/metadata)
return "Color Rotation: [metadata]"
/datum/gear_tweak/color_rotation/get_default()
return 0
/datum/gear_tweak/color_rotation/get_metadata(var/user, var/metadata, var/title = "Color Rotation")
return clamp(input(user, "Choose the amount of degrees to rotate the hue around the color wheel. (-180 - 180)", title, metadata) as num, -180, 180)
/datum/gear_tweak/color_rotation/tweak_item(var/obj/item/I, var/metadata)
I.color = color_rotation(metadata)
/*
Path adjustment
*/

View File

@@ -298,6 +298,8 @@ var/list/gear_datums = list()
gear_tweaks += list(gear_tweak_free_name)
if(flags & GEAR_HAS_DESC_SELECTION)
gear_tweaks += list(gear_tweak_free_desc)
if(flags & GEAR_HAS_COLOR_ROTATION_SELECTION)
gear_tweaks += list(gear_tweak_color_rotation)
/datum/gear_data
var/path