Add glasses and icons to preference menu for nearsighted (#75642)

## About The Pull Request
This adds a few more regular glasses options to the nearsighted pref
menu:

- Random
- Jamjar
- Binoclard

It also displays the icons for the TGUI dropdown menu.

## Why It's Good For The Game
More variety and better visualization. (nearsighted... get it?)

## Changelog
🆑
qol: Add more glasses to the nearsighted pref menu with icons
/🆑

---------

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
This commit is contained in:
Tim
2023-05-31 14:33:52 -04:00
committed by GitHub
co-authored by ShizCalev
parent bb6aee565f
commit b2f4cc70e9
9 changed files with 27 additions and 23 deletions
+6 -4
View File
@@ -2,8 +2,10 @@
///Types of glasses that can be selected at character selection with the Nearsighted quirk
GLOBAL_LIST_INIT(nearsighted_glasses, list(
"Circle",
"Hipster",
"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,
))
+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
@@ -269,7 +269,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)
@@ -323,19 +323,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
@@ -636,7 +636,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,
};