[MIRROR] Add glasses and icons to preference menu for nearsighted [MDB IGNORE] (#21563)

* Add glasses and icons to preference menu for nearsighted

* fix

* forgot modular edit

---------

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: ghost sheep <sheepwiththemask@gmail.com>
This commit is contained in:
SkyratBot
2023-06-07 14:56:57 +02:00
committed by GitHub
parent 9640564844
commit 524bbc8090
9 changed files with 29 additions and 24 deletions
+8 -5
View File
@@ -2,9 +2,12 @@
///Types of glasses that can be selected at character selection with the Nearsighted quirk
GLOBAL_LIST_INIT(nearsighted_glasses, list(
"Circle",
"Hipster",
"Modern", // SKYRAT EDIT ADD
"Regular",
"Thin",
"Regular" = /obj/item/clothing/glasses/regular,
"Circle" = /obj/item/clothing/glasses/regular/circle,
"Hipster" = /obj/item/clothing/glasses/regular/hipster,
"Thin" = /obj/item/clothing/glasses/regular/thin,
"Jamjar" = /obj/item/clothing/glasses/regular/jamjar,
"Binoclard" = /obj/item/clothing/glasses/regular/kim,
"Modern" = /obj/item/clothing/glasses/betterunshit, // SKYRAT ADD
))
+3 -9
View File
@@ -381,15 +381,9 @@
/datum/quirk/item_quirk/nearsighted/add_unique(client/client_source)
var/glasses_name = client_source?.prefs.read_preference(/datum/preference/choiced/glasses) || "Regular"
var/obj/item/clothing/glasses/glasses_type
switch(glasses_name)
if ("Thin")
glasses_type = /obj/item/clothing/glasses/regular/thin
if ("Circle")
glasses_type = /obj/item/clothing/glasses/regular/circle
if ("Hipster")
glasses_type = /obj/item/clothing/glasses/regular/hipster
else
glasses_type = /obj/item/clothing/glasses/regular
glasses_name = glasses_name == "Random" ? pick(GLOB.nearsighted_glasses) : glasses_name
glasses_type = GLOB.nearsighted_glasses[glasses_name]
give_item_to_holder(glasses_type, list(
LOCATION_EYES = ITEM_SLOT_EYES,
+9 -1
View File
@@ -2,9 +2,17 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_key = "glasses"
savefile_identifier = PREFERENCE_CHARACTER
should_generate_icons = TRUE
/datum/preference/choiced/glasses/init_possible_values()
return GLOB.nearsighted_glasses
var/list/values = list()
values["Random"] = icon('icons/effects/random_spawners.dmi', "questionmark")
for(var/glass_design in GLOB.nearsighted_glasses - "Random")
values[glass_design] = icon('icons/obj/clothing/glasses.dmi', "glasses_[lowertext(glass_design)]")
return values
/datum/preference/choiced/glasses/is_accessible(datum/preferences/preferences)
if (!..(preferences))
+6 -6
View File
@@ -270,7 +270,7 @@
/obj/item/clothing/glasses/regular
name = "prescription glasses"
desc = "Made by Nerd. Co."
icon_state = "glasses"
icon_state = "glasses_regular"
inhand_icon_state = "glasses"
clothing_traits = list(TRAIT_NEARSIGHTED_CORRECTED)
@@ -324,19 +324,19 @@
/obj/item/clothing/glasses/regular/jamjar
name = "jamjar glasses"
desc = "Also known as Virginity Protectors."
icon_state = "jamjar_glasses"
inhand_icon_state = "jamjar_glasses"
icon_state = "glasses_jamjar"
inhand_icon_state = "glasses_jamjar"
/obj/item/clothing/glasses/regular/hipster
name = "prescription glasses"
desc = "Made by Uncool. Co."
icon_state = "hipster_glasses"
icon_state = "glasses_hipster"
inhand_icon_state = null
/obj/item/clothing/glasses/regular/circle
name = "circle glasses"
desc = "Why would you wear something so controversial yet so brave?"
icon_state = "circle_glasses"
icon_state = "glasses_circle"
inhand_icon_state = null
//Here lies green glasses, so ugly they died. RIP
@@ -644,7 +644,7 @@
/obj/item/clothing/glasses/regular/kim
name = "binoclard lenses"
desc = "Shows you know how to sew a lapel and center a back vent."
icon_state = "binoclard_lenses"
icon_state = "glasses_binoclard"
inhand_icon_state = null
/obj/item/clothing/glasses/salesman
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@@ -1,6 +1,6 @@
import { FeatureChoiced, FeatureDropdownInput } from '../base';
import { FeatureIconnedDropdownInput, FeatureWithIcons } from '../base';
export const glasses: FeatureChoiced = {
export const glasses: FeatureWithIcons<string> = {
name: 'Glasses',
component: FeatureDropdownInput,
component: FeatureIconnedDropdownInput,
};