Skip to content

Commit

Permalink
adds a limit to the number of markings you can have (30) (#5638)
Browse files Browse the repository at this point in the history
## About The Pull Request
please don't give yourself 184 markings

## Why It's Good For The Game
please don't give yourself 184 markings

## Changelog
:cl:
add: adds a limit to the number of markings you can have (30)
/:cl:
  • Loading branch information
timothyteakettle authored Jun 22, 2023
1 parent b55c9fc commit 7d67a5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 7d67a5f

Please sign in to comment.