Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds a limit to the number of markings you can have (30) #5638

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/preferences/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
#define EQUIP_PREVIEW_LOADOUT 1
#define EQUIP_PREVIEW_JOB 2
#define EQUIP_PREVIEW_ALL (EQUIP_PREVIEW_LOADOUT|EQUIP_PREVIEW_JOB)

///The maximum number of markings a character can have
#define MAXIMUM_MARKINGS 30
4 changes: 4 additions & 0 deletions code/modules/preferences/preference_setup/general/03_body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/datum/sprite_accessory/S = GLOB.sprite_accessory_markings[id]
translated[S.name] = id
var/new_marking = tgui_input_list(user, "Choose a body marking:", "Character Preference", translated)
var/marking_count = length(pref.body_marking_ids)
if(marking_count >= MAXIMUM_MARKINGS)
to_chat(user, "<span class='warning'>You may only select up to [MAXIMUM_MARKINGS] markings!</span>")
return
if(new_marking && CanUseTopic(user))
pref.body_marking_ids[translated[new_marking]] = "#000000" //New markings start black
return PREFERENCES_REFRESH_UPDATE_PREVIEW
Expand Down